int echo_window(int xe, int ye) { Rect EchoBckgd(Vec2D(xe, ye), Vec2D( echo_window_x_size,echo_window_y_size)); EchoBckgd.SetRoundness(15); EchoBckgd.SetLineWidth(triple_epaisseur_ligne_fader); EchoBckgd.Draw(CouleurFond); if(window_focus_id==W_ECHO) { EchoBckgd.DrawOutline(CouleurFader); } else {EchoBckgd.DrawOutline(CouleurLigne); } neuro.Print("ECHO",xe+100,ye+30); //EDIT Rect GriderEditEnable( Vec2D((xe+610),(ye+10)),Vec2D(50,20)); GriderEditEnable.SetRoundness(5); if(index_enable_edit_echo==1) { GriderEditEnable.Draw(CouleurFader); } GriderEditEnable.DrawOutline(CouleurLigne.WithAlpha(0.5)); petitchiffre.Print("edit",xe+620 ,ye+22); neuro.Print(ol::ToString(echo_over_channel+1),xe+625 ,ye+55); char tcmp[24]; switch(dmx_view) { case 1: sprintf(tcmp,"Level %.2f - %d",echo_levels[echo_selected][0][echo_over_channel],(int)( echo_levels[echo_selected][0][echo_over_channel]*255)); break; case 0: sprintf(tcmp,"Level %.2f - %d",echo_levels[echo_selected][0][echo_over_channel],(int)( echo_levels[echo_selected][0][echo_over_channel]*100)); break; } petitchiffre.Print(tcmp,xe+500 ,ye+45); switch(dmx_view) { case 1: sprintf(tcmp,"Ground %.2f - %d",echo_levels[echo_selected][1][echo_over_channel],(int)( echo_levels[echo_selected][1][echo_over_channel]*255)); break; case 0: sprintf(tcmp,"Ground %.2f - %d",echo_levels[echo_selected][1][echo_over_channel],(int)( echo_levels[echo_selected][1][echo_over_channel]*100)); break; } petitchiffre.Print(tcmp,xe+500 ,ye+70); //sab 02/03/2014 sprintf(tcmp,""); strcpy(tcmp,""); int index_ec=0; //ECHO presets Rect EchoPreset(Vec2D(xe+10,ye+10),Vec2D(30,15)); EchoPreset.SetRoundness(4); for(int le=0;le<3;le++) { for(int cel=0;cel<8;cel++) { index_ec=cel+(le*8); EchoPreset.MoveTo(Vec2D(xe+180+(cel*40),ye+10+(le*25))); if(echo_selected==index_ec){EchoPreset.Draw(CouleurFader);} EchoPreset.DrawOutline(CouleurLigne.WithAlpha(0.5)); petitchiffre.Print(ol::ToString(index_ec+1),xe+188+(cel*40),ye+20+(le*25)); if(window_focus_id==W_ECHO && dragging_channel_in_echo==0 && mouse_x> xe+180+(40*cel) && mouse_x<xe+210+(40*cel) && mouse_y>ye+10+(le*25) && mouse_y<ye+30+(le*25)) { if( Midi_Faders_Affectation_Type!=0)//config midi { sprintf(tcmp,"Echo Preset %d",index_ec+1); show_type_midi(1663+index_ec, tcmp); EchoPreset.DrawOutline(CouleurBlind); } } } } Rect SetChannpos(Vec2D(xe+615,ye+65),Vec2D(40,20)); SetChannpos.SetRoundness(5); SetChannpos.Draw(Discrete2); SetChannpos.DrawOutline(CouleurLigne.WithAlpha(0.4)); petitchiffre.Print(ol::ToString(echo_grid_channel_position[echo_selected]+1),xe+625,ye+78); if(window_focus_id==W_ECHO && mouse_x>xe+615 && mouse_x<xe+655 && mouse_y>ye+65 && mouse_y<ye+85) { SetChannpos.DrawOutline(CouleurLigne.WithAlpha(0.7)); } //ECHO ACTION PANNEL Rect Action(Vec2D(xe+10,ye+40),Vec2D(115,20)); Action.SetRoundness(4); for (int n=0;n<5;n++) { Action.MoveTo(Vec2D(xe+10,ye+50+(n*30))); Action.DrawOutline(CouleurLigne.WithAlpha(0.5)); switch(n) { case 0: Action.Draw(CouleurFader.WithAlpha(echo_is_echo_mode[echo_selected])); petitchiffre.Print("ECHO FADER",xe+30,ye+62+(n*30)); sprintf(tcmp,"ECHO FADER"); break; case 1: petitchiffre.Print("SNAP FADER",xe+30,ye+62+(n*30)); sprintf(tcmp,"SNAP FADER"); break; case 2: Action.Draw(CouleurFader.WithAlpha(do_bounce[echo_selected])); petitchiffre.Print("BOUNCE !",xe+35,ye+62+(n*30)); sprintf(tcmp,"BOUNCE !"); break; case 3: petitchiffre.Print("SNAP-KILL-BOUNCE",xe+11,ye+62+(n*30)); sprintf(tcmp,"SNAP-KILL-BOUNCE"); break; case 4: petitchiffre.Print("GET BACK FADER",xe+15,ye+62+(n*30)); sprintf(tcmp,"GET BACK FADER"); break; default: break; } //actions if(window_focus_id==W_ECHO && dragging_channel_in_echo==0 && mouse_x>xe+30 && mouse_x<xe+145 && mouse_y>ye+50+(n*30) && mouse_y<ye+80+(n*30)) { if( Midi_Faders_Affectation_Type!=0)//config midi { show_type_midi(1686+n, tcmp); Action.DrawOutline(CouleurBlind); } } } petitchiffre.Print("FADER",xe+10,ye+218); Rect FBox(Vec2D(xe+70,ye+200),Vec2D(45,35)); FBox.SetRoundness(5); FBox.DrawOutline(CouleurLigne.WithAlpha(0.5)); neuro.Print(ol::ToString(echo_pointing_fader_num[echo_selected]),xe+80,ye+220); if(window_focus_id==W_ECHO && mouse_x>xe+70 && mouse_x<xe+115 && mouse_y>ye+200 && mouse_y<ye+235) { FBox.DrawOutline(CouleurLigne); } ////AFFECT TO DOCK Rect Affecttodock(Vec2D(xe+10,ye+245), Vec2D(110,20)); Affecttodock.SetRoundness(7.5); if(index_affect_echo_to_dock==1){Affecttodock.Draw(CouleurFader);} Affecttodock.DrawOutline(CouleurLigne.WithAlpha(0.5)); petitchiffre.Print( "Affect To Dock",(xe+20), (ye+258)); //manipulate channel params //ECHO ACTION PANNEL Rect ActionTyp(Vec2D(xe+500,ye+10),Vec2D(70,20)); ActionTyp.SetRoundness(4); switch(echo_channel_manipulate_mode[echo_selected]) { case 0: ActionTyp.Draw(Discrete8); petitchiffre.Print("CH.LEVEL",xe+507,ye+22); sprintf(tcmp,"CH.LEVEL"); break; case 1: ActionTyp.Draw(Discrete2); petitchiffre.Print("CH.GRND",xe+507,ye+22); sprintf(tcmp,"CH.GROUND"); break; } ActionTyp.DrawOutline(CouleurLigne.WithAlpha(0.5)); if(window_focus_id==W_ECHO && mouse_x>xe+500 && mouse_x<xe+570 && mouse_y>ye+10&& mouse_y<ye+30) { if( Midi_Faders_Affectation_Type!=0)//config midi { show_type_midi(1696, tcmp); ActionTyp.DrawOutline(CouleurBlind); } } Echo_Aera(xe+155,ye+95); Rect Frame(Vec2D(xe+185,ye+255),Vec2D(127,10)); float tmp_lev=0; Circle BMidiOut(xe+316,ye+255, 5); char mid_lev[8]; for (int cl=0;cl<3;cl++) { tmp_lev=echo_global_params[echo_selected][cl]; switch(cl) { case 0: sprintf(tcmp,"Gravity: %.2f",tmp_lev); break; case 1: sprintf(tcmp,"Mass: %.2f",tmp_lev); break; case 2: sprintf(tcmp,"Energy: %.2f",tmp_lev); break; default: //sab 02/03/2014 sprintf(tcmp,""); strcpy(tcmp,""); break; } sprintf(mid_lev,"%d",(int)(tmp_lev*127)); Rect LevelF(Vec2D(xe+155+(cl*180),ye+255),Vec2D(tmp_lev*127,10)); LevelF.Draw(Discrete8); Frame.MoveTo(Vec2D(xe+155+(cl*180),ye+255)); Frame.DrawOutline(CouleurLigne.WithAlpha(0.5)); petitchiffre.Print(tcmp,xe+155+(cl*180),ye+248); BMidiOut.MoveTo(Vec2D(xe+295+(cl*180),ye+265)); if(midi_send_out[1693+cl]==1) { BMidiOut.Draw(CouleurBlind); } BMidiOut.DrawOutline(CouleurGrisMoyen); petitchiffrerouge.Print(mid_lev,xe+286+(cl*180),ye+252); if(window_focus_id==W_ECHO && mouse_x>=xe+155+(cl*180) && mouse_x<=xe+285+(cl*180) && mouse_y>=ye+255 && mouse_y<=ye+265) { if( Midi_Faders_Affectation_Type!=0)//config midi { show_type_midi(1693+cl, tcmp); Frame.DrawOutline(CouleurBlind); } } } return(0); }
int Track_draw(int xp, int yp,int num_track) { //track selected Rect Btrack_sel(Vec2D(xp,yp),Vec2D(20,20)); Btrack_sel.SetRoundness(4); Btrack_sel.SetLineWidth(1); if( track_is_on[chaser_selected][num_track]==1){Btrack_sel.Draw(CouleurGreen);} Btrack_sel.DrawOutline(CouleurLigne); if(mouse_x>xp && mouse_x<xp+20 && mouse_y>yp && mouse_y<yp+20) { if( Midi_Faders_Affectation_Type!=0)//config midi { Btrack_sel.DrawOutline(CouleurBlind); } if(index_inspekt==1)//si au dessus de view, inspection { i_m_over_a_track=1;for(int pm=1;pm<513;pm++){over_track_show_channel[pm]= TrackContains[chaser_selected][num_track][pm];} } } petitchiffre.Print(ol::ToString(num_track+1),xp+5,yp+13); petitpetitchiffregris.Print(chaser_track_name[chaser_selected][num_track],xp+30,yp+22); if(TrackTypeIs[chaser_selected][num_track]==1) { char str_ty[16]; sprintf(str_ty,"Mem. %.1f",(float (TrackHasMem[chaser_selected][num_track])/10)); petitpetitchiffrerouge.Print(str_ty,xp+30,yp+32); } //master Rect track_fader(Vec2D(xp+30,yp),Vec2D(127,10)); Rect track_levelview(Vec2D(xp+30,yp),Vec2D(track_level[chaser_selected][num_track],10)); track_levelview.Draw(CouleurFader); if(mouse_x>=xp+30 && mouse_x<=xp+157 && mouse_y>yp && mouse_y<yp+10 && Midi_Faders_Affectation_Type!=0)//config midi { track_fader.DrawOutline(CouleurRed);//midi affect } else { track_fader.DrawOutline(CouleurLigne); } petitpetitchiffre.Print(ol::ToString(track_level[chaser_selected][num_track]),xp+190,yp+25); char temp_steppos[16]; sprintf(temp_steppos,"Time-Joint:B:%d E:%d R:%d", joint_begin_step[chaser_selected][num_track]+1, joint_end_step[chaser_selected][num_track]+1, count_steps_for_fades[chaser_selected][num_track]); petitpetitchiffregris.Print(temp_steppos,xp+240,yp+25); Circle BMidiOut( xp+180,yp+22, 5);//box du fader if(midi_send_out[1023+num_track]==1) { BMidiOut.Draw(CouleurBlind); } BMidiOut.DrawOutline(CouleurLigne); raccrochage_midi_visuel_horizontal_little (xp+30,yp,1023+num_track, 127, 10); //////Affichage cases for(int chcase=0;chcase<nbre_de_cases_par_track;chcase++) { Rect TCase(Vec2D(xp+170+(chcase*12),yp),Vec2D(12,12)); switch(chaser_step_operation[chaser_selected][num_track][chcase]) { case 0: TCase.Draw(CouleurLigne.WithAlpha(0.2)); break; case 1: TCase.Draw(CouleurFader); break; case 2: TCase.Draw(CouleurGreen); break; case 3: TCase.Draw(CouleurRed); break; } TCase.DrawOutline(CouleurFond); //Affichage des cases launchpad if( launchpad_chaser_mode==1) { if(num_track-position_affichage_track_num[chaser_selected]<chaser_midi_rows) { if( chcase>=chaser_step_launchpad[chaser_selected] && chcase<chaser_step_launchpad[chaser_selected]+8 ) { if(Midi_Faders_Affectation_Type!=0 )//config midi { TCase.DrawOutline(CouleurBlind); } else { TCase.DrawOutline(CouleurLigne);} } } } } return(0); }
int Interface_Trichromie(int xchroma, int ychroma, int rayon, int largeurchroma) { //background window Rect TrichroBackground(Vec2D (xchroma-158, ychroma-206 ), Vec2D ( 315,550)); TrichroBackground.SetRoundness(15); TrichroBackground.SetLineWidth(triple_epaisseur_ligne_fader); TrichroBackground.Draw(CouleurFond); if(window_focus_id==902) { TrichroBackground.DrawOutline(CouleurFader); } else { TrichroBackground.DrawOutline(CouleurLigne); } ///////////////////////////////roue de couleur/////////////////////////////////////////// /////////AFFICHEE EN OPENGL CAR PLUS RAPIDE QUE BLIT ECT//////////////////////////////// for (hcl=0; hcl<360; hcl+=0.1) { xcl = cos(hcl*PI/180.0)*(rayon+16); ycl = sin(hcl*PI/180.0)*(rayon+16); hsv_to_rgb(hcl, 1.0, 1.0, &rcl, &gcl, &bcl); Line(Vec2D(xchroma,ychroma),Vec2D(xchroma+xcl,ychroma+ycl)).Draw(Rgba(rcl,gcl,bcl)); } Circle MasqueNoir(Vec2D(xchroma,ychroma),rayon-16); MasqueNoir.Draw(CouleurFond); V3D_f v1 = { xchroma+vxd, ychroma+vyd, 0, 0., 0., makecol(0, 0, 0) // black vertex }; V3D_f v2 = { xchroma+vxw, ychroma+vyw, 0, 0., 0., makecol(255, 255, 255) // white vertex }; V3D_f v3 = { xchroma+vxh, ychroma+vyh, 0, 0., 0., makecol(r_pick, v_pick, b_pick) // color vertex }; triangle3d_f(screen, POLYTYPE_GCOL, NULL, &v1, &v2, &v3); // //AFFECTATION MIDI if(Midi_Faders_Affectation_Type!=0 && window_focus_id==W_TRICHROMY)//config midi { if(mouse_x>xchroma-140 && mouse_x<xchroma+140 && mouse_y>ychroma-140 && mouse_y<ychroma+140) { Circle Color( Vec2D(xchroma-1,ychroma), 140 ); Color.SetLineWidth(epaisseur_ligne_fader); Color.DrawOutline(CouleurBlind); } } //affichage du pointeur de hue Circle monCurseurHue( Vec2D(position_curseur_hue_x, position_curseur_hue_y), 12 ); monCurseurHue.SetLineWidth(epaisseur_ligne_fader); monCurseurHue.DrawOutline( CouleurLigne ); Circle monCurseurTriangle( Vec2D(xchroma+picker_x,ychroma+picker_y), 6 ); monCurseurTriangle.SetLineWidth(epaisseur_ligne_fader); monCurseurTriangle.DrawOutline( CouleurLigne ); /////////////////TRICHRO / QUADRI CHOOSE////////////////////////////////////// Rect ChooseTriQuadri( Vec2D(xchroma-60,(ychroma-190)),Vec2D(130,30)); ChooseTriQuadri.SetRoundness(15); ChooseTriQuadri.SetLineWidth(epaisseur_ligne_fader); if(window_focus_id==W_TRICHROMY && mouse_x>xchroma-60 && mouse_x<xchroma+80 && mouse_y>ychroma-190 && mouse_y<ychroma-160) { ChooseTriQuadri.Draw(CouleurSurvol); } ChooseTriQuadri.DrawOutline(CouleurLigne); if(index_quadri==0){petitchiffre.Print("TRICHROMY",xchroma-30, ychroma-172);} else if(index_quadri==1){petitchiffre.Print("QUADRICHROMY",xchroma-45, ychroma-172);} /////////////////////AFFECTATION ON / OFF AUX DOCKS FADERS/////////////////////////// Rect AffectTriTo( Vec2D(xchroma+20,(ychroma+300)),Vec2D(130,30)); AffectTriTo.SetRoundness(15); AffectTriTo.SetLineWidth(epaisseur_ligne_fader); if (index_affect_color_to_dock==1){AffectTriTo.Draw(CouleurFader);} AffectTriTo.DrawOutline(CouleurLigne); petitchiffre.Print("AFFECT TO DOCK",xchroma+35, ychroma+319); //PASTE ON THE FLY MODE Rect PasteTriTo( Vec2D(xchroma-150,(ychroma+300)),Vec2D(130,30)); PasteTriTo.SetRoundness(15); PasteTriTo.SetLineWidth(epaisseur_ligne_fader); if (index_paste_on_the_fly==1){PasteTriTo.Draw(CouleurBlind);} PasteTriTo.DrawOutline(CouleurLigne); petitpetitchiffre.Print("PASTE ON THE FLY",xchroma-135, ychroma+319); /////////////////////DOCKING DES COULEURS//////////////////////////////////////// //emplacement des box pour actions de storage RVB sur 6 presets Rect RedBox(Vec2D(xchroma-130,ychroma+165),Vec2D(50,20)); RedBox.SetRoundness(10); RedBox.SetLineWidth(epaisseur_ligne_fader); RedBox.Draw(Rgba::RED); RedBox.DrawOutline(CouleurLigne); Rect GreenBox(Vec2D(xchroma-65,ychroma+165),Vec2D(50,20)); GreenBox.SetRoundness(10); GreenBox.SetLineWidth(epaisseur_ligne_fader); GreenBox.Draw(Rgba::GREEN.WithAlpha(0.7)); GreenBox.DrawOutline(CouleurLigne); Rect BlueBox(Vec2D(xchroma,ychroma+165),Vec2D(50,20)); BlueBox.SetRoundness(10); BlueBox.SetLineWidth(epaisseur_ligne_fader); BlueBox.Draw(Rgba::BLUE); BlueBox.DrawOutline(CouleurLigne); Rect YellowBox(Vec2D(xchroma+65,ychroma+165),Vec2D(50,20)); YellowBox.SetRoundness(10); YellowBox.SetLineWidth(epaisseur_ligne_fader); if (index_quadri==1){YellowBox.Draw(Rgba::YELLOW);} YellowBox.DrawOutline(CouleurLigne); petitchiffre.Print(ol::ToString(my_red),xchroma-115, ychroma+179); petitchiffre.Print(ol::ToString(my_green),xchroma-55, ychroma+179); petitchiffre.Print(ol::ToString(my_blue ),xchroma+10, ychroma+179); petitchiffrerouge.Print(ol::ToString(my_yellow ),xchroma+75, ychroma+179); //midi out de la roue Circle BMidiOut( xchroma+140,ychroma+110, 10);//box du fader BMidiOut.SetLineWidth(epaisseur_ligne_fader); if(midi_send_out[497]==1) { BMidiOut.Draw(CouleurBlind); } BMidiOut.DrawOutline(CouleurLigne); raccrochage_midi_visuel_circulaire (xchroma, ychroma, 497, rayon, rayon); //liaison visuelle au fader du cercle midi out Line (Vec2D( xchroma+97,ychroma+100),Vec2D(xchroma+125,ychroma+100)).Draw(CouleurLigne); Line (Vec2D(xchroma+125,ychroma+100),Vec2D(xchroma+125+8,ychroma+106)).Draw(CouleurLigne); petitchiffre.Print("COLOR PRESETS",xchroma-65, ychroma+205); //premiere rangee de dock colors char string_allocation_col[7]; for (int dock_color=0;dock_color<4;dock_color++) { Rect DockBoxColor(Vec2D(xchroma-130+(65*dock_color),ychroma+215),Vec2D(50,20)); DockBoxColor.SetRoundness(10); DockBoxColor.SetLineWidth(epaisseur_ligne_fader); if(dock_color==dock_color_selected){DockBoxColor.Draw(CouleurFader); } sprintf(string_allocation_col,"%d / %d",(colorpreset_linked_to_dock[dock_color][0]+1),(colorpreset_linked_to_dock[dock_color][1]+1)); ////////////////////////////////////////////////////////////////////////////////// petitchiffre.Print(string_allocation_col,xchroma-120+(65*dock_color),ychroma+230); DockBoxColor.DrawOutline(CouleurLigne); if(window_focus_id==W_TRICHROMY && mouse_x>xchroma-130+(65*dock_color) && mouse_x<xchroma-80+(65*dock_color) && mouse_y>ychroma+215 && mouse_y<ychroma+235) { petitchiffre.Print(string_allocation_col,xchroma-120+(65*dock_color),ychroma+230); if( Midi_Faders_Affectation_Type!=0) {DockBoxColor.DrawOutline(CouleurBlind); } } } //deuxième rangee de dockcolors for (int dock_colortwo=0;dock_colortwo<4;dock_colortwo++) { Rect DockBoxColor2(Vec2D(xchroma-130+(65*dock_colortwo),ychroma+255),Vec2D(50,20)); DockBoxColor2.SetRoundness(10); DockBoxColor2.SetLineWidth(epaisseur_ligne_fader); if((dock_colortwo+4)==dock_color_selected){DockBoxColor2.Draw(CouleurFader); } sprintf(string_allocation_col,"%d / %d",(colorpreset_linked_to_dock[dock_colortwo+4][0]+1),(colorpreset_linked_to_dock[dock_colortwo+4][1]+1)); petitchiffre.Print(string_allocation_col,xchroma-120+(65*dock_colortwo),ychroma+270); DockBoxColor2.DrawOutline(CouleurLigne); if(window_focus_id==W_TRICHROMY && mouse_x>xchroma-130+(65*dock_colortwo) && mouse_x<xchroma-80+(65*dock_colortwo) && mouse_y>ychroma+255 && mouse_y<ychroma+275) { petitchiffre.Print(string_allocation_col,xchroma-120+(65*dock_colortwo),ychroma+270); if(Midi_Faders_Affectation_Type!=0) {DockBoxColor2.DrawOutline(CouleurBlind); } } } return(0); }