# data file for the Fltk User Interface Designer (fluid)
version 1.0302 
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 "Fl_Osc_Button.H"} {public local
} 

decl {\#include "Fl_Osc_Counter.H"} {public local
} 

decl {\#include "Fl_Osc_Choice.H"} {public local
} 

decl {\#include "Osc_IntModel.h"} {public local
} 

decl {\#include "Fl_Osc_Check.H"} {public local
} 

decl {\#include "Fl_Osc_Input.H"} {public local
} 

decl {\#include "Fl_Osc_Numeric_Input.H"} {public local
} 

decl {\#include "Fl_Osc_ListView.H"} {public local
} 

decl {\#include "Fl_Osc_Pane.H"} {public local
}

decl {\#include "../globals.h"} {public local
} 

decl {\#include "../Misc/Util.h"} {public local
} 

decl {using namespace zyncarla;} {public local
}

class ConfigUI {} {
  Function {make_window()} {} {
    Fl_Window configwindow {
      label {ZynAddSubFX Settings}
      callback {o->hide();}
      xywh {554 443 510 370} type Double visible
      class Fl_Osc_Window
    } {
      Fl_Box dummy {
        xywh {25 25 25 25}
        code0 {configwindow->init(osc, "/config/");}
      }
      Fl_Tabs {} {
        xywh {5 5 500 330}
      } {
        Fl_Group mainsettings {
          label {Main settings}
          xywh {5 25 500 310}
        } {
          Fl_Group {} {
            label {Sample Rate}
            xywh {15 45 165 30} box ENGRAVED_FRAME
          } {
            Fl_Input samplerateinput {
              xywh {115 50 60 20} type Int textfont 1
              code0 {o->init("cfg.SampleRate");}
              class Fl_Osc_Numeric_Input
            }
          }
          Fl_Input {} {
            label {Buffer Size}
            tooltip {Internal Sound Buffer Size (samples)} xywh {190 45 60 20} type Int labelsize 11 align 129 textfont 1
            code0 {o->init("cfg.SoundBufferSize");}
            class Fl_Osc_Numeric_Input
          }
          Fl_Check_Button {} {
            label {Swap Stereo }
            xywh {15 80 95 20} box NO_BOX labelsize 11
            code0 {o->init("cfg.SwapStereo");}
            class Fl_Osc_Check
          }
          Fl_Choice oscilsize_widget {
            label OscilSize
            callback{
            oscilsize->updateVal((int)(o->value()+7));
            }
            tooltip {ADSynth Oscillator Size (samples)} xywh {175 80 75 20} down_box BORDER_BOX labelfont 1 labelsize 11 textsize 10
          } {
            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_Counter {} {
            label {XML compression level}
            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->init("cfg.GzipCompression");}
            class Fl_Osc_Counter
          }
          Fl_Choice {} {
            label {PADsynth Interpolation}
            xywh {175 105 75 15} down_box BORDER_BOX labelsize 10 textsize 11
            code0 {o->init("cfg.Interpolation");}
            class Fl_Osc_Choice
          } {
            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}
            xywh {155 235 85 20} down_box BORDER_BOX labelsize 12 textfont 1 textsize 11
            code0 {o->init("cfg.VirKeybLayout");}
            class Fl_Osc_Choice
          } {
            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}
            xywh {10 255 220 20} down_box DOWN_BOX
            code0 {o->init("cfg.IgnoreProgramChange");}
            class Fl_Osc_Check
          }
        }
        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
            code0 {o->init("cfg.bankRootDirList");}
            class Fl_Osc_ListView
          }
          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->append(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->doRemove(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->doMove(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
            code0 {o->init("cfg.presetsDirList");}
            class Fl_Osc_ListView
          }
          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();}
        xywh {200 345 105 20} box THIN_UP_BOX
      }
    }
  }
  Function {ConfigUI(Fl_Osc_Interface *osc_)} {} {
    code {
    osc = osc_;
    make_window();
    oscilsize = new Osc_IntModel(osc);
    oscilsize->callback = [this](int i){
        oscilsize_widget->value(i-7);
    };
    oscilsize->doUpdate("/config/cfg.OscilPower");
    
    } {}
  }
  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 {show()} {} {
    code {
if (isPlugin) {
    mainsettings->deactivate();
}
    rootsbrowse->update();
    presetbrowse->update();
    configwindow->show();
    } {}
  }
  decl {class Fl_Osc_Interface *osc;} {public local
  }
  decl {class Osc_IntModel *oscilsize;} {public local
  }
} 
