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.

ConfigUI.fl 14KB

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