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 >
Text File  |  2001-03-02  |  8KB  |  332 lines

  1. VERSION 5.00
  2. Object = "{C4941F47-8BC1-49D3-9989-2B7826F26AE6}#1.0#0"; "MSPShell.dll"
  3. Begin VB.Form frmNewStation 
  4.    Caption         =   "New Station"
  5.    ClientHeight    =   6255
  6.    ClientLeft      =   2655
  7.    ClientTop       =   1125
  8.    ClientWidth     =   7335
  9.    Icon            =   "frmNewStation.frx":0000
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   6255
  12.    ScaleWidth      =   7335
  13.    Begin MSPROPSHELLLibCtl.MSPropShell StationProp 
  14.       Height          =   4815
  15.       Left            =   120
  16.       OleObjectBlob   =   "frmNewStation.frx":000C
  17.       TabIndex        =   7
  18.       Top             =   960
  19.       Width           =   7215
  20.    End
  21.    Begin VB.OptionButton optVideo 
  22.       Caption         =   "Audio And Video"
  23.       Height          =   195
  24.       Left            =   3600
  25.       TabIndex        =   6
  26.       Top             =   600
  27.       Width           =   1695
  28.    End
  29.    Begin VB.OptionButton optAudio 
  30.       Caption         =   "Audio Only"
  31.       Height          =   195
  32.       Left            =   1560
  33.       TabIndex        =   5
  34.       Top             =   600
  35.       Value           =   -1  'True
  36.       Width           =   1695
  37.    End
  38.    Begin VB.TextBox txtName 
  39.       Height          =   375
  40.       Left            =   1080
  41.       TabIndex        =   4
  42.       Top             =   120
  43.       Width           =   5655
  44.    End
  45.    Begin VB.CommandButton cmdCancel 
  46.       Cancel          =   -1  'True
  47.       Caption         =   "Cancel"
  48.       Height          =   375
  49.       Left            =   6000
  50.       TabIndex        =   2
  51.       Top             =   5880
  52.       Width           =   1335
  53.    End
  54.    Begin VB.CommandButton cmdOk 
  55.       Caption         =   "Ok"
  56.       Default         =   -1  'True
  57.       Height          =   375
  58.       Left            =   4440
  59.       TabIndex        =   1
  60.       Top             =   5880
  61.       Width           =   1455
  62.    End
  63.    Begin VB.Label lblType 
  64.       Caption         =   " Type"
  65.       Height          =   255
  66.       Left            =   120
  67.       TabIndex        =   0
  68.       Top             =   600
  69.       Width           =   615
  70.    End
  71.    Begin VB.Label lblName 
  72.       Caption         =   "&Name"
  73.       Height          =   255
  74.       Left            =   120
  75.       TabIndex        =   3
  76.       Top             =   120
  77.       Width           =   615
  78.    End
  79. End
  80. Attribute VB_Name = "frmNewStation"
  81. Attribute VB_GlobalNameSpace = False
  82. Attribute VB_Creatable = False
  83. Attribute VB_PredeclaredId = True
  84. Attribute VB_Exposed = False
  85. Option Explicit
  86.  
  87. Dim NewStnEnc As StnMgrEnc
  88. Dim Encoder As WMEncoder
  89.  
  90.  
  91.  
  92. Private Sub cmdCancel_Click()
  93.     Unload Me
  94. End Sub
  95.  
  96. Private Sub cmdOk_Click()
  97.    
  98.    On Error GoTo error_handler
  99.    
  100.    Dim SrcGrpCol As IWMEncSourceGroupCollection
  101.    Dim SrcGrp As IWMEncSourceGroup
  102.    Dim prf As IWMEncProfile
  103.    
  104.    Dim VideoSrc As IWMEncVideoSource
  105.    Dim AudioSrc As IWMEncSource
  106.    Dim I As Integer
  107.    
  108.    
  109.    If txtName.Text = "" Then
  110.         
  111.         txtName.SetFocus
  112.         
  113.         MsgBox "Please enter Station Name", vbInformation
  114.         
  115.         Exit Sub
  116.    
  117.    End If
  118.    NewStnEnc.EncName = txtName.Text
  119.    
  120.    Set SrcGrpCol = Encoder.SourceGroupCollection
  121.    
  122.    Set SrcGrp = SrcGrpCol.Item(0)
  123.  
  124.    Set prf = SrcGrp.Profile
  125.  
  126.    
  127.    
  128.    If optVideo.Value = True Then
  129.         NewStnEnc.VideoOpt = 1
  130.    End If
  131.   
  132.    StationProp.Apply
  133.    Set prf = SrcGrp.Profile
  134.    
  135.    NewStnEnc.EncPrfName = prf.Name
  136.    
  137.    Set SrcGrpCol = Encoder.SourceGroupCollection
  138.    I = 0
  139.    For Each SrcGrp In SrcGrpCol
  140.  
  141.        If SrcGrp.Name = "NewStation" Then
  142.  
  143.            SrcGrpCol.Remove (I)
  144.            Exit For
  145.        End If
  146.    I = I + 1
  147.    Next
  148.    
  149.    
  150.    Unload Me
  151.    Exit Sub
  152.     
  153. error_handler:
  154.     
  155.     MsgBox "Error Creating The Station", vbCritical
  156. End Sub
  157.  
  158. Private Sub Form_Load()
  159.     On Error GoTo error_handler
  160.     
  161.     Dim PpgDesc As New WMEncDisplayInfoPage
  162.     Dim PpgAttr As New WMEncAttributesPage
  163.     Dim PpgEnc As New WMEncProfilePage
  164.     Dim PpgOutput As New WMEncOutputPage
  165.     
  166.     Dim AudioSrc As IWMEncSource
  167.     Dim VideoSrc As IWMEncVideoSource
  168.     Dim SrcGrpCol As IWMEncSourceGroupCollection
  169.     Dim SrcGrp As IWMEncSourceGroup
  170.     Dim PrfCol As IWMEncProfileCollection
  171.     Dim prf As IWMEncProfile
  172.     Dim VidOpt As Integer
  173.         
  174.     Set Encoder = NewStnEnc.ExistEnc
  175.     StationProp.AddObject Encoder
  176.     VidOpt = NewStnEnc.VideoOpt
  177.     
  178.     If VidOpt = 1 Then
  179.         
  180.         optVideo.Value = True
  181.         'optAudio.Value = False
  182.     End If
  183.     
  184.     
  185.     Set SrcGrpCol = Encoder.SourceGroupCollection
  186.     
  187.     
  188.         
  189.     
  190.       
  191.         Set SrcGrp = SrcGrpCol.Add("NewStation")
  192.         
  193.         Set AudioSrc = SrcGrp.AddSource(WMENC_AUDIO)
  194.         If NewStnEnc.VideoOpt = 1 Then
  195.             Set VideoSrc = SrcGrp.AddSource(WMENC_VIDEO)
  196.         End If
  197.         Set PrfCol = Encoder.ProfileCollection
  198.             
  199.         If NewStnEnc.EncPrfName <> "" Then
  200.         
  201.             For Each prf In PrfCol
  202.             
  203.                 If UCase(prf.Name) = UCase(NewStnEnc.EncPrfName) Then
  204.                     SrcGrp.Profile = prf
  205.                     Exit For
  206.                 End If
  207.             Next
  208.         Else
  209.             For Each prf In PrfCol
  210.             
  211.                 If UCase(prf.Name) = "AUDIO FOR LOW BIT RATE VOICE-ORIENTED CONTENT (6.5 KBPS)" Then
  212.                     SrcGrp.Profile = prf
  213.                     Exit For
  214.                 End If
  215.             Next
  216.         End If
  217.         
  218.         
  219.     
  220.     
  221.     
  222.     StationProp.AddPage PpgDesc
  223.     StationProp.AddPage PpgAttr
  224.     StationProp.AddPage PpgEnc
  225.     StationProp.AddPage PpgOutput
  226.     
  227.     
  228.     Exit Sub
  229.     
  230. error_handler:
  231.     
  232.     MsgBox "Error in Encoder Settings", vbCritical
  233.     
  234. End Sub
  235.  
  236. Private Sub optAudio_Click()
  237.     
  238.     On Error GoTo error_handler
  239.     
  240.     Dim VideoCnt As Integer
  241.     Dim SrcGrpCol As IWMEncSourceGroupCollection
  242.     Dim SrcGrp As IWMEncSourceGroup
  243.     Dim PrfCol As IWMEncProfileCollection
  244.     Dim prf As IWMEncProfile
  245.     
  246.     If NewStnEnc.EncName <> "" Then
  247.         Exit Sub
  248.     End If
  249.     
  250.     
  251.     Set SrcGrpCol = Encoder.SourceGroupCollection
  252.     Set SrcGrp = SrcGrpCol.Item(0)
  253.     
  254.     VideoCnt = SrcGrp.SourceCount(WMENC_VIDEO)
  255.     If VideoCnt > 0 Then
  256.         SrcGrp.RemoveSource WMENC_VIDEO, 0
  257.     End If
  258.     
  259.     Set PrfCol = Encoder.ProfileCollection
  260.     
  261.     For Each prf In PrfCol
  262.         If UCase(prf.Name) = "AUDIO FOR LOW BIT RATE VOICE-ORIENTED CONTENT (6.5 KBPS)" Then
  263.             SrcGrp.Profile = prf
  264.         End If
  265.     Next
  266.     Exit Sub
  267.     
  268. error_handler:
  269.     
  270.     MsgBox "Error Getting Profiles of the Encoder!Check Encoder Settings", vbCritical
  271.  
  272. End Sub
  273.  
  274. Private Sub optVideo_Click()
  275.     
  276.     On Error GoTo error_handler
  277.     
  278.     Dim VideoSrc As IWMEncVideoSource
  279.     Dim VideoCnt As Integer
  280.     
  281.     Dim SrcGrpCol As IWMEncSourceGroupCollection
  282.     Dim SrcGrp As IWMEncSourceGroup
  283.     Dim PrfCol As IWMEncProfileCollection
  284.     Dim prf As IWMEncProfile
  285.     
  286.     If NewStnEnc.EncName <> "" Then
  287.         Exit Sub
  288.     End If
  289.     
  290.     
  291.     Set SrcGrpCol = Encoder.SourceGroupCollection
  292.     Set SrcGrp = SrcGrpCol.Item(0)
  293.     
  294.     
  295.     VideoCnt = SrcGrp.SourceCount(WMENC_VIDEO)
  296.     
  297.     If VideoCnt = 0 Then
  298.         Set VideoSrc = SrcGrp.AddSource(WMENC_VIDEO)
  299.     End If
  300.     
  301.     Set PrfCol = Encoder.ProfileCollection
  302.         
  303.     For Each prf In PrfCol
  304.         If UCase(prf.Name) = "VIDEO FOR LAN, CABLE MODEM, OR XDSL (100 TO 768 KBPS)" Then
  305.             SrcGrp.Profile = prf
  306.             Exit For
  307.         End If
  308.     Next
  309.     Exit Sub
  310.     
  311. error_handler:
  312.    
  313.    MsgBox "Error Getting Profiles of the Encoder!Check Encoder Settings", vbCritical
  314.    
  315. End Sub
  316.  
  317.  
  318.  
  319. Public Property Set StationMgrEnc(ByVal NewEnc As StnMgrEnc)
  320.     Set NewStnEnc = NewEnc
  321. End Property
  322.  
  323. Private Sub txtName_Change()
  324.     If (Len(txtName.Text)) = 1 Then
  325.         If txtName.Text = " " Then
  326.             txtName.Text = ""
  327.          End If
  328.     End If
  329. End Sub
  330.  
  331.  
  332.