Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1887 lines
59KB

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