int do_logical_ChannelsMenuSelection(int chx, int chy)
{

//LOGIQUE
//if(window_focus_id==0 && index_over_A_window==0 && index_over_faderspace==0 && mouse_button==1 && mouse_released==0)
if(window_focus_id==0 && index_over_faderspace==0 && mouse_button==1 && mouse_released==0)
{
if( mouse_y>chy+1 && mouse_y<chy+1+18 && mouse_x>chx+70 && mouse_x<chx+70+60 )
 {
 if(Midi_Faders_Affectation_Type!=0)
{
  attribute_midi_solo_affectation(1644,Midi_Faders_Affectation_Mode);
}
else
{
 ClassicalChannelView=toggle(ClassicalChannelView);
}
 mouse_released=1;
 }
for(int lv=0;lv<2;lv++)
{
for(int i=0;i<8;i++)
{
if(mouse_x>chx+140+(i*15) && mouse_x<chx+140+(i*15)+10 && mouse_y>chy+1+(15*lv) && mouse_y<chy+1+(15*lv)+10)
{
if(Midi_Faders_Affectation_Type!=0)
{
  attribute_midi_to_control(1628+i+(lv*8),Midi_Faders_Affectation_Type,Midi_Faders_Affectation_Mode);
}
else
{
if(index_do_dock==0 && index_do_modify==0 && index_main_clear==0)
{
if(ClassicalChannelView==1){ClassicalChannelView=0;if(Channel_View_MODE[i+(lv*8)]==0){Channel_View_MODE[i+(lv*8)]=1;}}
else
{
Channel_View_MODE[i+(lv*8)]=toggle(Channel_View_MODE[i+(lv*8)]);
ClassicalChannelView=0;
}
}
else if(index_do_dock==1 && i+(lv*8)!=0)//=vue patch
{
channel_view_is=i+(lv*8);
index_ask_record_selection_of_view=i+(lv*8);
index_ask_confirm=1;
}
else if(index_do_modify==1 && i+(lv*8)!=0)//=vue patch
{
channel_view_is=i+(lv*8);

index_ask_modify_selection_of_view=1;
index_ask_confirm=1;
}
else if(index_main_clear==1 && i+(lv*8)!=0)//=vue patch
{
channel_view_is=i+(lv*8);
index_ask_confirm=1;
index_ask_clear_selection_of_view=1;
}
}
mouse_released=1;
}
}
}
command_button_logical(chx+270,chy+1,index_blind,"Blind","Shift-F10",754,110);
command_button_logical(chx+340,chy+1,index_direct_chan,"Direct CH.","",1333,111);
command_button_logical(chx+410,chy+1,index_inspekt,"View","",1334,112);// int x, inty ,bool state, char *textedesc, int midiaffectation
command_button_logical(chx+480,chy+1,index_do_hipass,"HiPass","",1542,113);// int x, inty ,bool state, char *textedesc, int midiaffectation
command_button_logical(chx+550,chy+1,index_do_fgroup,"FGroup","",1592,114);// int x, inty ,bool state, char *textedesc, int midiaffectation

command_button_logical(chx+620,chy+1,Midi_Faders_Affectation_Type,"MidiAffect","",1625,106);// int x, inty ,bool state, char *textedesc, int midiaffectation
command_button_logical(chx+690,chy+1,index_midi_mute,"MidiMute","",1277,107);// int x, inty ,bool state, char *textedesc, int midiaffectation
command_button_logical(chx+760,chy+1,index_global_midi_send_on_faders,"M.Out Fad.","",1593,109);// int x, inty ,bool state, char *textedesc, int midiaffectation

command_button_logical(chx+830,chy+1,index_do_dock,"STORE","F1",743,102);// int x, inty ,bool state, char *textedesc, int midiaffectation
command_button_logical(chx+900,chy+1,index_do_modify,"MODIFY","F2",744,103);
command_button_logical(chx+970,chy+1,index_do_report,"REPORT","F3",745,104);
command_button_logical(chx+1040,chy+1,index_main_clear,"CLEAR","F4",746,105);
command_button_logical(chx+1110,chy+1,index_show_main_menu,"MENUS","RIGHT CLICK",1626,108);
}
//fin windows focus
return(0);
}
int do_logical_Interface_Trichromie(int xchroma, int ychroma, int rayon, int largeurchroma)
{

/////////////////TRICHRO / QUADRI CHOOSE//////////////////////////////////////

if(mouse_x>xchroma-60 && mouse_x<xchroma+80 && mouse_y>ychroma-190 && mouse_y<ychroma-160)
{

if(index_quadri==0){index_quadri=1;dock_color_type[dock_color_selected]=1;}
else if(index_quadri==1){index_quadri=0;dock_color_type[dock_color_selected]=0;}
mouse_released=1;
}


//GEL LIST BUTTON
if(mouse_x>xchroma+90 && mouse_x<xchroma+150 && mouse_y>ychroma-185 && mouse_y<ychroma-165)
{
show_gel_list=toggle(show_gel_list);
mouse_released=1;
}

/////////////////////AFFECTATION ON / OFF AUX DOCKS FADERS///////////////////////////

if(mouse_x>xchroma+20 && mouse_x<xchroma+150 && mouse_y>ychroma+300 && mouse_y< ychroma+330)
{
if(index_affect_color_to_dock==0)
{
reset_index_actions();
reset_indexs_confirmation();
index_affect_color_to_dock=1;
}
else
{
reset_index_actions();
}
index_do_dock=index_affect_color_to_dock;
mouse_released=1;
}
/////////////////////////////////////////////////////////////////////////////////

//////////////////////ROUE DE COULEUR//////////////////////////////////////////////////////

//AFFECTATION MIDI
if( Midi_Faders_Affectation_Type!=0)//config midi
  {
  //midi report
  switch(miditable[0][497])
  {
  case 0: sprintf(thetypinfo,"Note");break;
  case 1: sprintf(thetypinfo,"Key On");break;
  case 2: sprintf(thetypinfo,"Key Off");break;
  case 4: sprintf(thetypinfo,"Ctrl Change");break;
  }
  sprintf(string_last_midi_id,"COLOR WHEEL FADER is Ch: %d Pitch: %d Typ: %s" , miditable[1][497],miditable[2][497],thetypinfo);

  if(mouse_x>xchroma-140 && mouse_x<xchroma+140 && mouse_y>ychroma-140 && mouse_y<ychroma+140)
  {
    attribute_midi_solo_affectation(497,Midi_Faders_Affectation_Mode);
    mouse_released=1;
   }
}


/////////////////////DOCKING DES COULEURS////////////////////////////////////////
//emplacement des box pour actions de storage RVB sur 6 presets

//affectation des circuits aux RVB Y

if(mouse_y>ychroma+165 && mouse_y<ychroma+185)
{
if(mouse_x> xchroma-130 && mouse_x< xchroma-80 )//RED
{
if (index_inspekt==1){show_who_is_in_dock_color(dock_color_selected,0);}
couleur_to_affect=0;
bool there_is_asel_chan=0;

switch(index_paste_on_the_fly)
{
case 0:
for(int p=1;p<513;p++)
{
if(Selected_Channel[p]==1)
{there_is_asel_chan=1;break;}
}

if(there_is_asel_chan==1 && (index_do_dock==1|| index_do_modify==1 || index_do_report==1))
{index_do_affect_color_trichro=1;index_ask_confirm=1;}

else {index_do_affect_color_trichro=0;index_ask_confirm=0;sprintf(string_Last_Order,"No channel selected to store as color");}
break;
case 1:
if(index_blind==0)
{
for(int p=1;p<513;p++)
{
if(Selected_Channel[p]==1){bufferSaisie[p]=my_red;}
}
}
else
{
for(int p=1;p<513;p++)
{
if(Selected_Channel[p]==1){bufferBlind[p]=my_red;}
}
}
sprintf(string_Last_Order,"Pasted On the Fly RED result");
break;
}
mouse_released=1;
}

else if (mouse_x> xchroma-65 && mouse_x< xchroma-15 )//GREEN
{
if (index_inspekt==1){show_who_is_in_dock_color(dock_color_selected,1);}
couleur_to_affect=1;
bool there_is_asel_chan=0;
switch(index_paste_on_the_fly)
{
case 0:
for(int p=1;p<513;p++)
{if(Selected_Channel[p]==1){there_is_asel_chan=1;break;}}
if(there_is_asel_chan==1 && (index_do_dock==1|| index_do_modify==1 || index_do_report==1))
{index_do_affect_color_trichro=1;index_ask_confirm=1;}
else {sprintf(string_Last_Order,"No channel selected to store as color");}
break;
case 1:
if(index_blind==0)
{
for(int p=1;p<513;p++)
{
if(Selected_Channel[p]==1){bufferSaisie[p]=my_green;}
}
}
else
{
for(int p=1;p<513;p++)
{
if(Selected_Channel[p]==1){bufferBlind[p]=my_green;}
}
}
sprintf(string_Last_Order,"Pasted On the Fly GREEN result");
break;
}
mouse_released=1;
}

else if (mouse_x> xchroma && mouse_x< xchroma+50 )//BLUE
{
if (index_inspekt==1){show_who_is_in_dock_color(dock_color_selected,2);}

couleur_to_affect=2;
bool there_is_asel_chan=0;
switch(index_paste_on_the_fly)
{
case 0:
for(int p=1;p<513;p++)
{if(Selected_Channel[p]==1){there_is_asel_chan=1;break;}}
if(there_is_asel_chan==1 && (index_do_dock==1|| index_do_modify==1 || index_do_report==1)){index_do_affect_color_trichro=1;index_ask_confirm=1;}
else {sprintf(string_Last_Order,"No channel selected to store as color");}
break;
case 1:
if(index_blind==0)
{
for(int p=1;p<513;p++)
{
if(Selected_Channel[p]==1){bufferSaisie[p]=my_blue;}
}
}
else
{
for(int p=1;p<513;p++)
{
if(Selected_Channel[p]==1){bufferBlind[p]=my_blue;}
}
}
sprintf(string_Last_Order,"Pasted On the Fly BLUE result");
break;
}
mouse_released=1;
}

else if (mouse_x> xchroma+65 && mouse_x< xchroma+115 )//YELLOW
{
if (index_inspekt==1){show_who_is_in_dock_color(dock_color_selected,3);}
couleur_to_affect=3;
bool there_is_asel_chan=0;
switch(index_paste_on_the_fly)
{
case 0:
for(int p=1;p<513;p++)
{if(Selected_Channel[p]==1){there_is_asel_chan=1;break;}}
if(there_is_asel_chan==1&& (index_do_dock==1|| index_do_modify==1 || index_do_report==1)){index_do_affect_color_trichro=1;index_ask_confirm=1;}
else {sprintf(string_Last_Order,"No channel selected to store as color");}
break;
case 1:
if(index_blind==0)
{
for(int p=1;p<513;p++)
{
if(Selected_Channel[p]==1){bufferSaisie[p]=my_yellow;}
}
}
else
{
for(int p=1;p<513;p++)
{
if(Selected_Channel[p]==1){bufferBlind[p]=my_yellow;}
}
}
sprintf(string_Last_Order,"Pasted On the Fly YELLOW result");
break;
}
mouse_released=1;
}
}


//midi out de la roue

if(mouse_x> xchroma+140-10 && mouse_x< xchroma+140+10 && mouse_y>ychroma+110-10 && mouse_y<ychroma+110+10)
{

  if(midi_send_out[497]==0){midi_send_out[497]=1; }
  else if(midi_send_out[497]==1){midi_send_out[497]=0; }
  mouse_released=1;
  }

raccrochage_midi_logical_circulaire (xchroma-6, ychroma, 497, 125, 125);



//premiere rangee de dock colors

for (int dock_color=0;dock_color<4;dock_color++)
{
if(mouse_x>xchroma-130+(65*dock_color) && mouse_x<xchroma-80+(65*dock_color) && mouse_y>ychroma+215 && mouse_y<ychroma+235)
{
if( Midi_Faders_Affectation_Type!=0)
{
if(dock_color==0 && Midi_Faders_Affectation_Type==2)
{attribute_midi_to_control(949,Midi_Faders_Affectation_Type,Midi_Faders_Affectation_Mode);}
else{attribute_midi_solo_affectation(949+dock_color, Midi_Faders_Affectation_Mode);}
}
else
{
dock_color_selected=dock_color;
load_etat_picker_dans_dockcolor(dock_color_selected);
sprintf(string_Last_Order,">>Dock Color Selected %d",(dock_color_selected+1));
mouse_released=1;
}
}
}
//deuxième rangee de dockcolors
for (int dock_colortwo=0;dock_colortwo<4;dock_colortwo++)
{
if(mouse_x>xchroma-130+(65*dock_colortwo) && mouse_x<xchroma-80+(65*dock_colortwo) && mouse_y>ychroma+255 && mouse_y<ychroma+275)
{
if(Midi_Faders_Affectation_Type!=0)
{
attribute_midi_solo_affectation(949+(dock_colortwo+4), Midi_Faders_Affectation_Mode);
}
else
{
dock_color_selected=dock_colortwo+4;
load_etat_picker_dans_dockcolor(dock_color_selected);
sprintf(string_Last_Order,">>Dock Color Selected %d",dock_color_selected+1);
mouse_released=1;
}
}
}

//PASTE ON THE FLY
if(mouse_x>xchroma-150 && mouse_x<xchroma-20 && mouse_y>ychroma+300 && mouse_y< ychroma+330)
{
if(mouse_b&1 &&  mouse_released==0 && window_focus_id==902)
{
index_paste_on_the_fly=toggle(index_paste_on_the_fly);
mouse_released=1;
}
}


//GEL LIST
if(show_gel_list==1)
{

if(mouse_x>xchroma+180 && mouse_x<xchroma+250 && mouse_y>ychroma-185 && mouse_y<ychroma-165)
{
index_gel_type_selected++;
if(index_gel_type_selected>3)index_gel_type_selected=0;
mouse_released=1;
}
//numeric or designer list
if(mouse_x>xchroma+260 && mouse_x<xchroma+330 && mouse_y>ychroma-185 && mouse_y<ychroma-165)
{
show_designer_list=toggle(show_designer_list);
switch(show_designer_list)
{
case 0://numerical order
break;
case 1://designer order
break;
}
mouse_released=1;
}

//saisie d une ref de gelat
if(mouse_x>xchroma+340 && mouse_x<xchroma+390 && mouse_y>ychroma-185 && mouse_y<ychroma-165)
{
call_ref_number=atoi(numeric);
mouse_released=1;
if(call_ref_number<10000 && call_ref_number!=0)
{

//repositionnemennt de la liste
for (int i=0;i<10000;i++)
{
if(refs_of_gels[index_gel_type_selected][i]==call_ref_number )
{
gel_position[index_gel_type_selected]=i;
report_gels_to_rvb_trichro(index_gel_type_selected,gel_position[index_gel_type_selected]);
break;
}
}
reset_numeric_entry();
}

}
//+ - Index gelatine
if(mouse_y>ychroma-187 && mouse_y<ychroma-163)
{
//- index
if(mouse_x>xchroma+398 && mouse_x<xchroma+422)
{
if(gel_position[index_gel_type_selected]>10)gel_position[index_gel_type_selected]-=10;
mouse_released=1;
}
//+ index
if(mouse_x>xchroma+428 && mouse_x<xchroma+452)
{
if(gel_position[index_gel_type_selected]<10000-10)gel_position[index_gel_type_selected]+=10;
mouse_released=1;
}
}

//Transmission calculation
if(mouse_x>xchroma+510 && mouse_x<xchroma+550 && mouse_y>ychroma-185 && mouse_y<ychroma-165)
{
index_use_transmission=toggle(index_use_transmission);
mouse_released=1;
}

//sélection gel
for(int i=0;i<30;i++)
{
if( mouse_x>xchroma+175 && mouse_x<xchroma+485 && mouse_y>ychroma-150+(i*16) && mouse_y<ychroma-134+(i*16) )
{
call_ref_number=refs_of_gels[index_gel_type_selected][gel_position[index_gel_type_selected]+i];
report_gels_to_rvb_trichro(index_gel_type_selected,gel_position[index_gel_type_selected]+i);
mouse_released=1;
}
}
//fin gel list
}


return(0);
}
Exemplo n.º 3
0
int do_logical_echo_window(int xe, int ye)
{
if(window_focus_id==W_ECHO && dragging_channel_in_echo==0 && mouse_button==1)
{

//edit
if( mouse_released==0 && mouse_x>xe+610 && mouse_x<xe+610+50 && mouse_y>ye+10 && mouse_y<ye+10+20 )
{
index_enable_edit_echo=toggle(index_enable_edit_echo);
mouse_released=1;
}


int index_ec=0;
//SElection presets
for(int le=0;le<3;le++)
{
for(int cel=0;cel<8;cel++)
{
index_ec=cel+(le*8);
if( mouse_x> xe+180+(40*cel) && mouse_x<xe+180+(40*cel)+30 && mouse_y>ye+10+(le*25) && mouse_y<ye+10+(le*25)+20)
{
if( mouse_released==0 )
{
if( Midi_Faders_Affectation_Type!=0)//config midi
{
 attribute_midi_to_control(1663+index_ec,Midi_Faders_Affectation_Type,Midi_Faders_Affectation_Mode);
}
else
{
if(index_main_clear==1)
{
if(index_enable_edit_echo==1)
{
index_selected_echo_for_manipulation=index_ec;
index_ask_clear_echo_preset=1;
index_ask_confirm=1;             //clear_echo_preset(index_selected_echo_for_manipulation);
}
}

else
{
echo_selected=index_ec;

}
}
mouse_released=1;
}
}
}
}


//Set ChanPos
if( mouse_x>xe+615 && mouse_x<xe+615+40 && mouse_y>ye+65 && mouse_y<ye+65+20 && mouse_released==0 && dragging_channel_in_echo==0 && numeric_postext>0)
 {
 echo_grid_channel_position[echo_selected]=atoi(numeric)-1;
 echo_grid_channel_position[echo_selected]= constrain_int_data_to_this_range(echo_grid_channel_position[echo_selected],0,511-14);
 reset_numeric_entry();
 numeric_postext=0;
 mouse_released=1;
 }


//ECHO ACTION PANNEL

for (int n=0;n<5;n++)
{
//actions
if(mouse_x>xe+30 && mouse_x<xe+30+115 && mouse_y>ye+50+(n*30) && mouse_y<ye+50+30+(n*30))
{
if( mouse_released==0 )
{
if( Midi_Faders_Affectation_Type!=0)//config midi
{
attribute_midi_solo_affectation(1686+n,Midi_Faders_Affectation_Mode);
}
else
{
switch(n)
{
case 0:
     echo_is_echo_mode[echo_selected]=toggle(echo_is_echo_mode[echo_selected]);
     do_bounce[echo_selected]=echo_is_echo_mode[echo_selected];
break;
case 1:
     snap_fader_state(echo_selected,echo_pointing_fader_num[echo_selected]-1);
break;
case 2:
     bounce(echo_selected);
break;
case 3:
     snap_kill_and_bounce(echo_selected,echo_pointing_fader_num[echo_selected]-1);
break;
case 4:
     recall_fader_state_echo(echo_pointing_fader_num[echo_selected]-1);
break;
default:
break;
}
}
mouse_released=1;
}

}
}

//Fader point to
if( mouse_x>xe+70 && mouse_x<xe+70+45 && mouse_y>ye+200 && mouse_y<ye+200+35 && mouse_released==0 && numeric_postext>0)
{
echo_pointing_fader_num[echo_selected]=constrain_int_data_to_this_range(atoi(numeric),1,48);
reset_numeric_entry();
numeric_postext=0;
mouse_released=1;
}


////AFFECT TO DOCK
if( mouse_released==0 && mouse_x>xe+10 && mouse_x<xe+10+110 && mouse_y>ye+245 && mouse_y<ye+245+20  )
{
if(index_affect_echo_to_dock==0)
{
reset_index_actions();
reset_indexs_confirmation();
index_affect_echo_to_dock=1;
}
else
{
reset_index_actions();
}
index_do_dock=index_affect_echo_to_dock;
mouse_released=1;
}


//manipulate channel params Level mode / ground mode
if( mouse_released==0 && mouse_x>xe+500 && mouse_x<xe+500+70 && mouse_y>ye+10 && mouse_y<ye+10+20)
{
if( Midi_Faders_Affectation_Type!=0)//config midi
{
attribute_midi_solo_affectation(1696,Midi_Faders_Affectation_Mode);
}
else
{
if(index_main_clear==1 && index_enable_edit_echo==1)
{
switch(echo_channel_manipulate_mode[echo_selected])
{
 case 0://levels
 clear_echo_levels(echo_selected);
 break;
 case 1:
 clear_ground_levels(echo_selected);
 break;
}
index_main_clear=0;
}
else
{
echo_channel_manipulate_mode[echo_selected]=toggle(echo_channel_manipulate_mode[echo_selected]);
}
}
mouse_released=1;
}






//les Trois parametres globaux: gravite masse energy
for (int cl=0;cl<3;cl++)
{

if(mouse_x>=xe+155+(cl*180) && mouse_x<=xe+155+(cl*180)+130 && mouse_y>=ye+255 && mouse_y<=ye+255+10)
{
if(  mouse_released==0)
{
if( Midi_Faders_Affectation_Type!=0)//config midi
{
attribute_midi_solo_affectation(1693+cl,Midi_Faders_Affectation_Mode);
mouse_released=1;
}
else
{
echo_global_params[echo_selected][cl]= (float)(constrain_data_to_midi_range(mouse_x-( xe+155+(cl*180))))/127;
midi_levels[1693+cl]=(int)(echo_global_params[echo_selected][cl]*127);
}
}
}
//midi out
if( mouse_released==0 && mouse_x>=xe+290+(cl*180) && mouse_x<=xe+290+(cl*180)+10 && mouse_y>=ye+260 && mouse_y<=ye+265+10)
{
 midi_send_out[1693+cl]=toggle(midi_send_out[1693+cl]);
 mouse_released=1;
}

}//fin des 3 sliders



}
//hors du dragging 0
do_logical_Echo_Aera(xe+155,ye+95);
return(0);
}
int mini_faders_panel_core(int xmf, int ymf, int larg)
{

if(mouse_y>ymf && mouse_y<ymf+20 )
{

if(mouse_x>xmf+(24*larg)+10 && mouse_x<xmf+(24*larg)+30)
{
if( Midi_Faders_Affectation_Type!=0)
{
 attribute_midi_solo_affectation(774,1);
}
else
{
position_minifader_selected--;
if(position_minifader_selected<0){position_minifader_selected=core_user_define_nb_faders;}
refresh_minifader_state_view_core(position_minifader_selected);
mouse_released=1;
}
}

else if(mouse_x>xmf+(24*larg)+35 && mouse_x<xmf+(24*larg)+55)
{
if(Midi_Faders_Affectation_Type!=0)
{
attribute_midi_solo_affectation(775,1);
}
else
{
position_minifader_selected++;
if(position_minifader_selected>core_user_define_nb_faders){position_minifader_selected=0;}
refresh_minifader_state_view_core(position_minifader_selected);
mouse_released=1;
}
}
}


//SELECT ALL
if(mouse_y>ymf-25 && mouse_y<ymf-5 )
{
if(mouse_x>xmf+(24*larg)+10 && mouse_x<xmf+(24*larg)+55)
{
if(Midi_Faders_Affectation_Type!=0)
{
attribute_midi_solo_affectation(145,1);
}
else
{
for(int i=0;i<core_user_define_nb_faders;i++)
{minifaders_selected[i]=1;}
}
}
}





 //select
if(mouse_x>xmf+(24*larg)+10 && mouse_x<xmf+(24*larg)+55 )
{

if(mouse_y>ymf+25 && mouse_y<ymf+45 && mouse_released==0 )
{
if( Midi_Faders_Affectation_Type!=0)
{
attribute_midi_solo_affectation(776,1);
mouse_released=1;
}
else
{
minifaders_selected[position_minifader_selected]=toggle(minifaders_selected[position_minifader_selected]);
mouse_released=1;
}
}

else if(mouse_y>ymf+50 && mouse_y<ymf+70 && mouse_released==0 )
{
if( Midi_Faders_Affectation_Type!=0)
{
 attribute_midi_solo_affectation(777,1);
 }
else
{
for(int l=0;l<core_user_define_nb_faders;l++)
{
minifaders_selected[l]=0;
}
}
mouse_released=1;
}
}

///////////////LES ACTIONS////////////////////////////////////////////////////
for(int lu=0;lu<5;lu++)
{
for(int llu=0;llu<3;llu++)
{
int numcom=(lu*3)+llu;
//mouse action:
if(mouse_x>xmf+(24*larg)+70+(lu*25) && mouse_x<xmf+(24*larg)+70+(lu*25)+20 && mouse_y>ymf+(llu*25) && mouse_y<ymf+(llu*25)+20)
{
char tmp_c[36];
switch(numcom)
{
case 0:
sprintf(tmp_c,"Flash");
break;
case 1:
sprintf(tmp_c,"Lock");
break;
case 2:
sprintf(tmp_c,"Loop");
break;
case 3:
sprintf(tmp_c,"Lfo UP");
break;
case 4:
sprintf(tmp_c,"Lfo DOWN");
break;
case 5:
sprintf(tmp_c,"Lfo SAW");
break;
case 6:
sprintf(tmp_c,"All Dock Looped");
break;
case 7:
sprintf(tmp_c,"All at 0");
break;
case 8:
sprintf(tmp_c,"Set Pos");
break;
case 9:
sprintf(tmp_c,"To Prev Dock");
break;
case 10:
sprintf(tmp_c,"To Next Dock");
break;
case 11:
sprintf(tmp_c,"Up and Down");
break;
case 12:
sprintf(tmp_c,"Sel Prev Dock");
break;
case 13:
sprintf(tmp_c,"Sel Next Dock");
break;
case 14:
sprintf(tmp_c,"Play Embedded");
break;
default:
                    strcpy(tmp_c,"");
break;
}

sprintf(string_last_midi_id,"%s is Ch: %d Pitch: %d Type: %s",tmp_c, miditable[1][778+numcom],miditable[2][778+numcom],thetypinfo);

if(numcom!=0 )// hors flash
{
if( Midi_Faders_Affectation_Type!=0)
{
 attribute_midi_solo_affectation(778+numcom,1);
 }

else
{
do_action_on_selected_minifaders(numcom);
mouse_released=1;
}
}


}



}
}

//les presets de sélections de faders//////////////////////////////////////////////////////////

for(int lg=0;lg<8;lg++)
{

if(mouse_x>xmf+(24*larg)+10 && mouse_x<xmf+(24*larg)+10+20 && mouse_y>ymf+90+(lg*25) && mouse_y<ymf+90+(lg*25)+20)
{

if(Midi_Faders_Affectation_Type!=0)
{
 //midi report
 switch(miditable[0][794+lg])
 {
  case 0:
  sprintf(thetypinfo,"Note");
  break;
  case 1:
  sprintf(thetypinfo,"Key On");
  break;
  case 2:
  sprintf(thetypinfo,"Key Off");
  break;
  case 4:
  sprintf(thetypinfo,"Ctrl Change");
  break;
 }
  sprintf(string_last_midi_id,"FaderPreset %d is Ch: %d Pitch: %d Type: %s",lg+1, miditable[1][794+lg],miditable[2][794+lg],thetypinfo);

 if(Midi_Faders_Affectation_Type==1)
 {attribute_midi_solo_affectation(794+lg,1);}
 else if(Midi_Faders_Affectation_Type==2)
 {
 attribute_midi_to_control(794, Midi_Faders_Affectation_Type,Midi_Faders_Affectation_Mode);
 }
}
else
{
if(index_do_dock==1)
{
minifader_preset_is=lg;
index_record_minifader_preset=1;
index_ask_confirm=1;
}
else if(index_main_clear==1)
{
minifader_preset_is=lg;
index_clear_minifader_preset=1;
index_ask_confirm=1;
}
else //selection souris normale
{
for(int olp=0;olp<core_user_define_nb_faders;olp++)
{minifaders_selected[olp]=minifaders_preset_selection[lg][olp];}
sprintf(string_Last_Order,"Called Fader Selection from Preset %d", lg+1);
}

}
}
}
////////////Les locks presets///////////////////////////////////////////////////

for(int lck=0;lck<8;lck++)
{

if(mouse_x>xmf+(24*larg)+35 && mouse_x<xmf+(24*larg)+35+20 && mouse_y>ymf+90+(lck*25) && mouse_y<ymf+90+(lck*25)+20)
{

if( Midi_Faders_Affectation_Type!=0)
{

     //midi report
 switch(miditable[0][605+lck])
 {
  case 0:
  sprintf(thetypinfo,"Note");
  break;
  case 1:
  sprintf(thetypinfo,"Key On");
  break;
  case 2:
  sprintf(thetypinfo,"Key Off");
  break;
  case 4:
  sprintf(thetypinfo,"Ctrl Change");
  break;
 }
  sprintf(string_last_midi_id,"Lock Preset %d is Ch: %d Pitch: %d Type: %s",lck+1, miditable[1][605+lck],miditable[2][605+lck],thetypinfo);

  if(Midi_Faders_Affectation_Type==1)
 {attribute_midi_solo_affectation(605+lck,1);}
 else if(Midi_Faders_Affectation_Type==2)
 {
 attribute_midi_to_control(605, Midi_Faders_Affectation_Type,Midi_Faders_Affectation_Mode);
 }
}

else
 {

 if(index_do_dock==1)
 {

 minifader_lockpreset_is=lck;
 index_record_minifader_lockpreset=1;
 index_ask_confirm=1;
 }

 else  if(index_main_clear==1)
 {

 reset_indexs_confirmation();
 lock_preset_selected_for_record=lck;
 index_do_clear_lock_preset=1;
 index_ask_confirm=1;
 sprintf(string_Last_Order,">> Lock State %d cleared",lck+1);
 }
 else
 {
 do_lock_preset(lck);
 sprintf(string_Last_Order,">> Lock State %d called ",lck+1);
 }
mouse_released=1;
}
}
}


/////////////////ALL AT 0///////////////////////////////////////////////////////
all_at_zero_panel_core((xmf+24*larg)+60,ymf+80);

midi_send_faders_button_logical((xmf+24*larg)+140,ymf-40,W_MINIFADERS);


////////////////////////////////////////////////////////////////////////////////
/////////////////////////LES 48 POTARDS/////////////////////////////////////////
int hmfd=200;//hauteur d une ligne de 24 faders
for(int cmptfader=0; cmptfader<max_faders/2; cmptfader++)
{
for(int lfad=0;lfad<2;lfad++)
{

if(cmptfader+(lfad*24)<=core_user_define_nb_faders-1)//limitation nbre faders
{

////FX MODE

if(  window_focus_id==922 && mouse_released==0 && mouse_x>xmf+(cmptfader*larg) && mouse_x<xmf+(cmptfader*larg)+larg && mouse_y>(ymf+(lfad*hmfd))-12  && mouse_y<(ymf+(lfad*hmfd))-12+5 )
{
if( Midi_Faders_Affectation_Type!=0)
{
attribute_midi_to_control(1543+cmptfader+(lfad*24), Midi_Faders_Affectation_Type,  Midi_Faders_Affectation_Mode);
}
else
{
  fader_mode_with_buffers[cmptfader+(lfad*24)]++;
 if(fader_mode_with_buffers[cmptfader+(lfad*24)]>5){fader_mode_with_buffers[cmptfader+(lfad*24)]=0;}
}
mouse_released=1;
}

///////////SELECTION SOURIS SUR  NUMEROS AU DESSUS FADERS/////////////////////////////////////////////////////////
if( mouse_x>xmf+(cmptfader*larg) && mouse_x<xmf+(cmptfader*larg)+larg && mouse_y>(ymf+(lfad*hmfd))  && mouse_y<(ymf+15+(lfad*hmfd)) )
{
position_minifader_selected=cmptfader+(lfad*24);

int dock_selected_is=detect_dock_used(position_minifader_selected);


//SELECTION
if(index_do_dock==0 && index_do_modify==0 && index_do_dock==0   && index_type==0    && index_main_clear==0 )
{
 minifaders_selected[position_minifader_selected]=toggle(minifaders_selected[position_minifader_selected]);
 if(index_inspekt==1)//affichage qui dans dock si VIEW activé
 {
 show_who_is_in_dock( position_minifader_selected,   detect_dock_used(position_minifader_selected));
 }
 mouse_released=1;
}


 //store normal
 else if(index_do_dock==1 && index_direct_chan==0   && index_affect_chaser_to_dock==0  && index_affect_time==0 && index_affect_color_to_dock==0 && index_do_affect_net_to_dock==0
 && index_affect_dmxin==0 && index_affect_video_tracking_to_dock==0 && index_affect_audio_to_dock==0 && gridplayer_to_affect_is==-1
 && index_do_fgroup==0 && index_affect_to_dock_mover==0 && index_affect_draw_to_dock==0 &&  index_affect_echo_to_dock==0)
 {
 fader_selected_for_record=position_minifader_selected;
 dock_selected_for_record=dock_selected_is;
 index_do_record_on_faders=1;
 index_ask_confirm=1;
 }

  //affect time
 else if (index_do_dock==1 && index_affect_time==1 )
 {
 show_im_recording_a_time=1;
 DoTimeToDock(position_minifader_selected,dock_selected_is);
 sprintf(string_Last_Order,">>Time affected to Master %d Dock %d", position_minifader_selected+1,dock_selected_is);
 index_affect_time=0;
 }
 //color dock
 else if(index_do_dock==1 && index_affect_color_to_dock==1 )
 {
 fader_selected_for_record=position_minifader_selected;
 dock_selected_for_record=dock_selected_is;
 index_do_affect_color_on_faders=1;
 index_ask_confirm=1;
 }
 //dmx to dock
 else if(index_do_dock==1 && index_affect_dmxin==1 ) // affect couleurs dans dock
 {
 fader_selected_for_record=position_minifader_selected;
 dock_selected_for_record=dock_selected_is;
 index_do_dmx_to_dock=1;
 index_ask_confirm=1;
 }
 //artnet to dock
 else if(index_do_dock==1 && index_do_affect_net_to_dock==1 ) // affect Network IN dans dock
 {
 fader_selected_for_record=position_minifader_selected;
 dock_selected_for_record=dock_selected_is;
 index_do_artnet_to_dock=1;
 index_ask_confirm=1;
 }
 //video to dock
 else if(index_do_dock==1 && index_affect_video_tracking_to_dock==1) // affect Network IN dans dock
 {
 fader_selected_for_record=position_minifader_selected;
 dock_selected_for_record=dock_selected_is;
 index_do_video_to_dock=1;
 index_ask_confirm=1;
 }
 //audio to dock
 else if(index_do_dock==1 &&  index_affect_audio_to_dock==1) // affect audio controls dans dock
 {
 if(player_to_affect_to_dock>=0 && player_to_affect_to_dock<4 )
 {
 fader_selected_for_record=position_minifader_selected;
 dock_selected_for_record=dock_selected_is;
 index_do_audio_to_dock=1;
 index_ask_confirm=1;
 }
 }

 //store direct CH
 else if(index_do_dock==1 && index_direct_chan==1 )
 {
 fader_selected_for_record=position_minifader_selected;
 dock_selected_for_record=dock_selected_is;
 index_do_record_direct_ch=1;
 index_ask_confirm=1;
 }
 //store FX
 else if(index_do_dock==1 && index_affect_chaser_to_dock==1)
 {
 fader_selected_for_record=position_minifader_selected;
 dock_selected_for_record=dock_selected_is;
 index_do_affect_fx=1;
 index_ask_confirm=1;
 }
 //store Grid
 else if(index_do_dock==1 &&  gridplayer_to_affect_is>=0 )
 {
 fader_selected_for_record=position_minifader_selected;
 dock_selected_for_record=dock_selected_is;
 index_do_affect_grid_to_fader=1;
 index_ask_confirm=1;
 }
 //store group fader
 else if(index_do_dock==1 && index_do_fgroup==1 )
 {
 fader_selected_for_record=position_minifader_selected;
 dock_selected_for_record=dock_selected_is;
 bool index_there_is_fader_selected=0;
 for(int io=0;io<48;io++)
 {
 if(minifaders_selected[io]==1){index_there_is_fader_selected=1;break;}
 }
 if(index_there_is_fader_selected==1)
 {
 index_do_affect_fgroup=1;
 index_ask_confirm=1;
 }
 else{sprintf(string_Last_Order,"No minifaders selected");}
 }

  //Store Mover dans dock
 else if (  index_do_dock==1 && index_affect_to_dock_mover==1)
 {
 fader_selected_for_record=position_minifader_selected;
 dock_selected_for_record=dock_selected_is;
 index_do_affect_mover=1;
 index_ask_confirm=1;
 }


 //draw
 else if(index_do_dock==1 && index_affect_draw_to_dock==1)
 {
 fader_selected_for_record=position_minifader_selected;
 dock_selected_for_record=dock_selected_is;
 draw_preset_selected_for_order=draw_preset_selected;
 index_do_draw_affect_to_dock=1;
 index_ask_confirm=1;
 mouse_released=1;
 }
  //echo
 else if(index_do_dock==1 && index_affect_echo_to_dock==1)
 {
 fader_selected_for_record=position_minifader_selected;
 dock_selected_for_record=dock_selected_is;
 index_do_affect_echo_to_dock=1;
 index_ask_confirm=1;
 mouse_released=1;
 }

 //modify
 else if( index_do_modify==1 )
 {
 fader_selected_for_record=position_minifader_selected;
 dock_selected_for_record=dock_selected_is;
 index_do_modify_on_faders=1;
 index_ask_confirm=1;
 }


  //report
 if( index_do_report==1 && index_type==0 && index_do_dock==0 && index_do_modify==0 )
 {
 fader_selected_for_record=position_minifader_selected;
 dock_selected_for_record=dock_selected_is;
 index_do_report_on_faders=1;
 index_ask_confirm=1;
 sprintf(string_Last_Order,"Report");
 }

 //nommage de dock
 else if( index_type==1 && index_do_dock==0 && index_do_report==0 && index_do_modify==0   && numeric_postext!=0 )
 {
 for(int tt=0;tt<24;tt++)
 {
 DockName[position_minifader_selected][dock_selected_is][tt]=numeric[tt];
 }
 DockName[position_minifader_selected][dock_selected_is][24]='\0';
 reset_numeric_entry();numeric_postext=0;
 if(index_text_auto_close==1){index_type=0;}
 sprintf(string_Last_Order,">>On Master %d GIVED A NAME FOR DOCK %d ", position_minifader_selected+1,dock_selected_is+1);
 }

  //clear
 else if(index_main_clear==1 )
 {
 fader_selected_for_record=position_minifader_selected;
 dock_selected_for_record=dock_selected_is;
 index_do_clear_dock=1;
 index_ask_confirm=1;
 }


refresh_minifader_state_view_core(position_minifader_selected);
}

//MANIP DU MINI FADER/////////////////////////////////////////////////////////////
if( mouse_x>xmf+(cmptfader*larg) && mouse_x<xmf+(cmptfader*larg)+larg && mouse_y>(ymf+15+(lfad*hmfd))  && mouse_y<(ymf+20+127+(lfad*hmfd)) )
{

position_minifader_selected=cmptfader+(lfad*24);
refresh_minifader_state_view_core(cmptfader+(lfad*24));
if(index_inspekt==1){ //affichage qui dans dock si VIEW activé
show_who_is_in_dock( cmptfader+(lfad*24),   detect_dock_used(cmptfader+(lfad*24)));
}
set_mouse_range(xmf+(cmptfader*larg), ymf+20+(lfad*hmfd), xmf+(cmptfader*larg)+larg, ymf+20+127+(lfad*hmfd));//pour pas deborder
//click niveau fader
if( index_main_clear==0)
{
//NIVEAU
Fader[cmptfader+(lfad*24)]=((ymf+127+20+(lfad*hmfd))-mouse_y)*2;
midi_levels[cmptfader+(lfad*24)]=((ymf+127+20+(lfad*hmfd))-mouse_y);//desafffceté pour trouver pb

if(Fader[cmptfader+(lfad*24)]>=254){Fader[cmptfader+(lfad*24)]=255;midi_levels[cmptfader+(lfad*24)]=127;}

index_fader_is_manipulated[cmptfader+(lfad*24)]=1;
if(midi_send_out[cmptfader+(lfad*24)]==1){ index_send_midi_out[cmptfader+(lfad*24)]=1;}
if(lfo_mode_is[cmptfader+(lfad*24)]==1 || lfo_mode_is[cmptfader+(lfad*24)]==2 || lfo_cycle_is_on[cmptfader+(lfad*24)]==1)
{
lfo_mode_is[cmptfader+(lfad*24)]=0; lfo_mode_is[cmptfader+(lfad*24)]=0; lfo_cycle_is_on[cmptfader+(lfad*24)]=0;
}
//CONFIG MIDI

if(Midi_Faders_Affectation_Type!=0)
{
attribute_midi_to_control(cmptfader+(lfad*24), Midi_Faders_Affectation_Type,Midi_Faders_Affectation_Mode);
}
}
//NETTOYAGE DE FADER ET DOCK
if(index_main_clear==1)//clear de tous les dock du fader
{
 fader_selected_for_record=cmptfader+(lfad*24);
 index_do_clear_on_faders=1;
 index_ask_confirm=1;
 mouse_released=1  ;
}
}
}//fin limitation nb faders user define
}//fin doublage des faders
}
////////FIN DES 48 POTARDS//////////////////////////////////////////////////////

return(0);
}
int do_logical_Interface_Trichromie(int xchroma, int ychroma, int rayon, int largeurchroma)
{

/////////////////TRICHRO / QUADRI CHOOSE//////////////////////////////////////

if(mouse_x>xchroma-60 && mouse_x<xchroma+80 && mouse_y>ychroma-190 && mouse_y<ychroma-160)
{

if(index_quadri==0){index_quadri=1;dock_color_type[dock_color_selected]=1;}
else if(index_quadri==1){index_quadri=0;dock_color_type[dock_color_selected]=0;}
mouse_released=1;
}

/////////////////////AFFECTATION ON / OFF AUX DOCKS FADERS///////////////////////////

if(mouse_x>xchroma+20 && mouse_x<xchroma+150 && mouse_y>ychroma+300 && mouse_y< ychroma+330)
{
if(index_affect_color_to_dock==0)
{
reset_index_actions();
reset_indexs_confirmation();
index_affect_color_to_dock=1;
}
else
{
reset_index_actions();
}
index_do_dock=index_affect_color_to_dock;
mouse_released=1;
}
/////////////////////////////////////////////////////////////////////////////////

//////////////////////ROUE DE COULEUR//////////////////////////////////////////////////////

//AFFECTATION MIDI
if( Midi_Faders_Affectation_Type!=0)//config midi
  {
  //midi report
  switch(miditable[0][497])
  {
  case 0: sprintf(thetypinfo,"Note");break;
  case 1: sprintf(thetypinfo,"Key On");break;
  case 2: sprintf(thetypinfo,"Key Off");break;
  case 4: sprintf(thetypinfo,"Ctrl Change");break;
  }
  sprintf(string_last_midi_id,"COLOR WHEEL FADER is Ch: %d Pitch: %d Typ: %s" , miditable[1][497],miditable[2][497],thetypinfo);

  if(mouse_x>xchroma-140 && mouse_x<xchroma+140 && mouse_y>ychroma-140 && mouse_y<ychroma+140)
  {
    attribute_midi_solo_affectation(497,Midi_Faders_Affectation_Mode);
    mouse_released=1;
   }
}


/////////////////////DOCKING DES COULEURS////////////////////////////////////////
//emplacement des box pour actions de storage RVB sur 6 presets

//affectation des circuits aux RVB Y

if(mouse_y>ychroma+165 && mouse_y<ychroma+185)
{
if(mouse_x> xchroma-130 && mouse_x< xchroma-80 )//RED
{
if (index_inspekt==1){show_who_is_in_dock_color(dock_color_selected,0);}
couleur_to_affect=0;
bool there_is_asel_chan=0;

switch(index_paste_on_the_fly)
{
case 0:
for(int p=1;p<513;p++)
{
if(Selected_Channel[p]==1)
{there_is_asel_chan=1;break;}
}

if(there_is_asel_chan==1 && (index_do_dock==1|| index_do_modify==1 || index_do_report==1))
{index_do_affect_color_trichro=1;index_ask_confirm=1;}

else {index_do_affect_color_trichro=0;index_ask_confirm=0;sprintf(string_Last_Order,"No channel selected to store as color");}
break;
case 1:
if(index_blind==0)
{
for(int p=1;p<513;p++)
{
if(Selected_Channel[p]==1){bufferSaisie[p]=my_red;}
}
}
else
{
for(int p=1;p<513;p++)
{
if(Selected_Channel[p]==1){bufferBlind[p]=my_red;}
}
}
sprintf(string_Last_Order,"Pasted On the Fly RED result");
break;
}
mouse_released=1;
}

else if (mouse_x> xchroma-65 && mouse_x< xchroma-15 )//GREEN
{
if (index_inspekt==1){show_who_is_in_dock_color(dock_color_selected,1);}
couleur_to_affect=1;
bool there_is_asel_chan=0;
switch(index_paste_on_the_fly)
{
case 0:
for(int p=1;p<513;p++)
{if(Selected_Channel[p]==1){there_is_asel_chan=1;break;}}
if(there_is_asel_chan==1 && (index_do_dock==1|| index_do_modify==1 || index_do_report==1))
{index_do_affect_color_trichro=1;index_ask_confirm=1;}
else {sprintf(string_Last_Order,"No channel selected to store as color");}
break;
case 1:
if(index_blind==0)
{
for(int p=1;p<513;p++)
{
if(Selected_Channel[p]==1){bufferSaisie[p]=my_green;}
}
}
else
{
for(int p=1;p<513;p++)
{
if(Selected_Channel[p]==1){bufferBlind[p]=my_green;}
}
}
sprintf(string_Last_Order,"Pasted On the Fly GREEN result");
break;
}
mouse_released=1;
}

else if (mouse_x> xchroma && mouse_x< xchroma+50 )//BLUE
{
if (index_inspekt==1){show_who_is_in_dock_color(dock_color_selected,2);}

couleur_to_affect=2;
bool there_is_asel_chan=0;
switch(index_paste_on_the_fly)
{
case 0:
for(int p=1;p<513;p++)
{if(Selected_Channel[p]==1){there_is_asel_chan=1;break;}}
if(there_is_asel_chan==1 && (index_do_dock==1|| index_do_modify==1 || index_do_report==1)){index_do_affect_color_trichro=1;index_ask_confirm=1;}
else {sprintf(string_Last_Order,"No channel selected to store as color");}
break;
case 1:
if(index_blind==0)
{
for(int p=1;p<513;p++)
{
if(Selected_Channel[p]==1){bufferSaisie[p]=my_blue;}
}
}
else
{
for(int p=1;p<513;p++)
{
if(Selected_Channel[p]==1){bufferBlind[p]=my_blue;}
}
}
sprintf(string_Last_Order,"Pasted On the Fly BLUE result");
break;
}
mouse_released=1;
}

else if (mouse_x> xchroma+65 && mouse_x< xchroma+115 )//YELLOW
{
if (index_inspekt==1){show_who_is_in_dock_color(dock_color_selected,3);}
couleur_to_affect=3;
bool there_is_asel_chan=0;
switch(index_paste_on_the_fly)
{
case 0:
for(int p=1;p<513;p++)
{if(Selected_Channel[p]==1){there_is_asel_chan=1;break;}}
if(there_is_asel_chan==1&& (index_do_dock==1|| index_do_modify==1 || index_do_report==1)){index_do_affect_color_trichro=1;index_ask_confirm=1;}
else {sprintf(string_Last_Order,"No channel selected to store as color");}
break;
case 1:
if(index_blind==0)
{
for(int p=1;p<513;p++)
{
if(Selected_Channel[p]==1){bufferSaisie[p]=my_yellow;}
}
}
else
{
for(int p=1;p<513;p++)
{
if(Selected_Channel[p]==1){bufferBlind[p]=my_yellow;}
}
}
sprintf(string_Last_Order,"Pasted On the Fly YELLOW result");
break;
}
mouse_released=1;
}
}


//midi out de la roue

if(mouse_x> xchroma+140-10 && mouse_x< xchroma+140+10 && mouse_y>ychroma+110-10 && mouse_y<ychroma+110+10)
{

  if(midi_send_out[497]==0){midi_send_out[497]=1; }
  else if(midi_send_out[497]==1){midi_send_out[497]=0; }
  mouse_released=1;
  }

raccrochage_midi_logical_circulaire (xchroma-6, ychroma, 497, 125, 125);

do_colors();//ventilation des niveaux pickés ainsi que distrib dans faders et docks

//premiere rangee de dock colors

for (int dock_color=0;dock_color<4;dock_color++)
{
if(mouse_x>xchroma-130+(65*dock_color) && mouse_x<xchroma-80+(65*dock_color) && mouse_y>ychroma+215 && mouse_y<ychroma+235)
{
if( Midi_Faders_Affectation_Type!=0)
{
if(dock_color==0 && Midi_Faders_Affectation_Type==2)
{attribute_midi_to_control(949,Midi_Faders_Affectation_Type,Midi_Faders_Affectation_Mode);}
else{attribute_midi_solo_affectation(949+dock_color, Midi_Faders_Affectation_Mode);}
}
else
{
dock_color_selected=dock_color;
load_etat_picker_dans_dockcolor(dock_color_selected);
sprintf(string_Last_Order,">>Dock Color Selected %d",(dock_color_selected+1));
mouse_released=1;
}
}
}
//deuxième rangee de dockcolors
for (int dock_colortwo=0;dock_colortwo<4;dock_colortwo++)
{
if(mouse_x>xchroma-130+(65*dock_colortwo) && mouse_x<xchroma-80+(65*dock_colortwo) && mouse_y>ychroma+255 && mouse_y<ychroma+275)
{
if(Midi_Faders_Affectation_Type!=0)
{
attribute_midi_solo_affectation(949+(dock_colortwo+4), Midi_Faders_Affectation_Mode);
}
else
{
dock_color_selected=dock_colortwo+4;
load_etat_picker_dans_dockcolor(dock_color_selected);
sprintf(string_Last_Order,">>Dock Color Selected %d",dock_color_selected+1);
mouse_released=1;
}
}
}

//PASTE ON THE FLY
if(mouse_x>xchroma-150 && mouse_x<xchroma-20 && mouse_y>ychroma+300 && mouse_y< ychroma+330)
{
if(mouse_b&1 &&  mouse_released==0 && window_focus_id==902)
{
index_paste_on_the_fly=toggle(index_paste_on_the_fly);
mouse_released=1;
}
}
return(0);
}