home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2002 November
/
Chip_2002-11_cd1.bin
/
zkuste
/
vbasic
/
Data
/
Utils
/
WME71SDK.exe
/
RCDATA
/
CABINET
/
enccontrol.frm
< prev
next >
Wrap
Text File
|
2001-03-02
|
4KB
|
163 lines
VERSION 5.00
Object = "{C4941F47-8BC1-49D3-9989-2B7826F26AE6}#1.0#0"; "MSPShell.dll"
Begin VB.Form FrmEncControl
BorderStyle = 1 'Fixed Single
Caption = "Windows Media Encoder Control Sample"
ClientHeight = 3645
ClientLeft = 2385
ClientTop = 1080
ClientWidth = 8145
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 3645
ScaleWidth = 8145
StartUpPosition = 2 'CenterScreen
Begin MSPROPSHELLLibCtl.MSPropShell PageShell
Height = 3135
Left = 0
OleObjectBlob = "EncControl.frx":0000
TabIndex = 4
Top = 0
Width = 8055
End
Begin VB.CommandButton CmdExit
Caption = "E&xit"
Height = 375
Left = 6900
TabIndex = 0
Top = 3240
Width = 1155
End
Begin VB.CommandButton CmdStop
Caption = "S&top"
Enabled = 0 'False
Height = 375
Left = 5640
TabIndex = 3
Top = 3240
Width = 1155
End
Begin VB.CommandButton CmdStart
Caption = "&Start"
Height = 375
Left = 4380
TabIndex = 2
Top = 3240
Width = 1155
End
Begin VB.CommandButton CmdConfigure
Caption = "&Configure"
Height = 375
Left = 3120
TabIndex = 1
Top = 3240
Width = 1155
End
End
Attribute VB_Name = "FrmEncControl"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' The one and only Encoder!
Dim Encoder As New WMEncoder
Private Sub CmdConfigure_Click()
On Error GoTo err_handler
' Display Configure Encoder dialog passing it our Encoder
Set FrmConfigure.EncoderMain = Encoder
FrmConfigure.Show 1
Set FrmConfigure.EncoderMain = Nothing
Exit Sub
err_handler:
MsgBox "Error configuring the property pages"
End Sub
Private Sub CmdExit_Click()
' Goodbye!
Unload Me
End Sub
Private Sub CmdStart_Click()
On Error GoTo err_handler
' Start the encoder
Encoder.Start
CmdStart.Enabled = False
CmdStop.Enabled = True
Exit Sub
err_handler:
MsgBox "Error starting the encoder"
End Sub
Private Sub CmdStop_Click()
On Error GoTo err_handler
' Stop the encoder
Encoder.Stop
CmdStop.Enabled = False
CmdStart.Enabled = True
Exit Sub
err_handler:
MsgBox "Error stopping the encoder"
End Sub
Private Sub Form_Load()
On Error GoTo err_handler
' Create the Encoder's General Monitor Page
Dim PpgMain As WMEncMonMainPage
Set PpgMain = New WMEncMonMainPage
' Add the Encoder to the Page Shell
PageShell.AddObject Encoder
' Add the Monitor Page to the Page Shell
PageShell.AddPage PpgMain
Exit Sub
err_handler:
MsgBox "Error loading the statistics page"
End Sub
Private Sub Form_Unload(Cancel As Integer)
' Make sure the Encoder is stopping/stopped
If (Encoder.RunState <> WMENC_ENCODER_STOPPING) And (Encoder.RunState <> WMENC_ENCODER_STOPPED) Then
Encoder.Stop
End If
' Wait for it to stop if it hasn't yet
While Encoder.RunState <> WMENC_ENCODER_STOPPED
DoEvents
Wend
' Release the Encoder
Set Encoder = Nothing
End
End Sub