IWMEncSourceGroupCollection.Move

Windows Media Encoder SDK banner art

The Move method repositions a given source group directly in front of another source group in the collection.

Syntax

void IWMEncSourceGroupCollection.Move(
  IWMEncSourceGroup  SourceGroup,
  IWMEncSourceGroup  SourceGroupInfront
);

Parameters

SourceGroup

[in]  Repositioned IWMEncSourceGroup object.

SourceGroupInfront

[in]  IWMEncSourceGroup object before which SourceGroup is placed.

Return Values

This method does not return a value.

Remarks

Use the IWMEncSourceGroupCollection.Add method to add a source group. Use the IWMEncSourceGroupCollection.Item method to retrieve both SourceGroup and SourceGroupInfront.

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