You can set a start time for any element in a playlist with the ItemStartTimeSet method. The method has 2 parameters:
- _pStartTimestart - a time to start the item in M_DATETIME structure.
- _eStartTypestart - a type of calculation of times.
For example, to set a start time of a playlist item you should get the item (MItem object) and use:
M_DATETIME date = new M_DATETIME(); date.nDay = 25; date.nMonth = 12; date.nYear = 2017; date.nHour = 14; date.nMinute = 23; date.nSecond = 52; item.ItemStartTimeSet(ref date, eMStartType.eMST_Specified);
To disable start time of the item you should use any M_DATETIME structure and eMST_Off type or eMST_Auto:
item.ItemStartTimeSet(ref date, eMStartType.eMST_Off);
Once an item has a specified start time, all the next items' start times are calculated automatically. But if you have a sequence of files with determined start time, there are several types of playlist behavior - it can wait for the next start time, or skip the next scheduled item until its start time.
To set the behavior of playlist on the border between playlist items you should set the “schedule_waitstart” property through IMProps interface:
Let the previous file ended at 10:59 and the next item has a specified start time 11:00.
If “schedule_waitstart” value is:
- "stop" - playlist is stopped and the playlist background is shown. And at 11:00 the specified file starts to play.
- "pause-in" - playlist is paused on the first frame of the next item and at 11:00 this file starts to play.
- "pause-out" - playlist is paused on the last frame of the previous file and at 11:00 the next file starts to play.
"skip" - the next file with specified start time is skipped and the first next file without specified start time is played. Playlist goes on its playback until the next start time. If there are no files without specified start time in the playlist then the playlist is stopped.
With this approach, you can synchronize several playlists to start at the same time. Just set the same start time for the 1st items in all the playlists.