MPLATFORMLib Namespace > IMElements Interface : ElementsGetByIndex Method |
Sub ElementsGetByIndex( _ ByVal _nIndex As Integer, _ ByRef _ppChildElement As MElement _ )
void ElementsGetByIndex( int _nIndex, out MElement _ppChildElement )
procedure ElementsGetByIndex( _nIndex: Integer; Out _ppChildElement: MElement );
void ElementsGetByIndex( int _nIndex, [PARAMFLAG::Out] MElement* _ppChildElement )
Here is example of how to fill all elements in the scene with the same source:
Dim myMixer As New MMixerClass() myMixer.ScenesActiveGet(mySceneID, myIndex, myScene) Dim pChild As MElement myScene.ElementsAdd("newElem", "video", "stream_idx=0 h=0.5 w=0.5 show=1", pChild, 2.0) Dim nCount As Integer myScene.ElementsGetCount(nCount) For i As Integer = 0 To nCount - 1 Dim myElement as MElement myScene.ElementsGetByIndex(i, myElement) myElement.ElementMediaSet(Nothing, "d:\clips\SampleClip1.wmv", "", 2.0) Next
MMixerClass myMixer = new MMixerClass(); myMixer.ScenesActiveGet(out mySceneID, out myIndex, out myScene); MElement pChild; myScene.ElementsAdd("newElem", "video", "stream_idx=0 h=0.5 w=0.5 show=1", out pChild, 2.0); int nCount; myScene.ElementsGetCount(out nCount); for (int i=0; i<nCount; i++) { MElement myElement; myScene.ElementsGetByIndex(i, out myElement); myElement.ElementMediaSet(null, @"d:\clips\SampleClip1.wmv", "", 2.0); }
var myMixer: MMixer; myScenes: IMScenes; myScene: IMElements; mySceneID: string; myIndex: integer; myElement: MElement; i, nCount: integer; begin myMixer:= CreateComObject(CLASS_MMixer) as MMixer; myScenes := myMixer as IMScenes; myScenes.ScenesActiveGet(mySceneID, myIndex, myScene); myScene.ElementsAdd('newElem', 'video', tream_idx=0 h=0.5 w=0.5 show=1', myElement, 2.0); myScene.ElementsGetCount(nCount); for i:=0 to nCount-1 do begin myScene.ElementsGetByIndex(i, myElement); myElement.ElementMediaSet(nil, 'd:\clips\SampleClip1.wmv', '', 2.0); end; end;