Hi, Looking for a means of appending playlists at random.
The situation is to suit a standby player should an online stream fail. The player loads into auto and begins playback of a playlist chosen by the current hour. btw To activate the player I use Pira silence detector:
http://pira.cz/eng/silence.htm
Pira listens to the online player from a remote location, on stream failure it sends an email to the studio, starts mAirList and a pre configured Edcast (auto connect) at the remote site. Once mAirList/Edcast connects to the stream - Pira sends another email stating emergency player activated.
Back to the query.
The playlist contains just 2 items. On start of the first item it appends a mini playlist (upto 7 music tracks). I wish to randomise the order these mini playlists are selected (without repetition in X number of hours would be good too).
Going back to the first playlist and the second item - on start this randomises the playlist just appended.
From the forums:[code]// Playlist Randomizer
var i : Integer;
ziel: Integer;
begin
CurrentPlaylist.BeginUpdate;
try
for i:=0 to CurrentPlaylist.GetCount-1 do begin
if CurrentPlaybackControl.GetPlayerOfItem(CurrentPlaylist.GetItem(i)) = -1 then begin
ziel := random(CurrentPlaylist.GetCount-1);
if CurrentPlaybackControl.GetPlayerOfItem(CurrentPlaylist.GetItem(ziel)) = -1 then
CurrentPlaylist.Move(i,ziel);
end;
end;
finally
CurrentPlaylist.EndUpdate;
end;
end.[/code]
Neat trick.
editOne of these music tracks will at some point on start, append a playlist of just 2 items (jingle and promo to restart the sequence).edit
Next randomising the order playlists are selected, but stuck as normally I just crib scripts posted here (a programmer I’m not).
Thanks In Advance.
Kind Regards Tony