Script for..... Now Playing... sort of

Hi Dears,

Is there a way to change the Metadata given to the stream when one of the two players stopped playing. Sometimes I want to play a record but the metadata is still on the last played song out of one of the players. A more generic text would be cool then.

Thans Wilbert

Well, it requires some effort: As there’s no way to send content to the logger directly, you’d have to employ a silence item as a ”playable dummy“ which carries the desired text, to be started in parallel with the record player.

Ah… Yes… that was what I already did… Just wanted to automate that… Lazy as I am.

THX

We’ve had that before … a very copmplex task, if the metadata has to correspond to the record playing. A little less complicated if only a standard message is to be sent. Anyway, you had to put up some device which triggers the turntable and mAirList simultaneously.

Wilbert, this script should do what you intended: If a command (to be selected, here: EXTERNAL) is launched, a silence item (title and artist to be selected) of a reasonable duration (to be selected, here 15 seconds; in any case longer than the logging delay of your system) is loaded in a player and started automatically.

const
  TITLE       = 'No metadata at the moment';  // Set title part of message
  ARTIST      = 'We will be back soon';       // Set artist part of message
  
  EXTCOMMAND  = 'EXTERNAL';                   // Set command for triggering
  EXTDURATION = 15;                           // Set duration of item

procedure OnExecuteCommand(Command: string);
var
  NextIndex: integer;
  spi: ISilencePlaylistItem;
  pi:  IPlaylistItem;
begin
  if Command = EXTCOMMAND then
  begin
    spi := Factory.CreateSilencePlaylistItem;
    pi := spi;
    pi.SetTitle(TITLE);
    pi.SetArtist(ARTIST);
    pi.SetDuration(EXTDURATION);
    pi.SetAmplification(-12);
    pi.SetItemType(pitMusic);
    CurrentPlaylist.BeginUpdate;
    try
      CurrentPlaylist.Insert(CurrentPlaylist.GetNextIndex, pi);
    finally
      CurrentPlaylist.EndUpdate;
    end;
    while CurrentPlaybackControl.
      GetPlayer(CurrentPlaybackControl.GetPlayerOfItem(pi)).
      GetState = psLoading do 
      Sleep(100);
    CurrentPlaybackControl.GetPlayer(CurrentPlaybackControl.GetPlayerOfItem(pi)).
      ExecutePlayerCommand(pcStart);
  end;
end;

begin
end.

However, you have to take measures to trigger the turntable and mAirList in sync. And it could well be that the script is working only from v7.1 on.

1 Like

Hi Tondose,

Nice, I will play around with it. Superthanks…

Cheerio Wilbert

Thanks Tondose, at the end I created a button on the Mixer which loads silence on one of the players. In Mairlist I gave it the name of the Station and Show…

I scriping tool in Mairlist for dummies would be kind of cool… where you could create senario’s. Like: If Player A-B do not play for 5 seconds the What is Playing Metadata shows “Thanks Tondose”:slight_smile:

Cheers Wilbert

2 Likes

This is the kindest gratitude I ever received in this Forum. Thank you :slightly_smiling_face:

1 Like