|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458 |
- # data file for the Fltk User Interface Designer (fluid)
- version 1.0300
- header_name {.h}
- code_name {.cc}
- decl {//Copyright (c) 2002-2005 Nasca Octavian Paul} {private local
- }
-
- decl {//License: GNU GPL version 2 or later} {private local
- }
-
- decl {\#include <stdio.h>} {public local
- }
-
- decl {\#include <math.h>} {public local
- }
-
- decl {\#include <stdlib.h>} {public local
- }
-
- decl {\#include <FL/Fl_File_Chooser.H>} {public local
- }
-
- decl {\#include "../globals.h"} {public local
- }
-
- decl {\#include "../Misc/Util.h"} {public local
- }
-
- decl {\#include "../Misc/Dump.h"} {public local
- }
-
- decl {extern Dump dump;} {public local
- }
-
- class ConfigUI {} {
- Function {make_window()} {} {
- Fl_Window configwindow {
- label {ZynAddSubFX Settings}
- callback {writebankcfg();
- o->hide();}
- xywh {554 443 510 370} type Double visible
- } {
- Fl_Tabs {} {
- xywh {5 5 500 330}
- } {
- Fl_Group {} {
- label {Main settings}
- xywh {5 25 500 310}
- } {
- 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 11 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 10
- 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 11 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 {10 300 235 30} labelfont 1 labelsize 11 align 128
- }
- Fl_Box {} {
- label {Read the Readme.txt for other settings}
- xywh {10 280 240 15} labelfont 1 labelsize 11 align 128
- }
- Fl_Group {} {
- xywh {15 125 230 85} box ENGRAVED_BOX
- } {
- Fl_File_Input {} {
- label {Dump File}
- callback {config.cfg.DumpFile = o->value();}
- xywh {20 170 220 35} align 5
- code0 {o->insert(config.cfg.DumpFile.c_str());}
- }
- 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 11 align 128
- }
- Fl_Group {} {
- label Linux
- xywh {260 110 235 115} box ENGRAVED_BOX labelfont 1 labelsize 13 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 13 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 11 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 11 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 11 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 10 textsize 11
- 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();;}
- xywh {155 235 85 20} down_box BORDER_BOX labelsize 12 textfont 1 textsize 11
- code0 {o->value(config.cfg.VirKeybLayout);}
- } {
- MenuItem {} {
- label { }
- xywh {5 5 100 20} labelfont 1 labelsize 11 deactivate
- }
- MenuItem {} {
- label QWERTY
- xywh {15 15 100 20} labelfont 1 labelsize 11
- }
- MenuItem {} {
- label Dvorak
- xywh {25 25 100 20} labelfont 1 labelsize 11
- }
- MenuItem {} {
- label QWERTZ
- xywh {35 35 100 20} labelfont 1 labelsize 11
- }
- MenuItem {} {
- label AZERTY
- xywh {45 45 100 20} labelfont 1 labelsize 11
- }
- }
- Fl_Check_Button {} {
- label {Ignore MIDI Program Change}
- callback {config.cfg.IgnoreProgramChange=(int) o->value();}
- xywh {10 255 230 20} down_box DOWN_BOX
- code0 {o->value(config.cfg.IgnoreProgramChange);}
- }
- }
- 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 345 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].empty())
- rootsbrowse->add(config.cfg.bankRootDirList[i].c_str());
- };} {}
- }
- Function {writebankcfg()} {} {
- code {config.clearbankrootdirlist();
-
- for (int n=0;n<rootsbrowse->size();n++){
- config.cfg.bankRootDirList[n] = rootsbrowse->text(n+1);
- };} {}
- }
- Function {readpresetcfg()} {} {
- code {presetbrowse->clear();
-
- for(int i=0;i<MAX_BANK_ROOT_DIRS;i++){
- if(!config.cfg.presetsDirList[i].empty())
- presetbrowse->add(config.cfg.presetsDirList[i].c_str());
- };} {}
- }
- Function {writepresetcfg()} {} {
- code {config.clearpresetsdirlist();
-
- for (int n=0;n<presetbrowse->size();n++)
- config.cfg.presetsDirList[n] = presetbrowse->text(n+1);} {}
- }
- 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();} {}
- }
- }
|