Home AMX User Forum NetLinx Studio

Event for multi-dimension device array

Hello everyone,

suppose the below code :

DEFINE_DEVICE

dvTP_1 = 10001:1:0;
dvTP_2 = 10001:2:0;
dvTP_3 = 10001:3:0;
dvTP_4 = 10001:4:0;
dvTP_5 = 10001:5:0;

dviPad_1 = 11001:1:0;
dviPad_2 = 11001:2:0;
dviPad_3 = 11001:3:0;
dviPad_4 = 11001:4:0;
dviPad_5 = 11001:5:0;

DEFINE_CONSTANT

    dev dvTP_LVL[ ][ ] =  
            { 
                    { dvTP_1  , dvTP_2  , dvTP_3  , dvTP_4  , dvTP_5   }, 
                    { dviPad_1, dviPad_2, dviPad_3, dviPad_4, dviPad_5 } 
            };


        integer BTN_VOL_UP   = 24;
    integer BTN_VOL_DN   = 25;

            integer MODERO_PANEL = 1;
    integer IPAD_PANEL          = 2;

DEFINE_EVENT

button_event[dvTP_LVL[MODERO_PANEL],BTN_VOL_UP] //volume up from modero
{
push:
{
to[button.input]; //set button feedback
}
}

button_event[dvTP_LVL[IPAD_PANEL],BTN_VOL_UP] //volume up from iPad
{
push:
{
to[button.input]; //set button feedback
}
}

The above is a part of my code where any panel port represents an audio matrix output.

I'm afraid that if I had more panels ( ex. 10 panels ), I should make 10 x button events like the above ones.
Of course this is very hard ( not scalable at all ).

But if I had a simple dimension array like :

   dev dvTP_LVL[ ] =  { dvTP_1  , dvTP_2  , dvTP_3  , dvTP_4  , dvTP_5   }; //only the modero panel

everything seems very simple...

button_event[dvTP_LVL,BTN_VOL_UP] //volume up only from the modero panel
{
push:
{
to[button.input]; //set button feedback
}
}

What about if I have multi dimension device array ?
Is there a way to make only one button event for all panels at once ?

Thanks,
George

Comments

  • Stack the events maybe:

    button_event[dvTP_LVL[MODERO_PANEL],BTN_VOL_UP] //volume up from modero
    button_event[dvTP_LVL[IPAD_PANEL],BTN_VOL_UP] //volume up from iPad{
    push:
    {
      {
        to[button.input]; //set button feedback
      }
    }
    
Sign In or Register to comment.