Append Playlist at Random

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:

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;

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
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

A little digging in the forums. this script almost does things (it inserts the playlist to the top rather than append.
i’m sure in config there is an option to put new items to the bottom of a playlist so will have another look.


btw:Cheap-skate using version 2

Ok cracked it, see next reply.

The latest means:

On mAirList startup loads a playlist relevant to the hour.

Hour 14 contains:
Station ID
Promo (on start run script - LoadRandomPlaylist, the script linked in german selecting an m3u file rather than a single audio file)

These m3u files load to the top of the playlist and are called containers. When loaded they load closed so you cannot see what is in them (they do not expand when clicked either, but we are running in auto from an unattended remote location so not important).

At random then - container 5 consists of 6 songs (containers may vary in size)
Song 1 (on start run script RandomisePlaylist mentioned at the start of this thread)(on stop append playlist with a Spot - more about these later)

This changes the order of the following X number of songs, in this instance 5 and recreates the chain as a Spot serves the same purpose as the first playlist loaded by the hour. A script in the forums which loads a playlist according to the time date format (just using HH for the hour).

Head spinning - sorry!

Spots - a small playlist with Station ID, Promo and 1 song.