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.

416 lines
13KB

  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 <stdio.h>} {public local
  10. }
  11. decl {\#include <math.h>} {public local
  12. }
  13. decl {\#include <stdlib.h>} {public local
  14. }
  15. decl {\#include <FL/Fl_File_Chooser.H>} {public local
  16. }
  17. decl {\#include "../globals.h"} {public local
  18. }
  19. decl {\#include "../Misc/Util.h"} {public local
  20. }
  21. decl {\#include "../Misc/Dump.h"} {public local
  22. }
  23. decl {extern Dump dump;} {public local
  24. }
  25. class ConfigUI {} {
  26. Function {make_window()} {} {
  27. Fl_Window configwindow {
  28. label {ZynAddSubFX Settings}
  29. callback {writebankcfg();
  30. o->hide();}
  31. xywh {554 443 510 370} type Double visible
  32. } {
  33. Fl_Tabs {} {
  34. xywh {5 5 500 330}
  35. } {
  36. Fl_Group {} {
  37. label {Main settings}
  38. xywh {5 25 500 310}
  39. } {
  40. Fl_Group {} {
  41. label {Sample Rate}
  42. xywh {15 45 165 30} box ENGRAVED_FRAME
  43. } {
  44. Fl_Choice {} {
  45. callback {if ((int)o->value()==0) samplerateinput->activate();
  46. else samplerateinput->deactivate();
  47. int samplerates[8]={44100,16000,22050,32000,44100,48000,88200,96000};
  48. config.cfg.SampleRate=samplerates[(int)o->value()];
  49. setsamplerateinput();}
  50. xywh {20 50 85 20} down_box BORDER_BOX textsize 10
  51. code0 {o->value(getsamplerateorder());}
  52. } {
  53. MenuItem {} {
  54. label Custom
  55. xywh {10 10 100 20} labelfont 1
  56. }
  57. MenuItem {} {
  58. label 16000Hz
  59. xywh {30 30 100 20} labelfont 1
  60. }
  61. MenuItem {} {
  62. label 22050Hz
  63. xywh {20 20 100 20} labelfont 1
  64. }
  65. MenuItem {} {
  66. label 32000Hz
  67. xywh {30 30 100 20} labelfont 1
  68. }
  69. MenuItem {} {
  70. label 44100Hz
  71. xywh {40 40 100 20} labelfont 1
  72. }
  73. MenuItem {} {
  74. label 48000Hz
  75. xywh {50 50 100 20} labelfont 1
  76. }
  77. MenuItem {} {
  78. label 88200Hz
  79. xywh {60 60 100 20} labelfont 1
  80. }
  81. MenuItem {} {
  82. label 96000Hz
  83. xywh {70 70 100 20} labelfont 1
  84. }
  85. }
  86. Fl_Input samplerateinput {
  87. callback {char *tmp;
  88. config.cfg.SampleRate=strtoul(o->value(),&tmp,10);}
  89. xywh {115 50 60 20} type Int textfont 1
  90. code0 {setsamplerateinput();}
  91. code1 {if (getsamplerateorder()!=0) o->deactivate();}
  92. }
  93. }
  94. Fl_Input {} {
  95. label {Buffer Size}
  96. callback {char *tmp;
  97. config.cfg.SoundBufferSize=strtoul(o->value(),&tmp,10);}
  98. tooltip {Internal Sound Buffer Size (samples)} xywh {190 45 60 20} type Int labelsize 11 align 129 textfont 1
  99. code0 {char *tmpbuf=new char[100];o->cut(0,o->maximum_size());}
  100. code1 {snprintf(tmpbuf,100,"%d",config.cfg.SoundBufferSize);o->insert(tmpbuf);}
  101. code2 {delete []tmpbuf;}
  102. }
  103. Fl_Check_Button {} {
  104. label {Swap Stereo }
  105. callback {config.cfg.SwapStereo=(int) o->value();}
  106. xywh {15 80 95 20} box NO_BOX labelsize 11
  107. code0 {o->value(config.cfg.SwapStereo);}
  108. }
  109. Fl_Choice {} {
  110. label OscilSize
  111. callback {config.cfg.OscilSize=128<<o->value();}
  112. tooltip {ADSynth Oscillator Size (samples)} xywh {175 80 75 20} down_box BORDER_BOX labelfont 1 labelsize 11 textsize 10
  113. code0 {o->value( (int) (log(config.cfg.OscilSize/128.0-1.0)/log(2)) +1);}
  114. } {
  115. MenuItem {} {
  116. label 128
  117. xywh {25 25 100 20} labelfont 1
  118. }
  119. MenuItem {} {
  120. label 256
  121. xywh {35 35 100 20} labelfont 1
  122. }
  123. MenuItem {} {
  124. label 512
  125. xywh {45 45 100 20} labelfont 1
  126. }
  127. MenuItem {} {
  128. label 1024
  129. xywh {45 45 100 20} labelfont 1
  130. }
  131. MenuItem {} {
  132. label 2048
  133. xywh {55 55 100 20} labelfont 1
  134. }
  135. MenuItem {} {
  136. label 4096
  137. xywh {55 55 100 20} labelfont 1
  138. }
  139. MenuItem {} {
  140. label 8192
  141. xywh {65 65 100 20} labelfont 1
  142. }
  143. MenuItem {} {
  144. label 16384
  145. xywh {75 75 100 20} labelfont 1
  146. }
  147. }
  148. Fl_Box {} {
  149. label {Most settings has effect only after ZynAddSubFX is restarted.}
  150. xywh {10 300 235 30} labelfont 1 labelsize 11 align 128
  151. }
  152. Fl_Box {} {
  153. label {Read the Readme.txt for other settings}
  154. xywh {10 280 240 15} labelfont 1 labelsize 11 align 128
  155. }
  156. Fl_Group {} {
  157. xywh {15 125 230 85} box ENGRAVED_BOX
  158. } {
  159. Fl_File_Input {} {
  160. label {Dump File}
  161. callback {config.cfg.DumpFile = o->value();}
  162. xywh {20 170 220 35} align 5
  163. code0 {o->insert(config.cfg.DumpFile.c_str());}
  164. }
  165. Fl_Check_Button {} {
  166. label {Dump notes}
  167. callback {config.cfg.DumpNotesToFile=(int) o->value();
  168. dump.startnow();//this has effect only if this option was disabled}
  169. xywh {20 130 110 20} down_box DOWN_BOX
  170. code0 {o->value(config.cfg.DumpNotesToFile);}
  171. }
  172. Fl_Check_Button {} {
  173. label Append
  174. callback {config.cfg.DumpAppend=(int) o->value();}
  175. xywh {160 130 80 20} down_box DOWN_BOX
  176. code0 {o->value(config.cfg.DumpAppend);}
  177. }
  178. }
  179. Fl_Counter {} {
  180. label {XML compression level}
  181. callback {config.cfg.GzipCompression=(int) o->value();}
  182. tooltip {gzip compression level (0 - uncompressed)} xywh {20 215 65 15} type Simple labelsize 11 align 8 minimum 0 maximum 9 step 1
  183. code0 {o->value(config.cfg.GzipCompression);}
  184. }
  185. Fl_Choice {} {
  186. label {PADsynth Interpolation}
  187. callback {config.cfg.Interpolation=(int) o->value();}
  188. xywh {175 105 75 15} down_box BORDER_BOX labelsize 10 textsize 11
  189. code0 {o->value(config.cfg.Interpolation);}
  190. } {
  191. MenuItem {} {
  192. label {Linear(fast)}
  193. xywh {0 0 100 20} labelfont 1 labelsize 10
  194. }
  195. MenuItem {} {
  196. label {Cubic(slow)}
  197. xywh {10 10 100 20} labelfont 1 labelsize 10
  198. }
  199. }
  200. Fl_Choice {} {
  201. label {Virtual Keyboard Layout}
  202. callback {config.cfg.VirKeybLayout=(int) o->value();;}
  203. xywh {155 235 85 20} down_box BORDER_BOX labelsize 12 textfont 1 textsize 11
  204. code0 {o->value(config.cfg.VirKeybLayout);}
  205. } {
  206. MenuItem {} {
  207. label { }
  208. xywh {5 5 100 20} labelfont 1 labelsize 11 deactivate
  209. }
  210. MenuItem {} {
  211. label QWERTY
  212. xywh {15 15 100 20} labelfont 1 labelsize 11
  213. }
  214. MenuItem {} {
  215. label Dvorak
  216. xywh {25 25 100 20} labelfont 1 labelsize 11
  217. }
  218. MenuItem {} {
  219. label QWERTZ
  220. xywh {35 35 100 20} labelfont 1 labelsize 11
  221. }
  222. MenuItem {} {
  223. label AZERTY
  224. xywh {45 45 100 20} labelfont 1 labelsize 11
  225. }
  226. }
  227. Fl_Check_Button {} {
  228. label {Ignore MIDI Program Change}
  229. callback {config.cfg.IgnoreProgramChange=(int) o->value();}
  230. xywh {10 255 220 20} down_box DOWN_BOX
  231. code0 {o->value(config.cfg.IgnoreProgramChange);}
  232. }
  233. }
  234. Fl_Group {} {
  235. label {Bank root dirs}
  236. xywh {5 25 500 285} hide
  237. } {
  238. Fl_Browser rootsbrowse {
  239. callback {activatebutton_rootdir(o->value()!=0);}
  240. xywh {15 35 485 220} type Hold
  241. }
  242. Fl_Button {} {
  243. label {Add root directory...}
  244. callback {const char *dirname;
  245. dirname=fl_dir_chooser("Add a root directory for banks:",NULL,0);
  246. if (dirname==NULL) return;
  247. rootsbrowse->add(dirname);}
  248. xywh {15 265 80 35} box THIN_UP_BOX align 128
  249. }
  250. Fl_Button removerootdirbutton {
  251. label {Remove root dir...}
  252. callback {if (rootsbrowse->value()!=0) {
  253. rootsbrowse->remove(rootsbrowse->value());
  254. };
  255. activatebutton_rootdir(false);}
  256. xywh {105 265 80 35} box THIN_UP_BOX align 128
  257. code0 {o->deactivate();}
  258. }
  259. Fl_Button makedefaultrootdirbutton {
  260. label {Make default}
  261. callback {int n=rootsbrowse->value();
  262. if (n!=0) {
  263. rootsbrowse->move(1,n);
  264. rootsbrowse->value(1);
  265. rootsbrowse->redraw();
  266. };
  267. activatebutton_rootdir(true);}
  268. xywh {190 265 80 35} box THIN_UP_BOX align 128
  269. code0 {o->deactivate();}
  270. }
  271. }
  272. Fl_Group {} {
  273. label {Presets dirs}
  274. xywh {5 25 500 285} hide
  275. } {
  276. Fl_Browser presetbrowse {
  277. callback {activatebutton_presetdir(o->value()!=0);}
  278. xywh {15 35 485 220} type Hold
  279. }
  280. Fl_Button {} {
  281. label {Add preset directory...}
  282. callback {const char *dirname;
  283. dirname=fl_dir_chooser("Add a preset directory :",NULL,0);
  284. if (dirname==NULL) return;
  285. presetbrowse->add(dirname);}
  286. xywh {15 265 80 35} box THIN_UP_BOX align 128
  287. }
  288. Fl_Button removepresetbutton {
  289. label {Remove preset dir...}
  290. callback {if (presetbrowse->value()!=0) {
  291. presetbrowse->remove(presetbrowse->value());
  292. };
  293. activatebutton_presetdir(false);}
  294. xywh {105 265 80 35} box THIN_UP_BOX align 128
  295. code0 {o->deactivate();}
  296. }
  297. Fl_Button makedefaultpresetbutton {
  298. label {Make default}
  299. callback {int n=presetbrowse->value();
  300. if (n!=0) {
  301. presetbrowse->move(1,n);
  302. presetbrowse->value(1);
  303. presetbrowse->redraw();
  304. };
  305. activatebutton_presetdir(true);}
  306. xywh {190 265 80 35} box THIN_UP_BOX align 128
  307. code0 {o->deactivate();}
  308. }
  309. }
  310. }
  311. Fl_Button {} {
  312. label Close
  313. callback {configwindow->hide();
  314. writebankcfg();
  315. writepresetcfg();}
  316. xywh {200 345 105 20} box THIN_UP_BOX
  317. }
  318. }
  319. }
  320. Function {ConfigUI()} {} {
  321. code {make_window();
  322. readbankcfg();
  323. readpresetcfg();} {}
  324. }
  325. Function {activatebutton_rootdir(bool active)} {} {
  326. code {if (active) {
  327. removerootdirbutton->activate();
  328. makedefaultrootdirbutton->activate();
  329. }else{
  330. removerootdirbutton->deactivate();
  331. makedefaultrootdirbutton->deactivate();
  332. };} {}
  333. }
  334. Function {activatebutton_presetdir(bool active)} {} {
  335. code {if (active) {
  336. removepresetbutton->activate();
  337. makedefaultpresetbutton->activate();
  338. }else{
  339. removepresetbutton->deactivate();
  340. makedefaultpresetbutton->deactivate();
  341. };} {}
  342. }
  343. Function {readbankcfg()} {} {
  344. code {rootsbrowse->clear();
  345. for (int i=0;i<MAX_BANK_ROOT_DIRS;i++){
  346. if (!config.cfg.bankRootDirList[i].empty())
  347. rootsbrowse->add(config.cfg.bankRootDirList[i].c_str());
  348. };} {}
  349. }
  350. Function {writebankcfg()} {} {
  351. code {config.clearbankrootdirlist();
  352. for (int n=0;n<rootsbrowse->size();n++){
  353. config.cfg.bankRootDirList[n] = rootsbrowse->text(n+1);
  354. };} {}
  355. }
  356. Function {readpresetcfg()} {} {
  357. code {presetbrowse->clear();
  358. for(int i=0;i<MAX_BANK_ROOT_DIRS;i++){
  359. if(!config.cfg.presetsDirList[i].empty())
  360. presetbrowse->add(config.cfg.presetsDirList[i].c_str());
  361. };} {}
  362. }
  363. Function {writepresetcfg()} {} {
  364. code {config.clearpresetsdirlist();
  365. for (int n=0;n<presetbrowse->size();n++)
  366. config.cfg.presetsDirList[n] = presetbrowse->text(n+1);} {}
  367. }
  368. Function {getsamplerateorder()} {return_type int
  369. } {
  370. code {int smpr=config.cfg.SampleRate;
  371. int order=0;
  372. switch(smpr){
  373. case 16000:order=1;break;
  374. case 22050:order=2;break;
  375. case 32000:order=3;break;
  376. case 44100:order=4;break;
  377. case 48000:order=5;break;
  378. case 88200:order=6;break;
  379. case 96000:order=7;break;
  380. default:order=0;break;
  381. };
  382. return(order);} {}
  383. }
  384. Function {setsamplerateinput()} {return_type void
  385. } {
  386. code {char *tmpbuf=new char[100];
  387. samplerateinput->cut(0,samplerateinput->maximum_size());
  388. snprintf(tmpbuf,100,"%d",config.cfg.SampleRate);
  389. samplerateinput->insert(tmpbuf);
  390. delete []tmpbuf;} {}
  391. }
  392. Function {show()} {} {
  393. code {configwindow->show();} {}
  394. }
  395. }