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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  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 282 84 15} type Horizontal 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 1 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 33 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 33 18} labelsize 12 when 3 minimum 1 maximum 127 step 1 value 30 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_Dial centerfreq {
  152. label {C.f.}
  153. callback {centerfreqvo->do_callback();
  154. redrawPADnoteApply();}
  155. xywh {245 265 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
  156. code0 {o->init("Pcenterfreq");}
  157. class Fl_Osc_Dial
  158. }
  159. Fl_Dial octavesfreq {
  160. label {Oct.}
  161. callback {octavesfreqvo->do_callback();
  162. redrawPADnoteApply();}
  163. xywh {280 265 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
  164. code0 {o->init("Poctavesfreq");}
  165. class Fl_Osc_Dial
  166. }
  167. Fl_Button {} {
  168. label C
  169. callback {presetsui->copy(resonancewindow->loc());}
  170. xywh {625 275 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55
  171. }
  172. Fl_Button {} {
  173. label P
  174. callback {presetsui->paste(resonancewindow->loc(),this);}
  175. xywh {655 275 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55
  176. }
  177. Fl_Button applybutton {
  178. label Apply
  179. callback {applybutton->color(FL_GRAY);
  180. applybutton->redraw();
  181. if (cbapplywidget!=NULL) {
  182. cbapplywidget->do_callback();
  183. cbapplywidget->color(FL_GRAY);
  184. cbapplywidget->redraw();
  185. };}
  186. xywh {690 265 85 15} box THIN_UP_BOX labelfont 1 labelsize 11
  187. }
  188. Fl_Box rg {
  189. xywh {6 5 768 256} box BORDER_BOX
  190. class Fl_Resonance_Graph
  191. }
  192. }
  193. }
  194. Function {ResonanceUI(Fl_Osc_Interface *osc, std::string loc)} {open
  195. } {
  196. code {
  197. assert(osc);
  198. cbwidget=NULL;
  199. cbapplywidget=NULL;
  200. make_window(osc, loc);
  201. rg->init(khzvalue,dbvalue);
  202. applybutton->hide();} {}
  203. }
  204. Function {~ResonanceUI()} {} {
  205. code {resonancewindow->hide();
  206. delete resonancewindow;
  207. } {}
  208. }
  209. Function {redrawPADnoteApply()} {} {
  210. code {
  211. rg->update();
  212. if (cbwidget!=NULL) {
  213. cbwidget->do_callback();
  214. applybutton->color(FL_RED);
  215. applybutton->redraw();
  216. };} {}
  217. }
  218. Function {setcbwidget(Fl_Widget *cbwidget,Fl_Widget *cbapplywidget)} {} {
  219. code {this->cbwidget=cbwidget;
  220. this->cbapplywidget=cbapplywidget;
  221. rg->setcbwidget(cbwidget,applybutton);
  222. applybutton->show();} {}
  223. }
  224. Function {refresh()} {} {
  225. code {redrawPADnoteApply();
  226. //TODO fix me when controls are relocatable
  227. //enabled->value(respar->Penabled);
  228. //maxdb->value(respar->PmaxdB);
  229. //maxdbvo->value(respar->PmaxdB);
  230. //
  231. //centerfreqvo->value(respar->getcenterfreq()/1000.0);
  232. //octavesfreqvo->value(respar->getoctavesfreq());
  233. //
  234. //centerfreq->value(respar->Pcenterfreq);
  235. //octavesfreq->value(respar->Poctavesfreq);
  236. //
  237. //p1st->value(respar->Pprotectthefundamental);
  238. rg->update();} {}
  239. }
  240. decl {Fl_Widget *cbwidget,*cbapplywidget;} {private local
  241. }
  242. }