I work with some radio stations in Norway using mAirlist. They are also using the software Breakaway One for FM brodacast and WEB/HD. In this software it is possible to send HTTP post for changing PI between regional and local + PTY on FM RDS. How can this be scripted in mAirlist to make this changes during the playlist?
Is this actually an HTTP POST call you have to make, or rather HTTP GET? If these links in the screenshot are clickable links that change the PTY, it appears to be GET. That would be very simple in a script:
My advise is to decouple the script functionality from the actual item in the library/scheduling, by using a background script that waits for items with specific “characteristics” being played.
For example, this script would execute code whenever an item with the title “News” is played:
procedure OnItemStart(Item: IPlaylistItem; Region: byte; OnAir: boolean; UniqueID: string);
begin
// And item with the title "News" is started
if Item.GetTitle = 'News' then begin
// Insert code here
end;
end;
Or here is an alternative version that will wait for items of type News:
procedure OnItemStart(Item: IPlaylistItem; Region: byte; OnAir: boolean; UniqueID: string);
begin
// An item of type "News" is started
if Item.GetItemType = pitNews then begin
// Insert code here
end;
end;
Save as *.mls and register as a background script in the configuration of the playout computer.
Then you only need to take care that the items in your playlist/library have the correct title or type set.
Check out the Background Script Template.mls file in the program folder, there are many more procedures you can use as triggers.
// Called when on-air playback of an item (in any player) ends
procedure OnItemStop(Item: IPlaylistItem; Region: byte; OnAir: boolean; UniqueID: string; Duration: TTimeValue);
begin
end;
All of these can be found in the template file in the program folder.
Still did not do the trick, Just tried this script via Database → Run Script, and then I get error "Error running script: [ERROR] (1:1) Unexpected end of file
No, that’s not the correct menu item! That would be for one-shot scripts.
This one is a “background script”, and you have to install it on the playout computer.
So open up the config (or the mAirList Control Panel from the About menu, in case the playout is currently running), go to Background Scripts and add the script there.
But this string:
TCPSendString(‘10.0.0.1’, 1234, ‘DS=1’); need to be ASCll formatted. But seem to be UTF-8. It is the same way to post artist / title to 2WCom RDS encoders as ASCII.
I also need to the script to load with procedure OnOnAir and OnOffAir. The purpose is to send commands when the player is in On Air mode and Off.
// Called when mAirList goes ON AIR
procedure OnOnAir;
begin
HTTPGet('http://' + BREAKAWAY_IP + ':8282/parameter/fm1/misc/rds_pi_hex=F288'); // PI NASJONAL
TCPSendString('10.0.0.121', 5500, 'DS=2'); // PI NASJONAL 2WCOM < THIS NEED TO BE ASCII
end;
// Called when mAirList goes OFF AIR
procedure OnOffAir;
begin
HTTPGet(‘http://’ + BREAKAWAY_IP + ‘:8282/parameter/fm1/misc/rds_pi_hex=F688’); // PI REGIONAL PI
TCPSendString(‘10.0.0.121’, 5500, ‘DS=1’); // PI REG 2WCOM -< THIS NEED TO BE ASCII
If I want to trigger this script when Region playlist (via sub playlist goes onair and starts working, how should I start the script with OnPlayerStart. What defines the Sub playlist name to trigger this action?
HTTPGet(‘http://’ + BREAKAWAY_IP + ‘:8282/parameter/fm1/misc/rds_pi_hex=F688’); // PI REGIONAL PI
You mean when a “Region Container” item is playing? You can check for its ObjectClassID:
procedure OnItemStart(Item: IPlaylistItem; Region: byte; OnAir: boolean; UniqueID: string);
begin
// An item of class "RegionContainer" is started
if Item.GetObjectClassID = 'RegionContainer' then begin
// Insert code here
end;
end;