flagging played audio

Hi Torben, is there a way you could incoporate a form of flagging an audio file with either the time it was last played or a marker to say its been played X number of hours ago?

The number of hours user configurable, a nice touch would also be that the marker counts down to zero.

The use of the flags to warn presenters that these track should not be played again until the flag is clear. Handy? would certainly make life easier for the following presenter knowing what they can play (we’re working without playlists or schedules) without too many repeats.

Saves leaving paperwork to check whats happened too.

Kind regards tony

I was thinking about this a while ago… It’s a good idea. My idea would be to write the play date/time to the MMD file, and have the Browser extended to show various columns from the MMD file (in Explorer format), so that columns can be sorted just like in Windows.

I don’t understand why a ‘last played at…’ field of the type you are suggesting is in any way ‘better’ than the existing Played Items list. Or were you not aware of that Browser pane?

Since you can sort that pane by Time Played, I don’t see why you would want or need anything beyond that, unless you plan to write Script(s)to prevent files being added to a Playlist based on this ‘Last Played’ time.


Reason is - The browser pane only does it for that instance of mAirList (as is reset upon exiting), not across a LAN. So Studio2 wouldn’t know when a song was last played. Then again, there is always the LOG file :slight_smile:

I notice that MMDs already contain a LastPlayed value, which seems to be some numeric, encoded form of date/time (apologies, I’m no Delphi expert!). Unless of course this is now an obsolete field, but I don’t think so (correct, Torben?)

Maybe the answer to Charlie’s request would be to display the decoded form of this somewhere on the General tab of the Properties dialog? I would be in favour of that: it’s a very useful piece of information to know. Like Charlie, we at Leith FM do not presently use Playlists or scheduling.

Obviously (?) this date/time would have to be a NON-editable field, so adding it to the editable ‘grid’ would be a Bad Idea.


It’s my belief that the Browser should be upgraded (at some point when Torben feels like it!) to include standard Explorer columns - Artist, Title, Duration, Intro etc. I expect this may slow down the program a bit - But would be ideal if the facility was there. The “last played” could also be shown in a column.

Really, the last played is mainly suited to small-stations and RSLs where scheduling is not the relied-upon method of music playout - “Drag ‘n’ Drop Radio” (as I call it) would benefit from some kind of system where a DJ could easily see the last time a song/file was aired (ie: reached the EOF point).

Most of the features requested here could be easily covered by a suitable, full-features mAirList-compliant sister database. This is how these things are solved in commercial products. I doubt that it can be efficiently implementen when only dealing with files. The “slowing down” could become rather significant.


PS: There is a “GetLastPlayed” method/field in IPlaylistItem. But the value is not preserved when saving and loading the playlist. However, you might exploit this from within a script and keep your own list somewhere.

Torben, could you please confirm that the LastPlayed field in MMDs is updated each time an item is Started, and if so:
a) how does one ‘decode’ this into a date/time, or is a Delphi function needed to do this?
b) is the MMD LastPlayed field the basis of the GetLastPlayed method?
c) would it be difficult to display it in the item Properties dialog: on either the General or Details tab, probably?

Thanks in advance: I’m just trying to understand how all the Last Played stuff works!

Charlie: apologies, I mixed you up with Tony, who is the fellow non-scheduled radio guy! D’OH!


I just took a deeper look into the code:

Yes, the value is saved to the MMD, however in a quite unusual format (as a UNIX timestamp, i.e., seconds after 1970-01-01 01:00:00). I should change this to a more human-readable format, just like in the event list XML data.

No, it is not saved automatically. This would be a little problematic, because we needed a way to tell which MMDs are to be saved automatically and which not. Maybe a flag on the item or something, and an option to enable automatic saving for new items by default or not.

However, you can easily create a simple notification script, waiting for ntPlayerStart, and calling pi.SaveMMD. Voila. You could also add a custom “last played” entry in the User Defined Properties:

pi.GetUserData.Values['Last Played'] := FormatDateTime('yyyy-mm-dd hh:nn:ss', now); pi.SaveMMD;

(untested code)

The GetLastPlayed method and the LastPlayed field in the MMD refer to the same information. Regarding the conversion of the TDateTime type, use the Delphi function FormatDateTime. A good reference can be found here: http://www.delphibasics.co.uk/RTL.asp?Name=FormatDateTime

I will add the “last played” information to the Details tab of the Properties dialog.


Thanks Torben for giving this some consideration.

Autoplus (http://www.westcountrybs.co.uk/radio%20automation.htm) has a similar feature which highlights a played track in colour, although I cannot recall how long the time period is or if its a seperate database.

Its just a good instant visual reminder not to play the track again just yet and I’ve just realised this perhaps at least partially already exists.

If a user could set the last played limit to (for instance 120 items) that should cover a long enough period, as a quick fix it will suffice until a later version.

So much is already there, its just thinking about it more carefully!

As of version 1.5.49, the LastPlayed field is saved as a cleartext string inside the XML, and it is also displayed in the Properties dialog.


Hi Torben sorry to bring this one up again. Just wondered about the following:

  1. Is it possible to display the lastplayed history within the audio tags inside a playlist without openning the properties dialog?

  2. Currently the lastplayed history is reset if mAirList exits, I was hoping it would remember these details all the time.

  3. Extending on the lastplayed feature, would a mini-history be useable to others? In the nature of mAirList a configurable option for a counter to record and display (again in the comments) the number of uses each audio element receives over a defined period.

Kind regards tony