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