I’m pretty sure that I’ve written mAirListScript v3.1 code like this:
dt := CurrentPlaylist.GetItem(0).GetStartTime;
… but this doesn’t seem to work in v4.x. What is the v4.x equivalent code to obtain the (estimated) playout time of a Playlist Item? Does it require the use of sttEstimated with a function I haven’t managed to identify yet?
Also, does the TDateTime value returned include the date as well as the time of projected playout? If not, could that please be changed? It would then work very nicely with the ‘not before/not after’ settings on the v4.x Scheduling tab in an Item’s Properties dialog.
PS: I’m too scared to try the Hours Restrictions, given the way it’s stored in mAirListDB >shudder<. Are there specific methods and/or objects to handle comparisons with that value?
PPS: May I wish a great and trouble-free festive season to all our readers. 8)
In v4.x all backtiming-related calculations are stored in a “metadata” record that the playlist keeps for each item:
dt := CurrentPlaylist.GetMetadata(0).(type);
The possible values for “type” are:
sttStarted: The time the item was started (for playing/played items)
sttCalculated: The calculated starting time of future items
sttSinceLastBreak: As the name suggests, the time since the last automation break point.
If I recall correctly the date part is included as well - you can verify that by checking if the returned value is larger than 0.
You should turn on the “update backtiming with current time” option though - otherwise you might end up with start times (without the date part) relative to the beginning of the playlist, just as displayed in the Time column.
To tell if a time is “realtime” or not, you can look at the flags GetMetadata(i).GetStatusFlags returns - if pisfRealtime is in the flags, the time is “real”. There’s a couple of other flags that might be of interest:
I think something got missed off Torben’s posting; the correct syntax is this:
dt := CurrentPlaylist.GetMetadata(0).GetStartTime(sttCalculated);where 0 is the number (0-based) of the Playlist Item you want to ‘read.’
This will return a value of zero if the Item has already been played, otherwise it returns the Item’s ETA as a standard date/time value which includes the date.
So, everything working perfectly now: thanks very much!