Collection of tools useful for audio production
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.

457 lines
16KB

  1. # data file for the Fltk User Interface Designer (fluid)
  2. version 1.0300
  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 "WidgetPDial.h"} {public local
  18. }
  19. decl {\#include "EnvelopeUI.h"} {public local
  20. }
  21. decl {\#include "FilterUI.h"} {public local
  22. }
  23. decl {\#include "../Misc/Util.h"} {public local
  24. }
  25. decl {\#include "../Params/SUBnoteParameters.h"} {public local
  26. }
  27. decl {\#include "PresetsUI.h"} {public local
  28. }
  29. class SUBnoteharmonic {: {public Fl_Group}
  30. } {
  31. Function {make_window()} {private
  32. } {
  33. Fl_Window harmonic {
  34. xywh {329 403 90 225} type Double hide
  35. class Fl_Group
  36. } {
  37. Fl_Slider mag {
  38. callback {int x=0;
  39. if (Fl::event_button1()) x=127-(int)o->value();
  40. else o->value(127-x);
  41. pars->Phmag[n]=x;
  42. if (pars->Phmag[n]==0) o->selection_color(0);
  43. else o->selection_color(222);}
  44. tooltip {harmonic's magnitude} xywh {0 15 10 115} type {Vert Knob} box FLAT_BOX selection_color 222 maximum 127 step 1 value 127
  45. code0 {o->value(127-pars->Phmag[n]);}
  46. code1 {if (pars->Phmag[n]==0) o->selection_color(0);}
  47. }
  48. Fl_Slider bw {
  49. callback {int x=64;
  50. if (Fl::event_button1()) x=127-(int)o->value();
  51. else o->value(x);
  52. pars->Phrelbw[n]=x;}
  53. tooltip {harmonic's bandwidth} xywh {0 135 10 75} type {Vert Knob} box FLAT_BOX selection_color 222 maximum 127 step 1 value 64
  54. code0 {o->value(127-pars->Phrelbw[n]);}
  55. }
  56. Fl_Box {} {
  57. xywh {10 170 5 5} box FLAT_BOX color 45
  58. code0 {if (n+1==MAX_SUB_HARMONICS) o->hide();}
  59. }
  60. Fl_Box {} {
  61. label 01
  62. xywh {0 210 10 15} labelfont 1 labelsize 9 align 20
  63. code0 {char tmp[10];snprintf(tmp,10,"%d",n+1);o->label(strdup(tmp));}
  64. }
  65. Fl_Box {} {
  66. label 01
  67. xywh {0 0 10 15} labelfont 1 labelsize 9 align 20
  68. code0 {char tmp[10];snprintf(tmp,10,"%d",n+1);o->label(strdup(tmp));}
  69. }
  70. }
  71. }
  72. Function {SUBnoteharmonic(int x,int y, int w, int h, const char *label=0):Fl_Group(x,y,w,h,label)} {} {
  73. code {n=0;} {}
  74. }
  75. Function {init(SUBnoteParameters *pars_,int n_)} {} {
  76. code {pars=pars_;
  77. n=n_;
  78. make_window();
  79. harmonic->show();
  80. end();} {}
  81. }
  82. Function {refresh()} {} {
  83. code {mag->value(127-pars->Phmag[n]);
  84. if (pars->Phmag[n]==0) mag->selection_color(0);
  85. bw->value(127-pars->Phrelbw[n]);} {}
  86. }
  87. Function {~SUBnoteharmonic()} {} {
  88. code {harmonic->hide();
  89. hide();
  90. //delete(harmonic);} {}
  91. }
  92. decl {SUBnoteParameters *pars;} {private local
  93. }
  94. decl {int n;} {private local
  95. }
  96. }
  97. class SUBnoteUI {open : {public PresetsUI_}
  98. } {
  99. Function {make_window()} {open
  100. } {
  101. Fl_Window SUBparameters {
  102. label {SUBsynth Parameters} open
  103. xywh {544 466 735 390} type Double visible
  104. } {
  105. Fl_Scroll {} {
  106. label scroll open
  107. xywh {5 140 435 245} type HORIZONTAL box FLAT_BOX labeltype NO_LABEL
  108. } {
  109. Fl_Pack harmonics {open
  110. xywh {10 145 425 235} type HORIZONTAL
  111. code0 {for (int i=0;i<MAX_SUB_HARMONICS;i++){h[i]=new SUBnoteharmonic(0,0,15,o->h(),"");h[i]->init(pars,i);}}
  112. } {}
  113. }
  114. Fl_Button {} {
  115. label Close
  116. callback {SUBparameters->hide();}
  117. xywh {625 365 105 20} box THIN_UP_BOX labelfont 1 labelsize 11
  118. }
  119. Fl_Group {} {
  120. label AMPLITUDE
  121. xywh {5 5 215 135} box UP_FRAME labeltype EMBOSSED_LABEL labelfont 1 align 17
  122. } {
  123. Fl_Value_Slider vol {
  124. label Vol
  125. callback {pars->PVolume=(int)o->value();}
  126. tooltip Volume xywh {10 25 140 15} type {Horz Knob} box NO_BOX labelsize 11 align 8 maximum 127 step 1
  127. code0 {o->value(pars->PVolume);}
  128. }
  129. Fl_Value_Slider vsns {
  130. label {V.Sns}
  131. callback {pars->PAmpVelocityScaleFunction=(int) o->value();}
  132. 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
  133. code0 {o->value(pars->PAmpVelocityScaleFunction);}
  134. }
  135. Fl_Dial pan {
  136. label Pan
  137. callback {pars->PPanning=(int) o->value();}
  138. tooltip {Panning (leftmost is Random)} xywh {185 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
  139. code0 {o->value(pars->PPanning);}
  140. class WidgetPDial
  141. }
  142. Fl_Group ampenv {
  143. label {SUBsynth - Amplitude Envelope} open
  144. xywh {10 65 205 70} box FLAT_BOX color 51 align 144
  145. code0 {o->init(pars->AmpEnvelope);}
  146. class EnvelopeUI
  147. } {}
  148. }
  149. Fl_Group {} {
  150. xywh {495 325 235 35} box UP_FRAME
  151. } {
  152. Fl_Counter filterstages {
  153. label {Filter Stages}
  154. callback {pars->Pnumstages=(int) o->value();}
  155. tooltip {How many times the noise is filtered} xywh {515 340 45 15} type Simple labelfont 1 labelsize 10 align 1 minimum 1 maximum 5 step 1 textsize 10
  156. code0 {o->value(pars->Pnumstages);}
  157. }
  158. Fl_Choice magtype {
  159. label {Mag.Type}
  160. callback {pars->Phmagtype=(int) o->value();}
  161. xywh {585 340 65 15} down_box BORDER_BOX labelfont 1 labelsize 10 align 1 textsize 11
  162. code0 {o->value(pars->Phmagtype);}
  163. } {
  164. MenuItem {} {
  165. label Linear
  166. xywh {20 20 100 20} labelfont 1 labelsize 11
  167. }
  168. MenuItem {} {
  169. label {-40dB}
  170. xywh {30 30 100 20} labelfont 1 labelsize 11
  171. }
  172. MenuItem {} {
  173. label {-60dB}
  174. xywh {40 40 100 20} labelfont 1 labelsize 11
  175. }
  176. MenuItem {} {
  177. label {-80dB}
  178. xywh {50 50 100 20} labelfont 1 labelsize 11
  179. }
  180. MenuItem {} {
  181. label {-100dB}
  182. xywh {60 60 100 20} labelfont 1 labelsize 11
  183. }
  184. }
  185. Fl_Choice start {
  186. label Start
  187. callback {pars->Pstart=(int) o->value();} open
  188. xywh {670 340 50 15} down_box BORDER_BOX labelfont 1 labelsize 10 align 1 textsize 11
  189. code0 {o->value(pars->Pstart);}
  190. } {
  191. MenuItem {} {
  192. label Zero
  193. xywh {30 30 100 20} labelfont 1 labelsize 11
  194. }
  195. MenuItem {} {
  196. label RND
  197. xywh {40 40 100 20} labelfont 1 labelsize 11
  198. }
  199. MenuItem {} {
  200. label {Max.}
  201. xywh {50 50 100 20} labelfont 1 labelsize 11
  202. }
  203. }
  204. }
  205. Fl_Group freqsettingsui {
  206. label FREQUENCY
  207. xywh {440 5 290 135} box UP_FRAME labeltype EMBOSSED_LABEL labelfont 1 align 17
  208. } {
  209. Fl_Group freqenvelopegroup {
  210. label {SUBsynth - Frequency Envelope} open
  211. xywh {445 65 205 70} box FLAT_BOX color 51 align 144
  212. code0 {o->init(pars->FreqEnvelope);}
  213. code1 {if (pars->PFreqEnvelopeEnabled==0) o->deactivate();}
  214. class EnvelopeUI
  215. } {}
  216. Fl_Check_Button freqee {
  217. label Enabled
  218. callback {pars->PFreqEnvelopeEnabled=o->value();
  219. if (o->value()==0) freqenvelopegroup->deactivate();
  220. else freqenvelopegroup->activate();
  221. o->show();
  222. freqsettingsui->redraw();}
  223. xywh {445 68 55 15} down_box DOWN_BOX labelfont 1 labelsize 10
  224. code0 {o->value(pars->PFreqEnvelopeEnabled);}
  225. }
  226. Fl_Counter octave {
  227. label Octave
  228. callback {int k=(int) o->value();
  229. if (k<0) k+=16;
  230. pars->PCoarseDetune = k*1024+
  231. pars->PCoarseDetune%1024;}
  232. tooltip Octave xywh {670 50 45 15} type Simple labelsize 10 align 1 minimum -8 maximum 7 step 1 textfont 1 textsize 11
  233. code0 {int k=pars->PCoarseDetune/1024;if (k>=8) k-=16;}
  234. code2 {o->value(k);}
  235. }
  236. Fl_Counter coarsedet {
  237. label {Coarse Det.}
  238. callback {int k=(int) o->value();
  239. if (k<0) k+=1024;
  240. pars->PCoarseDetune = k+
  241. (pars->PCoarseDetune/1024)*1024;}
  242. tooltip {Coarse Detune} xywh {655 115 60 20} labelsize 10 align 1 minimum -64 maximum 63 step 1 textfont 1 textsize 11
  243. code0 {int k=pars->PCoarseDetune%1024;if (k>=512) k-=1024;}
  244. code2 {o->value(k);}
  245. code3 {o->lstep(10);}
  246. }
  247. Fl_Slider detune {
  248. callback {pars->PDetune=(int)o->value()+8192;
  249. detunevalueoutput->do_callback();}
  250. tooltip {Fine Detune (cents)} xywh {495 25 230 15} type {Horz Knob} box NO_BOX minimum -8192 maximum 8191 step 1
  251. code0 {o->value(pars->PDetune-8192);}
  252. }
  253. Fl_Value_Output detunevalueoutput {
  254. label Detune
  255. callback {o->value(getdetune(pars->PDetuneType,0,pars->PDetune));}
  256. xywh {448 25 45 15} labelsize 10 align 5 minimum -5000 maximum 5000 step 0.01 textfont 1 textsize 10
  257. code0 {o->value(getdetune(pars->PDetuneType,0,pars->PDetune));}
  258. }
  259. Fl_Check_Button hz440 {
  260. label 440Hz
  261. callback {int x=(int) o->value();
  262. pars->Pfixedfreq=x;
  263. if (x==0) fixedfreqetdial->deactivate();
  264. else fixedfreqetdial->activate();}
  265. tooltip {set the base frequency to 440Hz} xywh {555 45 50 15} down_box DOWN_BOX labelfont 1 labelsize 10
  266. code0 {o->value(pars->Pfixedfreq);}
  267. }
  268. Fl_Dial fixedfreqetdial {
  269. label {Eq.T.}
  270. callback {pars->PfixedfreqET=(int) o->value();}
  271. tooltip {How the frequency varies acording to the keyboard (leftmost for fixed frequency)} xywh {610 45 15 15} box ROUND_UP_BOX labelsize 10 align 8 maximum 127 step 1
  272. code0 {o->value(pars->PfixedfreqET);}
  273. code1 {if (pars->Pfixedfreq==0) o->deactivate();}
  274. class WidgetPDial
  275. }
  276. Fl_Choice detunetype {
  277. label {Detune Type}
  278. callback {pars->PDetuneType=(int) o->value()+1;
  279. detunevalueoutput->do_callback();} open
  280. xywh {655 85 70 15} down_box BORDER_BOX labelsize 10 align 5 textfont 1 textsize 10
  281. code0 {o->add("L35cents");o->add("L10cents");o->add("E100cents");o->add("E1200cents");}
  282. code1 {o->value(pars->PDetuneType-1);}
  283. } {}
  284. }
  285. Fl_Check_Button stereo {
  286. label Stereo
  287. callback {pars->Pstereo=(int) o->value();} selected
  288. xywh {440 325 55 35} box THIN_UP_BOX down_box DOWN_BOX labelsize 10
  289. code0 {o->value(pars->Pstereo);}
  290. }
  291. Fl_Button {} {
  292. label Clear
  293. callback {for (int i=0;i<MAX_SUB_HARMONICS;i++){
  294. h[i]->mag->value(127);
  295. pars->Phmag[i]=0;
  296. h[i]->bw->value(64);
  297. pars->Phrelbw[i]=64;
  298. };
  299. pars->Phmag[0]=127;
  300. h[0]->mag->value(0);
  301. SUBparameters->redraw();}
  302. tooltip {Clear the harmonics} xywh {445 365 70 20} box THIN_UP_BOX labelfont 1 labelsize 11
  303. }
  304. Fl_Group bandwidthsettingsui {
  305. label BANDWIDTH
  306. xywh {220 5 220 135} box UP_FRAME labeltype EMBOSSED_LABEL labelfont 1 align 17
  307. } {
  308. Fl_Group bandwidthenvelopegroup {
  309. label {SUBsynth - BandWidth Envelope} open
  310. xywh {225 65 205 70} box FLAT_BOX color 51 align 144
  311. code0 {o->init(pars->BandWidthEnvelope);}
  312. code1 {if (pars->PBandWidthEnvelopeEnabled==0) o->deactivate();}
  313. class EnvelopeUI
  314. } {}
  315. Fl_Check_Button bwee {
  316. label Enabled
  317. callback {pars->PBandWidthEnvelopeEnabled=o->value();
  318. if (o->value()==0) bandwidthenvelopegroup->deactivate();
  319. else bandwidthenvelopegroup->activate();
  320. o->show();
  321. bandwidthsettingsui->redraw();}
  322. xywh {225 67 55 15} down_box DOWN_BOX labelfont 1 labelsize 10
  323. code0 {o->value(pars->PBandWidthEnvelopeEnabled);}
  324. }
  325. Fl_Value_Slider bandwidth {
  326. label {Band Width}
  327. callback {pars->Pbandwidth=(int) o->value();}
  328. xywh {225 40 115 15} type {Horz Knob} box NO_BOX labelsize 10 align 1 maximum 127 step 1
  329. code0 {o->value(pars->Pbandwidth);}
  330. }
  331. Fl_Value_Slider bwidthscale {
  332. label {B.Width Scale}
  333. callback {pars->Pbwscale=(int) o->value()+64;}
  334. 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
  335. code0 {o->value(pars->Pbwscale-64);}
  336. }
  337. }
  338. Fl_Group globalfiltergroup {
  339. label FILTER
  340. xywh {440 140 290 185} box UP_FRAME labeltype EMBOSSED_LABEL labelfont 1 labelsize 13 align 17
  341. code0 {if (pars->PGlobalFilterEnabled==0) o->deactivate();}
  342. } {
  343. Fl_Group filterenv {
  344. label {SUBsynth - Filter Envelope} open
  345. xywh {445 250 275 70} box FLAT_BOX color 51 align 144
  346. code0 {o->init(pars->GlobalFilterEnvelope);}
  347. class EnvelopeUI
  348. } {}
  349. Fl_Group filterui {
  350. label {SUBsynthl - Filter} open
  351. xywh {445 165 275 75} box FLAT_BOX color 50 align 144
  352. code0 {o->init(pars->GlobalFilter,&pars->PGlobalFilterVelocityScale,&pars->PGlobalFilterVelocityScaleFunction);}
  353. class FilterUI
  354. } {}
  355. }
  356. Fl_Check_Button filtere {
  357. label Enabled
  358. callback {pars->PGlobalFilterEnabled=o->value();
  359. if (o->value()==0) globalfiltergroup->deactivate();
  360. else globalfiltergroup->activate();
  361. o->show();
  362. globalfiltergroup->redraw();}
  363. xywh {445 145 85 20} down_box DOWN_BOX labelfont 1 labelsize 11
  364. code0 {o->value(pars->PGlobalFilterEnabled);}
  365. }
  366. Fl_Button {} {
  367. label C
  368. callback {presetsui->copy(pars);}
  369. xywh {540 370 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 7
  370. }
  371. Fl_Button {} {
  372. label P
  373. callback {presetsui->paste(pars,this);}
  374. xywh {570 370 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 7
  375. }
  376. }
  377. }
  378. Function {refresh()} {} {
  379. code {for (int i=0;i<MAX_SUB_HARMONICS;i++) h[i]->refresh();
  380. vol->value(pars->PVolume);
  381. vsns->value(pars->PAmpVelocityScaleFunction);
  382. pan->value(pars->PPanning);
  383. bandwidth->value(pars->Pbandwidth);
  384. bwidthscale->value(pars->Pbwscale-64);
  385. bwee->value(pars->PBandWidthEnvelopeEnabled);
  386. if (pars->PBandWidthEnvelopeEnabled==0) bandwidthenvelopegroup->deactivate();
  387. else bandwidthenvelopegroup->activate();
  388. bwee->show();
  389. bandwidthsettingsui->redraw();
  390. detunevalueoutput->value(getdetune(pars->PDetuneType,0,pars->PDetune));
  391. freqee->value(pars->PFreqEnvelopeEnabled);
  392. if (pars->PFreqEnvelopeEnabled==0) freqenvelopegroup->deactivate();
  393. else freqenvelopegroup->activate();
  394. freqee->show();
  395. freqsettingsui->redraw();
  396. detune->value(pars->PDetune-8192);
  397. hz440->value(pars->Pfixedfreq);
  398. fixedfreqetdial->value(pars->PfixedfreqET);
  399. int k=pars->PCoarseDetune/1024;if (k>=8) k-=16;
  400. octave->value(k);
  401. detunetype->value(pars->PDetuneType-1);
  402. k=pars->PCoarseDetune%1024;if (k>=512) k-=1024;
  403. coarsedet->value(k);
  404. filtere->value(pars->PGlobalFilterEnabled);
  405. if (pars->PGlobalFilterEnabled==0) globalfiltergroup->deactivate();
  406. else globalfiltergroup->activate();
  407. filtere->show();
  408. globalfiltergroup->redraw();
  409. stereo->value(pars->Pstereo);
  410. filterstages->value(pars->Pnumstages);
  411. magtype->value(pars->Phmagtype);
  412. start->value(pars->Pstart);
  413. ampenv->refresh();
  414. bandwidthenvelopegroup->refresh();
  415. freqenvelopegroup->refresh();
  416. filterui->refresh();
  417. filterenv->refresh();} {}
  418. }
  419. Function {SUBnoteUI(SUBnoteParameters *parameters)} {} {
  420. code {pars=parameters;
  421. make_window();} {}
  422. }
  423. Function {~SUBnoteUI()} {} {
  424. code {//for (int i=0;i<MAX_SUB_HARMONICS;i++) delete (h[i]);
  425. SUBparameters->hide();
  426. delete(SUBparameters);} {}
  427. }
  428. decl {SUBnoteParameters *pars;} {private local
  429. }
  430. decl {SUBnoteharmonic *h[MAX_SUB_HARMONICS];} {private local
  431. }
  432. }