Share via


IWMEncSourceGroupCollection.Remove

Windows Media Encoder SDK banner art

The Remove method removes a source group from the collection.

Syntax

void IWMEncSourceGroupCollection.Remove(
  object  var
);

Parameters

var

[in]  Object containing the name or index of the source group.

Return Values

If this method fails, it returns an error number.

Number Description
0xC00D1B60 The active source group cannot be deleted while the encoder engine is running.

Example Code

using WMEncoderLib;

try
{
// Create a WMEncoder object.
WMEncoder Encoder;
Encoder = new WMEncoder();

// Declare objects and variables.
IWMEncSourceGroupCollection SrcGrpColl;
IWMEncSourceGroup SrcGrp;
IWMEncSourceGroup SrcGrp1;
IWMEncSourceGroup SrcGrp2;
IWMEncSourceGroup SrcGrp3;
int i;

// Create an IWMEncSourceGroupCollection object.
SrcGrpColl = Encoder.SourceGroupCollection;

// Add new source groups to the collection.
SrcGrp1 = SrcGrpColl.Add("SG_1");
SrcGrp2 = SrcGrpColl.Add("SG_2");
SrcGrp3 = SrcGrpColl.Add("SG_3");

// Loop through the collection to find a specific
// source group.
for (i = 0; i < SrcGrpColl.Count; i++)
{
    SrcGrp = SrcGrpColl.Item(i);
    if (SrcGrp.Name == "SG_3")
    {
        // Move SrcGrp3 in front of SrcGrp1.
        SrcGrpColl.Move(SrcGrp3, SrcGrp1);
        // Make ScrGrp3 active.
        SrcGrpColl.Active = SrcGrp3;
    }
}

// Remove SrcGrp2, by index, from the collection.
SrcGrpColl.Remove(2);
}

catch (Exception e)
{
     // TODO: Handle exceptions.
}

Requirements

Reference: Windows Media Encoder

Namespace: WMEncoderLib

Assembly: Interop.WMEncoderLib.dll

Library: WMEncoderLib.dll

See Also