IWMEncSourceGroup2.GetAutoRollover
The GetAutoRollover method retrieves the name of the source group that the current source group will roll over to automatically.
Syntax
string IWMEncSourceGroup2.GetAutoRollover(
out object pvar
);
Parameters
pvar
[out] Object indicating whether to roll over automatically. A value of 0 indicates no auto rollover; -1 indicates an automatic rollover at the end of the source group.
Return Values
This method returns a String specifying the source group name, and an Object indicating whether to roll over automatically.
Remarks
An empty string indicates that automatic rollover is not set.
Example Code
using WMEncoderLib;
try
{
// Create a WMEncoder object.
WMEncoder Encoder;
Encoder = new WMEncoder();
// Create an IWMEncSourceGroupCollection object.
IWMEncSourceGroupCollection SrcGrpColl;
SrcGrpColl = Encoder.SourceGroupCollection;
// Add an IWMEncSourceGroup object to the collection and add an
// audio source to it.
IWMEncSourceGroup2 SrcGrp1;
IWMEncSource SrcAud1;
SrcGrp1 = (IWMEncSourceGroup2)SrcGrpColl.Add("SG_1");
SrcAud1 = SrcGrp1.AddSource(WMENC_SOURCE_TYPE.WMENC_AUDIO);
SrcAud1.SetInput("C:\\audio1.avi", "", "");
// Add a second IWMEncSourceGroup object to the collection and add an
// audio source to it.
IWMEncSourceGroup2 SrcGrp2;
IWMEncSource SrcAud2;
SrcGrp2 = (IWMEncSourceGroup2)SrcGrpColl.Add("SG_2");
SrcAud2 = SrcGrp2.AddSource(WMENC_SOURCE_TYPE.WMENC_AUDIO);
SrcAud2.SetInput("Default_Audio_Device", "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.
string sRollTo1;
object vRollTime1;
string sRollTo2;
object vRollTime2;
sRollTo1 = SrcGrp1.GetAutoRollover(out vRollTime1);
sRollTo2 = SrcGrp2.GetAutoRollover(out vRollTime2);
}
catch (Exception e)
{
// TODO: Handle exceptions.
}
Requirements
Reference: Windows Media Encoder
Namespace: WMEncoderLib
Assembly: Interop.WMEncoderLib.dll
Library: WMEncoderLib.dll
See Also