MPLATFORMLib Namespace > MComposerClass Class : StreamsRemove Method |
Public Overridable Sub StreamsRemove( _ ByVal _pStream As MItem, _ ByVal _dblTimeForChange As Double _ )
public virtual void StreamsRemove( MItem _pStream, double _dblTimeForChange )
public procedure StreamsRemove( _pStream: MItem; _dblTimeForChange: Double ); virtual;
public: virtual void StreamsRemove( MItem* _pStream, double _dblTimeForChange )
Here is example of how to remove all streams from mixer:
'initialize a mixer Dim m_objMixer As New MMixerClass() m_objMixer.ObjectStart(Nothing) m_objMixer.FilePlayStart() 'add streams to the mixer Dim pItem As MItem m_objMixer.StreamsAdd("", Nothing, "C:\myFile.wmv", "", pItem, 1.0) m_objMixer.StreamsAdd("", Nothing, "C:\myFile1.wmv", "", pItem, 1.0) m_objMixer.StreamsAdd("", Nothing, "C:\myFile2.wmv", "", pItem, 1.0) 'remove all files Dim nFiles As Integer = 0 m_objMixer.StreamsGetCount(nFiles) For i As Integer = 0 To nFiles - 1 Dim myItem As MItem Dim strStreamID As String m_objMixer.StreamsGetByIndex(i, strStreamID, myItem) myMixer.StreamsRemove(myItem, 2.0); Next
//initialize a mixer MMixerClass m_objMixer = new MMixerClass(); m_objMixer.ObjectStart(null); m_objMixer.FilePlayStart(); //add streams to the mixer MItem pItem; m_objMixer.StreamsAdd("", null, @"C:\myFile.wmv", "", out pItem, 1.00); m_objMixer.StreamsAdd("", null, @"C:\myFile1.wmv", "", out pItem, 1.00); m_objMixer.StreamsAdd("", null, @"C:\myFile2.wmv", "", out pItem, 1.00); //remove all files int nFiles = 0; m_objMixer.StreamsGetCount(out nFiles); for (int i = 0; i < nFiles; i++) { MItem myItem; string strStreamID; m_objMixer.StreamsGetByIndex(i, out strStreamID, out myItem); myMixer.StreamsRemove(myItem, 2.0); }
var myItem: MItem; myMixer: MMixer; myFile: IMfile; myObject: IMObject; myStreams: IMstreams; i, nCount: integer; myStreamID: widestring; begin //initialize a mixer myMixer:= CreateComObject(CLASS_MMixer) as MMixer; myStreams:= myMixer as IMStreams; myFile:= myMixer as IMFile; myObject:= myMixer as IMobject; myObject.ObjectStart(nil); myFile.FilePlayStart(); //add stream to the mixer myStreams.StreamsAdd('', nil, 'C:\myFile.wmv', '', myItem, 2.0); myStreams.StreamsAdd('', nil, 'C:\myFile1.wmv', '', myItem, 2.0); myStreams.StreamsAdd('', nil, 'C:\myFile2.wmv', '', myItem, 2.0); myStreams.StreamsGetCount(nCount); for i:=0 to nCount-1 do begin myStreams.StreamsGetByIndex(1, myStreamID, myItem); myStreams.StreamsRemove(myItem, 2.0); end; end;