コード例 #1
0
int gridplayer_step_plus(int num_grid_player)
{
  index_grider_step_is[num_grid_player]++;
  if(index_grider_step_is[num_grid_player]>1023){index_grider_step_is[num_grid_player]=1023;}
  grid_niveauX1[num_grid_player]=255;
  grid_niveauX2[num_grid_player]=0;
  grid_floatX1[num_grid_player]=grid_niveauX1[num_grid_player];
  grid_floatX2[num_grid_player]=grid_niveauX2[num_grid_player];
  gridder_prepare_cross(num_grid_player, index_grider_selected[num_grid_player], index_grider_step_is[num_grid_player]);
  if(grider_seekto_mode[num_grid_player]==1 && grid_seekpos[index_grider_selected[num_grid_player]][index_grider_step_is[num_grid_player]]>0 )//seek position
  {index_grider_seek_pos[num_grid_player]=grid_seekpos[index_grider_selected[num_grid_player]][index_grider_step_is[num_grid_player]];}
  grid_counted_times[index_grider_selected[num_grid_player]] [index_grider_step_is[num_grid_player]]=0;
 return(0);
}
コード例 #2
0
int gridplayer_seek(int num_grider)
{
 if(index_grider_seek_pos[num_grider]<0){index_grider_seek_pos[num_grider]=0;}
 index_grider_step_is[num_grider]=index_grider_seek_pos[num_grider];

/* if(grider_seekto_mode[num_grider]==1 && grid_seekpos[index_grider_selected[num_grider]][index_grider_step_is[num_grider]]>0 )//seek position
 {index_grider_seek_pos[num_grider]=grid_seekpos[index_grider_selected[num_grider]][index_grider_step_is[num_grider]];}
 else {index_grider_seek_pos[num_grider]=1;}*/
 gridder_prepare_cross(num_grider,index_grider_selected[num_grider],index_grider_step_is[num_grider]);
 grid_niveauX1[num_grider]=255;
 grid_niveauX2[num_grider]=0;
 grid_floatX1[num_grider]=grid_niveauX1[num_grider];
 grid_floatX2[num_grider]=grid_niveauX2[num_grider];
 grid_counted_times[index_grider_selected[num_grider]] [index_grider_step_is[num_grider]]=0;
 return(0);
}
コード例 #3
0
int do_grid()
{
int gr_grille=0;
int gr_step=0;

int gr_grille_pr=0;
int gr_step_pr=0;

for(int grid_pl=0;grid_pl<core_user_define_nb_gridplayers;grid_pl++)
{
gr_grille=index_grider_selected[grid_pl];
gr_step=index_grider_step_is[grid_pl];

gr_grille_pr=grid_in_preset[grid_pl][0];
gr_step_pr=grid_in_preset[grid_pl][1];

for(int cg=0;cg<512;cg++)
{

if(grid_levels[gr_grille][gr_step][cg]>grid_levels[gr_grille_pr][gr_step_pr][cg])
{
buffer_gridder[grid_pl][cg]=
grid_levels[gr_grille_pr][gr_step_pr][cg]
 + (unsigned char)((((float)(grid_levels[gr_grille][gr_step][cg]-grid_levels[gr_grille_pr][gr_step_pr][cg])/255)*grid_niveauX1[grid_pl])) ;
}
if(grid_levels[gr_grille][gr_step][cg]<grid_levels[gr_grille_pr][gr_step_pr][cg])
{
buffer_gridder[grid_pl][cg]=
grid_levels[gr_grille][gr_step][cg]
+ (unsigned char)((((float)(grid_levels[gr_grille_pr][gr_step_pr][cg]-grid_levels[gr_grille][gr_step][cg])/255)*grid_niveauX2[grid_pl])) ;
}
if(grid_levels[gr_grille][gr_step][cg]==grid_levels[gr_grille_pr][gr_step_pr][cg])
{
buffer_gridder[grid_pl][cg]=grid_levels[gr_grille_pr][gr_step_pr][cg];
}
}
//bug grid sur temps decales out    ALGO RIGINAL
//buffer_gridder[grid_pl][cg]=(unsigned char)((((float)grid_levels[gr_grille][gr_step][cg])/255)*grid_niveauX1[grid_pl]
//+(((float)grid_levels[grid_in_preset[grid_pl][0]][grid_in_preset[grid_pl][1]][cg])/255)*grid_niveauX2[grid_pl]);




switch(grider_is_playing[grid_pl])
{
case 0:
gridder_prepare_cross(grid_pl,gr_grille,gr_step);
break;
case 1:
if(actual_time>(grid_crossfade_start_time[grid_pl]+grid_delay_out[grid_pl]))
{
grid_floatX1[grid_pl]-=grid_fraction_X1_out[grid_pl];
if(grid_floatX1[grid_pl]<0.0){grid_floatX1[grid_pl]=0.0;}
grid_niveauX1[grid_pl]=(int)grid_floatX1[grid_pl];
}
if(actual_time>(grid_crossfade_start_time[grid_pl]+grid_delay_in[grid_pl]))
{
grid_floatX2[grid_pl]+=grid_fraction_X2_in[grid_pl];
if(grid_floatX2[grid_pl]>255.0){grid_floatX2[grid_pl]=255.0;}
grid_niveauX2[grid_pl]=(int)grid_floatX2[grid_pl];
}
if(grid_niveauX1[grid_pl]==0 && grid_niveauX2[grid_pl]==255)
{
index_grider_selected[grid_pl]=grid_in_preset[grid_pl][0];
index_grider_step_is[grid_pl]=grid_in_preset[grid_pl][1];
grid_delay_in[grid_pl]=0;
grid_delay_out[grid_pl]=0;

if(grid_in_preset[grid_pl][1]>1023){index_grider_step_is[grid_pl]=1023;}
gridder_prepare_cross(grid_pl,index_grider_selected[grid_pl],index_grider_step_is[grid_pl]);
grid_niveauX1[grid_pl]=255;
grid_niveauX2[grid_pl]=0;
grid_floatX1[grid_pl]=grid_niveauX1[grid_pl];
grid_floatX2[grid_pl]=grid_niveauX2[grid_pl];

//stop mode on, step en tant que stop ou //stopplay enclenché
if((grider_stoplay_mode[grid_pl]==1 && grid_stoplay[index_grider_selected[grid_pl]][index_grider_step_is[grid_pl]]==1)
||grider_autostopmode[grid_pl]==1)
{grider_is_playing[grid_pl]=0;}
else//start time recalcul
{
grid_crossfade_start_time[grid_pl]=actual_time;
}
//def seek step
if(grider_seekto_mode[grid_pl]==1 && grid_seekpos[index_grider_selected[grid_pl]][index_grider_step_is[grid_pl]]>0)//seek position
  {index_grider_seek_pos[grid_pl]=grid_seekpos[index_grider_selected[grid_pl]][index_grider_step_is[grid_pl]];}
//rajout comptage count
if( grider_count_mode[grid_pl]==1 &&  grid_count[index_grider_selected[grid_pl]][index_grider_step_is[grid_pl]]>0)
{
grid_counted_times[index_grider_selected[grid_pl]][index_grider_step_is[grid_pl]]++;
sprintf( string_grid_count[grid_pl],"%d/%d from S.%d",  grid_counted_times[index_grider_selected[grid_pl]][index_grider_step_is[grid_pl]],grid_count[index_grider_selected[grid_pl]][index_grider_step_is[grid_pl]], index_grider_step_is[grid_pl]+1);
if(grid_counted_times[index_grider_selected[grid_pl]][index_grider_step_is[grid_pl]]>grid_count[index_grider_selected[grid_pl]][index_grider_step_is[grid_pl]])
{
//sab 02/03/2014 sprintf( string_grid_count[grid_pl],"");
strcpy( string_grid_count[grid_pl],"");

grid_counted_times[index_grider_selected[grid_pl]][index_grider_step_is[grid_pl]]=0;
}
}

}
break;
}
}

 return(0);
}
コード例 #4
0
int do_logical_TheCallGridBox(int xb, int yb, int num_grider)
{

if(mouse_x>xb+10 && mouse_x<xb+10+50 && mouse_y>yb && mouse_y<yb+20)
{
if(mouse_released==0)
{
if( Midi_Faders_Affectation_Type!=0)//config midi
{
attribute_midi_solo_affectation(1528+num_grider,Midi_Faders_Affectation_Mode);
}
else
{
if(numeric_postext>0)
{
int temp_num_grid=atoi(numeric);
if(temp_num_grid>0 && temp_num_grid<128)
{
//rajout
bool was_playing=grider_is_playing[num_grider];
grider_is_playing[num_grider]=0;
grid_niveauX1[num_grider]=255;
grid_niveauX2[num_grider]=0;
grid_floatX1[num_grider]=255.0;
grid_floatX2[num_grider]=0.0;
grid_fraction_X2_in[num_grider]=0.0;
grid_fraction_X1_out[num_grider]=0.0;

index_grider_selected[num_grider]=temp_num_grid-1;//avant modif du 5 nov que cette ligne la

//rajout
index_grider_step_is[num_grider]=0;
//chargement à la volée rafraichissement grid
gridder_prepare_cross(num_grider, index_grider_selected[num_grider], index_grider_step_is[num_grider]);


if(grider_seekto_mode[num_grider]==1 && grid_seekpos[index_grider_selected[num_grider]][index_grider_step_is[num_grider]]>0)//seek position original fonction
  {index_grider_seek_pos[num_grider]=grid_seekpos[index_grider_selected[num_grider]][index_grider_step_is[num_grider]];}

//rajout
if(was_playing==1){grider_is_playing[num_grider]=1;}

reset_numeric_entry();
}
}
else if(index_main_clear==1)
{
 grid_to_clear=index_grider_selected[num_grider];
 step_grid_to_clear=index_grider_step_is[index_grider_selected[num_grider]];
 index_ask_confirm=1;
 index_clear_a_grid=1;
}
}
mouse_released=1;
}
}

if(mouse_x>xb+70 && mouse_x<xb+70+170 && mouse_y>yb && mouse_y<yb+20 && index_type==1 && mouse_released==0)
{
 for(int tt=0;tt<24;tt++)
 {
 grider_name[index_grider_selected[num_grider]][tt]=numeric[tt];
 }
 grider_name[index_grider_selected[num_grider]][24]='\0';
 reset_numeric_entry();numeric_postext=0; if(index_text_auto_close==1){index_type=0;}
mouse_released=1;
}

//UP DOWN griders number selected

if(mouse_x>xb+265-12 && mouse_x<xb+265+12 && mouse_y>yb+10-12 && mouse_y<yb+10+12)
{

if(mouse_released==0)
{
if( Midi_Faders_Affectation_Type!=0)//config midi
{
attribute_midi_solo_affectation(1476+num_grider,Midi_Faders_Affectation_Mode);
}
else
{
if(index_grider_selected[num_grider]>0)
{index_grider_selected[num_grider]--;}
}
 mouse_released=1;
}
}


if( mouse_x>xb+295-12 && mouse_x<xb+295+12 && mouse_y>yb+10-12 && mouse_y<yb+10+12)
{

if( mouse_released==0)
{
if(Midi_Faders_Affectation_Type!=0)//config midi
{
attribute_midi_solo_affectation(1480+num_grider,Midi_Faders_Affectation_Mode);
}
else
{
if(index_grider_selected[num_grider]<127){index_grider_selected[num_grider]++;}
}
mouse_released=1;
}
}
return(0);
}
コード例 #5
0
int do_logical_TheStepBox(int xb,int yb, int num_grid_player)
{

//STEP IS

//Step minus
if(mouse_x>xb & mouse_x<xb+20 && mouse_y>yb && mouse_y<yb+20 )
{
if( mouse_released==0)
{
if(Midi_Faders_Affectation_Type!=0)//config midi
{
attribute_midi_solo_affectation(1484+num_grid_player,Midi_Faders_Affectation_Mode);
}
else
{
  gridplayer_step_minus(num_grid_player);
 }
  mouse_released=1;
}
}
 //Step plus
if(mouse_x>xb+60 & mouse_x<xb+60+20 && mouse_y>yb && mouse_y<yb+20 )
{
if( mouse_released==0)
{
if(Midi_Faders_Affectation_Type!=0)//config midi
{
attribute_midi_solo_affectation(1488+num_grid_player,Midi_Faders_Affectation_Mode);
}
else
{
  gridplayer_step_plus(num_grid_player);
}
  mouse_released=1;
 }
}

//set +127 box pour les pas
if(mouse_x>xb+60 && mouse_x<xb+60+20 && mouse_y>yb-6 && mouse_y<yb-6+5)
{
if( mouse_released==0)
 {
 if( Midi_Faders_Affectation_Type!=0)//config midi
 {
 attribute_midi_solo_affectation(1536+num_grid_player,Midi_Faders_Affectation_Mode);
 }
 mouse_released=1;
}
}
//chargement d'un pas, ou affectation d'un temps ou clear  du pas
if(mouse_x>xb+22 & mouse_x<xb+22+35 && mouse_y>yb-5 && mouse_y<yb-5+30 )
 {
if( mouse_released==0)
 {
 if( Midi_Faders_Affectation_Type!=0)//config midi
 {
 attribute_midi_solo_affectation(1532+num_grid_player,Midi_Faders_Affectation_Mode);
 }
 else
 {
 if(numeric_postext>0 && index_affect_time==0 && index_main_clear==0 && index_do_dock==0 )
                      {
                      int step_to_affect_to_grid=0;
                      step_to_affect_to_grid=atoi(numeric);
                      if(step_to_affect_to_grid>0 && step_to_affect_to_grid<1024)
                      {
                       index_grider_step_is[num_grid_player]=step_to_affect_to_grid-1;
                       if(grider_seekto_mode[num_grid_player]==1 && grid_seekpos[index_grider_selected[num_grid_player]][index_grider_step_is[num_grid_player]]>0 )//seek position
                       {index_grider_seek_pos[num_grid_player]=grid_seekpos[index_grider_selected[num_grid_player]][index_grider_step_is[num_grid_player]];}
                      }
                      reset_numeric_entry();
                      }
 else if (numeric_postext>0  && index_do_dock==1 && index_enable_edit_Grider==1)//charge mem
 {
  int mem_to_affect_to_grid=0;
  mem_to_affect_to_grid=int(atof(numeric)*10);
  if(MemoiresExistantes[mem_to_affect_to_grid]==1)
  {
    for(int i=1;i<513;i++)
   {
   if(i+grider_begin_channel_is+1<513)
   {
   grid_levels[index_grider_selected[num_grid_player]][index_grider_step_is[num_grid_player]][i+1]=Memoires[mem_to_affect_to_grid][i+grider_begin_channel_is+1];
   }
   }
   reset_numeric_entry();
   index_do_dock=0;
  }
 }
 else if (index_do_dock==1 && index_enable_edit_Grider==1)//charge circuits
 {
 if(index_affect_time==0)
 {
 switch(index_blind)
 {
 case 0:
  for(int i=1;i<513;i++)
 {
  grid_levels[index_grider_selected[num_grid_player]][index_grider_step_is[num_grid_player]][i-1]=bufferSaisie[i];
  bufferSaisie[i]=0;
 }
 break;
  case 1:
  for(int i=1;i<513;i++)
 {
  grid_levels[index_grider_selected[num_grid_player]][index_grider_step_is[num_grid_player]][i-1]=bufferBlind[i];
  bufferBlind[i]=0;
 }
 break;
 }
 }
  else if(index_affect_time==1 )
 {
 switch(to_step_editing_mode[num_grid_player])
 {
 case 0:
                      for(int ty=0;ty<4;ty++)
                      {
                      if(index_type_of_time_to_affect[ty]==1)
                      {
                      grid_times[index_grider_selected[num_grid_player]][index_grider_step_is[num_grid_player]][ty]=
                      (time_minutes*60)+time_secondes+(0.01*time_centiemes);
                      }
                      }
                      gridder_prepare_cross(num_grid_player, index_grider_selected[num_grid_player], index_grider_step_is[num_grid_player]);
 break;
 case 1://step to step mode
 if(index_grider_step_is[index_grider_selected[num_grid_player]]<index_StepTo[num_grid_player])
 {
 for(int st=index_grider_step_is[num_grid_player];st<=index_StepTo[num_grid_player];st++)
 {
                       for(int ty=0;ty<4;ty++)
                      {
                      if(index_type_of_time_to_affect[ty]==1)
                      {
                      grid_times[index_grider_selected[num_grid_player]][st][ty]=
                      (time_minutes*60)+time_secondes+(0.01*time_centiemes);
                      }
                      }
 }
 }
 break;
 }
 index_affect_time=0;
 }

 index_do_dock=0;
 }
 else if(index_do_modify==1 && index_enable_edit_Grider==1)
 {
 switch(index_blind)
 {
 case 0:
  for(int i=1;i<513;i++)
 {
  if(Selected_Channel[i]==1)
  {
  grid_levels[index_grider_selected[num_grid_player]][index_grider_step_is[num_grid_player]][i-1]=bufferSaisie[i];
  bufferSaisie[i]=0;
 }
 }
 break;
  case 1:
  for(int i=1;i<513;i++)
 {
 if(Selected_Channel[i]==1)
 {
  grid_levels[index_grider_selected[num_grid_player]][index_grider_step_is[num_grid_player]][i-1]=bufferBlind[i];
  bufferBlind[i]=0;
 }
 }
 break;
 }
 index_do_modify=0;
 }

 else if(index_do_report==1 && index_enable_edit_Grider==1)
 {

 for (int u=1;u<513;u++)
 {
 if(bufferSequenciel[u] >= bufferFaders[u])
 {
  grid_levels[index_grider_selected[num_grid_player]][index_grider_step_is[num_grid_player]][u-1]
 =  bufferSequenciel[u];
 }
 if(bufferFaders[u]>bufferSequenciel[u])
 {
grid_levels[index_grider_selected[num_grid_player]][index_grider_step_is[num_grid_player]][u-1]=bufferFaders[u];
 }
 Selected_Channel[u]=0;
 }

 index_do_report=0;
 }

 else if(index_main_clear==1 && index_affect_time==0 && index_enable_edit_Grider==1 )
 {
 grid_to_clear=index_grider_selected[num_grid_player];

  switch(to_step_editing_mode[num_grid_player])
 {
 case 0:
 step_grid_to_clear=index_grider_step_is[num_grid_player];
 index_ask_confirm=1;
 index_clear_a_grid_step=1;
 break;
 case 1:
 index_ask_confirm=1;
 step_grid_to_clear=index_grider_step_is[num_grid_player];
 index_clear_a_grid_serie_step=1;
 index_for_grid_stepto=index_StepTo[num_grid_player];
 break;
 }
 }
 }
 mouse_released=1;
 }

}

 return(0);
}
コード例 #6
0
int do_logical_TheGrid_commands ( int xb, int yb, int num_grid_player)
{

//accélérometer du player
if(mouse_x>xb-5 && mouse_x<xb+127+5 && mouse_y>=yb+30 && mouse_y<=yb+30+10 )
{
if(Midi_Faders_Affectation_Type!=0)//config midi
{
attribute_midi_solo_affectation(1508+num_grid_player,Midi_Faders_Affectation_Mode);
}
else
{
 if(grid_player_slave[num_grid_player]==0)
 {
  set_mouse_range(xb-5,yb+30,xb+127+5,yb+30+10);
  grid_crossfade_speed[num_grid_player]=mouse_x-xb;
  if(grid_crossfade_speed[num_grid_player]<0){grid_crossfade_speed[num_grid_player]=0;}
  else  if(grid_crossfade_speed[num_grid_player]>127){grid_crossfade_speed[num_grid_player]=127;}
  //integration gridplayer 1 au sequenciel
  if(index_link_speed_crossfade_to_gpl1==1 && num_grid_player==0)
  {
   grid_crossfade_speed[0]=crossfade_speed;
   midi_levels[1508]=crossfade_speed;
  }
  gridder_prepare_cross(num_grid_player,index_grider_selected[num_grid_player],index_grider_step_is[num_grid_player]);
 }
}
}

////////////////SLAVE MODE////////////////////////////////////////////////////
if(mouse_x>xb+150 && mouse_x<xb+150+40 && mouse_y>yb+25 && mouse_y<yb+25+15)
{
if(mouse_released==0)
{
if(Midi_Faders_Affectation_Type!=0)//config midi
{
attribute_midi_solo_affectation(1504+num_grid_player,Midi_Faders_Affectation_Mode);
}
else
{
grid_player_slave[num_grid_player]=toggle(grid_player_slave[num_grid_player]);
}
mouse_released=1;
}
}




for(int sp=0;sp<4;sp++)
{
if( mouse_x>xb && mouse_x<xb+10 && mouse_y>yb+70+(sp*20) && mouse_y<yb+70+(sp*20)+10 )
{
if( mouse_released==0 )
{
 if( Midi_Faders_Affectation_Type!=0)
 {
 attribute_midi_solo_affectation(1512+(sp*4)+num_grid_player,Midi_Faders_Affectation_Mode);
 }
 else
 {
 switch(sp)
 {
 case 0:
 grider_goto_mode[num_grid_player]=toggle(grider_goto_mode[num_grid_player]);
 break;
 case 1:
 grider_count_mode[num_grid_player]=toggle(grider_count_mode[num_grid_player]);
 break;
 case 2:
 grider_seekto_mode[num_grid_player]=toggle(grider_seekto_mode[num_grid_player]);
 break;
 case 3:
 grider_stoplay_mode[num_grid_player]=toggle(grider_stoplay_mode[num_grid_player]);
 break;
 default:
 break;
 }
 }
 mouse_released=1;
}
}
}//fin boucle4

//Goto Grid num
if( index_enable_edit_Grider==1  && mouse_x>xb+105 && mouse_x<xb+105+30 && mouse_y>yb+70 && mouse_y<yb+70+15 )
{
 if(  mouse_released==0 )
 {
 grid_goto[index_grider_selected[num_grid_player]][index_grider_step_is[num_grid_player]][0]=atoi(numeric)-1;
 if(grid_goto[index_grider_selected[num_grid_player]][index_grider_step_is[num_grid_player]][0]<0)
 {grid_goto[index_grider_selected[num_grid_player]][index_grider_step_is[num_grid_player]][0]=-1;}//désaffectation
 if(grid_goto[index_grider_selected[num_grid_player]][index_grider_step_is[num_grid_player]][0]>127)
 {grid_goto[index_grider_selected[num_grid_player]][index_grider_step_is[num_grid_player]][0]=127;}
 reset_numeric_entry();
 mouse_released=1;
 }
}
//Goto step num
if(index_enable_edit_Grider==1  &&  mouse_x>xb+150 && mouse_x<xb+150+40 && mouse_y>yb+70 && mouse_y<yb+70+15 )
{
if( mouse_released==0)
 {
  grid_goto[index_grider_selected[num_grid_player]][index_grider_step_is[num_grid_player]][1]=atoi(numeric)-1;
 if(grid_goto[index_grider_selected[num_grid_player]][index_grider_step_is[num_grid_player]][1]<0)
 {grid_goto[index_grider_selected[num_grid_player]][index_grider_step_is[num_grid_player]][1]=-1;}//désaffectation
 if(grid_goto[index_grider_selected[num_grid_player]][index_grider_step_is[num_grid_player]][1]>1023)
 {grid_goto[index_grider_selected[num_grid_player]][index_grider_step_is[num_grid_player]][1]=1023;}
 reset_numeric_entry();
 mouse_released=1;
 }
}

//count num
if( index_enable_edit_Grider==1  && mouse_x>xb+150 && mouse_x<xb+150+40 && mouse_y>yb+90 && mouse_y<yb+90+15  )
{
if( mouse_released==0)
 {
 grid_count[index_grider_selected[num_grid_player]][index_grider_step_is[num_grid_player]]=atoi(numeric);
 if(grid_count[index_grider_selected[num_grid_player]][index_grider_step_is[num_grid_player]]<0)
 {
 grid_count[index_grider_selected[num_grid_player]][index_grider_step_is[num_grid_player]]=0;
 }
 reset_numeric_entry();
 mouse_released=1;
 }
}


//Seek step num
if( index_enable_edit_Grider==1  && mouse_x>xb+150 && mouse_x<xb+150+40 && mouse_y>yb+110 && mouse_y<yb+110+15  )
{
if( mouse_released==0)
 {
  grid_seekpos[index_grider_selected[num_grid_player]][index_grider_step_is[num_grid_player]]=atoi(numeric)-1;
 if(grid_seekpos[index_grider_selected[num_grid_player]][index_grider_step_is[num_grid_player]]<0)
 {grid_seekpos[index_grider_selected[num_grid_player]][index_grider_step_is[num_grid_player]]=-1;}//désaffectation
 if(grid_seekpos[index_grider_selected[num_grid_player]][index_grider_step_is[num_grid_player]]>1023)
 {grid_seekpos[index_grider_selected[num_grid_player]][index_grider_step_is[num_grid_player]]=1023;}
 reset_numeric_entry();
 mouse_released=1;
 }
}

//Stoplay button
if( index_enable_edit_Grider==1  && mouse_x>xb+100 && mouse_x<xb+100+90 && mouse_y>yb+130 && mouse_y<yb+130+15 && mouse_b&1 && mouse_released==0)
{
 grid_stoplay[index_grider_selected[num_grid_player]][index_grider_step_is[num_grid_player]]=toggle(grid_stoplay[index_grider_selected[num_grid_player]][index_grider_step_is[num_grid_player]]);
 mouse_released=1;
}
return(0);
}
コード例 #7
0
int do_logical_x1_x2(int x_seq,int y_seq)
{

/////////////////////////////////////CROSSFADE MANUEL/////////////////////////////

if(mouse_y>=y_seq+60 && mouse_y<=y_seq+100+255)//-20 +20
{
///////////////////X///////////////////////////////////////////////////////////
if(mouse_x> x_seq+480 && mouse_x< x_seq+480+45)
{


switch(miditable[0][491])
{
//midi report
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,"STAGE Fader is Ch: %d Pitch: %d Typ: %s" , miditable[1][491],miditable[2][491],thetypinfo);
if( Midi_Faders_Affectation_Type!=0)//config midi
{
attribute_midi_solo_affectation(491,Midi_Faders_Affectation_Mode);
mouse_released=1;
}
else
{
set_mouse_range(x_seq+480, y_seq+60, x_seq+480+45, y_seq+100+255);//pour pas deborder
index_go=0; index_go_back=0; index_pause=0;
niveauX1=(y_seq+80+255)-mouse_y;
if(niveauX1<0){niveauX1=0;}
if(niveauX1>255){niveauX1=255;}
if(midi_send_out[491]==1){index_send_midi_out[491]=1;}
if(index_x1_x2_together==1)
{
if(((255.0-ratio_X1X2_together)/255)==1.0){niveauX2=(255-niveauX1);}
else {niveauX2=remapX2[(255-niveauX1)];}
if(niveauX2<0){niveauX2=0;}
if(niveauX2>255){niveauX2=255;}
if(midi_send_out[492]==1){index_send_midi_out[492]=1;}
}
}
}

////////////////////X2////////////////////////////////////////////////////////////////
if(mouse_x> x_seq+580 && mouse_x< x_seq+580+45)
{


//midi report
switch(miditable[0][492])
{
//midi report
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,"Preset Fader is Ch: %d Pitch: %d Typ: %s" , miditable[1][492],miditable[2][492],thetypinfo);
if( Midi_Faders_Affectation_Type!=0)//config midi
{
attribute_midi_solo_affectation(492,Midi_Faders_Affectation_Mode);
mouse_released=1;
}
else
{
set_mouse_range(x_seq+580, y_seq+60, x_seq+580+45, y_seq+100+255);//pour pas deborder
index_go=0; index_go_back=0; index_pause=0;
niveauX2=(-1)*(mouse_y-(y_seq+80+255));
if(niveauX2<0){niveauX2=0;}
if(niveauX2>255){niveauX2=255;}
if(midi_send_out[492]==1){index_send_midi_out[492]=1;}
if(index_x1_x2_together==1)
{
if(((255.0-ratio_X1X2_together)/255)==1.0){niveauX1=(255-niveauX2);}
else { niveauX1=255-remapX1[niveauX2];     }
if(niveauX1<0){niveauX1=0;}
if(niveauX1>255){niveauX1=255;}
if (niveauX2==255){niveauX1=0;}//report à zero
if(midi_send_out[491]==1){index_send_midi_out[491]=1;}
}
}
}
if(niveauX1==0 && niveauX2==255)
{
index_go=0; index_go_back=0; index_pause=0;
next_mem_crossfade_finished(position_preset);
index_x1_x2_together=1;
mouse_released=1;
}
}


raccrochage_midi_logical_vertical_dmx ( x_seq+480, (y_seq+80), 491, 45, 255);//X1
raccrochage_midi_logical_vertical_dmx ( x_seq+580, (y_seq+80), 492, 45, 255);//X2 séparés car inversés pour l'affichage etc

//TOGETHER


if(mouse_x>  x_seq+535 && mouse_x<  x_seq+535+40 && mouse_y>=y_seq+80 && mouse_y<=y_seq+80+255)
{

ratio_X1X2_together=(int)((mouse_y)-(y_seq+80+255));

float fract_remplaX1=(255.0-ratio_X1X2_together)/255;
float remapis=255.0;
float fract_remplaX2=(255.0-ratio_X1X2_together)/255;
for(int mop=255;mop>=0;mop--)
{
remapis-=fract_remplaX1;
if (remapis>255){remapX1[mop]=255;}
else if(remapis<0){remapX1[mop]=0;}
else
{
remapX1[mop]=(int)(remapis);
}
}

for(int mop=0;mop<256;mop++)
{
remapis+=fract_remplaX2;
if (remapis>255){remapX2[mop]=255;}
else if(remapis<0){remapX2[mop]=0;}
else {remapX2[mop]=(int)(remapis);  }
}
}


if(mouse_x>  x_seq+540 && mouse_x<  x_seq+540+50 && mouse_y>y_seq+50 && mouse_y<y_seq+50+20)
{
if(index_x1_x2_together==0){index_x1_x2_together=1;}
else {index_x1_x2_together=0;}
mouse_released=1;
}




if(mouse_x>x_seq+540+14-20 && mouse_x<x_seq+540+14+20 && mouse_y>y_seq+80+255+40-20 && mouse_y<y_seq+80+255+40+20)
{


//midi report
 switch(miditable[0][495])
{
//midi report
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,"GO is Ch: %d Pitch: %d Typ: %s" , miditable[1][495],miditable[2][495],thetypinfo);
if(Midi_Faders_Affectation_Type!=0)//config midi
{
attribute_midi_solo_affectation(495,Midi_Faders_Affectation_Mode);
mouse_released=1;
}
else
{
do_go_function();
if(index_go==1 && index_pause==0)
{
do_send_bang();
}
mouse_released=1;
}
}


//////////////go back

if(mouse_x>x_seq+490+14-20 && mouse_x<x_seq+490+14+20 && mouse_y>y_seq+80+255+40-20 && mouse_y<y_seq+80+255+40+20)
{

//midi report
switch(miditable[0][494])
{
//midi report
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,"GO BACK is Ch: %d Pitch: %d Typ: %s" , miditable[1][494],miditable[2][494],thetypinfo);
if( Midi_Faders_Affectation_Type!=0)//config midi
{
attribute_midi_solo_affectation(494,Midi_Faders_Affectation_Mode);
mouse_released=1;
}

else
{
do_go_back_function();
int banger_back_is=Banger_Memoire[position_preset]-1;
do_go_back_bang(banger_back_is);
mouse_released=1;
}
}


//////////////double go

if(mouse_x>x_seq+590+14-20 && mouse_x<x_seq+590+14+20 && mouse_y>y_seq+80+255+40-20 && mouse_y<y_seq+80+255+40+20)
{


//midi report
switch(miditable[0][496])
{
//midi report
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,"GO BACK is Ch: %d Pitch: %d Typ: %s" , miditable[1][496],miditable[2][496],thetypinfo);
if( Midi_Faders_Affectation_Type!=0)//config midi
{
attribute_midi_solo_affectation(496,Midi_Faders_Affectation_Mode);
mouse_released=1;
}

else
{
do_double_go_function();
if(index_go==1 && index_pause==0)
{
do_send_bang();
}
mouse_released=1;
}
}

/////////////////////ACCELEROMETRE

if(mouse_x>=x_seq+490 && mouse_x<=x_seq+490+127 && mouse_y>y_seq+405 && mouse_y<y_seq+405+(45/2))
{



switch(miditable[0][493])
{
//midi report
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,"SpeedFader is Ch: %d Pitch: %d Typ: %s" , miditable[1][493],miditable[2][493],thetypinfo);

if(Midi_Faders_Affectation_Type!=0)//config midi
{
attribute_midi_solo_affectation(493,Midi_Faders_Affectation_Mode);
mouse_released=1;
}
else
{
set_mouse_range(x_seq+490, y_seq+405, x_seq+490+127, y_seq+405+(45/2));//pour pas deborder
crossfade_speed=mouse_x-(x_seq+490);
if(crossfade_speed<0){crossfade_speed=0;}
if(crossfade_speed>127){crossfade_speed=127;}
//integration gridplayer 1
if(index_link_speed_crossfade_to_gpl1==1)
{
grid_crossfade_speed[0]=crossfade_speed;
midi_levels[1508]=crossfade_speed;
gridder_prepare_cross(0,index_grider_selected[0],index_grider_step_is[0]);
}

if(midi_send_out[493]==1){index_send_midi_out[493]=1;}
prepare_crossfade();
//ventilation_temps_vers_char();//icat
someone_changed_in_time_sequences=1;//icat
}
}

//midi out des x1 et x2

if(mouse_x> x_seq+655-10 && mouse_x<  x_seq+655+10 && mouse_y>y_seq+340-10 && mouse_y<y_seq+340+10)
{

  if(midi_send_out[491]==0){midi_send_out[491]=1; }
  else if(midi_send_out[491]==1){midi_send_out[491]=0; }
  //report pour x2 et speed crossfade
  midi_send_out[492]=midi_send_out[491];
  mouse_released=1;
}


//MIDI OUT DU SPEED

if(mouse_x> x_seq+655-10 && mouse_x<  x_seq+655+10 && mouse_y>y_seq+340-10+85 && mouse_y<y_seq+340+10+85)
{
  if(midi_send_out[493]==0){midi_send_out[493]=1; }
  else if(midi_send_out[493]==1){midi_send_out[493]=0; }
  mouse_released=1;
}

raccrochage_midi_logical_horizontal ( x_seq+490, y_seq+405, 493,127,13);

//auto reset on link
if(mouse_x> x_seq+548 && mouse_x<  x_seq+548+15 && mouse_y>y_seq+435 && mouse_y<y_seq+435+15)
{
if( Midi_Faders_Affectation_Type!=0)
{
attribute_midi_solo_affectation(1591,Midi_Faders_Affectation_Mode);
}
else
{
auto_reset_crossfade_speed_on_link=toggle(auto_reset_crossfade_speed_on_link);
}
mouse_released=1;
}
return(0);
}