IWMEncDeviceControl.SetInput
![]() |
The SetInput method adds a device control to the device control collection.
Syntax
IWMEncDeviceControl.SetInput(strInput, strScheme, strInitData)
Parameters
strInput
[in] String containing the device resource name.
strScheme
[in] String containing the scheme, which should be "DeviceControl".
strInitData
[in] String containing the initialization data. This parameter is reserved for future use and is ignored at this time.
Return Values
This method does not return a value.
Remarks
Use the IWMEncDeviceControlPluginInfoManager object to enumerate the devices on your system and to retrieve the resource name. For more information, see Enumerating Devices.
To control digital devices programmatically, you must add the Windows Media Encoder Device Control reference to the project. For more information, see Programming in Visual Basic.
Example Code
' Create a WMEncoder object.
Dim Encoder As WMEncoder
Set Encoder = New WMEncoder
' Add the device as the audio source and the video source.
Dim SrcGrpColl As IWMEncSourceGroupCollection
Dim SrcGrp As IWMEncSourceGroup2
Dim SrcAud As IWMEncSource
Dim SrcVid As IWMEncVideoSource
Set SrcGrpColl = Encoder.SourceGroupCollection
Set SrcGrp = SrcGrpColl.Add("SG_1")
Set SrcAud = SrcGrp.AddSource(WMENC_AUDIO)
Set SrcVid = SrcGrp.AddSource(WMENC_VIDEO)
' Replace the following name with the name of your device.
SrcAud.SetInput ("Device://Device resource name")
SrcVid.SetInput ("Device://Device resource name")
' Configure the output and profile.
' Retrieve the device control collection, then add a device to it.
Dim DCColl As IWMEncDeviceControlCollection
Set DCColl = SrcGrp.DeviceControlCollection
Dim DControl As IWMEncDeviceControl
Set DControl = DCColl.Add
' Replace the following name with the resource name of your device.
DControl.SetInput ("DeviceControl://Device resource name")
' Initialize the encoding session.
Encoder.PrepareToEncode True
' Get the plug-in from the device.
Dim DCPlugin As IWMEncDeviceControlPlugin
Set DCPlugin = DControl.GetDeviceControlPlugin
' Start encoding.
Encoder.Start
Requirements
Reference: Windows Media Encoder Device Control
Library: wmdevctl.dll
See Also
.gif)