# 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 <FL/Fl_Box.H>} {public local
} 

decl {\#include <FL/fl_draw.H>} {public local
} 

decl {\#include <FL/Fl_Value_Output.H>} {public local
} 

decl {\#include <math.h>} {private local
} 

decl {\#include <stdio.h>} {private local
} 

decl {\#include <stdlib.h>} {private local
} 

decl {\#include <string.h>} {private local
} 

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

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

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

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

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

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

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

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

class ResonanceUI {open : PresetsUI_
} {
  Function {make_window(Fl_Osc_Interface *osc, std::string loc)} {open
  } {
    Fl_Window resonancewindow {
      label Resonance open
      xywh {123 93 780 305} type Double
      class Fl_Osc_Window visible
    } {
      Fl_Value_Output khzvalue {
        label kHz
        xywh {415 264 45 18} labelsize 12 align 8 minimum 0.001 maximum 48 step 0.01 textfont 1 textsize 12
        code0 {//this widget must be before the calling widgets}
        code1 {resonancewindow->init(osc,loc);}
      }
      Fl_Value_Output dbvalue {
        label dB
        xywh {415 282 45 18} labelsize 12 align 8 minimum -150 maximum 150 step 0.1 textfont 1 textsize 12
        code0 {//this widget must be before the calling widgets}
      }
      Fl_Button {} {
        label Close
        callback {resonancewindow->hide();}
        xywh {690 283 84 17} box THIN_UP_BOX
      }
      Fl_Button {} {
        label Zero
        callback {
        o->oscWrite("zero");
        redrawPADnoteApply();}
        tooltip {Clear the resonance function} xywh {491 264 66 15} box THIN_UP_BOX labelfont 1 labelsize 12
        class Fl_Osc_Button
      }
      Fl_Button {} {
        label Smooth
        callback {o->oscWrite("smooth");
redrawPADnoteApply();}
        tooltip {Smooth the resonance function} xywh {491 282 66 18} box THIN_UP_BOX labelfont 1 labelsize 12
        class Fl_Osc_Button
      }
      Fl_Check_Button enabled {
        label Enable
        xywh {6 270 78 27} box THIN_UP_BOX down_box DOWN_BOX
        code0 {o->init("Penabled");}
        class Fl_Osc_Check
      }
      Fl_Slider maxdb {
        callback {maxdbvo->value(o->value());
redrawPADnoteApply();}
        xywh {90 285 84 15} box FLAT_BOX type {Horz Knob} minimum 1 maximum 90 step 1 value 30
        code0 {o->init("PmaxdB", 'i'); o->reset_value = 30;}
        class Fl_Osc_Slider
      }
      Fl_Value_Output maxdbvo {
        label {Max.}
        tooltip {The Maximum amplitude (dB)} xywh {126 264 24 18} labelsize 12 minimum 1 maximum 127 step 1 value 30 textfont 0 textsize 12
      }
      Fl_Box {} {
        label dB
        xywh {150 264 24 18}
      }
      Fl_Value_Output centerfreqvo {
        label {C.f.}
        callback {o->value(o->newvalue()/1000.0);}
        tooltip {Center Frequency (kHz)} xywh {210 264 45 18} labelsize 12 when 3 minimum 1 maximum 10 step 0.01 value 1 textfont 1 textsize 12
        code0 {o->init("centerfreq");}
        class Fl_Osc_Output
      }
      Fl_Value_Output octavesfreqvo {
        label {Oct.}
        callback {o->value(o->newvalue());}
        tooltip {No. of octaves} xywh {210 282 45 18} labelsize 12 when 3 minimum 0 maximum 11 step 0.01 value 5 textfont 1 textsize 12
        code0 {o->init("octavesfreq");}
        class Fl_Osc_Output
      }
      Fl_Button {} {
        label RND2
        callback {o->oscWrite("randomize", "i", 1);
redrawPADnoteApply();}
        tooltip {Randomize the resonance function} xywh {566 276 42 12} box THIN_UP_BOX labelfont 1 labelsize 10
        class Fl_Osc_Button
      }
      Fl_Button {} {
        label RND1
        callback {o->oscWrite("randomize", "i", 0);
redrawPADnoteApply();}
        tooltip {Randomize the resonance function} xywh {566 264 42 12} box THIN_UP_BOX labelfont 1 labelsize 10
        class Fl_Osc_Button
      }
      Fl_Button {} {
        label RND3
        callback {o->oscWrite("randomize", "i", 2);
redrawPADnoteApply();}
        tooltip {Randomize the resonance function} xywh {566 288 42 12} box THIN_UP_BOX labelfont 1 labelsize 10
        class Fl_Osc_Button
      }
      Fl_Check_Button p1st {
        label {P.1st}
        tooltip {Protect the fundamental frequency (do not damp the first harmonic)} xywh {365 285 45 15} down_box DOWN_BOX labelsize 10
        code0 {o->init("Pprotectthefundamental");}
        class Fl_Osc_Check
      }
      Fl_Button {} {
        label InterpP
        callback {int type;
       if (Fl::event_button()==FL_LEFT_MOUSE) type=0;
       else type=1;
       o->oscWrite("interpolatepeaks", "i", type);
       redrawPADnoteApply();}
        tooltip {Interpolate the peaks} xywh {365 265 46 15} box THIN_UP_BOX labelfont 1 labelsize 10
        class Fl_Osc_Button
      }
      Fl_Slider centerfreq {
        callback {centerfreqvo->do_callback();
redrawPADnoteApply();}
        xywh {260 268 90 14} box FLAT_BOX type {Horz Knob} labelsize 10 maximum 127 step 1
        code0 {o->init("Pcenterfreq", 'i');o->reset_value=64;}
        class Fl_Osc_Slider
      }
      Fl_Slider octavesfreq {
        callback {octavesfreqvo->do_callback();
redrawPADnoteApply();}
        xywh {260 286 90 14} box FLAT_BOX type {Horz Knob} labelsize 10 maximum 127 step 1
        code0 {o->init("Poctavesfreq", 'i');o->reset_value=64;}
        class Fl_Osc_Slider
      }
      Fl_Button {} {
        label C
        callback {presetsui->copy(resonancewindow->loc());}
        xywh {625 275 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55
      }
      Fl_Button {} {
        label P
        callback {presetsui->paste(resonancewindow->loc(),this);}
        xywh {655 275 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55
      }
      Fl_Button applybutton {
        label Apply
        callback {applybutton->color(FL_GRAY);
applybutton->redraw();
if (cbapplywidget!=NULL) {
	cbapplywidget->do_callback();
	cbapplywidget->color(FL_GRAY);
	cbapplywidget->redraw();
};}
        xywh {690 265 85 15} box THIN_UP_BOX labelfont 1 labelsize 11
      }
      Fl_Box rg {
        xywh {6 5 768 256} box BORDER_BOX
        class Fl_Resonance_Graph
      }
    }
  }
  Function {ResonanceUI(Fl_Osc_Interface *osc, std::string loc)} {open
  } {
    code {
assert(osc);
cbwidget=NULL;
cbapplywidget=NULL;
make_window(osc, loc);
rg->init(khzvalue,dbvalue);
applybutton->hide();} {}
  }
  Function {~ResonanceUI()} {} {
    code {resonancewindow->hide();
    delete resonancewindow;
    } {}
  }
  Function {redrawPADnoteApply()} {} {
    code {
    rg->update();
    if (cbwidget!=NULL) {
	cbwidget->do_callback();
	applybutton->color(FL_RED);
	applybutton->redraw();
};} {}
  }
  Function {setcbwidget(Fl_Widget *cbwidget,Fl_Widget *cbapplywidget)} {} {
    code {this->cbwidget=cbwidget;
this->cbapplywidget=cbapplywidget;
rg->setcbwidget(cbwidget,applybutton);
applybutton->show();} {}
  }
  Function {refresh()} {} {
    code {redrawPADnoteApply();
//TODO fix me when controls are relocatable
//enabled->value(respar->Penabled);

//maxdb->value(respar->PmaxdB);
//maxdbvo->value(respar->PmaxdB);
//
//centerfreqvo->value(respar->getcenterfreq()/1000.0);
//octavesfreqvo->value(respar->getoctavesfreq());
//
//centerfreq->value(respar->Pcenterfreq);
//octavesfreq->value(respar->Poctavesfreq);
//
//p1st->value(respar->Pprotectthefundamental);

rg->update();} {}
  }
  decl {Fl_Widget *cbwidget,*cbapplywidget;} {private local
  }
} 
