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.

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