I want my DHD PFL button to activate when I click with my mouse on the PFL button in player 1 (but also player 2, 3 and Cartwall).
The logic value of the PFL button of Player 1 is 758.
I created this script and put it in the Background Scripts of mAirList.
procedure OnPlayerPFLOn(PlaylistIndex: integer; PlayerIndex: integer; PFLCount: integer);
begin
if (PlayerIndex = 1-1) then
DHDRemote(0).SetLogic(758, true);
end;
procedure OnPlayerPFLOff(PlaylistIndex: integer; PlayerIndex: integer; PFLCount: integer);
begin
if (PlayerIndex = 1-1) then
DHDRemote(0).SetLogic(758, false);
end;
When I now mouseclick on the PFL button of player 1 the PFL button on my DHD gets activated, but the PFL gets activated an unlimited number of times, I think mAirList will crash in the end because the program is unresponsive at that time.
Thanks Torben, I do not exactly understand what you mean with “PFL logic are read-only in DHD”?
But I have setup my DHD differently, the PFL buttons, in my situation, are not setup as PFL in the DHD configuration. I don’t know exactly why I choose a different approach when I did setup the console but I had some problems with the PFL function. My PFL buttons are setup as a fader function and everything works as it should except for clicking the PFL button in the players of mAirList. But maybe, because of the way I have set it up, this is not possible.
I reconfigured my DHD for the PFL part, and now everything works with this script:
My players are on fader 3, 4 and 5. My cartwall is on fader 6. The default PFL device is on the cartwall fader, fader 6
//PFL button on DHD turns the PFL in mAirList on or off
procedure OnDHDCommand(Remote: IDHDRemote; ID: cardinal; Len: integer; Data0, Data1, Data2, Data3, Data4, Data5, Data6, Data7: byte);
begin
if (ID = $516) AND (Data1 = 3) AND (Data2 = 1) then begin
ExecuteCommand('PLAYER 1-1 PFL ON');
end;
if (ID = $516) AND (Data1 = 3) AND (Data2 = 0) then begin
ExecuteCommand('PLAYER 1-1 PFL OFF');
end;
if (ID = $516) AND (Data1 = 4) AND (Data2 = 1) then begin
ExecuteCommand('PLAYER 1-2 PFL ON');
end;
if (ID = $516) AND (Data1 = 4) AND (Data2 = 0) then begin
ExecuteCommand('PLAYER 1-2 PFL OFF');
end;
if (ID = $516) AND (Data1 = 5) AND (Data2 = 1) then begin
ExecuteCommand('PLAYER 1-3 PFL ON');
end;
if (ID = $516) AND (Data1 = 5) AND (Data2 = 0) then begin
ExecuteCommand('PLAYER 1-3 PFL OFF');
end;
if (ID = $516) AND (Data1 = 6) AND (Data2 = 1) then begin
ExecuteCommand('CARTWALL MODE PFL');
end;
if (ID = $516) AND (Data1 = 6) AND (Data2 = 0) then begin
ExecuteCommand('CARTWALL MODE ON AIR');
end;
end;
//Turns the DHD PFL Player button off when PFL is turned off with the mouse in mAirList
procedure OnPlayerPFLOff(PlaylistIndex: integer; PlayerIndex: integer; PFLCount: integer);
begin
if (PlaylistIndex = 0) and (PlayerIndex = 0) then
DHDRemote(0).SetPFL(3, false, false);
if (PlaylistIndex = 0) and (PlayerIndex = 1) then
DHDRemote(0).SetPFL(4, false, false);
if (PlaylistIndex = 0) and (PlayerIndex = 2) then
DHDRemote(0).SetPFL(5, false, false);
end;
//Turns the DHD PFL button automatically on at play in the mixeditor
procedure OnExtPFLOn(Item: IPlaylistItem; ExtPFLCount: integer);
begin
if ExtPFLCount = 1 then
DHDRemote(0).SetPFL(6, true, false);
end;
//Turns the DHD PFL button automatically off at pause or closing of the mixeditor
procedure OnExtPFLOff(Item: IPlaylistItem; ExtPFLCount: integer);
begin
if ExtPFLCount = 0 then
DHDRemote(0).SetPFL(6, false, false);
end;
//Turns the DHD Cartwall PFL button off when PFL is turned off with the mouse in mAirList
procedure OnCartwallOnAirModeChange(OldMode, NewMode: TCartwallOnAirMode);
begin
if NewMode = oamOnAir then
DHDRemote(0).SetPFL(6, false, false);
end;