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.

ResonanceUI.fl 7.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  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/Fl_Box.H>} {public local
  10. }
  11. decl {\#include <FL/fl_draw.H>} {public local
  12. }
  13. decl {\#include <FL/Fl_Value_Output.H>} {public local
  14. }
  15. decl {\#include <math.h>} {private local
  16. }
  17. decl {\#include <stdio.h>} {private local
  18. }
  19. decl {\#include <stdlib.h>} {private local
  20. }
  21. decl {\#include <string.h>} {private local
  22. }
  23. decl {\#include "Fl_Osc_Dial.H"} {public local
  24. }
  25. decl {\#include "Fl_Osc_Pane.H"} {selected public local
  26. }
  27. decl {\#include "Fl_Osc_Button.H"} {public local
  28. }
  29. decl {\#include "Fl_Osc_Check.H"} {public local
  30. }
  31. decl {\#include "Fl_Osc_Slider.H"} {public local
  32. }
  33. decl {\#include "Fl_Osc_Output.H"} {public local
  34. }
  35. decl {\#include "Fl_Resonance_Graph.H"} {public local
  36. }
  37. decl {\#include "PresetsUI.h"} {public local
  38. }
  39. class ResonanceUI {open : PresetsUI_
  40. } {
  41. Function {make_window(Fl_Osc_Interface *osc, std::string loc)} {open
  42. } {
  43. Fl_Window resonancewindow {
  44. label Resonance open
  45. xywh {123 93 780 305} type Double
  46. class Fl_Osc_Window visible
  47. } {
  48. Fl_Value_Output khzvalue {
  49. label kHz
  50. xywh {415 264 45 18} labelsize 12 align 8 minimum 0.001 maximum 48 step 0.01 textfont 1 textsize 12
  51. code0 {//this widget must be before the calling widgets}
  52. code1 {resonancewindow->init(osc,loc);}
  53. }
  54. Fl_Value_Output dbvalue {
  55. label dB
  56. xywh {415 282 45 18} labelsize 12 align 8 minimum -150 maximum 150 step 0.1 textfont 1 textsize 12
  57. code0 {//this widget must be before the calling widgets}
  58. }
  59. Fl_Button {} {
  60. label Close
  61. callback {resonancewindow->hide();}
  62. xywh {690 283 84 17} box THIN_UP_BOX
  63. }
  64. Fl_Button {} {
  65. label Zero
  66. callback {
  67. o->oscWrite("zero");
  68. redrawPADnoteApply();}
  69. tooltip {Clear the resonance function} xywh {491 264 66 15} box THIN_UP_BOX labelfont 1 labelsize 12
  70. class Fl_Osc_Button
  71. }
  72. Fl_Button {} {
  73. label Smooth
  74. callback {o->oscWrite("smooth");
  75. redrawPADnoteApply();}
  76. tooltip {Smooth the resonance function} xywh {491 282 66 18} box THIN_UP_BOX labelfont 1 labelsize 12
  77. class Fl_Osc_Button
  78. }
  79. Fl_Check_Button enabled {
  80. label Enable
  81. xywh {6 270 78 27} box THIN_UP_BOX down_box DOWN_BOX
  82. code0 {o->init("Penabled");}
  83. class Fl_Osc_Check
  84. }
  85. Fl_Slider maxdb {
  86. callback {maxdbvo->value(o->value());
  87. redrawPADnoteApply();}
  88. xywh {90 285 84 15} box FLAT_BOX type {Horz Knob} minimum 1 maximum 90 step 1 value 30
  89. code0 {o->init("PmaxdB", 'i'); o->reset_value = 30;}
  90. class Fl_Osc_Slider
  91. }
  92. Fl_Value_Output maxdbvo {
  93. label {Max.}
  94. tooltip {The Maximum amplitude (dB)} xywh {126 264 24 18} labelsize 12 minimum 1 maximum 127 step 1 value 30 textfont 0 textsize 12
  95. }
  96. Fl_Box {} {
  97. label dB
  98. xywh {150 264 24 18}
  99. }
  100. Fl_Value_Output centerfreqvo {
  101. label {C.f.}
  102. callback {o->value(o->newvalue()/1000.0);}
  103. tooltip {Center Frequency (kHz)} xywh {210 264 45 18} labelsize 12 when 3 minimum 1 maximum 10 step 0.01 value 1 textfont 1 textsize 12
  104. code0 {o->init("centerfreq");}
  105. class Fl_Osc_Output
  106. }
  107. Fl_Value_Output octavesfreqvo {
  108. label {Oct.}
  109. callback {o->value(o->newvalue());}
  110. tooltip {No. of octaves} xywh {210 282 45 18} labelsize 12 when 3 minimum 0 maximum 11 step 0.01 value 5 textfont 1 textsize 12
  111. code0 {o->init("octavesfreq");}
  112. class Fl_Osc_Output
  113. }
  114. Fl_Button {} {
  115. label RND2
  116. callback {o->oscWrite("randomize", "i", 1);
  117. redrawPADnoteApply();}
  118. tooltip {Randomize the resonance function} xywh {566 276 42 12} box THIN_UP_BOX labelfont 1 labelsize 10
  119. class Fl_Osc_Button
  120. }
  121. Fl_Button {} {
  122. label RND1
  123. callback {o->oscWrite("randomize", "i", 0);
  124. redrawPADnoteApply();}
  125. tooltip {Randomize the resonance function} xywh {566 264 42 12} box THIN_UP_BOX labelfont 1 labelsize 10
  126. class Fl_Osc_Button
  127. }
  128. Fl_Button {} {
  129. label RND3
  130. callback {o->oscWrite("randomize", "i", 2);
  131. redrawPADnoteApply();}
  132. tooltip {Randomize the resonance function} xywh {566 288 42 12} box THIN_UP_BOX labelfont 1 labelsize 10
  133. class Fl_Osc_Button
  134. }
  135. Fl_Check_Button p1st {
  136. label {P.1st}
  137. tooltip {Protect the fundamental frequency (do not damp the first harmonic)} xywh {365 285 45 15} down_box DOWN_BOX labelsize 10
  138. code0 {o->init("Pprotectthefundamental");}
  139. class Fl_Osc_Check
  140. }
  141. Fl_Button {} {
  142. label InterpP
  143. callback {int type;
  144. if (Fl::event_button()==FL_LEFT_MOUSE) type=0;
  145. else type=1;
  146. o->oscWrite("interpolatepeaks", "i", type);
  147. redrawPADnoteApply();}
  148. tooltip {Interpolate the peaks} xywh {365 265 46 15} box THIN_UP_BOX labelfont 1 labelsize 10
  149. class Fl_Osc_Button
  150. }
  151. Fl_Slider centerfreq {
  152. callback {centerfreqvo->do_callback();
  153. redrawPADnoteApply();}
  154. xywh {260 268 90 14} box FLAT_BOX type {Horz Knob} labelsize 10 maximum 127 step 1
  155. code0 {o->init("Pcenterfreq", 'i');o->reset_value=64;}
  156. class Fl_Osc_Slider
  157. }
  158. Fl_Slider octavesfreq {
  159. callback {octavesfreqvo->do_callback();
  160. redrawPADnoteApply();}
  161. xywh {260 286 90 14} box FLAT_BOX type {Horz Knob} labelsize 10 maximum 127 step 1
  162. code0 {o->init("Poctavesfreq", 'i');o->reset_value=64;}
  163. class Fl_Osc_Slider
  164. }
  165. Fl_Button {} {
  166. label C
  167. callback {presetsui->copy(resonancewindow->loc());}
  168. xywh {625 275 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55
  169. }
  170. Fl_Button {} {
  171. label P
  172. callback {presetsui->paste(resonancewindow->loc(),this);}
  173. xywh {655 275 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55
  174. }
  175. Fl_Button applybutton {
  176. label Apply
  177. callback {applybutton->color(FL_GRAY);
  178. applybutton->redraw();
  179. if (cbapplywidget!=NULL) {
  180. cbapplywidget->do_callback();
  181. cbapplywidget->color(FL_GRAY);
  182. cbapplywidget->redraw();
  183. };}
  184. xywh {690 265 85 15} box THIN_UP_BOX labelfont 1 labelsize 11
  185. }
  186. Fl_Box rg {
  187. xywh {6 5 768 256} box BORDER_BOX
  188. class Fl_Resonance_Graph
  189. }
  190. }
  191. }
  192. Function {ResonanceUI(Fl_Osc_Interface *osc, std::string loc)} {open
  193. } {
  194. code {
  195. assert(osc);
  196. cbwidget=NULL;
  197. cbapplywidget=NULL;
  198. make_window(osc, loc);
  199. rg->init(khzvalue,dbvalue);
  200. applybutton->hide();} {}
  201. }
  202. Function {~ResonanceUI()} {} {
  203. code {resonancewindow->hide();
  204. delete resonancewindow;
  205. } {}
  206. }
  207. Function {redrawPADnoteApply()} {} {
  208. code {
  209. rg->update();
  210. if (cbwidget!=NULL) {
  211. cbwidget->do_callback();
  212. applybutton->color(FL_RED);
  213. applybutton->redraw();
  214. };} {}
  215. }
  216. Function {setcbwidget(Fl_Widget *cbwidget,Fl_Widget *cbapplywidget)} {} {
  217. code {this->cbwidget=cbwidget;
  218. this->cbapplywidget=cbapplywidget;
  219. rg->setcbwidget(cbwidget,applybutton);
  220. applybutton->show();} {}
  221. }
  222. Function {refresh()} {} {
  223. code {redrawPADnoteApply();
  224. //TODO fix me when controls are relocatable
  225. //enabled->value(respar->Penabled);
  226. //maxdb->value(respar->PmaxdB);
  227. //maxdbvo->value(respar->PmaxdB);
  228. //
  229. //centerfreqvo->value(respar->getcenterfreq()/1000.0);
  230. //octavesfreqvo->value(respar->getoctavesfreq());
  231. //
  232. //centerfreq->value(respar->Pcenterfreq);
  233. //octavesfreq->value(respar->Poctavesfreq);
  234. //
  235. //p1st->value(respar->Pprotectthefundamental);
  236. rg->update();} {}
  237. }
  238. decl {Fl_Widget *cbwidget,*cbapplywidget;} {private local
  239. }
  240. }