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.

536 lines
17KB

  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-2005 Nasca Octavian Paul} {private local
  6. }
  7. decl {//License: GNU GPL version 2 or later} {private local
  8. }
  9. decl {\#include <stdlib.h>} {public local
  10. }
  11. decl {\#include <stdio.h>} {public local
  12. }
  13. decl {\#include <string.h>} {public local
  14. }
  15. decl {\#include "../globals.h"} {public local
  16. }
  17. decl {\#include "Fl_Osc_VSlider.H"} {public local
  18. }
  19. decl {\#include "Fl_Osc_Dial.H"} {public local
  20. }
  21. decl {\#include "EnvelopeUI.h"} {public local
  22. }
  23. decl {\#include "FilterUI.h"} {public local
  24. }
  25. decl {\#include "../Misc/Util.h"} {public local
  26. }
  27. decl {\#include "../Params/SUBnoteParameters.h"} {public local
  28. }
  29. decl {\#include "PresetsUI.h"} {public local
  30. }
  31. class PPSlider {: {public Fl_Slider, public Fl_Osc_Widget}
  32. } {
  33. Function {PPSlider(int x,int y, int w, int h, const char *label=0):Fl_Slider(x,y,w,h,label),Fl_Osc_Widget(this)} {open
  34. } {
  35. code {//Shamelessly copied from OscilGenUI.fl TODO refactor
  36. bw=false;} {}
  37. }
  38. Function {handle(int event)} {open return_type int
  39. } {
  40. code {int X=x(),Y=y(),W=w(),H=h();
  41. // catch any (un)learn event first
  42. {
  43. bool middle_mouse = (event == FL_PUSH && Fl::event_state(FL_BUTTON2) && !Fl::event_shift());
  44. bool ctl_click = (event == FL_PUSH && Fl::event_state(FL_BUTTON1) && Fl::event_ctrl());
  45. bool shift_middle = (event == FL_PUSH && Fl::event_state(FL_BUTTON2) && Fl::event_shift());
  46. if(middle_mouse || ctl_click) {
  47. osc->write("/learn", "s", (loc+ext).c_str());
  48. return 1;
  49. } else if(shift_middle) {
  50. osc->write("/unlearn", "s", (loc+ext).c_str());
  51. return 1;
  52. }
  53. }
  54. if ((!Fl::event_buttons())|| (event==0)||(Fl::event_shift()==0)) return(Fl_Slider::handle(event));
  55. if (!Fl::event_inside(X,Y,W,H)) {
  56. if (event==FL_DRAG){
  57. Fl_Slider::handle(FL_RELEASE);
  58. Fl_Slider::handle(FL_LEAVE);
  59. deactivate();
  60. activate();
  61. return(1);
  62. }else{
  63. return(Fl_Slider::handle(event));
  64. };
  65. } else {
  66. //Fl_Slider::handle(FL_FOCUS);
  67. Fl_Slider::handle(FL_PUSH);
  68. };
  69. return(1);} {}
  70. }
  71. Function {rebase(std::string new_base)} {return_type void
  72. } {
  73. code {(void) new_base;} {}
  74. }
  75. Function {update()} {return_type void
  76. } {
  77. code {} {}
  78. }
  79. Function {OSC_value(char c)} {open return_type void
  80. } {
  81. code {value(127-c+fmodf(value(), 1.0f));} {}
  82. }
  83. decl {bool bw;} {public local
  84. }
  85. }
  86. class SUBnoteharmonic {: {public Fl_Osc_Group}
  87. } {
  88. Function {make_window()} {private
  89. } {
  90. Fl_Window harmonic {
  91. xywh {329 403 90 305} type Double hide
  92. class Fl_Osc_Group
  93. } {
  94. Fl_Slider mag {
  95. callback {//TODO consider unifying this with the OscilGenUI display stuff
  96. int x=0;
  97. if (Fl::event_button1() || Fl::event() == FL_MOUSEWHEEL) x=127-(int)o->value();
  98. else o->value(127-x);
  99. o->osc->writeValue(o->loc + o->ext, (char) x);
  100. if (x==0) o->selection_color(0);
  101. else o->selection_color(222);}
  102. tooltip {harmonic's magnitude} xywh {0 15 10 135} type {Vert Knob} box FLAT_BOX selection_color 222 maximum 127 step 1 value 127
  103. class PPSlider
  104. }
  105. Fl_Slider bw {
  106. callback {int x=64;
  107. if (Fl::event_button1() || Fl::event() == FL_MOUSEWHEEL) x=127-(int)o->value();
  108. else o->value(x);
  109. o->osc->writeValue(o->loc + o->ext, (char) x)};
  110. tooltip {harmonic's bandwidth} xywh {0 157 10 130} type {Vert Knob} box FLAT_BOX selection_color 222 maximum 127 step 1 value 64
  111. class PPSlider
  112. }
  113. Fl_Box {} {
  114. xywh {10 219 5 5} box FLAT_BOX color 45
  115. code0 {if (n+1==MAX_SUB_HARMONICS) o->hide();}
  116. }
  117. Fl_Box {} {
  118. label 01
  119. xywh {0 288 10 15} labelfont 1 labelsize 9 align 20
  120. code0 {char tmp[10];snprintf(tmp,10,"%d",n+1);o->label(strdup(tmp));}
  121. }
  122. Fl_Box {} {
  123. label 01
  124. xywh {0 0 10 15} labelfont 1 labelsize 9 align 20
  125. code0 {char tmp[10];snprintf(tmp,10,"%d",n+1);o->label(strdup(tmp));}
  126. }
  127. }
  128. }
  129. Function {SUBnoteharmonic(int x,int y, int w, int h, const char *label=0):Fl_Osc_Group(x,y,w,h,label)} {} {
  130. code {n=0;} {}
  131. }
  132. Function {init(int n_)} {} {
  133. code {n=n_;
  134. make_window();
  135. harmonic->show();
  136. mag->ext = "Phmag" + to_s(n);
  137. mag->oscRegister(mag->ext.c_str());
  138. bw->ext = "Phrelbw" + to_s(n);
  139. bw->oscRegister(bw->ext.c_str());
  140. osc->requestValue(base+"Phrelbw"+to_s(n));
  141. end();} {}
  142. }
  143. Function {refresh()} {} {
  144. code {// request values for the widgets
  145. mag->oscWrite(mag->ext);
  146. bw->oscWrite(bw->ext);} {}
  147. }
  148. Function {~SUBnoteharmonic()} {} {
  149. code {harmonic->hide();
  150. hide();
  151. //delete(harmonic);} {}
  152. }
  153. decl {int n;} {private local
  154. }
  155. }
  156. class SUBnoteUI {open : {public PresetsUI_}
  157. } {
  158. Function {make_window()} {open
  159. } {
  160. Fl_Window SUBparameters {
  161. label {SUBsynth Parameters} open
  162. xywh {542 511 735 470} type Double
  163. class Fl_Osc_Window visible
  164. } {
  165. Fl_Box {} {
  166. xywh {0 0 0 0} box FLAT_BOX color 45
  167. code0 {SUBparameters->osc = osc; SUBparameters->base = loc;}
  168. }
  169. Fl_Scroll {} {
  170. label scroll open
  171. xywh {5 140 434 330} type HORIZONTAL box FLAT_BOX labeltype NO_LABEL
  172. } {
  173. Fl_Pack harmonics {open
  174. xywh {5 145 425 325} type HORIZONTAL
  175. code0 {for (int i=0;i<MAX_SUB_HARMONICS;i++){h[i]=new SUBnoteharmonic(0,0,15,o->h(),"");h[i]->init(i);}}
  176. } {}
  177. }
  178. Fl_Button {} {
  179. label Close
  180. callback {SUBparameters->hide();}
  181. xywh {625 446 105 20} box THIN_UP_BOX labelfont 1 labelsize 11
  182. }
  183. Fl_Group {} {
  184. label AMPLITUDE open
  185. xywh {5 5 215 135} box UP_FRAME labeltype EMBOSSED_LABEL labelfont 1 align 17
  186. } {
  187. Fl_Value_Slider vol {
  188. label Vol
  189. tooltip Volume xywh {10 25 140 15} type {Horz Knob} box NO_BOX labelsize 11 align 8 maximum 127 step 1
  190. code0 {o->init("PVolume");}
  191. class Fl_Osc_VSlider
  192. }
  193. Fl_Value_Slider vsns {
  194. label {V.Sns}
  195. tooltip {Velocity Sensing Function (rightmost to disable)} xywh {10 45 140 15} type {Horz Knob} box NO_BOX labelsize 11 align 8 maximum 127 step 1
  196. code0 {o->init("PAmpVelocityScaleFunction");}
  197. class Fl_Osc_VSlider
  198. }
  199. Fl_Dial pan {
  200. label Pan
  201. tooltip {Panning (leftmost is Random)} xywh {185 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
  202. code0 {o->init("PPanning");}
  203. class Fl_Osc_Dial
  204. }
  205. Fl_Group ampenv {
  206. label {SUBsynth - Amplitude Envelope} open
  207. xywh {10 65 205 70} box FLAT_BOX color 51 align 144
  208. code0 {o->init(ENV_ADSR, osc, loc, "AmpEnvelope/");}
  209. class EnvelopeUI
  210. } {}
  211. }
  212. Fl_Group {} {
  213. xywh {495 406 235 35} box UP_FRAME
  214. } {
  215. Fl_Counter filterstages {
  216. label {Filter Stages}
  217. tooltip {How many times the noise is filtered} xywh {515 421 45 15} type Simple labelfont 1 labelsize 10 align 1 minimum 1 maximum 5 step 1 textsize 10
  218. code0 {o->init("Pnumstages");}
  219. class Fl_Osc_Counter
  220. }
  221. Fl_Choice magtype {
  222. label {Mag.Type}
  223. xywh {585 421 65 15} down_box BORDER_BOX labelfont 1 labelsize 10 align 1 textsize 11
  224. code0 {o->init("Phmagtype");}
  225. class Fl_Osc_Choice
  226. } {
  227. MenuItem {} {
  228. label Linear
  229. xywh {20 20 100 20} labelfont 1 labelsize 11
  230. }
  231. MenuItem {} {
  232. label {-40dB}
  233. xywh {30 30 100 20} labelfont 1 labelsize 11
  234. }
  235. MenuItem {} {
  236. label {-60dB}
  237. xywh {40 40 100 20} labelfont 1 labelsize 11
  238. }
  239. MenuItem {} {
  240. label {-80dB}
  241. xywh {50 50 100 20} labelfont 1 labelsize 11
  242. }
  243. MenuItem {} {
  244. label {-100dB}
  245. xywh {60 60 100 20} labelfont 1 labelsize 11
  246. }
  247. }
  248. Fl_Choice start {
  249. label Start selected
  250. xywh {670 420 50 15} down_box BORDER_BOX labelfont 1 labelsize 10 align 1 textsize 11
  251. code0 {o->init("Pstart");}
  252. class Fl_Osc_Choice
  253. } {
  254. MenuItem {} {
  255. label Zero
  256. xywh {30 30 100 20} labelfont 1 labelsize 11
  257. }
  258. MenuItem {} {
  259. label RND
  260. xywh {40 40 100 20} labelfont 1 labelsize 11
  261. }
  262. MenuItem {} {
  263. label {Max.}
  264. xywh {50 50 100 20} labelfont 1 labelsize 11
  265. }
  266. }
  267. }
  268. Fl_Group freqsettingsui {
  269. label FREQUENCY open
  270. xywh {440 5 295 146} box UP_FRAME labeltype EMBOSSED_LABEL labelfont 1 align 17
  271. } {
  272. Fl_Group freqenvelopegroup {
  273. label {SUBsynth - Frequency Envelope} open
  274. xywh {445 75 205 70} box FLAT_BOX color 51 align 144
  275. code0 {o->init(ENV_ASR, osc, loc, "FreqEnvelope/");}
  276. class EnvelopeUI
  277. } {}
  278. Fl_Check_Button freqee {
  279. label Enabled
  280. callback {if (o->value()==0) freqenvelopegroup->deactivate();
  281. else freqenvelopegroup->activate();
  282. o->show();
  283. freqsettingsui->redraw();}
  284. xywh {445 77 55 15} down_box DOWN_BOX labelfont 1 labelsize 10
  285. code0 {o->init("PFreqEnvelopeEnabled");}
  286. class Fl_Osc_Check
  287. }
  288. Fl_Counter octave {
  289. label Octave
  290. tooltip Octave xywh {670 58 45 15} type Simple labelsize 10 align 1 minimum -8 maximum 7 step 1 textfont 1 textsize 11
  291. code0 {o->init("octave");}
  292. class Fl_Osc_Counter
  293. }
  294. Fl_Counter coarsedet {
  295. label {Coarse Det.}
  296. tooltip {Coarse Detune} xywh {655 125 60 20} labelsize 10 align 1 minimum -64 maximum 63 step 1 textfont 1 textsize 11
  297. code0 {o->init("coarsedetune");}
  298. code3 {o->lstep(10);}
  299. class Fl_Osc_Counter
  300. }
  301. Fl_Slider detune {
  302. callback {o->oscWrite("detunevalue");}
  303. tooltip {Fine Detune (cents)} xywh {495 27 230 15} type {Horz Knob} box NO_BOX minimum -8192 maximum 8191 step 1
  304. code0 {o->init("PDetune",'i');}
  305. class Fl_Osc_Slider
  306. }
  307. Fl_Value_Output detunevalueoutput {
  308. label Detune
  309. xywh {448 27 45 15} labelsize 10 align 5 minimum -5000 maximum 5000 step 0.01 textfont 1 textsize 10
  310. code0 {o->init("detunevalue");}
  311. class Fl_Osc_Output
  312. }
  313. Fl_Check_Button hz440 {
  314. label 440Hz
  315. callback {if (o->value()==0) fixedfreqetdial->deactivate();
  316. else fixedfreqetdial->activate();}
  317. tooltip {set the base frequency to 440Hz} xywh {555 53 50 15} down_box DOWN_BOX labelfont 1 labelsize 10
  318. code0 {o->init("Pfixedfreq");}
  319. class Fl_Osc_Check
  320. }
  321. Fl_Dial fixedfreqetdial {
  322. label {Eq.T.}
  323. tooltip {How the frequency varies acording to the keyboard (leftmost for fixed frequency)} xywh {610 53 15 15} box ROUND_UP_BOX labelsize 10 align 8 maximum 127 step 1
  324. code0 {o->init("PfixedfreqET");}
  325. class Fl_Osc_Dial
  326. }
  327. Fl_Choice detunetype {
  328. label {Detune Type}
  329. callback {o->oscWrite("detunevalue");} open
  330. xywh {655 94 70 15} down_box BORDER_BOX labelsize 10 align 5 textfont 1 textsize 10
  331. code0 {o->add("L35cents");o->add("L10cents");o->add("E100cents");o->add("E1200cents");}
  332. code1 {o->init("PDetuneType",1);}
  333. class Fl_Osc_Choice
  334. } {}
  335. }
  336. Fl_Check_Button stereo {
  337. label Stereo
  338. xywh {440 406 55 35} box THIN_UP_BOX down_box DOWN_BOX labelsize 10
  339. code0 {o->init("Pstereo");}
  340. class Fl_Osc_Check
  341. }
  342. Fl_Button {} {
  343. label Clear
  344. callback {o->oscWrite("clear");
  345. for (int i=0;i<MAX_SUB_HARMONICS;i++){
  346. h[i]->mag->value(127);
  347. h[i]->bw->value(64);
  348. };
  349. h[0]->mag->value(0);
  350. SUBparameters->redraw();}
  351. tooltip {Clear the harmonics} xywh {445 446 70 20} box THIN_UP_BOX labelfont 1 labelsize 11
  352. class Fl_Osc_Button
  353. }
  354. Fl_Group bandwidthsettingsui {
  355. label BANDWIDTH
  356. xywh {220 5 220 135} box UP_FRAME labeltype EMBOSSED_LABEL labelfont 1 align 17
  357. } {
  358. Fl_Group bandwidthenvelopegroup {
  359. label {SUBsynth - BandWidth Envelope} open
  360. xywh {225 65 205 70} box FLAT_BOX color 51 align 144
  361. code0 {o->init(ENV_ADSR_BW, osc, loc, "BandWidthEnvelope/");}
  362. class EnvelopeUI
  363. } {}
  364. Fl_Check_Button bwee {
  365. label Enabled
  366. callback {if (o->value()==0) bandwidthenvelopegroup->deactivate();
  367. else bandwidthenvelopegroup->activate();
  368. o->show();
  369. bandwidthsettingsui->redraw();}
  370. xywh {225 67 55 15} down_box DOWN_BOX labelfont 1 labelsize 10
  371. code0 {o->init("PBandWidthEnvelopeEnabled");}
  372. class Fl_Osc_Check
  373. }
  374. Fl_Value_Slider bandwidth {
  375. label {Band Width}
  376. xywh {225 40 115 15} type {Horz Knob} box NO_BOX labelsize 10 align 1 maximum 127 step 1
  377. code0 {o->init("Pbandwidth");}
  378. class Fl_Osc_VSlider
  379. }
  380. Fl_Value_Slider bwidthscale {
  381. label {B.Width Scale}
  382. tooltip {How much I increase the BandWidth according to lower/higher harmonics} xywh {345 40 90 15} type {Horz Knob} box NO_BOX labelsize 10 align 1 minimum -64 maximum 63 step 1
  383. code0 {o->init("Pbwscale",'i');}
  384. class Fl_Osc_Slider
  385. }
  386. }
  387. Fl_Group globalfiltergroup {
  388. label FILTER
  389. xywh {440 221 290 185} box UP_FRAME labeltype EMBOSSED_LABEL labelfont 1 labelsize 13 align 17
  390. } {
  391. Fl_Group filterenv {
  392. label {SUBsynth - Filter Envelope} open
  393. xywh {445 331 275 70} box FLAT_BOX color 51 align 144
  394. code0 {o->init(ENV_ADSR_FILTER, osc, loc, "GlobalFilterEnvelope/");}
  395. class EnvelopeUI
  396. } {}
  397. Fl_Group filterui {
  398. label {SUBsynthl - Filter} open
  399. xywh {445 246 275 75} box FLAT_BOX color 50 align 144
  400. code0 {o->init(loc + "PGlobalFilter" , osc, loc, "GlobalFilter/");}
  401. class FilterUI
  402. } {}
  403. }
  404. Fl_Check_Button filtere {
  405. label Enabled
  406. callback {if (o->value()==0) globalfiltergroup->deactivate();
  407. else globalfiltergroup->activate();
  408. o->show();
  409. globalfiltergroup->redraw();}
  410. xywh {445 226 85 20} down_box DOWN_BOX labelfont 1 labelsize 11
  411. code0 {o->init("PGlobalFilterEnabled");}
  412. class Fl_Osc_Check
  413. }
  414. Fl_Button {} {
  415. label C
  416. callback {presetsui->copy(loc);}
  417. xywh {540 451 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55
  418. }
  419. Fl_Button {} {
  420. label P
  421. callback {presetsui->paste(loc,this);}
  422. xywh {570 451 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55
  423. }
  424. Fl_Group {} {
  425. label OVERTONES open
  426. xywh {440 151 220 70} box UP_FRAME labeltype EMBOSSED_LABEL labelfont 1 align 17
  427. } {
  428. Fl_Choice spreadtype {
  429. label OvertonesPosition
  430. xywh {450 190 80 20} down_box BORDER_BOX labelsize 10 align 5 textsize 10
  431. code0 {o->init("POvertoneSpread.type");}
  432. class Fl_Osc_Choice
  433. } {
  434. MenuItem {} {
  435. label Harmonic
  436. xywh {0 0 34 20} labelfont 1 labelsize 11
  437. }
  438. MenuItem {} {
  439. label ShiftU
  440. xywh {10 10 34 20} labelfont 1 labelsize 11
  441. }
  442. MenuItem {} {
  443. label ShiftL
  444. xywh {20 20 34 20} labelfont 1 labelsize 11
  445. }
  446. MenuItem {} {
  447. label PowerU
  448. xywh {20 20 34 20} labelfont 1 labelsize 11
  449. }
  450. MenuItem {} {
  451. label PowerL
  452. xywh {30 30 34 20} labelfont 1 labelsize 11
  453. }
  454. MenuItem {} {
  455. label Sine
  456. xywh {40 40 34 20} labelfont 1 labelsize 11
  457. }
  458. MenuItem {} {
  459. label Power
  460. xywh {50 50 34 20} labelfont 1 labelsize 11
  461. }
  462. MenuItem {} {
  463. label Shift
  464. xywh {20 20 34 20} labelfont 1 labelsize 11
  465. }
  466. }
  467. Fl_Dial spreadpar1 {
  468. label Par1
  469. xywh {548 173 30 30} box ROUND_UP_BOX labelsize 10 maximum 255 step 1
  470. code0 {o->init("POvertoneSpread.par1");}
  471. class Fl_Osc_Dial
  472. }
  473. Fl_Dial spreadpar2 {
  474. label Par2
  475. xywh {583 173 30 30} box ROUND_UP_BOX labelsize 10 maximum 255 step 1
  476. code0 {o->init("POvertoneSpread.par2");}
  477. class Fl_Osc_Dial
  478. }
  479. Fl_Dial spreadpar3 {
  480. label ForceH
  481. xywh {618 173 30 30} box ROUND_UP_BOX labelsize 10 maximum 255 step 1
  482. code0 {o->init("POvertoneSpread.par3");}
  483. class Fl_Osc_Dial
  484. }
  485. }
  486. }
  487. }
  488. Function {refresh()} {} {
  489. code {
  490. SUBparameters->update();
  491. for (int i=0;i<MAX_SUB_HARMONICS;i++) h[i]->refresh();
  492. //globalfiltergroup->redraw();
  493. //ampenv->refresh();
  494. //bandwidthenvelopegroup->refresh();
  495. //freqenvelopegroup->refresh();
  496. //filterui->refresh();
  497. //filterenv->refresh();} {}
  498. }
  499. Function {SUBnoteUI(Fl_Osc_Interface *osc_, std::string loc_)} {} {
  500. code {osc = osc_;
  501. loc = loc_;
  502. make_window();} {}
  503. }
  504. Function {~SUBnoteUI()} {} {
  505. code {//for (int i=0;i<MAX_SUB_HARMONICS;i++) delete (h[i]);
  506. SUBparameters->hide();
  507. delete(SUBparameters);} {}
  508. }
  509. decl {Fl_Osc_Interface *osc;} {private local
  510. }
  511. decl {std::string loc;} {private local
  512. }
  513. decl {SUBnoteharmonic *h[MAX_SUB_HARMONICS];} {private local
  514. }
  515. }