IWMEncSourceGroupCollection.length

Windows Media Encoder SDK banner art

The length property retrieves the number of source groups in the collection.

Syntax

Long = IWMEncSourceGroupCollection.length

Parameters

This property takes no parameters.

Property Value

A Long that indicates the number of source groups in the collection.

Remarks

This method performs the same action as the IWMEncSourceGroupCollection.Count method and is included for JScript developers.

Example Code

' Create a WMEncoder object.
Dim Encoder As WMEncoder
Set Encoder = New WMEncoder

' Declare objects and variables.
Dim SrcGrpColl As IWMEncSourceGroupCollection
Dim SrcGrp As IWMEncSourceGroup
Dim SrcGrp1 As IWMEncSourceGroup
Dim SrcGrp2 As IWMEncSourceGroup
Dim SrcGrp3 As IWMEncSourceGroup
Dim i As Integer

' Create an IWMEncSourceGroupCollection object.
Set SrcGrpColl = Encoder.SourceGroupCollection

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

' Loop through the collection to find a specific
' source group.
For i = 0 To SrcGrpColl.Count - 1
    Set SrcGrp = SrcGrpColl.Item(i)
    If SrcGrp.Name = "SG_3" Then
        ' Move SrcGrp3 in front of SrcGrp1.
        SrcGrpColl.Move SrcGrp3, SrcGrp1
        ' Make ScrGrp3 active.
        SrcGrpColl.Active = SrcGrp3
    End If
Next
   
' Remove SrcGrp2, by index, from the collection.
SrcGrpColl.Remove 2

Requirements

Reference: Windows Media Encoder

Library: wmenc.exe

See Also