Platform SDK: Broadcast Architecture

Setting an Input Channel

Once you have set an input device for the Video control that supports channels, as described in Setting an Input Device, you can use the BPCDeviceBase.Channel property to set the device to the appropriate channel.

However, if multiple tuning spaces are defined on a broadcast client, as happens when there are multiple tuner cards installed, a particular device might not be able to tune to the specified channel. That channel might be supported by another device that accesses a different tuning space. You can check whether a device supports a channel by using the BPCDeviceBase.ChannelAvailable method.

The following example loops through the BPCDevices collection, searching for a device that supports the specified channel. If such a device is found, the script sets that device as the input device and sets the device's Channel property to the specified channel.

Dim MyChannel = 12
 
For Each Device In vid.Devices
  If vid.Input.HasChannel Then
    If Device.ChannelAvailable(MyChannel)
      vid.Input = Device
      vid.Input.Channel = MyChannel
      Exit For
    End If
  End If
Next