home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 November / Chip_2002-11_cd1.bin / zkuste / vbasic / Data / Utils / WME71SDK.exe / RCDATA / CABINET / stnmgrenc.cls < prev    next >
Text File  |  2001-04-17  |  4KB  |  156 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4.   Persistable = 0  'NotPersistable
  5.   DataBindingBehavior = 0  'vbNone
  6.   DataSourceBehavior  = 0  'vbNone
  7.   MTSTransactionMode  = 0  'NotAnMTSObject
  8. END
  9. Attribute VB_Name = "StnMgrEnc"
  10. Attribute VB_GlobalNameSpace = False
  11. Attribute VB_Creatable = True
  12. Attribute VB_PredeclaredId = False
  13. Attribute VB_Exposed = False
  14. Option Explicit
  15. Dim Name As String
  16. Dim EncProfile As String
  17.  
  18. Dim WithEvents Encoder   As WMEncoder
  19. Attribute Encoder.VB_VarHelpID = -1
  20.  
  21. Dim Over As Integer
  22.  
  23. Dim VidOpt  As Integer
  24.  
  25. Dim PlayCnt As Integer
  26.  
  27. Dim LstEnd As Integer
  28.  
  29. Private Type EncPlaylist
  30.     Vid As String
  31.     Aud As String
  32.     Duration As String
  33. End Type
  34.  
  35. Dim EncPlaylistArray() As EncPlaylist
  36.  
  37. Public Property Get EncName() As String
  38.     EncName = Name
  39. End Property
  40.  
  41. Public Property Let EncName(ByVal NewEnc As String)
  42.     Name = NewEnc
  43. End Property
  44.  
  45. Public Property Get EncPrfName() As String
  46.     EncPrfName = EncProfile
  47. End Property
  48.  
  49. Public Property Let EncPrfName(ByVal NewEncPrf As String)
  50.     EncProfile = NewEncPrf
  51. End Property
  52.  
  53. Public Property Get ExistEnc() As WMEncoder
  54.     Set ExistEnc = Encoder
  55. End Property
  56.  
  57. Public Property Get VideoOpt() As Integer
  58.     VideoOpt = VidOpt
  59. End Property
  60.  
  61. Public Property Let VideoOpt(ByVal Opt As Integer)
  62.     VidOpt = Opt
  63. End Property
  64. Public Sub Popl_Array(Vid As String, Aud As String, Durationdev As String, Cnt As Integer)
  65.     EncPlaylistArray(Cnt).Aud = Aud
  66.     EncPlaylistArray(Cnt).Vid = Vid
  67.     EncPlaylistArray(Cnt).Duration = Durationdev
  68. End Sub
  69.  
  70. Public Sub Init_Array(Cnt As Integer)
  71.    ReDim EncPlaylistArray(1 To Cnt)
  72. End Sub
  73.  
  74. Public Property Get PlaylistPos() As Integer
  75.     PlaylistPos = PlayCnt
  76. End Property
  77.  
  78. Public Property Let PlaylistPos(ByVal iNewValue As Integer)
  79.     PlayCnt = iNewValue
  80. End Property
  81.  
  82.  
  83. Public Property Get Stat() As Integer
  84.     Stat = Over
  85. End Property
  86.  
  87. Public Property Let Stat(ByVal NewValue As Integer)
  88.     Over = NewValue
  89. End Property
  90.  
  91.  
  92. Public Sub EncInit()
  93.     Set Encoder = New WMEncoder
  94. End Sub
  95. Public Property Get LstStop() As Integer
  96.     
  97.     LstStop = LstEnd
  98.  
  99. End Property
  100.  
  101. Public Property Let LstStop(ByVal iNewValue As Integer)
  102.     LstEnd = iNewValue
  103. End Property
  104. Public Sub PlayElem(Vid As String, Aud As String, Dur As String)
  105.     
  106.     Dim EncPlay As EncPlaylist
  107.     Dim LenPlay As Long
  108.     
  109.     EncPlay = EncPlaylistArray(PlayCnt)
  110.     
  111.     Vid = EncPlay.Vid
  112.     Aud = EncPlay.Aud
  113.     Dur = EncPlay.Duration
  114.     
  115.     If Dur <> "0" And Dur <> "-" Then
  116.         
  117.         LenPlay = Dur
  118.         LenPlay = LenPlay - 1
  119.         
  120.         EncPlay.Duration = LenPlay
  121.         EncPlaylistArray(PlayCnt) = EncPlay
  122.     
  123.     End If
  124.  
  125. End Sub
  126.  
  127. Public Property Get MaxBound() As Integer
  128.     On Error GoTo error_handler
  129.     MaxBound = UBound(EncPlaylistArray)
  130.     Exit Property
  131. error_handler:
  132.     MaxBound = 0
  133. End Property
  134.  
  135. Public Sub AllElem(Vid As String, Aud As String, Dur As String, pos As Integer)
  136.     Dim EncList As EncPlaylist
  137.     
  138.     EncList = EncPlaylistArray(pos)
  139.     Vid = EncList.Vid
  140.     Aud = EncList.Aud
  141.     Dur = EncList.Duration
  142. End Sub
  143.  
  144. Private Sub Encoder_OnSourceStateChange(ByVal enumState As WMEncoderLib.WMENC_SOURCE_STATE, ByVal enumType As WMEncoderLib.WMENC_SOURCE_TYPE, ByVal iIndex As Integer, ByVal bstrSourceGroup As String)
  145.     If enumState = WMENC_SOURCE_STOP Then
  146.         Over = 1
  147.     Else
  148.         If enumState = WMENC_SOURCE_START Then
  149.             Over = 0
  150.  
  151.         End If
  152.     End If
  153.  
  154. End Sub
  155.  
  156.