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 >
Text File  |  2001-04-17  |  13KB  |  439 lines

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  3. Object = "{C932BA88-4374-101B-A56C-00AA003668DC}#1.1#0"; "MSMASK32.OCX"
  4. Begin VB.Form frmInput 
  5.    Caption         =   "Input"
  6.    ClientHeight    =   4095
  7.    ClientLeft      =   2820
  8.    ClientTop       =   2415
  9.    ClientWidth     =   6975
  10.    Icon            =   "frmInput.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   4095
  13.    ScaleWidth      =   6975
  14.    Begin VB.ComboBox cmbAltAudio 
  15.       Height          =   315
  16.       Left            =   5040
  17.       Style           =   2  'Dropdown List
  18.       TabIndex        =   14
  19.       Top             =   1320
  20.       Visible         =   0   'False
  21.       Width           =   1575
  22.    End
  23.    Begin VB.ComboBox CmbAltVideo 
  24.       Height          =   315
  25.       Left            =   5040
  26.       Style           =   2  'Dropdown List
  27.       TabIndex        =   13
  28.       Top             =   1680
  29.       Visible         =   0   'False
  30.       Width           =   1575
  31.    End
  32.    Begin VB.ComboBox cmbAudio 
  33.       Height          =   315
  34.       Left            =   1320
  35.       Style           =   2  'Dropdown List
  36.       TabIndex        =   12
  37.       Top             =   3000
  38.       Width           =   5175
  39.    End
  40.    Begin VB.ComboBox cmbVideo 
  41.       Height          =   315
  42.       ItemData        =   "frmInput.frx":000C
  43.       Left            =   1320
  44.       List            =   "frmInput.frx":000E
  45.       Style           =   2  'Dropdown List
  46.       TabIndex        =   11
  47.       Top             =   2400
  48.       Width           =   5175
  49.    End
  50.    Begin MSComDlg.CommonDialog dlgInput 
  51.       Left            =   4320
  52.       Top             =   1560
  53.       _ExtentX        =   847
  54.       _ExtentY        =   847
  55.       _Version        =   393216
  56.    End
  57.    Begin VB.CommandButton cmdCancel 
  58.       Cancel          =   -1  'True
  59.       Caption         =   "Cancel"
  60.       Height          =   375
  61.       Left            =   5400
  62.       TabIndex        =   10
  63.       Top             =   600
  64.       Width           =   1335
  65.    End
  66.    Begin VB.CommandButton cmdOk 
  67.       Caption         =   "Ok"
  68.       Default         =   -1  'True
  69.       Height          =   375
  70.       Left            =   5400
  71.       TabIndex        =   9
  72.       Top             =   120
  73.       Width           =   1335
  74.    End
  75.    Begin MSMask.MaskEdBox medbDuration 
  76.       Height          =   375
  77.       Left            =   1320
  78.       TabIndex        =   8
  79.       Top             =   3600
  80.       Width           =   5175
  81.       _ExtentX        =   9128
  82.       _ExtentY        =   661
  83.       _Version        =   393216
  84.       MaxLength       =   8
  85.       Mask            =   "##:##:##"
  86.       PromptChar      =   " "
  87.    End
  88.    Begin VB.CommandButton cmdBrowse 
  89.       Caption         =   "Browse"
  90.       Height          =   375
  91.       Left            =   4080
  92.       TabIndex        =   3
  93.       Top             =   720
  94.       Width           =   1095
  95.    End
  96.    Begin VB.OptionButton optDevice 
  97.       Caption         =   "Device"
  98.       Height          =   255
  99.       Left            =   0
  100.       TabIndex        =   2
  101.       Top             =   1800
  102.       Width           =   975
  103.    End
  104.    Begin VB.TextBox txtFile 
  105.       Height          =   375
  106.       Left            =   840
  107.       TabIndex        =   1
  108.       Top             =   720
  109.       Width           =   3135
  110.    End
  111.    Begin VB.OptionButton optFile 
  112.       Caption         =   "File "
  113.       Height          =   255
  114.       Left            =   0
  115.       TabIndex        =   0
  116.       Top             =   240
  117.       Value           =   -1  'True
  118.       Width           =   975
  119.    End
  120.    Begin VB.Label lblTime 
  121.       Caption         =   "(HH:Min:Sec)"
  122.       Height          =   255
  123.       Left            =   120
  124.       TabIndex        =   7
  125.       Top             =   3840
  126.       Width           =   975
  127.    End
  128.    Begin VB.Label lblDuration 
  129.       Caption         =   "Duration:"
  130.       Height          =   255
  131.       Left            =   240
  132.       TabIndex        =   6
  133.       Top             =   3600
  134.       Width           =   855
  135.    End
  136.    Begin VB.Label lblAudio 
  137.       Caption         =   "Audio :"
  138.       Height          =   255
  139.       Left            =   480
  140.       TabIndex        =   5
  141.       Top             =   3120
  142.       Width           =   495
  143.    End
  144.    Begin VB.Label lblVideo 
  145.       Caption         =   "Video :"
  146.       Height          =   255
  147.       Left            =   480
  148.       TabIndex        =   4
  149.       Top             =   2520
  150.       Width           =   495
  151.    End
  152. End
  153. Attribute VB_Name = "frmInput"
  154. Attribute VB_GlobalNameSpace = False
  155. Attribute VB_Creatable = False
  156. Attribute VB_PredeclaredId = True
  157. Attribute VB_Exposed = False
  158. Option Explicit
  159. Dim EncIn As WMEncoder
  160. Dim StnCls As StnMgrEnc
  161.  
  162. Private Sub cmdBrowse_Click()
  163.         
  164.         On Error GoTo error_handler
  165.         
  166.         dlgInput.DialogTitle = "Input File"
  167.         If StnCls.VideoOpt = 1 Then
  168.             dlgInput.Filter = "Video Files(*.asf,*.avi,*.bmp,*.mpg,*.wmv)|*.asf;*.avi;*.bmp;*.mpg;*.wmv"
  169.         Else
  170.             dlgInput.Filter = "Audio Files(*.mp3,*.wav,*.wma,*.asf)|*.mp3;*.wav;*.wma;*.asf"
  171.         End If
  172.         
  173.         dlgInput.Flags = cdlOFNFileMustExist
  174.         dlgInput.ShowOpen
  175.         txtFile.Text = dlgInput.FileName
  176.         dlgInput.FileName = ""
  177.         txtFile.SetFocus
  178.         Exit Sub
  179.     
  180. error_handler:
  181.     
  182.     MsgBox "System Error", vbCritical
  183.  
  184. End Sub
  185.  
  186. Private Sub cmdCancel_Click()
  187.     Unload Me
  188. End Sub
  189.  
  190. Private Sub cmdOk_Click()
  191.     
  192.     On Error GoTo error_handler
  193.     
  194.     Dim Cnt As Integer
  195.     Dim PlayTime As String
  196.     Dim Hh As Integer
  197.     Dim Min As Integer
  198.     Dim Sec As Integer
  199.     
  200.     Cnt = frmPlaylist.lvwPlaylist.ListItems.Count + 1
  201.     
  202.     If optDevice.Value = True Then
  203.         If medbDuration.Text = "  :  :  " Then
  204.             MsgBox "Please enter the Duration", vbInformation
  205.             Exit Sub
  206.         End If
  207.              
  208.         
  209.         PlayTime = medbDuration.Text
  210.         Hh = Mid(PlayTime, 1, 2)
  211.         Min = Mid(PlayTime, 4, 2)
  212.         Sec = Mid(PlayTime, 7, 2)
  213.         If Min > 60 Then
  214.             MsgBox "please enter Minutes  less than 60 "
  215.             Exit Sub
  216.         End If
  217.         If Sec > 60 Then
  218.             MsgBox "please enter seconds less than 60 "
  219.             Exit Sub
  220.         End If
  221.         
  222.         If StnCls.VideoOpt = 0 Then
  223.             frmPlaylist.lvwPlaylist.ListItems.Add Cnt, , cmbAudio.Text
  224.             frmPlaylist.lvwPlaylist.ListItems(Cnt).ListSubItems.Add , "Audio", cmbAudio.Text
  225.             frmPlaylist.lvwPlaylist.ListItems(Cnt).ListSubItems.Add , "Duration", medbDuration.Text
  226.             frmPlaylist.lvwPlaylist.SelectedItem = frmPlaylist.lvwPlaylist.ListItems.Item(1)
  227.         Else
  228.             frmPlaylist.lvwPlaylist.ListItems.Add Cnt, , cmbVideo.Text
  229.             frmPlaylist.lvwPlaylist.ListItems(Cnt).ListSubItems.Add , "Audio", cmbAudio.Text
  230.             frmPlaylist.lvwPlaylist.ListItems(Cnt).ListSubItems.Add , "Duration", medbDuration.Text
  231.             frmPlaylist.lvwPlaylist.SelectedItem = frmPlaylist.lvwPlaylist.ListItems.Item(1)
  232.         End If
  233.     Else
  234.         
  235.         If txtFile.Text = "" Then
  236.             
  237.             MsgBox "Please Enter  Input File", vbExclamation
  238.             
  239.             Exit Sub
  240.             
  241.         
  242.         End If
  243.         
  244.         frmPlaylist.lvwPlaylist.ListItems.Add Cnt, , txtFile.Text
  245.         frmPlaylist.lvwPlaylist.ListItems(Cnt).ListSubItems.Add , "Audio", txtFile.Text
  246.         frmPlaylist.lvwPlaylist.ListItems(Cnt).ListSubItems.Add , "Duration", "-"
  247.         frmPlaylist.lvwPlaylist.SelectedItem = frmPlaylist.lvwPlaylist.ListItems.Item(1)
  248.     End If
  249.     
  250.     Unload Me
  251.     Exit Sub
  252.     
  253. error_handler:
  254.     
  255.     MsgBox "Error processing Input", vbCritical
  256.     
  257. End Sub
  258.  
  259. Private Sub Form_Load()
  260.     
  261.     On Error GoTo error_handler
  262.     
  263.     cmbVideo.Enabled = False
  264.     cmbAudio.Enabled = False
  265.     medbDuration.Enabled = False
  266.     lblVideo.Enabled = False
  267.     lblAudio.Enabled = False
  268.     lblDuration.Enabled = False
  269.     lblTime.Enabled = False
  270.     Exit Sub
  271.     
  272. error_handler:
  273.     
  274.     MsgBox "System Error", vbCritical
  275.     
  276. End Sub
  277.  
  278. Private Sub optDevice_Click()
  279.     
  280.     On Error GoTo error_handler
  281.     
  282.     Dim DeviceInfo As IWMEncPluginInfo
  283.     
  284.     Dim DeviceInfoMgr As IWMEncSourcePluginInfoManager
  285.     
  286.     Dim I As Integer
  287.     Dim J As Integer
  288.     Dim AltPath As String
  289.     
  290.     Set EncIn = StnCls.ExistEnc
  291.     
  292.     txtFile.Enabled = False
  293.     cmdBrowse.Enabled = False
  294.     
  295.     If StnCls.VideoOpt = 1 Then
  296.         cmbVideo.Enabled = True
  297.         lblVideo.Enabled = True
  298.     End If
  299.         
  300.     
  301.     
  302.     cmbAudio.Enabled = True
  303.     medbDuration.Enabled = True
  304.     
  305.     
  306.     
  307.     lblAudio.Enabled = True
  308.     lblDuration.Enabled = True
  309.     lblTime.Enabled = True
  310.     
  311.     
  312.     
  313.     Set DeviceInfoMgr = EncIn.SourcePluginInfoManager
  314.    
  315.     
  316.     
  317.      I = DeviceInfoMgr.Count
  318.      I = I - 1
  319.           
  320.     While I >= 0
  321.         Set DeviceInfo = DeviceInfoMgr.Item(I)
  322.         If LCase(DeviceInfo.SchemeType) <> "file" Then
  323.             AltPath = DeviceInfo.SchemeType
  324.             AltPath = AltPath & "://"
  325.             If StnCls.VideoOpt = 0 Then
  326.                 If DeviceInfo.MediaType = WMENC_AUDIO Then
  327.                     
  328.                     If DeviceInfo.Resources = False Then
  329.                         cmbAudio.AddItem DeviceInfo.Name
  330.                         cmbAltAudio.AddItem AltPath
  331.                         cmbAudio.ListIndex = 0
  332.                         cmbAltAudio.ListIndex = 0
  333.                     Else
  334.                         J = DeviceInfo.Count
  335.                         J = J - 1
  336.  
  337.                         While J >= 0
  338.                             cmbAudio.AddItem DeviceInfo.Item(J)
  339.                             AltPath = AltPath & DeviceInfo.Item(J)
  340.                             cmbAltAudio.AddItem AltPath
  341.                             J = J - 1
  342.                             cmbAudio.ListIndex = 0
  343.                             cmbAltAudio.ListIndex = 0
  344.                         Wend
  345.                     End If
  346.                     
  347.                 End If
  348.             Else
  349.                 If DeviceInfo.MediaType = WMENC_AUDIO Then
  350.                     
  351.                     If DeviceInfo.Resources = False Then
  352.                         cmbAudio.AddItem DeviceInfo.Name
  353.                         cmbAltAudio.AddItem AltPath
  354.                         cmbAudio.ListIndex = 0
  355.                         cmbAltAudio.ListIndex = 0
  356.                     Else
  357.                         J = DeviceInfo.Count
  358.                         J = J - 1
  359.  
  360.                         While J >= 0
  361.                             cmbAudio.AddItem DeviceInfo.Item(J)
  362.                             AltPath = AltPath & DeviceInfo.Item(J)
  363.                             cmbAltAudio.AddItem AltPath
  364.                             J = J - 1
  365.                             cmbAudio.ListIndex = 0
  366.                             cmbAltAudio.ListIndex = 0
  367.                         Wend
  368.                     End If
  369.                 End If
  370.                 If DeviceInfo.MediaType = WMENC_VIDEO Then
  371.                     
  372.                     If DeviceInfo.Resources = False Then
  373.                         cmbVideo.AddItem DeviceInfo.Name
  374.                         CmbAltVideo.AddItem AltPath
  375.                         cmbVideo.ListIndex = 0
  376.                         CmbAltVideo.ListIndex = 0
  377.                     Else
  378.                         J = DeviceInfo.Count
  379.                         J = J - 1
  380.  
  381.                         While J >= 0
  382.                             cmbVideo.AddItem DeviceInfo.Item(J)
  383.                             AltPath = AltPath & DeviceInfo.Item(J)
  384.                             CmbAltVideo.AddItem AltPath
  385.                             J = J - 1
  386.                             cmbVideo.ListIndex = 0
  387.                             CmbAltVideo.ListIndex = 0
  388.                         Wend
  389.                     End If
  390.                 End If
  391.            
  392.             End If
  393.         End If
  394.         I = I - 1
  395.     Wend
  396.     Exit Sub
  397.     
  398. error_handler:
  399.  
  400.     MsgBox "Error Getting Device Information", vbCritical
  401.     
  402. End Sub
  403.  
  404. Private Sub optFile_Click()
  405.           
  406.     cmbVideo.Enabled = False
  407.     
  408.     cmbAudio.Enabled = False
  409.     
  410.     medbDuration.Enabled = False
  411.     
  412.     lblVideo.Enabled = False
  413.     
  414.     lblAudio.Enabled = False
  415.     
  416.     lblDuration.Enabled = False
  417.     
  418.     lblTime.Enabled = False
  419.     
  420.     
  421.     txtFile.Enabled = True
  422.     
  423.     cmdBrowse.Enabled = True
  424.         
  425. End Sub
  426.  
  427. Private Sub txtFile_Change()
  428.     If (Len(txtFile.Text)) = 1 Then
  429.         If txtFile.Text = " " Then
  430.             txtFile.Text = ""
  431.          End If
  432.     End If
  433. End Sub
  434.  
  435.  
  436. Public Property Set MainStnMgr(ByVal MainStn As StnMgrEnc)
  437.     Set StnCls = MainStn
  438. End Property
  439.