I am planning to move my student station away from Station Playlist - on to mAirlist.
One of the main things we want to be able to do, is stop/limit people inserting tracks into the playlist between set hours. (We have a pre-determined playlist of which only 2 tracks are allowed to be added for operation between 9-7).
The way I would like to do it is use a script to limit the amount of items people are allowed to enter into the playlist during set times. Do people think this would be possible?
Hi Matt, not sure if this can be achieved with a script. Perhaps a request for a feature in version 3 with user permissions.
I would lock down mAirlist itself by disabling right clicks and remove the insert option in the top toolbar. Also remove the browser. To insert audio use Charlies playlist adder utilty within the forums.
While we use mAirList for live assist, still a great fan of Station Playlist for automation, especially for listening for and relaying remote streams (which if they fail station playlist will resume local playout).
Thats a shame. Is there a script option that can notify when an Item has been added to the playlist? If so I guess it could remove it if a global count is above 2?
Has anyone else got any ideas how I could achive stopping people playing too many songs outside the playlist, but allow them to add a couple per hour?
Currently I will continue to use Station Playlist for the Sustainer, just because it is easier. But for Assist mode in the studio I would like them to use mAirlist.
The only solution I can imagine is a notification script, run each x seconds, which checks if the playlist is still “alright” and possibly deletes some items. This can be achieved with the OnTimer function. There muste be some examples somewhere in the forum.
But why don’t you just create a log file, compare it to the scheduled log after the show, and kick people out when they don’t stick to the rules?
I will have a play and see what I can come up with. Is there any way I can store a variable globaly? For example save an integer number to use next time the script is run?
I have had a go at putting together a script which does this. The script counts everytime something is played which doesnt have the comment ‘Playlist’. When this count is above 1 (2 items have been played) the next part of the script removes anything without the ‘Playlist’ comment and replaces it with a Dummy Item.
Both parts of the script work perfectly well on there own - but when I mix them together and put the ‘IF pcount > 1 THEN BEGIN’ in the OnTimer, the script seems to add infinate numbers of items over and over again - thus crashing mAirlist. Anyone have any ideas as to why? Cant seem to see anything wrong?
VAR
i: integer;
item: IPlaylistItem;
dpi: IDummyPlaylistItem;
pi: IPlaylistItem;
pcount: integer;
procedure OnStartup;
begin
SetTimerInterval(5000); // 1000ms = 1 Sec
EnableTimer;
end;
procedure OnPlayerStart(PlayerControl: IPlayerControl; Item: IPlaylistItem);
begin
IF item.GetComment <> 'Playlist' THEN BEGIN
SystemLog('Bad') ;
pcount := pcount + 1;
SystemLog(IntToStr(pcount));
END;
end;
procedure OnTimer;
begin
IF pcount > 1 THEN BEGIN
SystemLog('Checking Playlist Started');
FOR i := 0 to CurrentPlaylist.GetCount - 1 DO
BEGIN
item := CurrentPlaylist.GetItem(i);
IF item.GetComment <> 'Playlist' THEN BEGIN
SystemLog(item.getartist);
dpi := Factory.CreateDummyPlaylistItem;
pi := IPlaylistItem(dpi);
pi.SetTitle('Please do not add more than 2 items to the playlist');
pi.SetArtist(item.GetArtist + ' - ' + item.GetTitle);
pi.SetComment('Playlist');
CurrentPlaylist.Delete(i);
CurrentPlaylist.Insert (i,pi);
pi.SetColored(true);
pi.SetColor($FF0000);
END;
end;
END;
end;
begin
end.
Thanks in advance,
Matt
P.S. - I know that using the comment field is probably not the best way to do it, but it is easy whilst testing the script. I will have to have a think about the best way to do it when the script is done.