MasterUI.fl (59562B)
1 # data file for the Fltk User Interface Designer (fluid) 2 version 1.0302 3 header_name {.h} 4 code_name {.cc} 5 decl {//Copyright (c) 2002-2009 Nasca Octavian Paul - (c) 2009-2023 Mark McCurry} {private local 6 } 7 8 decl {//License: GNU GPL version 2 or later} {private local 9 } 10 11 decl {\#include <stdlib.h>} {public local 12 } 13 14 decl {\#include <stdio.h>} {public local 15 } 16 17 decl {\#include <string.h>} {public local 18 } 19 20 decl {\#if ! defined(PLUGINVERSION) && HAS_X11 21 \#include "zynaddsubfx.xpm" 22 \#endif} {private local 23 } 24 25 decl {\#include "WidgetPDial.h"} {public local 26 } 27 28 decl {\#include "ADnoteUI.h"} {public local 29 } 30 31 decl {\#include "SUBnoteUI.h"} {public local 32 } 33 34 decl {\#include "EffUI.h"} {public local 35 } 36 37 decl {\#include "VirKeyboard.h"} {public local 38 } 39 40 decl {\#include "ConfigUI.h"} {public local 41 } 42 43 decl {\#include "BankUI.h"} {public local 44 } 45 46 decl {\#include "PartUI.h"} {public local 47 } 48 49 decl {\#include "MicrotonalUI.h"} {public local 50 } 51 52 decl {\#include "PresetsUI.h"} {public local 53 } 54 55 decl {\#include "NioUI.h"} {public global 56 } 57 58 decl {\#include "VuPartMeter.h"} {public local 59 } 60 61 decl {\#include "Fl_Osc_Dial.H"} {private local 62 } 63 64 decl {\#include "Osc_DataModel.h"} {private local 65 } 66 67 decl {\#include "Fl_Osc_TSlider.H"} {private local 68 } 69 70 decl {\#include "VuMasterMeter.h"} {public local 71 } 72 73 decl {\#include "PartNameButton.h"} {public local 74 } 75 76 decl {\#include "common.H"} {public local 77 } 78 79 decl {\#if USE_NSM 80 \#include "NSM.H" 81 extern NSM_Client *nsm; 82 \#endif} {public local 83 } 84 85 decl {\#if !defined(PLUGINVERSION) && defined(NTK_GUI) 86 \#include <X11/xpm.h> 87 \#endif} {public local 88 } 89 90 decl {\#if !defined(PLUGINVERSION) && HAS_X11 91 \#include <FL/Fl_RGB_Image.H> 92 \#endif} {private local 93 } 94 95 decl {\#if !defined(PLUGINVERSION) && HAS_X11 96 \#include <FL/Fl.H> 97 \#endif} {private local 98 } 99 100 decl {\#if !defined(PLUGINVERSION) && HAS_X11 101 \#include <FL/Enumerations.H> 102 \#endif} {private local 103 } 104 105 decl {\#if !defined(PLUGINVERSION) && HAS_X11 106 \#include <FL/Fl_Pixmap.H> 107 \#endif} {private local 108 } 109 110 decl {\#include "../globals.h"} {public local 111 } 112 113 class SysEffSend {: {public Fl_Osc_Dial} 114 } { 115 Function {SysEffSend(int x,int y, int w, int h, const char *label=0):Fl_Osc_Dial(x,y,w,h,label)} {} { 116 code {} {} 117 } 118 Function {init(int neff1,int neff2)} {} { 119 code {//TODO figure out if this extra class is even needed 120 minimum(0); 121 maximum(127); 122 step(1); 123 labelfont(1); 124 labelsize(10); 125 align(FL_ALIGN_TOP); 126 127 Fl_Osc_Dial::init("part"+to_s(neff1)+"/sysefxsend"+to_s(neff2)); 128 char tmp[25];snprintf(tmp,25,"%d->%d",neff1+1,neff2+1); 129 this->copy_label(tmp);} {} 130 } 131 Function {~SysEffSend()} {} { 132 code {hide();} {} 133 } 134 } 135 136 class Panellistitem {open : {public Fl_Osc_Group} 137 } { 138 Function {make_window()} {open private 139 } { 140 Fl_Window panellistitem {open 141 private xywh {632 715 100 260} type Double box NO_BOX 142 class Fl_Group visible 143 } { 144 Fl_Group panellistitemgroup {open 145 private xywh {0 20 70 240} box UP_FRAME 146 code0 {/*if (master->part[npart]->Penabled==0) o->deactivate();*/} 147 code1 {set_module_parameters( o );} 148 } { 149 Fl_Group {} {open 150 xywh {45 65 15 110} box ENGRAVED_FRAME 151 } { 152 Fl_Box partvu { 153 label {V U} 154 xywh {45 65 15 110} box FLAT_BOX color 0 selection_color 75 labelcolor 55 align 128 155 class VuPartMeter 156 } 157 } 158 Fl_Button partname { 159 label { } 160 callback {if ((int)bankui->cbwig->value()!=(npart+1)){ 161 bankui->cbwig->value(npart+1); 162 bankui->cbwig->do_callback(); 163 }; 164 bankui->show();} 165 xywh {5 27 60 30} box THIN_DOWN_BOX down_box FLAT_BOX labelfont 1 labelsize 10 align 208 166 code0 {o->ext = "Pname";o->oscRegister("Pname");} 167 class PartNameButton 168 } 169 Fl_Slider partvolume { 170 xywh {10 65 30 110} type {Vert Knob} box NO_BOX minimum 127 maximum 0 step 1 value 127 171 code0 {o->init("Pvolume", 'i');o->reset_value=96;} 172 class Fl_Osc_TSlider 173 } 174 Fl_Dial partpanning { 175 xywh {20 180 30 30} maximum 127 step 1 176 code0 {o->init("Ppanning");o->reset_value=64;} 177 class Fl_Osc_Dial 178 } 179 Fl_Button {} { 180 label edit 181 callback {if ((int)bankui->cbwig->value()!=(npart+1)){ 182 bankui->cbwig->value(npart+1); 183 bankui->cbwig->do_callback(); 184 } 185 if (Fl::event_shift()) 186 partui->instrumenteditwindow->show(); 187 else if (Fl::event_ctrl()) 188 partui->instrumentkitlist->show(); 189 } 190 xywh {15 235 40 20} labelsize 10 191 } 192 Fl_Choice partrcv { 193 tooltip {receive from Midi channel} xywh {10 213 50 15} down_box BORDER_BOX labelsize 10 align 5 textfont 1 textsize 10 194 code0 {char nrstr[10]; for(int i=0;i<NUM_MIDI_CHANNELS;i++){sprintf(nrstr,"Ch%d",i+1);if (i!=9) o->add(nrstr); else o->add("Dr10");};} 195 code1 {o->init("Prcvchn");} 196 class Fl_Osc_Choice 197 } {} 198 } 199 Fl_Check_Button partenabled { 200 label 01 201 callback { 202 if ((int) o->value()==0) panellistitemgroup->deactivate(); 203 else { 204 panellistitemgroup->activate(); 205 }; 206 207 o->redraw();} 208 private xywh {5 0 45 20} down_box DOWN_BOX labeltype EMBOSSED_LABEL labelfont 1 labelsize 13 align 24 209 code0 {char tmp[12];snprintf(tmp,12,"%d",npart+1);o->copy_label(tmp);} 210 code1 {o->init("Penabled");} 211 class Fl_Osc_Check 212 } 213 } 214 } 215 Function {Panellistitem(int x,int y, int w, int h, const char *label=0):Fl_Osc_Group(x,y,w,h,label)} {} { 216 code {npart=0; 217 bankui=NULL;} {} 218 } 219 Function {init(int npart_,BankUI *bankui_, PartUI *partui_)} {} { 220 code {npart=npart_; 221 bankui=bankui_; 222 partui=partui_; 223 ext = "part"+to_s(npart)+"/"; 224 225 make_window(); 226 panellistitem->show(); 227 end();} {} 228 } 229 Function {refresh()} {} { 230 code { 231 partenabled->update(); 232 partrcv->update(); 233 partpanning->update(); 234 partvolume->update(); 235 partname->update(); 236 237 if ((int)bankui->cbwig->value()!=(npart+1)) 238 panellistitemgroup->color(fl_rgb_color(160,160,160)); 239 else 240 panellistitemgroup->color(fl_rgb_color(50,190,240)); 241 242 panellistitemgroup->redraw();} {} 243 } 244 Function {~Panellistitem()} {} { 245 code {} {} 246 } 247 decl {int npart;} {private local 248 } 249 decl {BankUI *bankui;} {private local 250 } 251 decl {PartUI *partui;} {private local 252 } 253 } 254 255 class MasterUI {open 256 } { 257 Function {make_window()} {open 258 } { 259 Fl_Window masterwindow { 260 label zynaddsubfx 261 callback {if ((isPlugin 262 \#if USE_NSM 263 || (nsm && nsm->is_active()) 264 \#endif 265 || fl_choice("Exit and leave the unsaved data?","No","Yes",NULL))) { 266 close(); 267 };} open 268 xywh {330 365 390 525} type Double xclass zynaddsubfx visible 269 class Fl_Osc_Window 270 } { 271 Fl_Box dummy_again { 272 xywh {25 25 25 25} 273 code0 {masterwindow->init(osc, "");} 274 } 275 276 Fl_Group win_root {open 277 xywh {0 0 390 525} 278 class Fl_Osc_Group 279 } { 280 Fl_Menu_Bar mastermenu { 281 xywh {0 0 390 25} 282 } { 283 Submenu {} { 284 label {&File} 285 xywh {5 5 100 20} 286 } { 287 MenuItem {} { 288 label {&New (erase all)...} 289 callback {do_new_master();} 290 xywh {25 25 100 20} 291 } 292 MenuItem {} { 293 label {&Revert changes...} 294 callback {do_revert_changes();} 295 xywh {25 25 100 20} 296 } 297 MenuItem {} { 298 label {&Open Parameters...} 299 callback {\#if USE_NSM 300 if ( nsm && nsm->is_active() ) 301 { 302 do_load_master(); 303 do_save_master( nsm->project_filename ); 304 } 305 else 306 \#endif 307 { 308 do_load_master(); 309 }} 310 xywh {25 25 100 20} 311 } 312 MenuItem {} { 313 label {&Save All Parameters...} 314 callback {\#if USE_NSM 315 if ( nsm && nsm->is_active() ) 316 { 317 do_save_master( nsm->project_filename ); 318 } 319 else 320 \#endif 321 { 322 do_save_master(); 323 }} 324 xywh {15 15 100 20} divider 325 } 326 MenuItem {} { 327 label {&Load Midi Learn...} 328 callback {char *filename; 329 filename=fl_file_chooser("Open:","({*.xlz})",NULL,0); 330 if (filename==NULL) return; 331 332 osc->write("/load_xlz", "s", filename);} 333 xywh {40 40 100 20} 334 } 335 MenuItem {} { 336 label {Clear Midi Learn...} 337 callback {osc->write("/clear_xlz", "");} 338 xywh {40 40 100 20} 339 } 340 MenuItem {} { 341 label {Save Midi Learn...} 342 callback {char *filename; 343 int result; 344 filename=fl_file_chooser("Save:","({*.xlz})",NULL,0); 345 if (filename==NULL) return; 346 filename=fl_filename_setext(filename,".xlz"); 347 348 result=fileexists(filename); 349 if (result) { 350 result=0; 351 if (!fl_choice("The file exists. \\nOverwrite it?","No","Yes",NULL)) return; 352 }; 353 354 osc->write("/save_xlz", "s", filename);} 355 xywh {30 30 100 20} divider 356 } 357 MenuItem {} { 358 label {&Load Scale Settings...} 359 callback {char *filename; 360 filename=fl_file_chooser("Open:","({*.xsz})",NULL,0); 361 if (filename==NULL) return; 362 363 osc->write("/load_xsz", "s", filename); 364 } 365 xywh {40 40 100 20} 366 } 367 MenuItem {} { 368 label {Save Sc&ale Settings ..} 369 callback {char *filename; 370 int result=0; 371 372 filename=fl_file_chooser("Save:","({*.xsz})",NULL,0); 373 if (filename==NULL) return; 374 filename=fl_filename_setext(filename,".xsz"); 375 376 result=fileexists(filename); 377 if (result) { 378 result=0; 379 if (!fl_choice("The file exists. \\nOverwrite it?","No","Yes",NULL)) return; 380 381 }; 382 383 384 osc->write("/save_xsz", "s", filename); } 385 xywh {30 30 100 20} 386 } 387 MenuItem {} { 388 label {Show Scale Settings...} 389 callback {microtonalui->show();} 390 xywh {5 5 100 20} divider 391 } 392 MenuItem {} { 393 label {&Settings...} 394 callback {configui->show();} 395 xywh {30 30 100 20} 396 } 397 MenuItem {} { 398 label {N&io Settings} 399 callback {nioui.refresh(); 400 nioui.show();} 401 xywh {5 5 36 21} divider 402 } 403 MenuItem {} { 404 label {&Copyright...} 405 callback {aboutwindow->show();} 406 xywh {20 20 100 20} divider 407 } 408 MenuItem {} { 409 label {E&xit} 410 callback {masterwindow->do_callback();} 411 xywh {15 15 100 20} 412 } 413 } 414 Submenu {} { 415 label {&Instrument} 416 xywh {15 15 100 20} 417 } { 418 MenuItem {} { 419 label {&Clear Instrument...} 420 callback {if (fl_choice("Clear instrument's parameters ?","No","Yes",NULL)){ 421 // int npart=(int)npartcounter->value()-1; 422 osc->write("/part"+to_s(npart)+"/clear"); 423 }; 424 425 updatepanel();} 426 xywh {40 40 100 20} 427 } 428 MenuItem {} { 429 label {&Open Instrument...} 430 callback {const char *filename; 431 filename=fl_file_chooser("Load:","({*.xiz})",NULL,0); 432 if (filename==NULL) return; 433 434 435 osc->write("/load_xiz", "is", npart, filename); 436 npartcounter->do_callback(); 437 updatepanel(); 438 439 /* 440 if (result==-10) fl_alert("Error: Could not load the file\\nbecause it is not an instrument file."); 441 else if (result<0) fl_alert("Error: Could not load the file.");*/} 442 xywh {35 35 100 20} 443 } 444 MenuItem {} { 445 label {&Save Instrument ...} 446 callback {char *filename; 447 448 filename=fl_file_chooser("Save:","({*.xiz})",NULL,0); 449 if (filename==NULL) return; 450 filename=fl_filename_setext(filename,".xiz"); 451 452 int result=fileexists(filename); 453 if (result) { 454 result=0; 455 if (!fl_choice("The file exists. \\nOverwrite it?","No","Yes",NULL)) return; 456 457 }; 458 459 osc->write("/save_xiz", "is", npart, filename); 460 /*if (result<0) fl_alert("Error: Could not save the file.");*/} 461 xywh {25 25 100 20} divider 462 } 463 MenuItem {} { 464 label {Show Instrument &Bank...} 465 callback {bankui->show();} 466 xywh {5 5 100 20} divider 467 } 468 MenuItem {} { 469 label {&Virtual Keyboard...} 470 callback {virkeyboard->show();} 471 xywh {15 15 100 20} 472 } 473 } 474 Submenu recordmenu { 475 label {&Record} 476 xywh {5 5 100 20} 477 } { 478 MenuItem {} { 479 label {&Choose WAV file...} 480 callback {char *filename; 481 recordbutton->deactivate(); 482 pausebutton->deactivate(); 483 pauselabel->deactivate(); 484 stopbutton->deactivate(); 485 filename=fl_file_chooser("Record to audio file:","(*.wav)",NULL,0); 486 if (filename==NULL) return; 487 fl_filename_setext(filename,".wav"); 488 489 //TODO TODO Test if a file exists 490 if (fl_choice("The file *might* exist. \\nOverwrite it?","No","Yes",NULL)) { 491 osc->write("/HDDRecorder/preparefile", "s", filename); 492 recordbutton->activate();//TODO make this button osc controlled 493 } 494 495 /*if (result!=0) fl_alert("Error: Could not save the file.");*/} 496 xywh {5 5 100 20} 497 } 498 } 499 Submenu {} { 500 label Misc 501 xywh {15 15 100 20} 502 } { 503 MenuItem {} { 504 label {Switch User Interface Mode} 505 callback {if (fl_choice("Switch the User Interface to Beginner mode ?","No","Yes",NULL)){ 506 masterwindow->hide(); 507 refresh_master_ui(); 508 simplemasterwindow->show(); 509 osc->write("/config/cfg.UserInterfaceMode", "i", 2); 510 };} 511 xywh {15 15 100 20} 512 } 513 } 514 } 515 Fl_Box dummy { 516 xywh {25 25 25 25} 517 code0 {win_root->osc = osc;} 518 code1 {win_root->base = "/";} 519 } 520 Fl_Dial mastervolumedial { 521 label {Master Volume} 522 tooltip {Master Volume} xywh {15 32 55 55} box ROUND_UP_BOX labelsize 9 align 130 maximum 127 step 1 523 code2 {o->init("volume"); o->selection_color(FL_RED); o->reset_value=80;} 524 class Fl_Osc_Dial 525 } 526 Fl_Counter masterkeyshiftcounter { 527 label {Master KeyShift} 528 xywh {150 97 120 23} type Simple labelsize 9 minimum -64 maximum 64 step 1 529 code0 {o->lstep(12);} 530 code1 {o->init("Pkeyshift",'i',0);} 531 class Fl_Osc_Counter 532 } 533 Fl_Button {} { 534 label {Panic!} 535 callback {virkeyboard->releaseallkeys(); 536 o->oscWrite("Panic");} 537 xywh {280 29 105 53} color 90 labelfont 1 538 class Fl_Osc_Button 539 } 540 Fl_Group partuigroup {open 541 xywh {0 310 390 205} 542 } { 543 Fl_Group partui {open 544 xywh {0 310 383 175} 545 code0 {o->init("/part0/", 0,bankui,"/part0/", osc);} 546 code1 {o->show();} 547 class PartUI 548 } {} 549 } 550 Fl_Tabs {} {open 551 xywh {0 145 390 165} box UP_FRAME 552 } { 553 Fl_Group {} { 554 label {System Effects} open 555 xywh {0 162 390 145} labelsize 15 align 9 556 } { 557 Fl_Counter syseffnocounter { 558 label {Sys.Effect No.} 559 callback {nsyseff=(int) o->value()-1; 560 syseffectuigroup->reext("sysefx"+to_s(nsyseff)+"/"); 561 sysefftype->oscMove("sysefx"+to_s(nsyseff)+"/efftype"); 562 syseffectui->refresh();} 563 xywh {5 181 80 22} type Simple labelfont 1 labelsize 10 align 1 minimum 0 maximum 127 step 1 value 1 textfont 1 564 code0 {o->bounds(1,NUM_SYS_EFX);} 565 code1 {o->value(nsyseff+1);} 566 } 567 Fl_Choice sysefftype { 568 label EffType 569 callback {syseffectui->efftype = o->value(); 570 syseffectui->refresh();} 571 xywh {285 176 100 22} down_box BORDER_BOX labelsize 10 572 code0 {o->init("sysefx"+to_s(nsyseff)+"/efftype");} 573 class Fl_Osc_Choice 574 } { 575 MenuItem {} { 576 label {No Effect} 577 xywh {15 15 100 20} labelfont 1 labelsize 10 578 } 579 MenuItem {} { 580 label Reverb 581 xywh {25 25 100 20} labelfont 1 labelsize 10 582 } 583 MenuItem {} { 584 label Echo 585 xywh {35 35 100 20} labelfont 1 labelsize 10 586 } 587 MenuItem {} { 588 label Chorus 589 xywh {45 45 100 20} labelfont 1 labelsize 10 590 } 591 MenuItem {} { 592 label Phaser 593 xywh {55 55 100 20} labelfont 1 labelsize 10 594 } 595 MenuItem {} { 596 label AlienWah 597 xywh {65 65 100 20} labelfont 1 labelsize 10 598 } 599 MenuItem {} { 600 label Distortion 601 xywh {75 75 100 20} labelfont 1 labelsize 10 602 } 603 MenuItem {} { 604 label EQ 605 xywh {85 85 100 20} labelfont 1 labelsize 10 606 } 607 MenuItem {} { 608 label DynFilter 609 xywh {95 95 100 20} labelfont 1 labelsize 10 610 } 611 MenuItem {} { 612 label Sympathetic 613 xywh {105 105 100 20} labelfont 1 labelsize 10 614 } 615 } 616 Fl_Group syseffectuigroup { 617 xywh {5 203 380 95} color 48 618 class Fl_Osc_Group 619 } { 620 Fl_Box {} { 621 xywh {5 203 0 0} 622 code0 {syseffectuigroup->ext = "sysefx0/";} 623 } 624 Fl_Group syseffectui { 625 xywh {5 203 380 95} 626 code0 {o->init(false);} 627 class EffUI 628 } {} 629 } 630 Fl_Button {} { 631 label {Send to...} 632 callback {syseffsendwindow->show();} 633 xywh {90 181 85 22} box THIN_UP_BOX labelfont 1 labelsize 11 634 } 635 Fl_Button {} { 636 label C 637 callback {presetsui->copy("/sysefx"+to_s(nsyseff)+"/");} 638 xywh {180 187 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55 639 } 640 Fl_Button {} { 641 label P 642 callback { presetsui->paste("/sysefx"+to_s(nsyseff)+"/",syseffectui);} selected 643 xywh {210 187 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55 644 } 645 } 646 Fl_Group {} { 647 label {Insertion Effects} open 648 xywh {0 165 390 145} labelsize 15 align 9 hide 649 } { 650 Fl_Counter inseffnocounter { 651 label {Ins.Effect No.} 652 callback {ninseff=(int) o->value()-1; 653 insefftype->oscMove("insefx"+to_s(ninseff)+"/efftype"); 654 inseffectuigroup->reext("insefx"+to_s(ninseff)+"/"); 655 inseffpart->oscMove("Pinsparts"+to_s(ninseff)); 656 657 /* 658 insefftype->value(master->insefx[ninseff]->geteffect()); 659 inseffpart->value(master->Pinsparts[ninseff]+2); 660 inseffectui->refresh(); 661 662 if (master->Pinsparts[ninseff]!=-1) { 663 insefftype->activate(); 664 inseffectui->activate(); 665 inseffectuigroup->activate(); 666 } else { 667 insefftype->deactivate(); 668 inseffectui->deactivate(); 669 inseffectuigroup->deactivate(); 670 };*/} 671 xywh {5 183 80 22} type Simple labelfont 1 labelsize 10 align 1 minimum 0 maximum 127 step 1 value 1 textfont 1 672 code0 {o->bounds(1,NUM_INS_EFX);} 673 code1 {o->value(ninseff+1);} 674 } 675 Fl_Choice insefftype { 676 label EffType 677 callback {/*pthread_mutex_lock(&master->mutex); 678 master->insefx[ninseff]->changeeffect((int) o->value()); 679 pthread_mutex_unlock(&master->mutex);*/ 680 inseffectui->efftype = o->value(); 681 inseffectui->refresh(); 682 inseffectui->show();} 683 xywh {285 173 100 22} down_box BORDER_BOX labelsize 10 684 code0 {/*o->value(master->insefx[ninseff]->geteffect());*/} 685 code1 {/*if (master->Pinsparts[ninseff]== -1) o->deactivate();*/} 686 code2 {o->init("insefx"+to_s(ninseff)+"/efftype");} 687 class Fl_Osc_Choice 688 } { 689 MenuItem {} { 690 label {No Effect} 691 xywh {30 30 100 20} labelfont 1 labelsize 10 692 } 693 MenuItem {} { 694 label Reverb 695 xywh {40 40 100 20} labelfont 1 labelsize 10 696 } 697 MenuItem {} { 698 label Echo 699 xywh {50 50 100 20} labelfont 1 labelsize 10 700 } 701 MenuItem {} { 702 label Chorus 703 xywh {60 60 100 20} labelfont 1 labelsize 10 704 } 705 MenuItem {} { 706 label Phaser 707 xywh {65 65 100 20} labelfont 1 labelsize 10 708 } 709 MenuItem {} { 710 label AlienWah 711 xywh {75 75 100 20} labelfont 1 labelsize 10 712 } 713 MenuItem {} { 714 label Distortion 715 xywh {85 85 100 20} labelfont 1 labelsize 10 716 } 717 MenuItem {} { 718 label EQ 719 xywh {95 95 100 20} labelfont 1 labelsize 10 720 } 721 MenuItem {} { 722 label DynFilter 723 xywh {105 105 100 20} labelfont 1 labelsize 10 724 } 725 MenuItem {} { 726 label Sympathetic 727 xywh {115 115 100 20} labelfont 1 labelsize 10 728 } 729 } 730 Fl_Group inseffectuigroup {open 731 xywh {5 205 380 95} box FLAT_BOX color 48 732 class Fl_Osc_Group 733 } { 734 Fl_Box {} { 735 xywh {5 205 0 0} 736 code0 {inseffectuigroup->ext = "insefx0/";} 737 } 738 Fl_Group inseffectui { 739 xywh {5 205 380 90} box UP_FRAME 740 code0 {o->init(true);} 741 class EffUI 742 } {} 743 } 744 Fl_Choice inseffpart { 745 label {Insert To.} 746 callback {/*master->Pinsparts[ninseff]=(int) o->value()-2;*/ 747 if ((int) o->value()==1){ 748 inseffectuigroup->deactivate(); 749 insefftype->deactivate(); 750 inseffectui->deactivate(); 751 } else { 752 inseffectuigroup->activate(); 753 insefftype->activate(); 754 inseffectui->activate(); 755 }; 756 /*master->insefx[ninseff]->cleanup();*/} open 757 xywh {95 183 80 22} down_box BORDER_BOX labelfont 1 labelsize 10 align 5 textsize 10 758 code0 {o->add("Master Out");o->add("Off");} 759 code1 {char tmp[50]; for (int i=0;i<NUM_MIDI_PARTS;i++) {sprintf(tmp,"Part %2d",i+1);o->add(tmp);};} 760 code3 {o->init("Pinsparts"+to_s(ninseff),-2);} 761 class Fl_Osc_Choice 762 } {} 763 Fl_Button {} { 764 label C 765 callback {presetsui->copy(inseffectuigroup->loc());} 766 xywh {180 185 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55 767 } 768 Fl_Button {} { 769 label P 770 callback {presetsui->paste(inseffectuigroup->loc(),inseffectui);} 771 xywh {210 185 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55 772 } 773 } 774 } 775 Fl_Button {} { 776 label Scales 777 callback {microtonalui->show();} 778 xywh {320 87 65 23} color 51 labelfont 1 779 } 780 Fl_Group {} { 781 xywh {150 40 117 45} box UP_FRAME 782 } { 783 Fl_Button recordbutton { 784 label {Rec.} 785 callback {o->deactivate(); 786 recordmenu->deactivate(); 787 recordmenu->label("&Record(*)"); 788 stopbutton->activate(); 789 pausebutton->activate(); 790 pauselabel->activate(); 791 o->oscWrite("HDDRecorder/start"); 792 o->oscWrite("reset-vu"); 793 mastermenu->redraw();} 794 tooltip {Start Recording} xywh {159 46 21 21} box ROUND_UP_BOX color 88 labelfont 1 labelsize 10 align 2 deactivate 795 class Fl_Osc_Button 796 } 797 Fl_Button stopbutton { 798 label Stop 799 callback {o->deactivate(); 800 o->oscWrite("HDDRecorder/stop"); 801 recordbutton->deactivate(); 802 pausebutton->deactivate(); 803 pauselabel->deactivate(); 804 recordmenu->activate(); 805 recordmenu->label("&Record"); 806 mastermenu->redraw();} 807 tooltip {Stop Recording and close the audio file} xywh {237 46 21 21} box THIN_UP_BOX color 4 labelfont 1 labelsize 10 align 2 deactivate 808 class Fl_Osc_Button 809 } 810 Fl_Button pausebutton { 811 label {| |} 812 callback {o->deactivate(); 813 o->oscWrite("HDDRecorder/pause"); 814 recordbutton->activate(); 815 mastermenu->redraw();} 816 tooltip {Pause Recording} xywh {198 46 21 21} box THIN_UP_BOX color 4 selection_color 4 labelfont 1 labelcolor 3 align 16 deactivate 817 class Fl_Osc_Button 818 } 819 Fl_Box pauselabel { 820 label Pause 821 xywh {192 66 30 15} labelfont 1 labelsize 10 deactivate 822 } 823 } 824 Fl_Group {} { 825 xywh {1 490 389 55} 826 } { 827 Fl_Box mastervu { 828 label {VU-Meter} 829 xywh {5 490 380 30} box FLAT_BOX color 48 selection_color 75 830 code0 {o->init(osc);} 831 class VuMasterMeter 832 } 833 } 834 Fl_Check_Button nrpnbutton { 835 label NRPN 836 tooltip {Receive NRPNs} xywh {10 115 60 25} down_box DOWN_BOX labelsize 12 837 code0 {o->init("ctl/NRPN.receive");} 838 class Fl_Osc_Check 839 } 840 Fl_Counter npartcounter { 841 callback {int nval=(int) o->value()-1; 842 /*partuigroup->remove(partui); 843 delete partui; 844 partui=new PartUI(0,0,765,525); 845 partuigroup->add(partui); 846 char buffer[1024]; 847 snprintf(buffer, 1024, "/part%d/", nval); 848 partui->init(master->part[nval], buffer, master, nval, bankui, "/part"+to_s(nval)+"/", osc); 849 partui->redraw(); 850 o->redraw(); 851 */ 852 npart=nval; 853 partui->rebase("/part"+to_s(npart)+"/"); 854 855 updatepanel(); 856 simplenpartcounter->value(nval+1); 857 simplenpartcounter->do_callback();} 858 tooltip {The part number} xywh {5 312 50 18} type Simple labelfont 1 minimum 0 maximum 127 step 1 value 1 textfont 1 859 code0 {o->bounds(1,NUM_MIDI_PARTS);} 860 code1 {bankui->init(o);} 861 } 862 Fl_Button {} { 863 label vK 864 callback {virkeyboard->show();} 865 tooltip {Virtual Keyboard} xywh {280 87 40 23} color 51 labelfont 1 866 } 867 Fl_Group {} { 868 xywh {85 32 55 110} box UP_FRAME 869 } { 870 Fl_Button {} { 871 label Reset 872 callback {globalfinedetuneslider->value(64.0); 873 globalfinedetuneslider->do_callback();} 874 tooltip {Master fine detune reset} xywh {90 37 45 23} box THIN_UP_BOX labelsize 10 875 } 876 Fl_Dial globalfinedetuneslider { 877 label {Fine Detune} 878 tooltip {global fine detune} xywh {90 68 45 45} box ROUND_UP_BOX labelsize 9 align 130 maximum 127 step 1 value 64 879 code0 {o->init("microtonal/Pglobalfinedetune");o->reset_value=64;} 880 class Fl_Osc_Dial 881 } 882 } 883 Fl_Button {} { 884 label {Panel Window} 885 callback {updatepanel(); 886 panelwindow->show();} 887 tooltip {Panel Window} xywh {280 112 105 23} color 51 labelfont 1 labelsize 10 888 } 889 Fl_Button sm_indicator1 { 890 label SM 891 xywh {350 5 35 15} box ROUNDED_BOX down_box ROUNDED_BOX color 45 selection_color 93 labelfont 3 labelcolor 39 deactivate 892 } 893 } 894 } 895 Fl_Window aboutwindow { 896 label {Copyright...} 897 xywh {411 344 365 280} type Double hide 898 } { 899 Fl_Box {} { 900 label {Copyright (c) 2002-2009 Nasca O. PAUL, 2009-2023 Mark McCurry, and others. Please read AUTHORS.txt} 901 xywh {15 35 335 55} labeltype EMBOSSED_LABEL labelsize 15 align 208 902 } 903 Fl_Box {} { 904 label {This is free software; you may redistribute it and/or modify it under the terms of the 905 version 2 (or any later version) of the GNU General Public License as published by the Free Software Foundation. 906 This program comes with 907 ABSOLUTELY NO WARRANTY. 908 See the version 2 (or any later version) of the 909 GNU General Public License for details.} 910 xywh {15 90 335 145} labelfont 1 labelsize 11 align 144 911 } 912 Fl_Button {} { 913 label {Close this window} 914 callback {aboutwindow->hide();} 915 xywh {80 245 190 25} box THIN_UP_BOX labelsize 11 916 } 917 Fl_Box {} { 918 label ZynAddSubFX 919 xywh {15 5 335 30} labeltype EMBOSSED_LABEL labelfont 1 labelsize 20 align 16 920 } 921 } 922 Fl_Window syseffsendwindow { 923 label {System Effects Send} 924 xywh {171 234 120 250} type Double hide resizable 925 class Fl_Osc_Window 926 } { 927 Fl_Box {} { 928 xywh {0 0 0 0} 929 code0 {syseffsendwindow->init(osc,"");} 930 } 931 Fl_Scroll syseffscroll {open 932 xywh {0 45 120 170} box FLAT_BOX resizable 933 code0 {syseffsendwindow->begin();for (int neff1=0;neff1<NUM_SYS_EFX;neff1++) for (int neff2=neff1+1;neff2<NUM_SYS_EFX;neff2++)} 934 code1 {{syseffsend[neff1][neff2]=new Fl_Osc_Dial(o->x()+(neff2-1)*35,o->y()+15+neff1*50,30,30);syseffsend[neff1][neff2]->label(strdup((to_s(neff1) + "->" + to_s(neff2)).c_str()));syseffsend[neff1][neff2]->init("/sysefxfrom"+to_s(neff1)+"/to"+to_s(neff2));};syseffsendwindow->end();} 935 } {} 936 Fl_Button {} { 937 label Close 938 callback {syseffsendwindow->hide();} 939 xywh {25 220 80 25} box THIN_UP_BOX 940 } 941 Fl_Box {} { 942 label {Send system effect's output to other system effects} 943 xywh {5 5 110 35} labelsize 10 align 192 944 } 945 } 946 Fl_Window panelwindow { 947 label {ZynAddSubFX Panel} open 948 xywh {615 247 630 635} type Double 949 class Fl_Osc_Window visible 950 } { 951 Fl_Box {} { 952 xywh {0 0 0 0} 953 code0 {panelwindow->init(osc,"/");} 954 } 955 Fl_Scroll {} {open 956 xywh {0 5 570 310} type HORIZONTAL box THIN_UP_BOX 957 } { 958 Fl_Pack {} {open 959 xywh {5 10 560 285} type HORIZONTAL 960 code0 {for (int i=0;i<NUM_MIDI_PARTS/2;i++){panellistitem[i]=new Panellistitem(0,0,70,260,"");panellistitem[i]->init(i,bankui,partui);}} 961 } {} 962 } 963 Fl_Scroll {} {open 964 xywh {0 320 570 310} type HORIZONTAL box THIN_UP_BOX 965 } { 966 Fl_Pack {} {open 967 xywh {5 325 560 285} type HORIZONTAL 968 code0 {for (int i=NUM_MIDI_PARTS/2;i<NUM_MIDI_PARTS;i++){panellistitem[i]=new Panellistitem(0,0,70,260,"");panellistitem[i]->init(i,bankui,partui);}} 969 } {} 970 } 971 Fl_Button {} { 972 label Close 973 callback {panelwindow->hide(); 974 updatepanel();} 975 xywh {575 605 50 25} box THIN_UP_BOX labelsize 13 976 } 977 Fl_Button {} { 978 label Refresh 979 callback {updatepanel();} 980 xywh {575 570 55 25} box THIN_UP_BOX labelsize 13 981 } 982 } 983 Fl_Window simplemasterwindow { 984 label ZynAddSubFX 985 callback { 986 if (isPlugin || fl_choice("Exit and leave the unsaved data?","No","Yes",NULL)) 987 { 988 *exitprogram=1; 989 };} open 990 xywh {655 378 600 335} type Double 991 class Fl_Osc_Window visible 992 } { 993 Fl_Box {} { 994 xywh {0 0 0 0} 995 code0 {simplemasterwindow->init(osc, "/");} 996 } 997 Fl_Menu_Bar simplemastermenu { 998 xywh {0 0 600 25} 999 } { 1000 Submenu {} { 1001 label {&File} 1002 xywh {10 10 100 20} 1003 } { 1004 MenuItem {} { 1005 label {&New (erase all)...} 1006 callback {do_new_master();} 1007 xywh {30 30 100 20} 1008 } 1009 MenuItem {} { 1010 label {&Revert changes...} 1011 callback {do_revert_changes();} 1012 xywh {30 30 100 20} 1013 } 1014 MenuItem {} { 1015 label {&Open Parameters...} 1016 callback {do_load_master();} 1017 xywh {30 30 100 20} 1018 } 1019 MenuItem {} { 1020 label {&Save All Parameters...} 1021 callback {\#if USE_NSM 1022 if ( nsm && nsm->is_active() ) 1023 { 1024 do_save_master( nsm->project_filename ); 1025 } 1026 else 1027 \#endif 1028 { 1029 do_save_master(); 1030 }} 1031 xywh {20 20 100 20} divider 1032 } 1033 MenuItem {} { 1034 label {&Settings...} 1035 callback {configui->show();} 1036 xywh {35 35 100 20} divider 1037 } 1038 MenuItem {} { 1039 label {&Copyright...} 1040 callback {aboutwindow->show();} 1041 xywh {25 25 100 20} divider 1042 } 1043 MenuItem {} { 1044 label {E&xit} 1045 callback {masterwindow->do_callback();} 1046 xywh {20 20 100 20} 1047 } 1048 } 1049 Submenu {} { 1050 label {&Instrument} 1051 xywh {20 20 100 20} 1052 } { 1053 MenuItem {} { 1054 label {&Open Instrument...} 1055 callback {const char *filename; 1056 filename=fl_file_chooser("Load:","({*.xiz})",NULL,0); 1057 if (filename==NULL) return; 1058 1059 1060 osc->write("/load_xiz", "si", filename, npart); 1061 simplenpartcounter->do_callback(); 1062 /* 1063 if (result==-10) fl_alert("Error: Could not load the file\\nbecause it is not an instrument file."); 1064 else if (result<0) fl_alert("Error: Could not load the file.");*/} 1065 xywh {40 40 100 20} 1066 } 1067 MenuItem {} { 1068 label {Show Instrument &Bank...} 1069 callback {bankui->show();} 1070 xywh {10 10 100 20} divider 1071 } 1072 } 1073 Submenu {} { 1074 label Misc 1075 xywh {0 0 100 20} 1076 } { 1077 MenuItem {} { 1078 label {Switch User Interface Mode} 1079 callback {if (fl_choice("Switch the User Interface to Advanced mode ?","No","Yes",NULL)){ 1080 simplemasterwindow->hide(); 1081 refresh_master_ui(); 1082 masterwindow->show(); 1083 osc->write("/config/cfg.UserInterfaceMode", "i", 1); 1084 };} 1085 xywh {0 0 100 20} 1086 } 1087 } 1088 } 1089 Fl_Group simplelistitemgroup { 1090 private xywh {125 65 215 145} box UP_FRAME 1091 class Fl_Osc_Group 1092 } { 1093 Fl_Box {} { 1094 xywh {125 65 0 0} 1095 code0 {simplelistitemgroup->ext = "part0/";} 1096 } 1097 Fl_Button partname { 1098 callback {if ((int)bankui->cbwig->value()!=(npart+1)){ 1099 bankui->cbwig->value(npart+1); 1100 bankui->cbwig->do_callback(); 1101 }; 1102 bankui->show();} 1103 xywh {130 72 205 18} box THIN_DOWN_BOX down_box FLAT_BOX color 50 labelfont 1 labelsize 11 align 208 1104 code0 {o->ext = "Pname";o->oscRegister("Pname");} 1105 class PartNameButton 1106 } 1107 Fl_Slider partpanning { 1108 label Pan 1109 xywh {185 95 145 15} type {Horz Knob} box NO_BOX labelsize 11 maximum 127 step 1 value 64 1110 code0 {o->init("Ppanning",'i'); o->reset_value=64;} 1111 class Fl_Osc_TSlider 1112 } 1113 Fl_Choice partrcv { 1114 label {Midi Channel Receive} 1115 callback {virkeys->releaseallkeys(0); 1116 virkeys->midich=(int) o->value();} open 1117 tooltip {receive from Midi channel} xywh {140 157 65 18} down_box BORDER_BOX labelsize 10 align 130 textfont 1 1118 code0 {char nrstr[10]; for(int i=0;i<NUM_MIDI_CHANNELS;i++){sprintf(nrstr,"Ch%d",i+1);if (i!=9) o->add(nrstr); else o->add("Dr10");};} 1119 code1 {o->init("Prcvchn");} 1120 class Fl_Osc_Choice 1121 } {} 1122 Fl_Dial partvolume { 1123 xywh {135 95 45 40} labelsize 9 maximum 127 step 1 1124 code0 {o->init("Pvolume"); o->reset_value=96;} 1125 class Fl_Osc_Dial 1126 } 1127 Fl_Box {} { 1128 label Volume 1129 xywh {130 130 55 20} labelsize 10 1130 } 1131 Fl_Check_Button simplepartportamento { 1132 label Portamento 1133 tooltip {Enable/Disable the portamento} xywh {193 127 79 23} down_box DOWN_BOX labelsize 9 1134 code0 {o->init("ctl/portamento.portamento");} 1135 class Fl_Osc_Check 1136 } 1137 Fl_Counter simpleminkcounter { 1138 label {Min.key} 1139 callback {if (simpleminkcounter->value()>simplemaxkcounter->value()) o->textcolor(FL_RED); 1140 else o->textcolor(FL_BLACK);} 1141 tooltip {Minimum key (that the part receives NoteOn messages)} xywh {210 158 40 15} type Simple labelsize 10 minimum 0 maximum 127 step 1 textsize 10 1142 code0 {o->init("Pminkey");} 1143 class Fl_Osc_Counter 1144 } 1145 Fl_Counter simplemaxkcounter { 1146 label {Max.key} 1147 callback {if (simpleminkcounter->value()>simplemaxkcounter->value()) o->textcolor(FL_RED); 1148 else o->textcolor(FL_BLACK);} 1149 tooltip {Maximum key (that the part receives NoteOn messages)} xywh {255 158 40 15} type Simple labelsize 10 minimum 0 maximum 127 step 1 textsize 10 1150 code0 {o->init("Pmaxkey");} 1151 class Fl_Osc_Counter 1152 } 1153 Fl_Button {} { 1154 label m 1155 callback {o->oscWrite("grabMinNote");} 1156 tooltip {set the minimum key to the last pressed key} xywh {230 188 15 12} box THIN_UP_BOX labelsize 10 1157 class Fl_Osc_Button 1158 } 1159 Fl_Button {} { 1160 label M 1161 callback {o->oscWrite("grabMaxNote");} 1162 tooltip {set the maximum key to the last pressed key} xywh {260 188 15 12} box THIN_UP_BOX labelsize 10 1163 class Fl_Osc_Button 1164 } 1165 Fl_Button {} { 1166 label R 1167 callback {simpleminkcounter->value(0); 1168 simpleminkcounter->do_callback(); 1169 simplemaxkcounter->value(127); 1170 simplemaxkcounter->do_callback();} 1171 tooltip {reset the minimum key to 0 and maximum key to 127} xywh {245 188 15 12} box THIN_UP_BOX labelfont 1 labelsize 10 1172 } 1173 Fl_Counter simplepartkeyshiftcounter { 1174 label KeyShift 1175 xywh {280 120 50 20} type Simple labelsize 11 minimum -64 maximum 64 step 1 1176 code0 {o->lstep(12);} 1177 code1 {o->init("Pkeyshift", 'i', 0);} 1178 class Fl_Osc_Counter 1179 } 1180 Fl_Dial simplesyseffsend { 1181 xywh {300 160 30 30} maximum 127 step 1 1182 code0 {o->alt_init("/","Psysefxvol"+to_s(nsyseff)+"/part"+to_s(npart));} 1183 class Fl_Osc_Dial 1184 } 1185 Fl_Box {} { 1186 label Effect 1187 xywh {295 190 40 15} labelsize 10 1188 } 1189 } 1190 Fl_Check_Button partenabled { 1191 label Enabled 1192 callback {if ((int) o->value()==0) simplelistitemgroup->deactivate(); 1193 else { 1194 simplelistitemgroup->activate(); 1195 if ((int)bankui->cbwig->value()!=(npart+1)){ 1196 bankui->cbwig->value(npart+1); 1197 bankui->cbwig->do_callback(); 1198 }; 1199 }; 1200 1201 o->redraw();} 1202 private xywh {250 40 85 20} down_box DOWN_BOX labeltype EMBOSSED_LABEL labelfont 1 labelsize 13 align 24 1203 code0 {//char tmp[10];snprintf(tmp,10,"%d",npart+1);o->copy_label(tmp);} 1204 code1 {o->init("part0/Penabled");} 1205 class Fl_Osc_Check 1206 } 1207 Fl_Box virkeys { 1208 label Keyboard 1209 xywh {5 215 590 80} box BORDER_BOX color 17 1210 code0 {o->init(osc, "/");} 1211 class VirKeys 1212 } 1213 Fl_Group {} { 1214 xywh {340 30 255 185} 1215 } { 1216 Fl_Tabs {} { 1217 xywh {345 35 245 175} box UP_FRAME align 18 1218 } { 1219 Fl_Group {} { 1220 label {System Effects} 1221 xywh {345 55 245 155} box UP_FRAME labelfont 1 labelsize 12 align 18 1222 } { 1223 Fl_Counter simplesyseffnocounter { 1224 label {Sys.Effect No.} 1225 callback {nsyseff=(int) o->value()-1; 1226 /*simplesysefftype->value(master->sysefx[nsyseff]->geteffect());*/ 1227 simplesyseffectui->refresh(); 1228 simplesysefftype->oscMove("sysefx"+to_s(nsyseff)+"/efftype"); 1229 simplesyseffectuigroup->reext("sysefx"+to_s(nsyseff)+"/"); 1230 simplesyseffsend->oscMove("Psysefxvol"+to_s(nsyseff)+"/part"+to_s(npart)); 1231 simplerefresh();} 1232 xywh {350 75 80 20} type Simple labelfont 1 labelsize 10 align 1 minimum 0 maximum 127 step 1 value 1 textfont 1 1233 code0 {o->bounds(1,NUM_SYS_EFX);} 1234 code1 {o->value(nsyseff+1);} 1235 } 1236 Fl_Choice simplesysefftype { 1237 label EffType 1238 callback { 1239 simplesyseffectui->efftype = o->value(); 1240 simplesyseffectui->refresh(); 1241 } 1242 xywh {515 80 70 15} down_box BORDER_BOX labelsize 10 align 5 1243 code0 {o->init("sysefx"+to_s(nsyseff)+"/efftype");} 1244 class Fl_Osc_Choice 1245 } { 1246 MenuItem {} { 1247 label {No Effect} 1248 xywh {20 20 100 20} labelfont 1 labelsize 10 1249 } 1250 MenuItem {} { 1251 label Reverb 1252 xywh {30 30 100 20} labelfont 1 labelsize 10 1253 } 1254 MenuItem {} { 1255 label Echo 1256 xywh {40 40 100 20} labelfont 1 labelsize 10 1257 } 1258 MenuItem {} { 1259 label Chorus 1260 xywh {50 50 100 20} labelfont 1 labelsize 10 1261 } 1262 MenuItem {} { 1263 label Phaser 1264 xywh {60 60 100 20} labelfont 1 labelsize 10 1265 } 1266 MenuItem {} { 1267 label AlienWah 1268 xywh {70 70 100 20} labelfont 1 labelsize 10 1269 } 1270 MenuItem {} { 1271 label Distortion 1272 xywh {80 80 100 20} labelfont 1 labelsize 10 1273 } 1274 MenuItem {} { 1275 label EQ 1276 xywh {90 90 100 20} labelfont 1 labelsize 10 1277 } 1278 MenuItem {} { 1279 label DynFilter 1280 xywh {100 100 100 20} labelfont 1 labelsize 10 1281 } 1282 MenuItem {} { 1283 label Sympathetic 1284 xywh {110 110 100 20} labelfont 1 labelsize 10 1285 } 1286 } 1287 Fl_Group simplesyseffectuigroup { 1288 xywh {350 95 235 95} color 48 1289 class Fl_Osc_Group 1290 } { 1291 Fl_Box {} { 1292 xywh {350 95 0 0} 1293 code0 {simplesyseffectuigroup->ext = "sysefx0/";} 1294 } 1295 Fl_Group simplesyseffectui { 1296 xywh {350 95 234 95} 1297 code0 {o->init(false);} 1298 code1 {o->refresh();} 1299 class SimpleEffUI 1300 } {} 1301 } 1302 Fl_Button {} { 1303 label {Send to...} 1304 callback {syseffsendwindow->show();} 1305 xywh {435 75 75 20} box THIN_UP_BOX labelfont 1 labelsize 11 1306 } 1307 Fl_Button {} { 1308 label P 1309 callback {/*pthread_mutex_lock(&master->mutex); 1310 presetsui->paste(master->sysefx[nsyseff],simplesyseffectui); 1311 pthread_mutex_unlock(&master->mutex);*/} 1312 xywh {560 65 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55 1313 } 1314 } 1315 Fl_Group {} { 1316 label {Insertion Effects} 1317 xywh {345 55 245 155} box UP_FRAME labelfont 1 labelsize 12 align 18 hide 1318 } { 1319 Fl_Counter simpleinseffnocounter { 1320 label {Ins.Effect No.} 1321 callback {ninseff=(int) o->value()-1; 1322 /*simpleinsefftype->value(master->insefx[ninseff]->geteffect()); 1323 simpleinseffpart->value(master->Pinsparts[ninseff]+2);*/ 1324 simpleinseffectuigroup->reext("insefx"+to_s(ninseff)+"/"); 1325 simpleinsefftype->oscMove("insefx"+to_s(ninseff)+"/efftype"); 1326 simpleinseffectui->refresh(); 1327 1328 /* 1329 if (master->Pinsparts[ninseff]!=-1) { 1330 simpleinsefftype->activate(); 1331 simpleinseffectui->activate(); 1332 simpleinseffectuigroup->activate(); 1333 } else { 1334 simpleinsefftype->deactivate(); 1335 simpleinseffectui->deactivate(); 1336 simpleinseffectuigroup->deactivate(); 1337 };*/} 1338 xywh {350 75 80 20} type Simple labelfont 1 labelsize 10 align 1 minimum 0 maximum 127 step 1 value 1 textfont 1 1339 code0 {o->bounds(1,NUM_INS_EFX);} 1340 code1 {o->value(ninseff+1);} 1341 } 1342 Fl_Choice simpleinsefftype { 1343 label EffType 1344 callback {/*pthread_mutex_lock(&master->mutex); 1345 master->insefx[ninseff]->changeeffect((int) o->value()); 1346 pthread_mutex_unlock(&master->mutex);*/ 1347 simpleinseffectui->efftype = o->value(); 1348 simpleinseffectui->refresh(); 1349 simpleinseffectui->show();} 1350 xywh {515 80 70 15} down_box BORDER_BOX labelsize 10 align 5 1351 code0 {/*o->value(master->insefx[ninseff]->geteffect());*/} 1352 code1 {/*if (master->Pinsparts[ninseff]== -1) o->deactivate();*/} 1353 code2 {o->init("insefx"+to_s(ninseff)+"/efftype");} 1354 class Fl_Osc_Choice 1355 } { 1356 MenuItem {} { 1357 label {No Effect} 1358 xywh {35 35 100 20} labelfont 1 labelsize 10 1359 } 1360 MenuItem {} { 1361 label Reverb 1362 xywh {45 45 100 20} labelfont 1 labelsize 10 1363 } 1364 MenuItem {} { 1365 label Echo 1366 xywh {55 55 100 20} labelfont 1 labelsize 10 1367 } 1368 MenuItem {} { 1369 label Chorus 1370 xywh {65 65 100 20} labelfont 1 labelsize 10 1371 } 1372 MenuItem {} { 1373 label Phaser 1374 xywh {70 70 100 20} labelfont 1 labelsize 10 1375 } 1376 MenuItem {} { 1377 label AlienWah 1378 xywh {80 80 100 20} labelfont 1 labelsize 10 1379 } 1380 MenuItem {} { 1381 label Distortion 1382 xywh {90 90 100 20} labelfont 1 labelsize 10 1383 } 1384 MenuItem {} { 1385 label EQ 1386 xywh {100 100 100 20} labelfont 1 labelsize 10 1387 } 1388 MenuItem {} { 1389 label DynFilter 1390 xywh {110 110 100 20} labelfont 1 labelsize 10 1391 } 1392 MenuItem {} { 1393 label Sympathetic 1394 xywh {120 120 100 20} labelfont 1 labelsize 10 1395 } 1396 } 1397 Fl_Group simpleinseffectuigroup { 1398 xywh {350 95 234 95} box FLAT_BOX color 48 1399 class Fl_Osc_Group 1400 } { 1401 Fl_Box {} { 1402 xywh {350 95 0 0} 1403 code0 {simpleinseffectuigroup->ext = "insefx0/";} 1404 } 1405 Fl_Group simpleinseffectui { 1406 xywh {350 95 234 95} 1407 code0 {o->init(true);} 1408 class SimpleEffUI 1409 } {} 1410 } 1411 Fl_Choice simpleinseffpart { 1412 label {Insert To.} 1413 callback {/*master->Pinsparts[ninseff]=(int) o->value()-2;*/ 1414 if ((int) o->value()==1){ 1415 simpleinseffectuigroup->deactivate(); 1416 simpleinsefftype->deactivate(); 1417 simpleinseffectui->deactivate(); 1418 } else { 1419 simpleinseffectuigroup->activate(); 1420 simpleinsefftype->activate(); 1421 simpleinseffectui->activate(); 1422 }; 1423 /*master->insefx[ninseff]->cleanup();*/} open 1424 xywh {435 75 80 20} down_box BORDER_BOX labelfont 1 labelsize 10 align 5 textsize 10 1425 code0 {o->add("Master Out");o->add("Off");} 1426 code1 {char tmp[50]; for (int i=0;i<NUM_MIDI_PARTS;i++) {sprintf(tmp,"Part %2d",i+1);o->add(tmp);};} 1427 code3 {/*o->value(master->Pinsparts[ninseff]+2);*/} 1428 } {} 1429 Fl_Button {} { 1430 label P 1431 callback {/*pthread_mutex_lock(&master->mutex); 1432 presetsui->paste(master->insefx[ninseff],simpleinseffectui); 1433 pthread_mutex_unlock(&master->mutex);*/} 1434 xywh {560 65 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55 1435 } 1436 } 1437 } 1438 } 1439 Fl_Group {} { 1440 xywh {5 300 590 30} box ENGRAVED_FRAME 1441 } { 1442 Fl_Box simplemastervu { 1443 label {VU-Meter} 1444 xywh {5 300 590 30} box FLAT_BOX color 41 selection_color 75 1445 code0 {o->init(osc);} 1446 class VuMasterMeter 1447 } 1448 } 1449 Fl_Dial simplemastervolumedial { 1450 label {Master Volume} 1451 tooltip {Master Volume} xywh {10 35 40 40} box ROUND_UP_BOX labelfont 1 labelsize 11 align 130 maximum 127 step 1 1452 code0 {o->init("Pvolume");o->reset_value=80;} 1453 class Fl_Osc_Dial 1454 } 1455 Fl_Counter simplemasterkeyshiftcounter { 1456 label {Master KeyShift} 1457 xywh {15 110 90 20} labelsize 11 minimum -64 maximum 64 step 1 1458 code0 {o->lstep(12);} 1459 code1 {o->init("Pkeyshift",'i',0);} 1460 class Fl_Osc_Counter 1461 } 1462 Fl_Button {} { 1463 label {Stop ALL sounds!} 1464 callback {virkeyboard->releaseallkeys(); 1465 o->oscWrite("Panic");} 1466 xywh {5 149 115 31} color 90 labelfont 1 labelsize 10 1467 class Fl_Osc_Button 1468 } 1469 Fl_Button {} { 1470 label Reset 1471 callback {simpleglobalfinedetuneslider->value(64.0); 1472 simpleglobalfinedetuneslider->do_callback();} 1473 tooltip {Master fine detune reset} xywh {70 30 50 17} box THIN_UP_BOX labelsize 11 align 128 1474 } 1475 Fl_Dial simpleglobalfinedetuneslider { 1476 label {Fine Detune} 1477 tooltip {global fine detune} xywh {80 50 30 30} box ROUND_UP_BOX labelsize 11 align 130 maximum 127 step 1 value 64 1478 code0 {o->init("microtonal/Pglobalfinedetune");o->reset_value=64;} 1479 class Fl_Osc_Dial 1480 } 1481 Fl_Counter simplenpartcounter { 1482 label Part 1483 callback {virkeys->releaseallkeys(0); 1484 npartcounter->value(o->value()); 1485 npart=(int) o->value()-1; 1486 1487 simplelistitemgroup->reext("part"+to_s(npart)+"/"); 1488 partenabled->oscMove("part"+to_s(npart)+"/Penabled"); 1489 simplerefresh();} 1490 tooltip {The part number} xywh {170 40 70 20} type Simple labelfont 1 align 4 minimum 0 maximum 127 step 1 value 1 textfont 1 1491 code0 {o->bounds(1,NUM_MIDI_PARTS);} 1492 } 1493 Fl_Counter {} { 1494 label {Keyb.Oct.} 1495 callback {virkeys->releaseallkeys(0); 1496 virkeys->midioct=(int) o->value(); 1497 virkeys->take_focus();} 1498 tooltip {Midi Octave} xywh {5 190 55 20} type Simple labelsize 11 align 8 when 6 minimum 0 maximum 5 step 1 textfont 1 textsize 11 1499 code0 {o->value(virkeys->midioct);} 1500 } 1501 Fl_Button sm_indicator2 { 1502 label SM 1503 xywh {560 5 35 15} box ROUNDED_BOX down_box ROUNDED_BOX color 45 selection_color 93 labelfont 3 labelcolor 39 deactivate 1504 } 1505 } 1506 Fl_Window selectuiwindow { 1507 label {User Interface mode} 1508 callback {*exitprogram=1;} 1509 xywh {342 246 430 250} type Double hide non_modal 1510 class Fl_Osc_Window 1511 } { 1512 Fl_Box {} { 1513 label {Welcome to ZynAddSubFX} 1514 xywh {5 5 425 40} labeltype SHADOW_LABEL labelfont 1 labelsize 26 1515 } 1516 Fl_Box {} { 1517 label {Please choose the interface mode:} 1518 xywh {10 50 265 25} labelfont 1 labelsize 13 1519 } 1520 Fl_Button {} { 1521 label Advanced 1522 callback { 1523 osc->write("/config/cfg.UserInterfaceMode", "i", 1); 1524 masterwindow->show(); 1525 selectuiwindow->hide();} 1526 xywh {10 165 100 35} color 229 labelfont 1 labelsize 16 1527 } 1528 Fl_Box {} { 1529 label {.. if you have used ZynAddSubFX before, or you like to have full control to all parameters.} 1530 xywh {110 165 310 35} labelfont 1 labelsize 11 align 144 1531 } 1532 Fl_Button {} { 1533 label Beginner 1534 callback {simplemasterwindow->show(); 1535 selectuiwindow->hide(); 1536 osc->write("/config/cfg.UserInterfaceMode", "i", 2);} 1537 xywh {10 80 100 65} color 238 labelfont 1 labelsize 16 1538 } 1539 Fl_Box {} { 1540 label {..if you are a beginner, you prefer using presets or you prefer to use simpler user interfaces. Most functionality of ZynAddSubFX will be hidden in this mode to make simple the learning/using it.} 1541 xywh {110 75 320 75} labelfont 1 labelsize 11 align 144 1542 } 1543 Fl_Box {} { 1544 label {You can switch the interface modes anytime you want.} 1545 xywh {30 215 360 25} box BORDER_BOX color 51 labelfont 1 labelsize 11 align 144 1546 } 1547 } 1548 } 1549 Function {updatesendwindow()} {} { 1550 code {/*for (int neff1=0;neff1<NUM_SYS_EFX;neff1++) 1551 for (int neff2=neff1+1;neff2<NUM_SYS_EFX;neff2++) 1552 syseffsend[neff1][neff2]->value(master->Psysefxsend[neff1][neff2]);*/} {} 1553 } 1554 Function {updatepanel()} {} { 1555 code {for (int npart=0;npart<NUM_MIDI_PARTS;npart++){ 1556 panellistitem[npart]->refresh(); 1557 };} {} 1558 } 1559 Function {setfilelabel(const char *filename)} {} { 1560 code {if (filename!=NULL) snprintf(&masterwindowlabel[0],100,"%s - ZynAddSubFX",fl_filename_name(filename)); 1561 else snprintf(&masterwindowlabel[0],100,"%s","ZynAddSubFX"); 1562 masterwindowlabel[99]='\\0'; 1563 masterwindow->label(&masterwindowlabel[0]); 1564 simplemasterwindow->label(&masterwindowlabel[0]); 1565 masterwindow->update_title(); 1566 simplemasterwindow->update_title(); 1567 } {} 1568 } 1569 Function {MasterUI(int *exitprogram_, class Fl_Osc_Interface *osc_):nioui(osc_)} {open 1570 } { 1571 code {exitprogram=exitprogram_; 1572 osc=osc_; 1573 ninseff=0; 1574 nsyseff=0; 1575 npart=0; 1576 last_loaded[0]=0; 1577 last_loaded[XMZ_PATH_MAX - 1]=0; 1578 loading_next[0]=0; 1579 last_xmz = new Osc_DataModel(osc); 1580 last_xmz->callback = [this](std::string filestr) { 1581 const char *filename = filestr.c_str(); 1582 if (filename[0] != 0) 1583 strncpy(last_loaded, filename, XMZ_PATH_MAX-1); 1584 else if (loading_next[0] != 0) { 1585 strncpy(last_loaded, loading_next, XMZ_PATH_MAX-1); 1586 loading_next[0] = 0; 1587 } else 1588 last_loaded[0] = 0; 1589 last_loaded[XMZ_PATH_MAX - 1] = 0; 1590 char *label = NULL; 1591 if(last_loaded[0] != 0) { 1592 label = strrchr(last_loaded, '/'); 1593 if(label && *label) 1594 label = label+1; 1595 else 1596 label = last_loaded; 1597 } 1598 1599 setfilelabel(label); 1600 }; 1601 last_xmz->doUpdate("/last_xmz"); 1602 1603 for (int i=0;i<NUM_SYS_EFX;i++) 1604 for (int j=0;j<NUM_SYS_EFX;j++) 1605 syseffsend[i][j]=NULL; 1606 1607 microtonalui=new MicrotonalUI(osc, "/microtonal/"); 1608 virkeyboard=new VirKeyboard(osc, "/"); 1609 bankui=new BankUI(&npart, osc); 1610 configui=new ConfigUI(osc); 1611 1612 make_window(); 1613 fl_open_display(); 1614 1615 \#if !defined(PLUGINVERSION) && defined(FLTK_GUI) 1616 Fl_Pixmap *pixmap = new Fl_Pixmap(zynaddsubfx_xpm); 1617 Fl_RGB_Image *p = new Fl_RGB_Image(pixmap, FL_GRAY); 1618 masterwindow->icon(p); 1619 \#endif 1620 \#if !defined(PLUGINVERSION) && defined(NTK_GUI) 1621 Pixmap p, mask; 1622 XCreatePixmapFromData(fl_display, DefaultRootWindow(fl_display), 1623 (char**)zynaddsubfx_xpm, &p, &mask, NULL); 1624 masterwindow->icon((char *)p); 1625 \#endif 1626 assert(osc); 1627 presetsui=new PresetsUI(osc); 1628 setfilelabel(NULL); 1629 swapefftype=0; 1630 simplerefresh();} {} 1631 } 1632 Function {~MasterUI()} {} { 1633 code {masterwindow->hide(); 1634 delete masterwindow; 1635 simplemasterwindow->hide(); 1636 delete simplemasterwindow; 1637 aboutwindow->hide(); 1638 delete aboutwindow; 1639 syseffsendwindow->hide(); 1640 delete syseffsendwindow; 1641 1642 delete virkeyboard; 1643 delete microtonalui; 1644 delete bankui; 1645 delete configui; 1646 1647 delete presetsui; 1648 delete panelwindow; 1649 delete selectuiwindow;} {} 1650 } 1651 Function {showUI(int UIMode)} {} { 1652 code {switch (UIMode){ 1653 case 0:selectuiwindow->show(); 1654 break; 1655 case 1:masterwindow->show(); 1656 break; 1657 case 2:simplemasterwindow->show(); 1658 break; 1659 };} {} 1660 } 1661 Function {simplerefresh()} {} { 1662 code {/* 1663 if (master->part[npart]->Pname[0]!=0) partname->label((char *)master->part[npart]->Pname); 1664 else partname->label("Click here to load a instrument"); 1665 */ 1666 1667 simplelistitemgroup->redraw();} {} 1668 } 1669 Function {do_new_master_unconditional()} {} { 1670 code {delete microtonalui; 1671 microtonalui=new MicrotonalUI(osc, "/microtonal/"); 1672 1673 osc->write("/reset_master"); 1674 osc->write("/last_xmz"); 1675 npartcounter->value(1); 1676 refresh_master_ui(); 1677 updatepanel();} {} 1678 } 1679 Function {do_new_master()} {} { 1680 code {if (fl_choice("Clear *ALL* the parameters ?","No","Yes",NULL)){ 1681 do_new_master_unconditional(); 1682 }} {} 1683 } 1684 Function {do_revert_changes_unconditional()} {return_type int 1685 } { 1686 code {strncpy(loading_next, last_loaded, XMZ_PATH_MAX-1); 1687 osc->write("/load_xmz", "s", last_loaded); 1688 osc->write("/last_xmz"); 1689 refresh_master_ui(); 1690 updatepanel(); 1691 1692 return 1;} {} 1693 } 1694 Function {do_revert_changes()} {} { 1695 code {if (last_loaded[0] == 0) 1696 do_new_master(); 1697 else 1698 if (fl_choice("Revert *ALL* the parameters ?","No","Yes",NULL)){ 1699 do_revert_changes_unconditional(); 1700 }} {} 1701 } 1702 Function {do_load_master_unconditional(const char *filename, const char *display_name)} {return_type int 1703 } { 1704 code {strncpy(loading_next, filename, XMZ_PATH_MAX-1); 1705 osc->write("/load_xmz", "s", filename); 1706 osc->write("/last_xmz"); 1707 refresh_master_ui(); 1708 updatepanel(); 1709 1710 setfilelabel(display_name); 1711 1712 return 1;} {} 1713 } 1714 Function {do_load_master(const char* file = NULL)} {} { 1715 code {const char *filename; 1716 if (file == NULL) { 1717 filename=fl_file_chooser("Open:","({*.xmz})",NULL,0); 1718 if (filename==NULL) return; 1719 } 1720 else { 1721 filename = file; 1722 } 1723 1724 int result = do_load_master_unconditional( filename, filename ); 1725 1726 if (result==-10) fl_alert("Error: Could not load the file\\nbecause it is not a zynaddsubfx parameters file."); 1727 else if (result<0) fl_alert("Error: Could not load the file.");} {} 1728 } 1729 Function {do_save_master(const char* file = NULL)} {} { 1730 code {const char *filename; 1731 char *tmp; 1732 int result=0; 1733 if (file == NULL) { 1734 tmp=fl_file_chooser("Save:","({*.xmz})",NULL,0); 1735 if (tmp==NULL) return; 1736 tmp=fl_filename_setext(tmp,".xmz"); 1737 filename=tmp; 1738 result=fileexists(tmp); 1739 if (result) { 1740 result=0; 1741 if (!fl_choice("The file exists. Overwrite it?","No","Yes",NULL)) return; 1742 1743 } 1744 } 1745 else { 1746 filename = file; 1747 } 1748 1749 1750 osc->write("/save_xmz", "s", filename); 1751 if (result<0) fl_alert("Error: Could not save the file."); 1752 else 1753 { 1754 osc->write("/last_xmz", "s", filename); 1755 \#if USE_NSM 1756 if ( nsm && nsm->is_active() ) 1757 setfilelabel( nsm->display_name ); 1758 else 1759 \#endif 1760 setfilelabel(filename); 1761 } 1762 updatepanel();} {} 1763 } 1764 Function {refresh_master_ui()} {} { 1765 code {ninseff=0; 1766 nsyseff=0; 1767 npart=0; 1768 1769 //the Master UI 1770 npartcounter->do_callback(); 1771 syseffnocounter->do_callback(); 1772 inseffnocounter->do_callback(); 1773 delete microtonalui; 1774 microtonalui=new MicrotonalUI(osc, "/microtonal/"); 1775 updatesendwindow(); 1776 updatepanel(); 1777 1778 //the simple MasterUI 1779 simplenpartcounter->value(1); 1780 simplesyseffnocounter->value(1); 1781 simpleinseffnocounter->value(1); 1782 simplenpartcounter->do_callback(); 1783 simplesyseffnocounter->do_callback(); 1784 simpleinseffnocounter->do_callback(); 1785 1786 simplerefresh(); 1787 bankui->hide();} {} 1788 } 1789 decl {class Osc_DataModel *last_xmz;} {public local 1790 } 1791 decl {MicrotonalUI *microtonalui;} {private local 1792 } 1793 decl {BankUI *bankui;} {private local 1794 } 1795 decl {int ninseff,npart;} {private local 1796 } 1797 decl {int nsyseff;} {private local 1798 } 1799 decl {int *exitprogram;} {private local 1800 } 1801 decl {Fl_Osc_Dial *syseffsend[NUM_SYS_EFX][NUM_SYS_EFX];} {private local 1802 } 1803 decl {VirKeyboard *virkeyboard;} {private local 1804 } 1805 decl {ConfigUI *configui;} {private local 1806 } 1807 decl {int swapefftype;} {private local 1808 } 1809 decl {char masterwindowlabel[100];} {private local 1810 } 1811 decl {Panellistitem *panellistitem[NUM_MIDI_PARTS];} {public local 1812 } 1813 decl {NioUI nioui;} {private local 1814 } 1815 decl {class Fl_Osc_Interface *osc;} {public local 1816 } 1817 decl {char last_loaded[XMZ_PATH_MAX];} {public local 1818 } 1819 decl {char loading_next[XMZ_PATH_MAX];} {public local 1820 } 1821 Function {close()} {open return_type void 1822 } { 1823 code {*exitprogram=1;} {} 1824 } 1825 }