Mairlist 5 and Launchpad - Colors Cartwall don't work

Hello Torben,

I’m using version 5. I’m using a launchpad for starting jingles in the cartwall. Therefore I use an actionscript.
There is the following procedure which handles the colors on the launchpad.

procedure OnCartPlayerStateChange(PlayerIndex: integer; OldState: TPlayerState; NewState: TPlayerState);
var row:integer;
begin

	row := PlayerIndex div 8;

if  (OldState = psStopped) then 
	begin
		midiout(Launchpad_Device,144, Buttons[PlayerIndex],cHighAmber);
		midiout(Launchpad_Device,144, StopButtons[row],cHighRed);
	end
else if (NewState = psLoaded) then 
	begin
		midiout(Launchpad_Device,144, Buttons[PlayerIndex],cHighGreen);
		midiout(Launchpad_Device,144, StopButtons[row],cHighRed);
	end
else if (NewState = psEmpty) then 
	begin
		midiout(Launchpad_Device,144, Buttons[PlayerIndex],cOff);
		midiout(Launchpad_Device,144, StopButtons[row],clowRed);
	end
else if (NewState = psPlaying) then 
	begin
		midiout(Launchpad_Device,144, Buttons[PlayerIndex],cHighRed);
		midiout(Launchpad_Device,144, StopButtons[row],cBlinkRed);
	end
else if (NewState = psFading) then 
	begin
		midiout(Launchpad_Device,144, Buttons[PlayerIndex],cBlinkRed);
		midiout(Launchpad_Device,144, StopButtons[row],cBlinkRed);
	end
else if (NewState = psError) then 
	begin
		midiout(Launchpad_Device,144, Buttons[PlayerIndex],cBlinkYellow);
	end

else if (NewState = psLoading) then 
	begin
		midiout(Launchpad_Device,144, Buttons[PlayerIndex],cBlinkGreen);
	end;



end;

With the new version it doesn’t work anymore. Can you tell me what I have to change? I think it has something to do with the TPlayerState or Playerindex.

Have a look at the Notification Script Template included in the distribution (should be somewhere in the program directory).

The OnCartPlayerStateChange hook doesn’t exist anymore. Instead we now have OnCartwallPlayerStateChange, with some additional parameters:

// Called when the state of a player on the current cartwall page changes
// (or the user switches to another page).
procedure OnCartwallPlayerStateChange(PlayerIndex: integer;
  OldState: TPlayerState; NewState: TPlayerState;
  Item: IAudioCartwallItem; PlaylistItem: IPlaylistItem;
  OnAirMode: TCartwallOnAirMode);
begin
end;

I think you can just copy&paste the old code into this new procedure. However please note that the PlayerIndex is now 1-based, i.e., exactly the number that is displayed in the GUI (or 0 if you have turned of numbering). So you should probably change the first line to

row := (PlayerIndex - 1) div 8;

Let me know if this works.

Hello Torben,

Thanks for your answer. It does something, but not enterily the way I want. My wish is that when I have loaded an item the launchpad makes a button green. When I start a jingle the button must turn red. When I stop a jingle the button must turn green again.

I looked in the notification script, but i can’t figure it out by my self. Please help. Can you give a short explanation of the prodecure for the cartwall. What i.e. wherefor are the arguments: Playerindex, Oldstate, Newstate, Item, Playlistitem, Onairmode.

Please help.

Thanks!

Perhaps you should post the entire script so we can see what else might need to be changed.

Problem solved.
procedure OnCartPlayerStateChange(PlayerIndex: integer; OldState: TPlayerState; NewState: TPlayerState);
var row:integer;
begin

	row := PlayerIndex-1 div 8;

if  ([b]NewState[/b] = psStopped) then 
	begin
		midiout(Launchpad_Device,144, Buttons[PlayerIndex-1],cHighAmber);
		midiout(Launchpad_Device,144, StopButtons[row],cHighRed);
	end
else if (NewState = psLoaded) then 
	begin
		midiout(Launchpad_Device,144, Buttons[PlayerIndex-1],cHighGreen);
		midiout(Launchpad_Device,144, StopButtons[row],cHighRed);
	end
else if (NewState = psEmpty) then 
	begin
		midiout(Launchpad_Device,144, Buttons[PlayerIndex-1],cOff);
		midiout(Launchpad_Device,144, StopButtons[row],clowRed);
	end
else if (NewState = psPlaying) then 
	begin
		midiout(Launchpad_Device,144, Buttons[PlayerIndex-1],cHighRed);
		midiout(Launchpad_Device,144, StopButtons[row],cBlinkRed);
	end
else if (NewState = psFading) then 
	begin
		midiout(Launchpad_Device,144, Buttons[PlayerIndex-1],cBlinkRed);
		midiout(Launchpad_Device,144, StopButtons[row],cBlinkRed);
	end
else if (NewState = psError) then 
	begin
		midiout(Launchpad_Device,144, Buttons[PlayerIndex-1],cBlinkYellow);
	end

else if (NewState = psLoading) then 
	begin
		midiout(Launchpad_Device,144, Buttons[PlayerIndex-1],cBlinkGreen);
	end;



end;
  1. Change “PlayerIndex” in to “PlayerIndex-1”.
  2. At the first “if-statement” change (OldState = psStopped) to (Newstate = psStopped)
    Then everything works well. The script was original downloaded from : GitHub - Lexorius/Mairlist-Launchpad-Script: a Plugin-Script to Control mAirList Radio Automation with a Novation Launchpad. Thanks to Thomas “Kloppi” Kloppholz