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 15KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458
  1. # data file for the Fltk User Interface Designer (fluid)
  2. version 1.0300
  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_Light_Button {} {
  104. label {Swap Stereo }
  105. callback {config.cfg.SwapStereo=(int) o->value();}
  106. xywh {20 80 85 20} box THIN_UP_BOX labelsize 10
  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 100 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_Group {} {
  180. xywh {255 45 245 260} box ENGRAVED_FRAME
  181. } {
  182. Fl_Box {} {
  183. label {Note: Not all the following settings are used (this depends on the operating system, etc..)}
  184. xywh {260 50 235 45} labelfont 1 labelsize 11 align 128
  185. }
  186. Fl_Group {} {
  187. label Linux
  188. xywh {260 110 235 115} box ENGRAVED_BOX labelfont 1 labelsize 13 align 5
  189. } {
  190. Fl_File_Input {} {
  191. label {OSS Sequencer Device (/dev/...)}
  192. callback {snprintf(config.cfg.LinuxOSSSeqInDev,config.maxstringsize,"%s",o->value());}
  193. xywh {265 180 225 35} align 5
  194. code0 {o->insert(config.cfg.LinuxOSSSeqInDev);}
  195. }
  196. Fl_File_Input {} {
  197. label {OSS Wave Out Device (/dev/...)}
  198. callback {snprintf(config.cfg.LinuxOSSWaveOutDev,config.maxstringsize,"%s",o->value());}
  199. xywh {265 130 225 35} align 5
  200. code0 {o->insert(config.cfg.LinuxOSSWaveOutDev);}
  201. }
  202. }
  203. Fl_Group {} {
  204. label Windows
  205. xywh {260 250 235 50} box ENGRAVED_BOX labelfont 1 labelsize 13 align 5
  206. } {
  207. Fl_Counter {} {
  208. label {Midi In Dev}
  209. callback {config.cfg.WindowsMidiInId=(int) o->value();
  210. midiinputnamebox->label(config.winmididevices[config.cfg.WindowsMidiInId].name);}
  211. xywh {270 270 65 20} type Simple labelsize 11 align 1 minimum 0 maximum 100 step 1
  212. code0 {o->maximum(config.winmidimax-1);}
  213. code1 {o->value(config.cfg.WindowsMidiInId);}
  214. }
  215. Fl_Box midiinputnamebox {
  216. label {Midi input device name}
  217. xywh {340 260 150 35} labelfont 1 labelsize 11 align 212
  218. code0 {o->label(config.winmididevices[config.cfg.WindowsMidiInId].name);}
  219. }
  220. }
  221. }
  222. Fl_Counter {} {
  223. label {XML compression level}
  224. callback {config.cfg.GzipCompression=(int) o->value();}
  225. tooltip {gzip compression level (0 - uncompressed)} xywh {20 215 65 15} type Simple labelsize 11 align 8 minimum 0 maximum 9 step 1
  226. code0 {o->value(config.cfg.GzipCompression);}
  227. }
  228. Fl_Choice {} {
  229. label {PADsynth Interpolation}
  230. callback {config.cfg.Interpolation=(int) o->value();}
  231. xywh {175 105 75 15} down_box BORDER_BOX labelsize 10 textsize 11
  232. code0 {o->value(config.cfg.Interpolation);}
  233. } {
  234. MenuItem {} {
  235. label {Linear(fast)}
  236. xywh {0 0 100 20} labelfont 1 labelsize 10
  237. }
  238. MenuItem {} {
  239. label {Cubic(slow)}
  240. xywh {10 10 100 20} labelfont 1 labelsize 10
  241. }
  242. }
  243. Fl_Choice {} {
  244. label {Virtual Keyboard Layout}
  245. callback {config.cfg.VirKeybLayout=(int) o->value();;}
  246. xywh {155 235 85 20} down_box BORDER_BOX labelsize 12 textfont 1 textsize 11
  247. code0 {o->value(config.cfg.VirKeybLayout);}
  248. } {
  249. MenuItem {} {
  250. label { }
  251. xywh {5 5 100 20} labelfont 1 labelsize 11 deactivate
  252. }
  253. MenuItem {} {
  254. label QWERTY
  255. xywh {15 15 100 20} labelfont 1 labelsize 11
  256. }
  257. MenuItem {} {
  258. label Dvorak
  259. xywh {25 25 100 20} labelfont 1 labelsize 11
  260. }
  261. MenuItem {} {
  262. label QWERTZ
  263. xywh {35 35 100 20} labelfont 1 labelsize 11
  264. }
  265. MenuItem {} {
  266. label AZERTY
  267. xywh {45 45 100 20} labelfont 1 labelsize 11
  268. }
  269. }
  270. Fl_Check_Button {} {
  271. label {Ignore MIDI Program Change}
  272. callback {config.cfg.IgnoreProgramChange=(int) o->value();}
  273. xywh {10 255 230 20} down_box DOWN_BOX
  274. code0 {o->value(config.cfg.IgnoreProgramChange);}
  275. }
  276. }
  277. Fl_Group {} {
  278. label {Bank root dirs}
  279. xywh {5 25 500 285} hide
  280. } {
  281. Fl_Browser rootsbrowse {
  282. callback {activatebutton_rootdir(o->value()!=0);}
  283. xywh {15 35 485 220} type Hold
  284. }
  285. Fl_Button {} {
  286. label {Add root directory...}
  287. callback {const char *dirname;
  288. dirname=fl_dir_chooser("Add a root directory for banks:",NULL,0);
  289. if (dirname==NULL) return;
  290. rootsbrowse->add(dirname);}
  291. xywh {15 265 80 35} box THIN_UP_BOX align 128
  292. }
  293. Fl_Button removerootdirbutton {
  294. label {Remove root dir...}
  295. callback {if (rootsbrowse->value()!=0) {
  296. rootsbrowse->remove(rootsbrowse->value());
  297. };
  298. activatebutton_rootdir(false);}
  299. xywh {105 265 80 35} box THIN_UP_BOX align 128
  300. code0 {o->deactivate();}
  301. }
  302. Fl_Button makedefaultrootdirbutton {
  303. label {Make default}
  304. callback {int n=rootsbrowse->value();
  305. if (n!=0) {
  306. rootsbrowse->move(1,n);
  307. rootsbrowse->value(1);
  308. rootsbrowse->redraw();
  309. };
  310. activatebutton_rootdir(true);}
  311. xywh {190 265 80 35} box THIN_UP_BOX align 128
  312. code0 {o->deactivate();}
  313. }
  314. }
  315. Fl_Group {} {
  316. label {Presets dirs}
  317. xywh {5 25 500 285} hide
  318. } {
  319. Fl_Browser presetbrowse {
  320. callback {activatebutton_presetdir(o->value()!=0);}
  321. xywh {15 35 485 220} type Hold
  322. }
  323. Fl_Button {} {
  324. label {Add preset directory...}
  325. callback {const char *dirname;
  326. dirname=fl_dir_chooser("Add a preset directory :",NULL,0);
  327. if (dirname==NULL) return;
  328. presetbrowse->add(dirname);}
  329. xywh {15 265 80 35} box THIN_UP_BOX align 128
  330. }
  331. Fl_Button removepresetbutton {
  332. label {Remove preset dir...}
  333. callback {if (presetbrowse->value()!=0) {
  334. presetbrowse->remove(presetbrowse->value());
  335. };
  336. activatebutton_presetdir(false);}
  337. xywh {105 265 80 35} box THIN_UP_BOX align 128
  338. code0 {o->deactivate();}
  339. }
  340. Fl_Button makedefaultpresetbutton {
  341. label {Make default}
  342. callback {int n=presetbrowse->value();
  343. if (n!=0) {
  344. presetbrowse->move(1,n);
  345. presetbrowse->value(1);
  346. presetbrowse->redraw();
  347. };
  348. activatebutton_presetdir(true);}
  349. xywh {190 265 80 35} box THIN_UP_BOX align 128
  350. code0 {o->deactivate();}
  351. }
  352. }
  353. }
  354. Fl_Button {} {
  355. label Close
  356. callback {configwindow->hide();
  357. writebankcfg();
  358. writepresetcfg();}
  359. xywh {200 345 105 20} box THIN_UP_BOX
  360. }
  361. }
  362. }
  363. Function {ConfigUI()} {} {
  364. code {make_window();
  365. readbankcfg();
  366. readpresetcfg();} {}
  367. }
  368. Function {activatebutton_rootdir(bool active)} {} {
  369. code {if (active) {
  370. removerootdirbutton->activate();
  371. makedefaultrootdirbutton->activate();
  372. }else{
  373. removerootdirbutton->deactivate();
  374. makedefaultrootdirbutton->deactivate();
  375. };} {}
  376. }
  377. Function {activatebutton_presetdir(bool active)} {} {
  378. code {if (active) {
  379. removepresetbutton->activate();
  380. makedefaultpresetbutton->activate();
  381. }else{
  382. removepresetbutton->deactivate();
  383. makedefaultpresetbutton->deactivate();
  384. };} {}
  385. }
  386. Function {readbankcfg()} {} {
  387. code {rootsbrowse->clear();
  388. for (int i=0;i<MAX_BANK_ROOT_DIRS;i++){
  389. if (!config.cfg.bankRootDirList[i].empty())
  390. rootsbrowse->add(config.cfg.bankRootDirList[i].c_str());
  391. };} {}
  392. }
  393. Function {writebankcfg()} {} {
  394. code {config.clearbankrootdirlist();
  395. for (int n=0;n<rootsbrowse->size();n++){
  396. config.cfg.bankRootDirList[n] = rootsbrowse->text(n+1);
  397. };} {}
  398. }
  399. Function {readpresetcfg()} {} {
  400. code {presetbrowse->clear();
  401. for(int i=0;i<MAX_BANK_ROOT_DIRS;i++){
  402. if(!config.cfg.presetsDirList[i].empty())
  403. presetbrowse->add(config.cfg.presetsDirList[i].c_str());
  404. };} {}
  405. }
  406. Function {writepresetcfg()} {} {
  407. code {config.clearpresetsdirlist();
  408. for (int n=0;n<presetbrowse->size();n++)
  409. config.cfg.presetsDirList[n] = presetbrowse->text(n+1);} {}
  410. }
  411. Function {getsamplerateorder()} {return_type int
  412. } {
  413. code {int smpr=config.cfg.SampleRate;
  414. int order=0;
  415. switch(smpr){
  416. case 16000:order=1;break;
  417. case 22050:order=2;break;
  418. case 32000:order=3;break;
  419. case 44100:order=4;break;
  420. case 48000:order=5;break;
  421. case 88200:order=6;break;
  422. case 96000:order=7;break;
  423. default:order=0;break;
  424. };
  425. return(order);} {}
  426. }
  427. Function {setsamplerateinput()} {return_type void
  428. } {
  429. code {char *tmpbuf=new char[100];
  430. samplerateinput->cut(0,samplerateinput->maximum_size());
  431. snprintf(tmpbuf,100,"%d",config.cfg.SampleRate);
  432. samplerateinput->insert(tmpbuf);
  433. delete []tmpbuf;} {}
  434. }
  435. Function {show()} {} {
  436. code {configwindow->show();} {}
  437. }
  438. }