IWMEncSourceGroup2.SetAutoRollover
![]() |
The SetAutoRollover method specifies the name of the source group that the current source group will roll over to automatically.
Syntax
IWMEncSourceGroup2.SetAutoRollover(lRolloverTime, strSourceGroupName)
Parameters
lRolloverTime
[in] Long indicating whether automatic rollover is set. If 0, auto rollover is not set. If -1, auto rollover is at the end of the source group.
strSourceGroupName
[in] String containing the source group name. If this string is empty, auto rollover is not set.
Return Values
This method does not return a value.
Example Code
' Create a WMEncoder object.
Dim Encoder As WMEncoder
Set Encoder = New WMEncoder
' Create an IWMEncSourceGroupCollection object.
Dim SrcGrpColl As IWMEncSourceGroupCollection
Set SrcGrpColl = Encoder.SourceGroupCollection
' Add an IWMEncSourceGroup object to the collection and add an
' audio source to it.
Dim SrcGrp1 As IWMEncSourceGroup2
Dim SrcAud1 As IWMEncSource
Set SrcGrp1 = SrcGrpColl.Add("SG_1")
Set SrcAud1 = SrcGrp1.AddSource(WMENC_AUDIO)
SrcAud1.SetInput "C:\audio1.avi"
' Add a second IWMEncSourceGroup object to the collection and add an
' audio source to it.
Dim SrcGrp2 As IWMEncSourceGroup2
Dim SrcAud2 As IWMEncSource
Set SrcGrp2 = SrcGrpColl.Add("SG_2")
Set SrcAud2 = SrcGrp2.AddSource(WMENC_AUDIO)
SrcAud2.SetInput "Device://Default_Audio_Device"
' Set SG_1 to roll over to SG_2 when the end of the file is reached.
SrcGrp1.SetAutoRollover -1, "SG_2"
' Retrieve the rollover settings for both source groups.
Dim sRollTo1 As String, vRollTime1 As Variant
Dim sRollTo2 As String, vRollTime2 As Variant
sRollTo1 = SrcGrp1.GetAutoRollover(vRollTime1)
sRollTo2 = SrcGrp2.GetAutoRollover(vRollTime2)
Requirements
Reference: Windows Media Encoder
Library: wmenc.exe
See Also
.gif)