Command or script to load eventlist

Is it possible to load (Import) an eventlist using a command or script?
Once a studio is on air, certain events should be active and when the studio is off air those events shouldn’t be active. This allows the off air studio to serve as pre-production/voicetracking studio.

(e.g.load new playlists every hour shouldn’t be available when the studio is a pre production studio)

Previous scripts I found in this forum all give errors:

begin
CurrentPlaybackControl(0).GetEventList.LoadFromFile(‘C:\Anyfolder\Whatever.mls’);
end.

this script gives a “Invalid number of parameters” error.

begin
IPlayoutInstance(Instance).GetEventList.LoadFromFile(‘C:\Anyfolder\Whatever.mls’)
end.

this script gives a “IPlayoutInstance” error.

begin
Instance.GetEventList.LoadFromFile(‘C:\Anyfolder\Whatever.mls’);
end.

this script gives a “GetEventList” error.

I hope there is a simple solution for this?

Hi Ruud,

you can define events in relation to the system status ON AIR or OFF AIR.
This is the internal mode and has nothing to do with the encoder status, the connection.

Would that help?

Hi Uli,

Thanks for your reply. I was thinking so deeply that I overlooked the standard scopes function.
Now it will be a nice puzzle since I want to give 2 equal studios both 3 options.

1 - Studio is used for live shows. Events will be enabled
2 - Studio is used for voice tracking while playlist 1 is running non-stop in the background. (using the D&R Airence non stop function) Events will be enabled
3 - Studio is used for voice tracking while playlist 1 remains empty because the other studio is currently ‘live’. Events wil be disabled

If you also have a clarifying picture about this, I’m open to tips. In the meantime, I’m also going to brainstorm a lot about how I can fix this challenge.

small question. can a button be ‘disabled’ and ‘disabled+active’ by remote like you can set a button on or off with the Remote ID?

Yes, it can. Use

BUTTONNAME ON
BUTTONNAME OFF
BUTTONNAME ENABLE
BUTTONNAME DISABLE

Note that a button cannot be set to on while being disabled – even via scripting. You will want to enable it first.

Is there also a option for disable+active?

Will be enabled again when pressing it?

Is there a difference between active and on?

When disabled and active, the button is active but not able to press to turn off. It ‘Locks’ a enabled button from pressing it.

BTW I found a way to enable and turn on a button by a script.

begin
ExecuteCommand('BUTTONNAME ENABLE');
Sleep(100);
ExecuteCommand('BUTTONNAME ON');
end.

The sleep line set a wait of 100ms between both steps and so the button gets enabled and then almost imediatly turned on. The script also works with BUTTONNAME OFF.

This is what I would have proposed to you. I found that the Sleep command could well be omitted.

My bad. I Tought you mentioned that it wasn’t able to do in scripting.
And indeed the sleep can be skipped.
Thx for the help so far!

Now really my last question! is it possible to read a button state in a script?
Now we are switching buttons on and off by a scrip. Can a script also read the state of a button?

Why I ask this? I will try to combine the state of 2 buttons to execute a command in a script.
button 1 on / button 2 on - Command 1
button 1 on / button 2 off - Command 2
button 1 off / button 2 on - Command 3
button 1 off / button 2 off - Command 4

I promise this will be my final question for today hahaha

I always work around that with a boolean variable which is set parallel to the action of the Button. I wrote this down before here, in German, though. (But Google will help you translating it.)

Keep in mind to define the initial state of these variables as well as the button state itself in a procedure OnLoad.

I already found your post and was translating it. Thx for your great help. This will become a cool function!
I’ll let you know in here how i fixed it.
Big thank you!!!

2 Likes

After a lot of Trial and Errors I have a basic script ready.

This script switches the BUTTON.ONAIR.STATE button to 4 3 by means of 2 ‘switches/commands’:

  1. Airence On + OnAir On = Live broadcast from studio
  2. Airence Off + OnAir On = Preproduction studio (Playlist 1 is used for playout)
  3. Airence On + OnAir Off = Preproduction studio (Playlist 1 is not used for playout)
  4. Airence Off + OnAir Off = Preproduction studio (Playlist 1 is not used for playout) (= same as 3)

What was important to me was that I could switch with both OnAir and Airence commands, so both commands are linked to a boolean variable.

Now on to link procedures to the different modes. (events, logging enabled/disabled and automation of the main playlist)
This is going to be okay too, I think I’ve overcome the biggest puzzle. I Really want to thank @Tondose for all his information in the ‘scripting hilfe’ posts. For me it was the first time to write a bit of a complex script. In the past I could work around with simple scripts.

And yes, it works so far!

var
 AirenceOn: boolean;
 OnAir: boolean;

procedure OnLoad;
begin
  AirenceOn :=false;
  OnAir :=true;
  ExecuteCommand('BUTTON.ONAIR.STATE ENABLE');       // sets the button in start position
  ExecuteCommand('BUTTON.ONAIR.STATE OFF');          // sets the button in start position
end;

procedure OnExecuteCommand (Command: String);
begin
  if AirenceOn AND (Command = 'STUDIO ON AIR') then begin		// LIVE ON Air
    OnAir :=true;
    ExecuteCommand('BUTTON.ONAIR.STATE ENABLE');
    ExecuteCommand('BUTTON.ONAIR.STATE OFF');
    end
   else if AirenceOn AND (Command = 'STUDIO OFF AIR') then begin	// PreProduction OFF Air
    OnAir :=false;
      ExecuteCommand('BUTTON.ONAIR.STATE ENABLE'); 
      ExecuteCommand('BUTTON.ONAIR.STATE DISABLE');
   end
   else if NOT AirenceOn AND (Command = 'STUDIO ON AIR') then begin	// PreProduction Nonstop ON Air
    OnAir :=true;
      ExecuteCommand('BUTTON.ONAIR.STATE ENABLE'); 
      ExecuteCommand('BUTTON.ONAIR.STATE ON');
   end
   else if NOT AirenceOn AND (Command = 'STUDIO OFF AIR') then begin	// PreProduction OFF Air
    OnAir :=false;
      ExecuteCommand('BUTTON.ONAIR.STATE ENABLE'); 
      ExecuteCommand('BUTTON.ONAIR.STATE DISABLE');
   end

   else if OnAir AND (Command = 'AIRENCE ON') then begin	// LIVE ON Air 
    AirenceOn :=true;
      ExecuteCommand('BUTTON.ONAIR.STATE ENABLE'); 
      ExecuteCommand('BUTTON.ONAIR.STATE OFF');
   end
   else if OnAir AND (Command = 'AIRENCE OFF') then begin	// PreProduction Nonstop ON Air 
    AirenceOn :=false;
      ExecuteCommand('BUTTON.ONAIR.STATE ENABLE'); 
      ExecuteCommand('BUTTON.ONAIR.STATE ON');
   end
   else if NOT OnAir AND (Command = 'AIRENCE ON') then begin	// Preproduction OFF Air 
    AirenceOn :=true;
      ExecuteCommand('BUTTON.ONAIR.STATE ENABLE'); 
      ExecuteCommand('BUTTON.ONAIR.STATE DISABLE');
   end
   else if NOT OnAir AND (Command = 'AIRENCE OFF') then begin	// Preproduction OFF Air 
    AirenceOn :=false;
      ExecuteCommand('BUTTON.ONAIR.STATE ENABLE'); 
      ExecuteCommand('BUTTON.ONAIR.STATE DISABLE');
   end

end;

begin
end.

Side note: I first enabled the button BUTTON.ONAIR.STATE at every ExecuteCommand, since this way you can switch from almost any position without the button stays disabled

Perhaps this script could be more compact, but it works for now!
Hope you like to have quick look and if you have some tips, they are welcome at all time.

Like in a good crime movie: CASE CLOSED!

1 Like