MPLATFORMLib Namespace > MElementClass Class : ElementsGetCount Method |
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 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++) { 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 ElementsGetByIndex(i, myElement); myElement.ElementMediaSet(nil, 'd:\clips\SampleClip1.wmv', '', 2.0); end; end;