home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2002 November
/
Chip_2002-11_cd1.bin
/
zkuste
/
vbasic
/
Data
/
Utils
/
WME71SDK.exe
/
RCDATA
/
CABINET
/
frminput.frm
< prev
next >
Wrap
Text File
|
2001-04-17
|
13KB
|
439 lines
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Object = "{C932BA88-4374-101B-A56C-00AA003668DC}#1.1#0"; "MSMASK32.OCX"
Begin VB.Form frmInput
Caption = "Input"
ClientHeight = 4095
ClientLeft = 2820
ClientTop = 2415
ClientWidth = 6975
Icon = "frmInput.frx":0000
LinkTopic = "Form1"
ScaleHeight = 4095
ScaleWidth = 6975
Begin VB.ComboBox cmbAltAudio
Height = 315
Left = 5040
Style = 2 'Dropdown List
TabIndex = 14
Top = 1320
Visible = 0 'False
Width = 1575
End
Begin VB.ComboBox CmbAltVideo
Height = 315
Left = 5040
Style = 2 'Dropdown List
TabIndex = 13
Top = 1680
Visible = 0 'False
Width = 1575
End
Begin VB.ComboBox cmbAudio
Height = 315
Left = 1320
Style = 2 'Dropdown List
TabIndex = 12
Top = 3000
Width = 5175
End
Begin VB.ComboBox cmbVideo
Height = 315
ItemData = "frmInput.frx":000C
Left = 1320
List = "frmInput.frx":000E
Style = 2 'Dropdown List
TabIndex = 11
Top = 2400
Width = 5175
End
Begin MSComDlg.CommonDialog dlgInput
Left = 4320
Top = 1560
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "Cancel"
Height = 375
Left = 5400
TabIndex = 10
Top = 600
Width = 1335
End
Begin VB.CommandButton cmdOk
Caption = "Ok"
Default = -1 'True
Height = 375
Left = 5400
TabIndex = 9
Top = 120
Width = 1335
End
Begin MSMask.MaskEdBox medbDuration
Height = 375
Left = 1320
TabIndex = 8
Top = 3600
Width = 5175
_ExtentX = 9128
_ExtentY = 661
_Version = 393216
MaxLength = 8
Mask = "##:##:##"
PromptChar = " "
End
Begin VB.CommandButton cmdBrowse
Caption = "Browse"
Height = 375
Left = 4080
TabIndex = 3
Top = 720
Width = 1095
End
Begin VB.OptionButton optDevice
Caption = "Device"
Height = 255
Left = 0
TabIndex = 2
Top = 1800
Width = 975
End
Begin VB.TextBox txtFile
Height = 375
Left = 840
TabIndex = 1
Top = 720
Width = 3135
End
Begin VB.OptionButton optFile
Caption = "File "
Height = 255
Left = 0
TabIndex = 0
Top = 240
Value = -1 'True
Width = 975
End
Begin VB.Label lblTime
Caption = "(HH:Min:Sec)"
Height = 255
Left = 120
TabIndex = 7
Top = 3840
Width = 975
End
Begin VB.Label lblDuration
Caption = "Duration:"
Height = 255
Left = 240
TabIndex = 6
Top = 3600
Width = 855
End
Begin VB.Label lblAudio
Caption = "Audio :"
Height = 255
Left = 480
TabIndex = 5
Top = 3120
Width = 495
End
Begin VB.Label lblVideo
Caption = "Video :"
Height = 255
Left = 480
TabIndex = 4
Top = 2520
Width = 495
End
End
Attribute VB_Name = "frmInput"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim EncIn As WMEncoder
Dim StnCls As StnMgrEnc
Private Sub cmdBrowse_Click()
On Error GoTo error_handler
dlgInput.DialogTitle = "Input File"
If StnCls.VideoOpt = 1 Then
dlgInput.Filter = "Video Files(*.asf,*.avi,*.bmp,*.mpg,*.wmv)|*.asf;*.avi;*.bmp;*.mpg;*.wmv"
Else
dlgInput.Filter = "Audio Files(*.mp3,*.wav,*.wma,*.asf)|*.mp3;*.wav;*.wma;*.asf"
End If
dlgInput.Flags = cdlOFNFileMustExist
dlgInput.ShowOpen
txtFile.Text = dlgInput.FileName
dlgInput.FileName = ""
txtFile.SetFocus
Exit Sub
error_handler:
MsgBox "System Error", vbCritical
End Sub
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdOk_Click()
On Error GoTo error_handler
Dim Cnt As Integer
Dim PlayTime As String
Dim Hh As Integer
Dim Min As Integer
Dim Sec As Integer
Cnt = frmPlaylist.lvwPlaylist.ListItems.Count + 1
If optDevice.Value = True Then
If medbDuration.Text = " : : " Then
MsgBox "Please enter the Duration", vbInformation
Exit Sub
End If
PlayTime = medbDuration.Text
Hh = Mid(PlayTime, 1, 2)
Min = Mid(PlayTime, 4, 2)
Sec = Mid(PlayTime, 7, 2)
If Min > 60 Then
MsgBox "please enter Minutes less than 60 "
Exit Sub
End If
If Sec > 60 Then
MsgBox "please enter seconds less than 60 "
Exit Sub
End If
If StnCls.VideoOpt = 0 Then
frmPlaylist.lvwPlaylist.ListItems.Add Cnt, , cmbAudio.Text
frmPlaylist.lvwPlaylist.ListItems(Cnt).ListSubItems.Add , "Audio", cmbAudio.Text
frmPlaylist.lvwPlaylist.ListItems(Cnt).ListSubItems.Add , "Duration", medbDuration.Text
frmPlaylist.lvwPlaylist.SelectedItem = frmPlaylist.lvwPlaylist.ListItems.Item(1)
Else
frmPlaylist.lvwPlaylist.ListItems.Add Cnt, , cmbVideo.Text
frmPlaylist.lvwPlaylist.ListItems(Cnt).ListSubItems.Add , "Audio", cmbAudio.Text
frmPlaylist.lvwPlaylist.ListItems(Cnt).ListSubItems.Add , "Duration", medbDuration.Text
frmPlaylist.lvwPlaylist.SelectedItem = frmPlaylist.lvwPlaylist.ListItems.Item(1)
End If
Else
If txtFile.Text = "" Then
MsgBox "Please Enter Input File", vbExclamation
Exit Sub
End If
frmPlaylist.lvwPlaylist.ListItems.Add Cnt, , txtFile.Text
frmPlaylist.lvwPlaylist.ListItems(Cnt).ListSubItems.Add , "Audio", txtFile.Text
frmPlaylist.lvwPlaylist.ListItems(Cnt).ListSubItems.Add , "Duration", "-"
frmPlaylist.lvwPlaylist.SelectedItem = frmPlaylist.lvwPlaylist.ListItems.Item(1)
End If
Unload Me
Exit Sub
error_handler:
MsgBox "Error processing Input", vbCritical
End Sub
Private Sub Form_Load()
On Error GoTo error_handler
cmbVideo.Enabled = False
cmbAudio.Enabled = False
medbDuration.Enabled = False
lblVideo.Enabled = False
lblAudio.Enabled = False
lblDuration.Enabled = False
lblTime.Enabled = False
Exit Sub
error_handler:
MsgBox "System Error", vbCritical
End Sub
Private Sub optDevice_Click()
On Error GoTo error_handler
Dim DeviceInfo As IWMEncPluginInfo
Dim DeviceInfoMgr As IWMEncSourcePluginInfoManager
Dim I As Integer
Dim J As Integer
Dim AltPath As String
Set EncIn = StnCls.ExistEnc
txtFile.Enabled = False
cmdBrowse.Enabled = False
If StnCls.VideoOpt = 1 Then
cmbVideo.Enabled = True
lblVideo.Enabled = True
End If
cmbAudio.Enabled = True
medbDuration.Enabled = True
lblAudio.Enabled = True
lblDuration.Enabled = True
lblTime.Enabled = True
Set DeviceInfoMgr = EncIn.SourcePluginInfoManager
I = DeviceInfoMgr.Count
I = I - 1
While I >= 0
Set DeviceInfo = DeviceInfoMgr.Item(I)
If LCase(DeviceInfo.SchemeType) <> "file" Then
AltPath = DeviceInfo.SchemeType
AltPath = AltPath & "://"
If StnCls.VideoOpt = 0 Then
If DeviceInfo.MediaType = WMENC_AUDIO Then
If DeviceInfo.Resources = False Then
cmbAudio.AddItem DeviceInfo.Name
cmbAltAudio.AddItem AltPath
cmbAudio.ListIndex = 0
cmbAltAudio.ListIndex = 0
Else
J = DeviceInfo.Count
J = J - 1
While J >= 0
cmbAudio.AddItem DeviceInfo.Item(J)
AltPath = AltPath & DeviceInfo.Item(J)
cmbAltAudio.AddItem AltPath
J = J - 1
cmbAudio.ListIndex = 0
cmbAltAudio.ListIndex = 0
Wend
End If
End If
Else
If DeviceInfo.MediaType = WMENC_AUDIO Then
If DeviceInfo.Resources = False Then
cmbAudio.AddItem DeviceInfo.Name
cmbAltAudio.AddItem AltPath
cmbAudio.ListIndex = 0
cmbAltAudio.ListIndex = 0
Else
J = DeviceInfo.Count
J = J - 1
While J >= 0
cmbAudio.AddItem DeviceInfo.Item(J)
AltPath = AltPath & DeviceInfo.Item(J)
cmbAltAudio.AddItem AltPath
J = J - 1
cmbAudio.ListIndex = 0
cmbAltAudio.ListIndex = 0
Wend
End If
End If
If DeviceInfo.MediaType = WMENC_VIDEO Then
If DeviceInfo.Resources = False Then
cmbVideo.AddItem DeviceInfo.Name
CmbAltVideo.AddItem AltPath
cmbVideo.ListIndex = 0
CmbAltVideo.ListIndex = 0
Else
J = DeviceInfo.Count
J = J - 1
While J >= 0
cmbVideo.AddItem DeviceInfo.Item(J)
AltPath = AltPath & DeviceInfo.Item(J)
CmbAltVideo.AddItem AltPath
J = J - 1
cmbVideo.ListIndex = 0
CmbAltVideo.ListIndex = 0
Wend
End If
End If
End If
End If
I = I - 1
Wend
Exit Sub
error_handler:
MsgBox "Error Getting Device Information", vbCritical
End Sub
Private Sub optFile_Click()
cmbVideo.Enabled = False
cmbAudio.Enabled = False
medbDuration.Enabled = False
lblVideo.Enabled = False
lblAudio.Enabled = False
lblDuration.Enabled = False
lblTime.Enabled = False
txtFile.Enabled = True
cmdBrowse.Enabled = True
End Sub
Private Sub txtFile_Change()
If (Len(txtFile.Text)) = 1 Then
If txtFile.Text = " " Then
txtFile.Text = ""
End If
End If
End Sub
Public Property Set MainStnMgr(ByVal MainStn As StnMgrEnc)
Set StnCls = MainStn
End Property