I’m trying to check if a cartwall player is loaded,
So I can light up a button if the file is loaded in that cartwall-spot and dim the button if the cartwall-spot is empty.
But I can’t find a function in the ‘Help-file’ to check if a cartwall player is loaded.
and, i’m curious what happens if I skip to a next page, if the ‘loaded’ state changes.
procedure OnCartwallPlayerLoad(PlayerIndex: integer; Item: IAudioCartwallItem; PlaylistItem: IPlaylistItem; Duration: TTimeValue);
var i : integer;
begin
if (PlayerIndex= 1) then begin
MambaNetRemote(0).SetSensor(31, true);
end;
if (PlayerIndex= 2) then begin
MambaNetRemote(0).SetSensor(32, true);
end;
if (PlayerIndex= 3) then begin
MambaNetRemote(0).SetSensor(33, true);
end;
end;
begin
end.
So, cranking up my Windows machine then (cannot recall this by heart) …
All the syntax for background scripts can be found in the file Background Script Template.mls which is delivered with every installation into the the mAirList programme folder.
Try the following:
procedure OnCartwallPlayerStateChange(PlayerIndex: integer;
OldState: TPlayerState; NewState: TPlayerState;
Item: IAudioCartwallItem; PlaylistItem: IPlaylistItem;
OnAirMode: TCartwallOnAirMode);
begin
if NewState = psLoaded then
MambaNetRemote(0).SetSensor(30 + PlayerIndex, true);
end;
begin
end.
Untested, as no Mambanet device available.
For the different player states available please make use of the search engine, they have been listed multiply around here. Some of them are
It took some extra work, combining with other scripts, but here’s the working solution!
procedure OnLoad;
var
i: integer;
s: TPlayerStateArray;
begin
Cartwall.GetActivePagePlayerStates(s);
for i := 1 to 14 do
begin
if (s[i] = psLoaded) or (s[i] = psPaused) or (s[i] = psStopped) then
MambaNetRemote(0).SetSensor(30 + i, true)
else
MambaNetRemote(0).SetSensor(30 + i, false);
end;
end;
// Cartwall load
procedure OnCartwallPlayerStateChange(PlayerIndex: integer;
OldState: TPlayerState; NewState: TPlayerState;
Item: IAudioCartwallItem; PlaylistItem: IPlaylistItem;
OnAirMode: TCartwallOnAirMode);
var
i: integer;
s: TPlayerStateArray;
begin
Cartwall.GetActivePagePlayerStates(s);
for i := 1 to 14 do
begin
if (s[i] = psLoaded) or (s[i] = psPaused) or (s[i] = psStopped) then
MambaNetRemote(0).SetSensor(30 + i, true)
else
MambaNetRemote(0).SetSensor(30 + i, false);
end;
end;
copy the script to a file, add this file to ‘background scripts’ in mairlist controlpanel.
This wil make mAirlist send the commands to your AXUM/MAMBANET device.
NOTE: I assume that you have created a source for every cartwallplayer you have. This source is primary for communication with mairlist, I don’t use them for audio. See my earlier tutorials for setting up Cartwall players with Axum.
Let’s continue:
In your Axum control panel, go to [Surface configuration]
Open your mAirlist ‘Surface’ created to communicatie with mAirlist
For Sensor 31 select: source ->cartwall1 → alert
and so on for all your cartwall players an upcoming number.
go to [Surface configuration]
open your CRM-node ( in my case Node 'Axite-UI-6FBP-CRM )
scroll down to: Switch 23 off color set this to 1 (green)
and in the folowing column select: source → cartwall1 → alert
and so on for all your cartwall players in the corresponding button.
NOTE: I use red for playling: Switch 23 on color is set to ‘2’ (red).