home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form Form1
- Caption = "Filter Graph Builder"
- ClientHeight = 4575
- ClientLeft = 1320
- ClientTop = 1380
- ClientWidth = 6465
- Height = 5040
- Left = 1230
- LinkTopic = "Form1"
- ScaleHeight = 4575
- ScaleWidth = 6465
- Top = 1005
- Width = 6645
- Begin VB.CommandButton New
- Caption = "New"
- Height = 375
- Left = 3480
- TabIndex = 15
- Top = 840
- Width = 975
- End
- Begin VB.CommandButton Pause
- Caption = "Pause"
- Height = 375
- Left = 5280
- TabIndex = 14
- Top = 2280
- Width = 975
- End
- Begin VB.CommandButton Connect
- Caption = "Connect..."
- Height = 375
- Left = 3480
- TabIndex = 13
- Top = 2520
- Width = 975
- End
- Begin VB.CommandButton Render
- Caption = "Render"
- Height = 375
- Left = 3480
- TabIndex = 12
- Top = 1920
- Width = 975
- End
- Begin VB.CommandButton Add
- Caption = "Add..."
- Height = 495
- Left = 5280
- TabIndex = 11
- Top = 840
- Width = 975
- End
- Begin VB.CommandButton Source
- Caption = "Source"
- Height = 495
- Left = 5280
- TabIndex = 10
- Top = 120
- Width = 975
- End
- Begin VB.ListBox PinInfo
- Height = 1425
- Left = 720
- TabIndex = 6
- Top = 1800
- Width = 2415
- End
- Begin VB.ComboBox Pins
- Height = 315
- Left = 720
- Style = 2 'Dropdown List
- TabIndex = 5
- Top = 1200
- Width = 2415
- End
- Begin VB.CommandButton Stop
- Caption = "Stop"
- Height = 375
- Left = 5280
- TabIndex = 4
- Top = 2760
- Width = 975
- End
- Begin VB.CommandButton Run
- Caption = "&Run"
- Height = 375
- Left = 5280
- TabIndex = 3
- Top = 1800
- Width = 975
- End
- Begin VB.ComboBox Filters
- Height = 315
- Left = 720
- Style = 2 'Dropdown List
- TabIndex = 1
- Top = 240
- Width = 2415
- End
- Begin VB.CommandButton Open
- Caption = "&Open"
- Height = 375
- Left = 3480
- TabIndex = 0
- Top = 240
- Width = 975
- End
- Begin VB.Label Label3
- Caption = "Info"
- Height = 255
- Left = 240
- TabIndex = 9
- Top = 1800
- Width = 375
- End
- Begin VB.Label Label2
- Caption = "Pins"
- Height = 375
- Left = 240
- TabIndex = 8
- Top = 1200
- Width = 495
- End
- Begin VB.Label Label1
- Caption = "Filters"
- Height = 255
- Left = 240
- TabIndex = 7
- Top = 240
- Width = 495
- End
- Begin VB.Label VendorInfo
- Height = 255
- Left = 720
- TabIndex = 2
- Top = 720
- Width = 2415
- End
- Begin MSComDlg.CommonDialog CommonDialog1
- Left = 240
- Top = 3480
- _Version = 65536
- _ExtentX = 847
- _ExtentY = 847
- _StockProps = 0
- Flags = 4096
- End
- Attribute VB_Name = "Form1"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Dim pMC As Object
- Dim pSelFilter As Object
- Dim pselpin As Object
- Dim bRunning As Boolean
- Private Sub Add_Click()
- Set Registry.RegFilters = pMC.RegFilterCollection
- Registry.Show 1
- RefreshFilters
- End Sub
- Private Sub Connect_Click()
- SelectPin.OtherDir = pselpin.Direction
- Set SelectPin.Graph = pMC
- Set SelectPin.SelFilter = pSelFilter
- SelectPin.RefreshFilters
- SelectPin.Show 1
- If SelectPin.bOK Then
- Dim p As IPinInfo
- Set p = SelectPin.SelPin
- pselpin.Connect p
- RefreshFilters
- End If
- End Sub
- Private Sub Filters_Click()
- Dim pfilter As IFilterInfo
- For Each pfilter In pMC.FilterCollection
- If pfilter.Name = Filters.Text Then
- Set pSelFilter = pfilter
- VendorInfo.Caption = pfilter.VendorInfo
- Pins.Clear
- Dim pPin As IPinInfo
- For Each pPin In pfilter.Pins
- Pins.AddItem pPin.Name
- Next pPin
- End If
- Next pfilter
- Pins.ListIndex = 0
- End Sub
- Private Sub Form_Load()
- bRunning = False
- Filters.Clear
- Pins.Clear
- Set pMC = New FilgraphManager
- End Sub
- Private Sub New_Click()
- Set pSelFilter = Nothing
- Set pselpin = Nothing
- Set pMC = Nothing
- Set pMC = New FilgraphManager
- Filters.Clear
- Pins.Clear
- PinInfo.Clear
- bRunning = False
- End Sub
- Private Sub Open_Click()
- CommonDialog1.ShowOpen
- pMC.RenderFile CommonDialog1.filename
- RefreshFilters
- End Sub
- Private Sub Pause_Click()
- pMC.Pause
- End Sub
- Private Sub Pins_Click()
- On Error Resume Next
- Dim pPin As IPinInfo
- For Each pPin In pSelFilter.Pins
- If pPin.Name = Pins.Text Then
- Set pselpin = pPin
- PinInfo.Clear
- Dim pPinOther As IPinInfo
- Set pPinOther = pPin.ConnectedTo
- If Err.Number = 0 Then
- PinInfo.AddItem "Connected To: " + pPinOther.Name
- Dim pPeer As IFilterInfo
- Set pPeer = pPinOther.FilterInfo
- PinInfo.AddItem "Peer Filter: " + pPeer.Name
- Dim mt As IMediaTypeInfo
- Set mt = pPin.ConnectionMediaType
- PinInfo.AddItem "Media Type: " + mt.Type
- End If
- If pPin.Direction = 0 Then
- PinInfo.AddItem "Direction: Input"
- Else
- PinInfo.AddItem "Direction: Output"
- End If
- End If
- Next pPin
- End Sub
- Private Sub Render_Click()
- pselpin.Render
- RefreshFilters
- End Sub
- Private Sub Run_Click()
- If Not bRunning Then
-
- Dim pPosition As IMediaPosition
- Set pPosition = pMC
- If Err.Number = 0 Then
- On Error Resume Next
- pPosition.CurrentPosition = 0
- End If
- End If
- pMC.Run
- bRunning = True
- End Sub
- Private Sub Source_Click()
- CommonDialog1.ShowOpen
- Dim filter As Object
- pMC.AddSourceFilter CommonDialog1.filename, filter
- RefreshFilters
- End Sub
- Private Sub Stop_Click()
- pMC.Stop
- bRunning = False
- End Sub
- Public Sub RefreshFilters()
- Filters.Clear
- Dim pfilter As IFilterInfo
- For Each pfilter In pMC.FilterCollection
- Filters.AddItem pfilter.Name
- Next pfilter
- If Filters.ListCount > 0 Then
- Filters.ListIndex = 0
- End If
- End Sub
-