home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2002 November
/
Chip_2002-11_cd1.bin
/
zkuste
/
vbasic
/
Data
/
Utils
/
WME71SDK.exe
/
RCDATA
/
CABINET
/
frmnewstation.frm
< prev
next >
Wrap
Text File
|
2001-03-02
|
8KB
|
332 lines
VERSION 5.00
Object = "{C4941F47-8BC1-49D3-9989-2B7826F26AE6}#1.0#0"; "MSPShell.dll"
Begin VB.Form frmNewStation
Caption = "New Station"
ClientHeight = 6255
ClientLeft = 2655
ClientTop = 1125
ClientWidth = 7335
Icon = "frmNewStation.frx":0000
LinkTopic = "Form1"
ScaleHeight = 6255
ScaleWidth = 7335
Begin MSPROPSHELLLibCtl.MSPropShell StationProp
Height = 4815
Left = 120
OleObjectBlob = "frmNewStation.frx":000C
TabIndex = 7
Top = 960
Width = 7215
End
Begin VB.OptionButton optVideo
Caption = "Audio And Video"
Height = 195
Left = 3600
TabIndex = 6
Top = 600
Width = 1695
End
Begin VB.OptionButton optAudio
Caption = "Audio Only"
Height = 195
Left = 1560
TabIndex = 5
Top = 600
Value = -1 'True
Width = 1695
End
Begin VB.TextBox txtName
Height = 375
Left = 1080
TabIndex = 4
Top = 120
Width = 5655
End
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "Cancel"
Height = 375
Left = 6000
TabIndex = 2
Top = 5880
Width = 1335
End
Begin VB.CommandButton cmdOk
Caption = "Ok"
Default = -1 'True
Height = 375
Left = 4440
TabIndex = 1
Top = 5880
Width = 1455
End
Begin VB.Label lblType
Caption = " Type"
Height = 255
Left = 120
TabIndex = 0
Top = 600
Width = 615
End
Begin VB.Label lblName
Caption = "&Name"
Height = 255
Left = 120
TabIndex = 3
Top = 120
Width = 615
End
End
Attribute VB_Name = "frmNewStation"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim NewStnEnc As StnMgrEnc
Dim Encoder As WMEncoder
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdOk_Click()
On Error GoTo error_handler
Dim SrcGrpCol As IWMEncSourceGroupCollection
Dim SrcGrp As IWMEncSourceGroup
Dim prf As IWMEncProfile
Dim VideoSrc As IWMEncVideoSource
Dim AudioSrc As IWMEncSource
Dim I As Integer
If txtName.Text = "" Then
txtName.SetFocus
MsgBox "Please enter Station Name", vbInformation
Exit Sub
End If
NewStnEnc.EncName = txtName.Text
Set SrcGrpCol = Encoder.SourceGroupCollection
Set SrcGrp = SrcGrpCol.Item(0)
Set prf = SrcGrp.Profile
If optVideo.Value = True Then
NewStnEnc.VideoOpt = 1
End If
StationProp.Apply
Set prf = SrcGrp.Profile
NewStnEnc.EncPrfName = prf.Name
Set SrcGrpCol = Encoder.SourceGroupCollection
I = 0
For Each SrcGrp In SrcGrpCol
If SrcGrp.Name = "NewStation" Then
SrcGrpCol.Remove (I)
Exit For
End If
I = I + 1
Next
Unload Me
Exit Sub
error_handler:
MsgBox "Error Creating The Station", vbCritical
End Sub
Private Sub Form_Load()
On Error GoTo error_handler
Dim PpgDesc As New WMEncDisplayInfoPage
Dim PpgAttr As New WMEncAttributesPage
Dim PpgEnc As New WMEncProfilePage
Dim PpgOutput As New WMEncOutputPage
Dim AudioSrc As IWMEncSource
Dim VideoSrc As IWMEncVideoSource
Dim SrcGrpCol As IWMEncSourceGroupCollection
Dim SrcGrp As IWMEncSourceGroup
Dim PrfCol As IWMEncProfileCollection
Dim prf As IWMEncProfile
Dim VidOpt As Integer
Set Encoder = NewStnEnc.ExistEnc
StationProp.AddObject Encoder
VidOpt = NewStnEnc.VideoOpt
If VidOpt = 1 Then
optVideo.Value = True
'optAudio.Value = False
End If
Set SrcGrpCol = Encoder.SourceGroupCollection
Set SrcGrp = SrcGrpCol.Add("NewStation")
Set AudioSrc = SrcGrp.AddSource(WMENC_AUDIO)
If NewStnEnc.VideoOpt = 1 Then
Set VideoSrc = SrcGrp.AddSource(WMENC_VIDEO)
End If
Set PrfCol = Encoder.ProfileCollection
If NewStnEnc.EncPrfName <> "" Then
For Each prf In PrfCol
If UCase(prf.Name) = UCase(NewStnEnc.EncPrfName) Then
SrcGrp.Profile = prf
Exit For
End If
Next
Else
For Each prf In PrfCol
If UCase(prf.Name) = "AUDIO FOR LOW BIT RATE VOICE-ORIENTED CONTENT (6.5 KBPS)" Then
SrcGrp.Profile = prf
Exit For
End If
Next
End If
StationProp.AddPage PpgDesc
StationProp.AddPage PpgAttr
StationProp.AddPage PpgEnc
StationProp.AddPage PpgOutput
Exit Sub
error_handler:
MsgBox "Error in Encoder Settings", vbCritical
End Sub
Private Sub optAudio_Click()
On Error GoTo error_handler
Dim VideoCnt As Integer
Dim SrcGrpCol As IWMEncSourceGroupCollection
Dim SrcGrp As IWMEncSourceGroup
Dim PrfCol As IWMEncProfileCollection
Dim prf As IWMEncProfile
If NewStnEnc.EncName <> "" Then
Exit Sub
End If
Set SrcGrpCol = Encoder.SourceGroupCollection
Set SrcGrp = SrcGrpCol.Item(0)
VideoCnt = SrcGrp.SourceCount(WMENC_VIDEO)
If VideoCnt > 0 Then
SrcGrp.RemoveSource WMENC_VIDEO, 0
End If
Set PrfCol = Encoder.ProfileCollection
For Each prf In PrfCol
If UCase(prf.Name) = "AUDIO FOR LOW BIT RATE VOICE-ORIENTED CONTENT (6.5 KBPS)" Then
SrcGrp.Profile = prf
End If
Next
Exit Sub
error_handler:
MsgBox "Error Getting Profiles of the Encoder!Check Encoder Settings", vbCritical
End Sub
Private Sub optVideo_Click()
On Error GoTo error_handler
Dim VideoSrc As IWMEncVideoSource
Dim VideoCnt As Integer
Dim SrcGrpCol As IWMEncSourceGroupCollection
Dim SrcGrp As IWMEncSourceGroup
Dim PrfCol As IWMEncProfileCollection
Dim prf As IWMEncProfile
If NewStnEnc.EncName <> "" Then
Exit Sub
End If
Set SrcGrpCol = Encoder.SourceGroupCollection
Set SrcGrp = SrcGrpCol.Item(0)
VideoCnt = SrcGrp.SourceCount(WMENC_VIDEO)
If VideoCnt = 0 Then
Set VideoSrc = SrcGrp.AddSource(WMENC_VIDEO)
End If
Set PrfCol = Encoder.ProfileCollection
For Each prf In PrfCol
If UCase(prf.Name) = "VIDEO FOR LAN, CABLE MODEM, OR XDSL (100 TO 768 KBPS)" Then
SrcGrp.Profile = prf
Exit For
End If
Next
Exit Sub
error_handler:
MsgBox "Error Getting Profiles of the Encoder!Check Encoder Settings", vbCritical
End Sub
Public Property Set StationMgrEnc(ByVal NewEnc As StnMgrEnc)
Set NewStnEnc = NewEnc
End Property
Private Sub txtName_Change()
If (Len(txtName.Text)) = 1 Then
If txtName.Text = " " Then
txtName.Text = ""
End If
End If
End Sub