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.

684 lines
21KB

  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 "Fl_Osc_Dial.H"} {public local
  10. }
  11. decl {\#include "Fl_Osc_Check.H"} {public local
  12. }
  13. decl {\#include "Fl_Osc_Button.H"} {public local
  14. }
  15. decl {\#include "Fl_Osc_Counter.H"} {public local
  16. }
  17. decl {\#include <stdio.h>} {public local
  18. }
  19. decl {\#include <stdlib.h>} {public local
  20. }
  21. decl {\#include "../globals.h"} {public local
  22. }
  23. decl {\#include <FL/Fl_Group.H>} {public local
  24. }
  25. decl {\#include "../Params/EnvelopeParams.h"} {public local
  26. }
  27. decl {\#include <FL/Fl_Box.H>} {public local
  28. }
  29. decl {\#include <FL/fl_draw.H>} {public local
  30. }
  31. decl {\#include <FL/fl_ask.H>} {public local
  32. }
  33. decl {\#include "PresetsUI.h"} {public local
  34. }
  35. decl {\#include "common.H"} {public local
  36. }
  37. decl {\#include "EnvelopeFreeEdit.h"} {public local
  38. }
  39. class EnvelopeUI {open : {public Fl_Osc_Group,PresetsUI_}
  40. } {
  41. Function {EnvelopeUI(int x,int y, int w, int h, const char *label=0):Fl_Osc_Group(x,y,w,h,label)} {} {
  42. code {freemodeeditwindow=NULL;
  43. envADSR=NULL;
  44. envASR=NULL;
  45. envADSRfilter=NULL;
  46. envASRbw=NULL;
  47. envfree=NULL;} {}
  48. }
  49. Function {~EnvelopeUI()} {} {
  50. code {envwindow->hide();
  51. hide();
  52. freemodeeditwindow->hide();
  53. delete (freemodeeditwindow);} {}
  54. }
  55. Function {make_freemode_edit_window()} {open
  56. } {
  57. Fl_Window freemodeeditwindow {
  58. label Envelope open
  59. xywh {702 801 575 180} type Double
  60. class Fl_Osc_Window visible
  61. } {
  62. Fl_Button {} {
  63. label C
  64. callback {presetsui->copy(freemodeeditwindow->loc());}
  65. xywh {465 160 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 7
  66. code0 {freemodeeditwindow->osc = osc; freemodeeditwindow->base = loc();}
  67. }
  68. Fl_Button {} {
  69. label P
  70. callback {presetsui->paste(freemodeeditwindow->loc(),this);}
  71. xywh {482 160 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 7
  72. }
  73. Fl_Button addpoint {
  74. label {Add point}
  75. callback {
  76. if(freeedit->lastpoint >= MAX_ENVELOPE_POINTS - 1)
  77. return;
  78. o->oscWrite("addPoint", "i", freeedit->lastpoint);
  79. freeedit->lastpoint+=1;
  80. freeedit->update();
  81. envfree->redraw();
  82. sustaincounter->update();
  83. //sustaincounter->value(Penvsustain);
  84. //sustaincounter->maximum(Penvpoints-2);}
  85. xywh {115 155 80 20} box THIN_UP_BOX labelsize 11
  86. code0 {(void)o;//if (Pfreemode==0) o->hide();}
  87. class Fl_Osc_Button
  88. }
  89. Fl_Box freeedit {
  90. label Envelope
  91. callback {sustaincounter->maximum(o->Penvpoints-2);}
  92. xywh {5 5 565 145} box FLAT_BOX color 0
  93. code0 {o->init();}
  94. class EnvelopeFreeEdit
  95. }
  96. Fl_Button deletepoint {
  97. label {Delete point}
  98. callback {o->oscWrite("delPoint", "i", freeedit->lastpoint);
  99. freeedit->lastpoint-=1;
  100. freeedit->update();
  101. envfree->redraw();
  102. sustaincounter->update();
  103. //sustaincounter->value(Penvsustain);
  104. //sustaincounter->maximum(Penvpoints-2);}
  105. xywh {200 155 80 20} box THIN_UP_BOX labelsize 11
  106. code0 {(void)o;//if (Pfreemode==0) o->hide();}
  107. class Fl_Osc_Button
  108. }
  109. Fl_Check_Button freemodebutton {
  110. label FreeMode
  111. callback {
  112. o->oscWrite("Pfreemode", o->value() ? "T" : "F");
  113. reinit(o->value());
  114. freeedit->lastpoint=-1;
  115. freeedit->redraw();}
  116. tooltip {Enable or disable the freemode} xywh {10 155 95 20} labelsize 11
  117. code0{o->init("Pfreemode");}
  118. class Fl_Osc_Check
  119. }
  120. Fl_Check_Button forcedreleasecheck {
  121. label frcR
  122. tooltip {Forced Release} xywh {410 165 40 15} down_box DOWN_BOX labelsize 10
  123. code0 {o->init("Pforcedrelease");}
  124. code1 {//TODO if (Pfreemode==0) o->hide();}
  125. class Fl_Osc_Check
  126. }
  127. Fl_Dial envstretchdial {
  128. label {Str.}
  129. tooltip {Envelope stretch (on lower notes make the envelope longer)} xywh {380 155 25 25} box ROUND_UP_BOX labelsize 10 align 4 maximum 127 step 1
  130. code0 {o->init("Penvstretch");}
  131. code1 {//TODO if (Pfreemode==0) o->hide();}
  132. class Fl_Osc_Dial
  133. }
  134. Fl_Button {} {
  135. label Close
  136. callback {freemodeeditwindow->hide();}
  137. xywh {510 155 60 20} box THIN_UP_BOX
  138. }
  139. Fl_Check_Button linearenvelopecheck {
  140. label L
  141. tooltip {Linear Envelope} xywh {410 151 30 15} down_box DOWN_BOX labelsize 10
  142. code0 {o->init("Plinearenvelope");}
  143. code1 {//TODO if ((Pfreemode==0)||(Envmode>2)) o->hide();}
  144. class Fl_Osc_Check
  145. }
  146. Fl_Counter sustaincounter {
  147. label Sust
  148. callback {freeedit->redraw();
  149. envfree->redraw();}
  150. tooltip {Sustain (0 is disabled)} xywh {315 155 40 15} type Simple labelsize 11 align 4 minimum 0 maximum 127 step 1
  151. code3 {o->init("Penvsustain");}
  152. class Fl_Osc_Counter
  153. }
  154. }
  155. }
  156. Function {make_ADSR_window()} {} {
  157. Fl_Window envADSR {open
  158. xywh {353 911 205 70} type Double color 50 labelfont 1
  159. class Fl_Osc_Group visible
  160. } {
  161. Fl_Group {} {
  162. label {Amplitude Envelope}
  163. xywh {0 0 205 70} box UP_BOX color 223 labeltype ENGRAVED_LABEL labelsize 10 align 17
  164. code0 {set_module_parameters(o);}
  165. } {
  166. Fl_Button {} {
  167. label C
  168. callback {presetsui->copy(envADSR->loc());}
  169. xywh {150 5 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 7
  170. }
  171. Fl_Button {} {
  172. label P
  173. callback {presetsui->paste(envADSR->loc(),this);}
  174. xywh {167 5 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 7
  175. }
  176. Fl_Dial e1adt {
  177. label {A.dt}
  178. callback {freeedit->redraw();}
  179. tooltip {Attack time} xywh {5 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
  180. code0 {o->init("PA_dt");}
  181. class Fl_Osc_Dial
  182. }
  183. Fl_Dial e1ddt {
  184. label {D.dt}
  185. callback {freeedit->redraw();}
  186. tooltip {Decay time} xywh {40 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
  187. code0 {o->init("PD_dt");}
  188. class Fl_Osc_Dial
  189. }
  190. Fl_Dial e1rdt {
  191. label {R.dt}
  192. callback {freeedit->redraw();}
  193. tooltip {Release time} xywh {110 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
  194. code0 {o->init("PR_dt");}
  195. class Fl_Osc_Dial
  196. }
  197. Fl_Dial e1sval {
  198. label {S.val}
  199. callback {freeedit->redraw();}
  200. tooltip {Sustain value} xywh {75 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
  201. code0 {o->init("PS_val");}
  202. class Fl_Osc_Dial
  203. }
  204. Fl_Check_Button e1forcedrelease {
  205. label frcR
  206. tooltip {Forced Release} xywh {180 35 20 15} down_box DOWN_BOX labelsize 10 align 6
  207. code0 {o->init("Pforcedrelease");}
  208. class Fl_Osc_Check
  209. }
  210. Fl_Dial e1envstretch {
  211. label Stretch
  212. tooltip {Envelope stretch (on lower notes makes the envelope longer)} xywh {145 25 25 25} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
  213. code0 {o->init("Penvstretch");}
  214. class Fl_Osc_Dial
  215. }
  216. Fl_Button {} {
  217. label E
  218. callback {freemodeeditwindow->show();}
  219. tooltip {Envelope window} xywh {185 5 15 15} labelfont 1 labelsize 10
  220. }
  221. Fl_Check_Button e1linearenvelope {
  222. label L
  223. tooltip {The evelope is linear} xywh {180 20 15 15} down_box DOWN_BOX labelsize 10 align 4
  224. code0 {o->init("Plinearenvelope");}
  225. class Fl_Osc_Check
  226. }
  227. }
  228. }
  229. }
  230. Function {make_ASR_window()} {} {
  231. Fl_Window envASR {open
  232. xywh {1067 911 210 70} type Double
  233. class Fl_Osc_Group visible
  234. } {
  235. Fl_Group {} {
  236. label {Frequency Envelope}
  237. xywh {0 0 210 70} box UP_BOX color 223 labeltype ENGRAVED_LABEL labelsize 10 align 17
  238. code0 {set_module_parameters(o);}
  239. } {
  240. Fl_Button {} {
  241. label C
  242. callback {presetsui->copy(envASR->loc());}
  243. xywh {155 5 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 7
  244. }
  245. Fl_Button {} {
  246. label P
  247. callback {presetsui->paste(envASR->loc(),this);}
  248. xywh {172 5 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 7
  249. }
  250. Fl_Dial e2aval {
  251. label {A.val}
  252. callback {freeedit->redraw();}
  253. tooltip {Starting value} xywh {5 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
  254. code0 {o->init("PA_val");}
  255. class Fl_Osc_Dial
  256. }
  257. Fl_Dial e2adt {
  258. label {A.dt}
  259. callback {freeedit->redraw();}
  260. tooltip {Attack time} xywh {40 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
  261. code0 {o->init("PA_dt");}
  262. class Fl_Osc_Dial
  263. }
  264. Fl_Dial e2rval {
  265. label {R.val}
  266. callback {freeedit->redraw();}
  267. tooltip {Release value} xywh {110 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
  268. code0 {o->init("PR_val");}
  269. class Fl_Osc_Dial
  270. }
  271. Fl_Dial e2rdt {
  272. label {R.dt}
  273. callback {freeedit->redraw();}
  274. tooltip {Release time} xywh {75 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
  275. code0 {o->init("PR_dt");}
  276. class Fl_Osc_Dial
  277. }
  278. Fl_Dial e2envstretch {
  279. label Stretch
  280. tooltip {Envelope stretch (on lower notes makes the envelope longer)} xywh {145 25 25 25} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
  281. code0 {o->init("Penvstretch");}
  282. class Fl_Osc_Dial
  283. }
  284. Fl_Check_Button e2forcedrelease {
  285. label frcR
  286. tooltip {Forced release} xywh {180 25 15 25} down_box DOWN_BOX labelsize 10 align 6
  287. code0 {o->init("Pforcedrelease");}
  288. class Fl_Osc_Check
  289. }
  290. }
  291. Fl_Button {} {
  292. label E
  293. callback {freemodeeditwindow->show();}
  294. tooltip {Envelope window} xywh {190 5 15 15} labelfont 1 labelsize 10
  295. }
  296. }
  297. }
  298. Function {make_ADSRfilter_window()} {} {
  299. Fl_Window envADSRfilter {open
  300. xywh {1002 911 275 70} type Double color 50 labelfont 1
  301. class Fl_Osc_Group visible
  302. } {
  303. Fl_Group {} {
  304. label {Filter Envelope}
  305. xywh {0 0 275 70} box UP_BOX color 223 labeltype ENGRAVED_LABEL labelsize 10 align 17
  306. code0 {set_module_parameters(o);}
  307. } {
  308. Fl_Button {} {
  309. label C
  310. callback {presetsui->copy(envADSRfilter->loc());}
  311. xywh {220 5 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 7
  312. }
  313. Fl_Button {} {
  314. label P
  315. callback {presetsui->paste(envADSRfilter->loc(),this);}
  316. xywh {237 5 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 7
  317. }
  318. Fl_Dial e3aval {
  319. label {A.val}
  320. callback {freeedit->redraw();}
  321. tooltip {Starting value} xywh {5 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
  322. code0 {o->init("PA_val");}
  323. class Fl_Osc_Dial
  324. }
  325. Fl_Dial e3adt {
  326. label {A.dt}
  327. callback {freeedit->redraw();}
  328. tooltip {Attack time} xywh {40 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
  329. code0 {o->init("PA_dt");}
  330. class Fl_Osc_Dial
  331. }
  332. Fl_Dial e3dval {
  333. label {D.val}
  334. callback {freeedit->redraw();}
  335. tooltip {decay value} xywh {75 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
  336. code0 {o->init("PD_val");}
  337. class Fl_Osc_Dial
  338. }
  339. Fl_Dial e3ddt {
  340. label {D.dt}
  341. callback {freeedit->redraw();}
  342. tooltip {decay time} xywh {110 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
  343. code0 {o->init("PD_dt");}
  344. class Fl_Osc_Dial
  345. }
  346. Fl_Dial e3rdt {
  347. label {R.dt}
  348. callback {freeedit->redraw();}
  349. tooltip {Release time} xywh {145 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
  350. code0 {o->init("PR_dt");}
  351. class Fl_Osc_Dial
  352. }
  353. Fl_Dial e3rval {
  354. label {R.val}
  355. callback {freeedit->redraw();}
  356. tooltip {Release value} xywh {180 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
  357. code0 {o->init("PR_val");}
  358. class Fl_Osc_Dial
  359. }
  360. Fl_Dial e3envstretch {
  361. label Stretch
  362. tooltip {Envelope stretch (on lower notes makes the envelope longer)} xywh {215 25 25 25} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
  363. code0 {o->init("Penvstretch");}
  364. class Fl_Osc_Dial
  365. }
  366. Fl_Check_Button e3forcedrelease {
  367. label frcR
  368. tooltip {Forced Release} xywh {250 30 15 20} down_box DOWN_BOX labelsize 10 align 6
  369. code0 {o->init("Pforcedrelease");}
  370. class Fl_Osc_Check
  371. }
  372. Fl_Button {} {
  373. label E
  374. callback {freemodeeditwindow->show();}
  375. xywh {255 5 15 15} labelfont 1 labelsize 10
  376. }
  377. }
  378. }
  379. }
  380. Function {make_ASRbw_window()} {} {
  381. Fl_Window envASRbw {open
  382. xywh {371 911 210 70} type Double
  383. code0 {set_module_parameters(o);}
  384. class Fl_Osc_Group visible
  385. } {
  386. Fl_Group {} {
  387. label {BandWidth Envelope}
  388. xywh {0 0 210 70} box UP_BOX color 223 labeltype ENGRAVED_LABEL labelsize 10 align 17
  389. code0 {set_module_parameters(o);}
  390. } {
  391. Fl_Button {} {
  392. label C
  393. callback {presetsui->copy(envASRbw->loc());}
  394. xywh {155 5 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 7
  395. }
  396. Fl_Button {} {
  397. label P
  398. callback {presetsui->paste(envASRbw->loc(),this);}
  399. xywh {172 5 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 7
  400. }
  401. Fl_Dial e4aval {
  402. label {A.val}
  403. callback {freeedit->redraw();}
  404. tooltip {Starting value} xywh {5 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
  405. code0 {o->init("PA_val");}
  406. class Fl_Osc_Dial
  407. }
  408. Fl_Dial e4adt {
  409. label {A.dt}
  410. callback {freeedit->redraw();}
  411. tooltip {Attack time} xywh {40 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
  412. code0 {o->init("PA_dt");}
  413. class Fl_Osc_Dial
  414. }
  415. Fl_Dial e4rval {
  416. label {R.val}
  417. callback {freeedit->redraw();}
  418. tooltip {Release value} xywh {110 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
  419. code0 {o->init("PR_val");}
  420. class Fl_Osc_Dial
  421. }
  422. Fl_Dial e4rdt {
  423. label {R.dt}
  424. callback {freeedit->redraw();}
  425. tooltip {Release time} xywh {75 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
  426. code0 {o->init("PR_dt");}
  427. class Fl_Osc_Dial
  428. }
  429. Fl_Dial e4envstretch {
  430. label Stretch
  431. tooltip {Envelope stretch (on lower notes makes the envelope longer)} xywh {145 25 25 25} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
  432. code0 {o->init("Penvstretch");}
  433. class Fl_Osc_Dial
  434. }
  435. Fl_Check_Button e4forcedrelease {
  436. label frcR
  437. tooltip {Forced release} xywh {180 25 15 25} down_box DOWN_BOX labelsize 10 align 6
  438. code0 {o->init("Pforcedrelease");}
  439. class Fl_Osc_Check
  440. }
  441. }
  442. Fl_Button {} {
  443. label E
  444. callback {freemodeeditwindow->show();}
  445. xywh {190 5 15 15} labelfont 1 labelsize 10
  446. }
  447. }
  448. }
  449. Function {make_free_window()} {} {
  450. Fl_Window envfree {open
  451. xywh {385 911 205 70} type Double color 50 labelfont 1 resizable
  452. code0 {set_module_parameters(o);}
  453. class Fl_Osc_Group visible
  454. } {
  455. Fl_Group envfreegroup {
  456. label {Amplitude Envelope}
  457. xywh {0 0 205 70} box UP_BOX color 223 labeltype ENGRAVED_LABEL labelsize 10 align 17 resizable
  458. code0 {set_module_parameters(o);}
  459. } {
  460. Fl_Button {} {
  461. label E
  462. callback {freemodeeditwindow->show();}
  463. xywh {185 5 15 15} labelfont 1 labelsize 10
  464. }
  465. Fl_Box freeeditsmall {
  466. label Envelope
  467. callback {envfree->redraw();}
  468. xywh {5 20 195 45} box FLAT_BOX color 0 resizable
  469. code0 {o->init();}
  470. class EnvelopeFreeEdit
  471. }
  472. Fl_Button {} {
  473. label C
  474. callback {presetsui->copy(envfree->loc());}
  475. xywh {150 5 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 55
  476. }
  477. Fl_Button {} {
  478. label P
  479. callback {presetsui->paste(envfree->loc(),this);}
  480. xywh {167 5 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 55
  481. }
  482. }
  483. }
  484. }
  485. Function {init(int env_type, Fl_Osc_Interface *osc_, std::string base_, std::string ext_)} {open
  486. } {
  487. code {osc = osc_;
  488. base = base_;
  489. ext = ext_;
  490. Envmode = env_type;
  491. Penvsustain = false;
  492. Penvpoints = 3;
  493. Penvstretch = 0;
  494. Pforcedrelease = 0;
  495. Plinearenvelope = 0;
  496. assert(osc);
  497. make_ADSR_window();
  498. make_ASR_window();
  499. make_ADSRfilter_window();
  500. make_ASRbw_window();
  501. make_free_window();
  502. make_freemode_edit_window();
  503. envwindow=NULL;
  504. if(Envmode==3) envfreegroup->label("Frequency Envelope");
  505. if(Envmode==4) envfreegroup->label("Filter Envelope");
  506. if(Envmode==5) envfreegroup->label("Bandwidth Envelope");
  507. freemodeeditwindow->label(this->label());
  508. freeeditsmall->setpair(freeedit);
  509. freeedit->setpair(freeeditsmall);
  510. refresh();} {}
  511. }
  512. Function {rebase(std::string new_base)} {open
  513. } {
  514. code {Fl_Osc_Group::rebase(new_base);
  515. freemodeeditwindow->rebase(new_base+ext);} {}
  516. }
  517. Function {reinit(bool Pfreemode)} {open
  518. } {
  519. code {
  520. //if(!Pfreemode){
  521. // int answer=fl_choice("Disable the free mode of the Envelope?","No","Yes",NULL);
  522. // freemodebutton->value(Pfreemode);
  523. // if (answer==0)
  524. // return;
  525. //};
  526. freeedit->update();
  527. hide();
  528. const int winx=freemodeeditwindow->x();
  529. const int winy=freemodeeditwindow->y();
  530. bool reshow = freemodeeditwindow->visible();
  531. freemodeeditwindow->hide();
  532. envwindow->hide();
  533. Fl_Group *par=envwindow->parent();
  534. par->hide();
  535. refresh();
  536. envwindow->show();
  537. par->redraw();
  538. par->show();
  539. show();
  540. freemodeeditwindow->position(winx,winy);
  541. if(reshow)
  542. freemodeeditwindow->show();
  543. if (Pfreemode) {
  544. freemodebutton->value(1);
  545. addpoint->show();
  546. deletepoint->show();
  547. forcedreleasecheck->show();
  548. sustaincounter->show();
  549. envstretchdial->show();
  550. } else{
  551. freemodebutton->value(0);
  552. addpoint->hide();
  553. deletepoint->hide();
  554. forcedreleasecheck->hide();
  555. sustaincounter->hide();
  556. envstretchdial->hide();
  557. };
  558. } {selected
  559. }
  560. }
  561. Function {refresh()} {open
  562. } {
  563. code {
  564. sustaincounter->value(Penvsustain);
  565. sustaincounter->maximum(Penvpoints-2);
  566. envstretchdial->value(Penvstretch);
  567. linearenvelopecheck->value(Plinearenvelope);
  568. //Conditionally display widgets
  569. if(freemodebutton->value()) {
  570. freemodebutton->value(1);
  571. addpoint->show();
  572. deletepoint->show();
  573. forcedreleasecheck->show();
  574. sustaincounter->show();
  575. envstretchdial->show();
  576. } else {
  577. freemodebutton->value(0);
  578. addpoint->hide();
  579. deletepoint->hide();
  580. forcedreleasecheck->hide();
  581. sustaincounter->hide();
  582. envstretchdial->hide();
  583. }
  584. if(freemodebutton->value() || Envmode>2)
  585. linearenvelopecheck->hide();
  586. else
  587. linearenvelopecheck->show();
  588. forcedreleasecheck->value(Pforcedrelease);
  589. if (freemodebutton->value()==0){
  590. addpoint->hide();
  591. deletepoint->hide();
  592. } else {
  593. addpoint->show();
  594. deletepoint->show();
  595. }
  596. envADSR->hide();
  597. envASR->hide();
  598. envADSRfilter->hide();
  599. envASRbw->hide();
  600. envfree->hide();
  601. if (freemodebutton->value()==0){
  602. switch(Envmode){
  603. case 1:
  604. case 2:
  605. envwindow=envADSR;
  606. break;
  607. case 3:
  608. envwindow=envASR;
  609. break;
  610. case 4:
  611. envwindow=envADSRfilter;
  612. break;
  613. case 5:
  614. envwindow=envASRbw;
  615. break;
  616. default:
  617. break;
  618. };
  619. }else{
  620. envwindow=envfree;
  621. };
  622. assert(envwindow);
  623. envwindow->resize(this->x(),this->y(),this->w(),this->h());
  624. envwindow->show();} {}
  625. }
  626. decl {int Envmode;} {private local
  627. }
  628. decl {int Penvsustain;} {private local
  629. }
  630. decl {int Penvpoints;} {private local
  631. }
  632. decl {int Penvstretch;} {private local
  633. }
  634. decl {int Pforcedrelease;} {private local
  635. }
  636. decl {int Plinearenvelope;} {private local
  637. }
  638. decl {Fl_Group *envwindow;} {private local
  639. }
  640. }