Operates playlists
Methods
PlaylistAdd
Inserts a new item into the playlist at the specified position.
Syntax
void PlaylistAdd( object _pExternOrRef, string _bsPath, string _bsParam, ref int _pnIndex, out MItem _ppPlaylistItem )
Parameters
_pExternOrRef - reference to external object (for example, live source)
_bsPath - path of the item
_bsParam - additional parameters of element (“Live” to add live source, “Playlist” to add playlist). If you want to add a new playlist with any file then you should use PlaylistAdd( “my_file.avi”, “playlist”). If you add file, you can set file properties here (like in FileNameSet method), see MFile object: properties.
_pnIndex - place of element in playlist
Possible values:
0 - insert new file to first position of playlist: [newfile] [first] ... [last]
1 - insert new file to second position of playlist: [first] [newfile] ... [last] etc.
-1 - insert new file to the end of playlist: [first] ... [last] [newfile]
2 - insert new file to second position from the end of playlist: [first] ... [newfile] [last]
3 - insert new file to third position from the end of playlist: [first] ... [newfile] [pre-last] [last] etc.
_ppPlaylistItem - output playlist item
PlaylistBackgroundGet
Gets the current playlist background.
Syntax
void PlaylistBackgroundGet( out string _pbsPath, out MItem _ppPlaylistItem )
Parameters
_pbsPath - path to the background file
_ppPlaylistItem - background playlist item MItem object
PlaylistBackgroundSet
Sets the background of playlist.
Syntax
void PlaylistBackgroundSet( object _pExternOrRef, string _bsPath, string _bsParam, out MItem _ppPlaylistItem )
Parameters
_pExternOrRef - reference to external object (for example, live source)
_bsPath - path to source. Possible values: color name ("red") or #RRGGBB color code; "transparent" for transparent background; path to media file or playlist. empty string to be able to see the last frame of playlist.
_bsParam - additional parameters string
_ppPlaylistItem - background playlist MItem object
PlaylistCommandAdd
Adds a command to the playlist.
Syntax
void PlaylistCommandAdd( string _bsCommand, string _bsParam, object _pTargetObject, out int _pnIndex, out MItem _ppPlaylistItem )
Parameters
_bsCommand - name of the comand
_bsParam - parameters of the command
_pTargetObject - target object of the command
_pnIndex - index of output item
_ppPlaylistItem - output playlist MItem object
PlaylistGetByIndex
Gets the item and the item offset from the start by item index.
Syntax
void PlaylistGetByIndex( int _nIndex, out double _pdblFileOffset, out string _pbsPath, out MItem _ppPlaylistItem )
Parameters
_nIndex - playlist item index (use -1 for the current item, -2 for the current break or qued item and -3 for qued item only in case of breaks)
_pdblFileOffset - file offset from the start
_pbsPath - item path
_ppPlaylistItem - playlist item MItem object
PlaylistGetByOffset
Gets the item in playlist by the offset time from start.
Syntax
void PlaylistGetByOffset( double _dblTimeOffset, out int _pnIndex, out double _pdblFileTime, out string _pbsPath, out MItem _ppPlaylistItem )
Parameters
_dblTimeOffset - offset position from the start
_pnIndex - index of playlist item
_pdblFileTime - position in file
_pbsPath - file path
_ppPlaylistItem - output playlist item MItem object
PlaylistGetCount
Gets the number of the playlist items and the total playlist duration.
Syntax
void PlaylistGetCount( out int _pnCount, out double _pdblTotalDuration )
Parameters
_pnCount - number of items in playlist
_pdblTotalDuration - total playlist duration
PlaylistPosGet
Gets the current playlist position (current item index, current item time and current playlist time). The position is calculated from item in-point with calculation of all breaks.
Syntax
void PlaylistPosGet( out int _pnIndex, out int _pnNextIndex, out double _pdblFileTime, out double _pdblListTime )
Parameters
_pnIndex - current item index
_pnNextIndex - next item index
_pdblFileTime - time position in seconds related to currently played item
_pdblListTime - time position in seconds related to the whole playlist
PlaylistPosSet
Sets the current playlist position to the specified file and time. The position is calculated from item in-point with calculation of all breaks.
Syntax
void PlaylistPosSet( int _nIndex, double _dblFileOrListTime, double _dblPreroll )
Parameters
_nIndex - playlist item index Possible values: 0, 1, 2 etc. - playlist item index to set position to. -1 - set position related to the whole playlist.
_dblFileOrListTime - file or playlist time in seconds to set position to
_dblPreroll - preroll value in seconds. It will be passed from the beginning of file before position set
PlaylistRemove
Removes the item from playlist.
Syntax
void PlaylistRemove( MItem pFile )
Parameters
PlaylistRemoveByIndex
Removes multiple items from the playlist.
Syntax
void PlaylistRemoveByIndex( int _nIndex, int _nExtraRemove )
Parameters
_nIndex - index of item to start remove from
_nExtraRemove - number of items to be removed Possible values: 0 - remove single item. positive value - number of items to be removed is calculated to the end of playlist. negative value -clear all playlist items
PlaylistReorder
Changes the playlist items order.
Syntax
void PlaylistReorder( int _nIndex, int _nIndexAdd )
Parameters
_nIndex - index of item to be changed
_nIndexAdd - index change number Possible values: positive value - position is changed in direction to end of playlist. negative value - position is changed in direction to beggining of playlist