MPLATFORMLib Namespace > MItemClass Class : FileInOutSet Method |
Here is example or playlist initialization and adding a file to it:
Dim myPlaylist As New MPlaylistClass() myPlaylist.PreviewWindowSet("", panelPreview.Handle.ToInt32()) myPlaylist.PreviewEnable("", 1, 1) myPlaylist.ObjectStart(New Object()) 'Insert clip at the end of playlist Dim nIndex As Integer = -1 Dim pFile As MItem Dim strPath As String = "d:\clips\SampleClip1.wmv" myPlaylist.PlaylistAdd(Nothing, strPath, "", nIndex, pFile) pItem.FileInOutSet(5.0, 10.0) myPlaylist.FilePlayStart()
MPlaylistClass myPlaylist = new MPlaylistClass(); myPlaylist.PreviewWindowSet("", panelPreview.Handle.ToInt32()); myPlaylist.PreviewEnable("", 1, 1); myPlaylist.ObjectStart(new object()); //Insert clip at the end of playlist int nIndex = -1; MItem pFile; string strPath = @"d:\clips\SampleClip1.wmv"; myPlaylist.PlaylistAdd(null, strPath, "", ref nIndex, out pFile); pItem.FileInOutSet(5.0, 10.0); myPlaylist.FilePlayStart();
var nIndex: integer; pItem: MItem; myPlaylist: MPlaylist; myPreview: IMPreview; myEvents: TEvents; myFile:IMFile; myObject:IMObject; cookie: LONG_PTR; begin myPlaylist:= CreateComObject(CLASS_MPlaylist) as MPlaylist; myPreview:= myPlaylist as IMPreview; myObject:= myPlaylist as IMObject; myEvents:=TEvents.Create(); myObject.ObjectCallbackSet(myEvents, cookie); myFile:=myPlaylist as IMFile; myPreview.PreviewWindowSet('', panelPreview.Handle); myPreview.PreviewEnable('', 1, 1); nIndex:=-1; myPlaylist.PlaylistAdd(nil, 'c:\myFile.avi', '', nIndex, pItem); pItem.FileInOutSet(5.0, 10.0); myFile.FilePlayStart(); end;