# data file for the Fltk User Interface Designer (fluid)
version 1.0304
header_name {.h}
code_name {.cc}
comment {EffUI.h} {not_in_source in_header
}

comment {EffUI.cc} {in_source not_in_header
}

comment {Original ZynAddSubFX author Nasca Octavian Paul
Copyright (C) 2002-2005 Nasca Octavian Paul
Copyright 2009-2010, Alan Calvert
Copyright 2016-2021, Will Godfrey & others

This file is part of yoshimi, which is free software: you can redistribute
it and/or modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.

yoshimi is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE.   See the GNU General Public License (version 2 or
later) for more details.

You should have received a copy of the GNU General Public License along with
yoshimi; if not, write to the Free Software Foundation, Inc., 51 Franklin
Street, Fifth Floor, Boston, MA  02110-1301, USA.

This file is a derivative of the ZynAddSubFX original

} {selected in_source in_header
}

decl {\#include <string>} {public local
}

decl {\#include <iostream>} {public local
}

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

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

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

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

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

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

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

class EQGraph {: {public Fl_Box}
} {
  Function {EQGraph(int x,int y, int w, int h, const char *label=0):Fl_Box(x,y,w,h,label)} {} {
    code {eff = NULL;
        maxdB = 30;} {}
  }
  Function {init(EffectMgr *eff_)} {} {
    code {synth = eff_->getSynthEngine();
eff = eff_;
        oldx = -1;
        khzval = -1;} {}
  }
  Function {draw_freq_line(float freq, int type)} {} {
    code {fl_color(FL_GRAY);
        float freqx = getfreqpos(freq);

        if (type == 0)
        {
            if (active_r())
                fl_color(FL_WHITE);
            else
                fl_color(205, 205, 205);
        }

        if (freqx > 0.0 && freqx < 1.0)
        fl_line(x() + (int) (freqx * w()), y(),
            x() + (int) (freqx * w()), y() + h());} {}
  }
  Function {draw()} {} {
    code {//
        int ox = x(), oy = y(), lx = w(), ly = h(), i, iy, oiy;
        float freqx;
        fl_line_style(0, int(1 * lx / 190.0f));
        if (active_r())
            fl_color(0, 70, 150);
        else
            fl_color(80, 120, 160);
        fl_rectf(ox, oy, lx, ly);

        // draw the lines
        fl_color(FL_GRAY);
        fl_line(ox + 2, oy + ly / 2, ox + lx - 2, oy + ly / 2);

        freqx = getfreqpos(1000.0);
        if (freqx > 0.0 && freqx < 1.0)
            fl_line(ox + (int) (freqx * lx), oy,
                    ox + (int) (freqx * lx), oy + ly);

        for (i = 1; i < 10; ++i)
        {
            if (i == 1)
            {
                draw_freq_line(i * 100.0,0);
                draw_freq_line(i * 1000.0,0);
            }
            else
                if (i == 5)
                {
                    draw_freq_line(i * 10.0, 1);
                    draw_freq_line(i * 100.0, 1);
                    draw_freq_line(i * 1000.0, 1);
                }
                else
                {
                    draw_freq_line(i * 10.0, 1);
                    draw_freq_line(i * 100.0, 1);
                    draw_freq_line(i * 1000.0, 1);
                }
        }
        draw_freq_line(10000.0, 0);
        draw_freq_line(20000.0, 1);

        int GY = 6;
        if (ly < GY * 3)
            GY = -1;
        for (i = 1; i < GY; ++i)
        {
            int tmp = (int)(ly / (float)GY * i);
            fl_line(ox + 2, oy + tmp, ox + lx - 2, oy + tmp);
        }

        fl_line_style(0, int(2 * lx / 190.0f));
        // draw the frequency response
        if (active_r())
            fl_color(FL_YELLOW);
        else
            fl_color(200, 200, 80);
        oiy = getresponse(ly, getfreqx(0.0));
        float half_samplerate_f = synth->samplerate_f * 0.5f;
        int oix = 0;
        for (i = 1; i < lx; ++i)
        {
            float frq = getfreqx(i / (float)lx);
            if (frq > half_samplerate_f)
                break;
            iy = getresponse(ly, frq);
            if (oiy >= 0 && oiy < ly && iy >= 0 && iy < ly)
                fl_line(ox + oix, oy + ly - oiy, ox + i, oy + ly - oiy);
            oix = i;
            oiy = iy;
        }
        fl_line_style(0, 1);} {}
  }
  Function {getresponse(int maxy,float freq)} {return_type int
  } {
    code {float dbresp = eff->getEQfreqresponse(freq);
        int idbresp = (int) ((dbresp / maxdB + 1.0) * maxy / 2.0);

        // fprintf(stderr,"%.5f\\n",(dbresp/maxdB+1.0)*maxy/2.0);

        return idbresp;} {}
  }
  Function {getfreqx(float x)} {return_type float
  } {
    code {if (x > 1.0)
            x = 1.0;
        return 20.0 * powf(1000.0, x);} {}
  }
  Function {getfreqpos(float freq)} {return_type float
  } {
    code {if (freq < 0.00001)
            freq = 0.00001;
        return logf(freq / 20.0) / logf(1000.0);} {}
  }
  decl {int oldx,oldy;} {private local
  }
  decl {float khzval;} {public local
  }
  decl {EffectMgr *eff;} {private local
  }
  decl {int maxdB;} {private local
  }
  decl {SynthEngine *synth;} {private local
  }
}

class EffUI {: {public Fl_Group,public PresetsUI_}
} {
  Function {EffUI(int x,int y, int w, int h, const char *label=0):Fl_Group(x,y,w,h,label)} {} {
    code {//
    eff = NULL;
    filterwindow = NULL;
    fwin_filterui = NULL;
    lastfiltW = 0;} {}
  }
  Function {~EffUI()} {} {
    code {//
        effnullwindow->hide();        // delete (effnullwindow);
        effreverbwindow->hide();        // delete (effreverbwindow);
        effechowindow->hide();          // delete (effechowindow);
        effchoruswindow->hide();        // delete (effchoruswindow);
        effphaserwindow->hide();        // delete (effphaserwindow);
        effalienwahwindow->hide();      // delete (effalienwahwindow);
        effdistorsionwindow->hide();    // delete (effdistorsionwindow);
        effeqwindow->hide();            // delete (effeqwindow);
        effdynamicfilterwindow->hide(); // delete (effdynamicfilterwindow);

        if (filterwindow != NULL)
        {
            if (filterwindow->visible())
                saveWin(synth, filterwindow->w(), filterwindow->h(), filterwindow->x(), filterwindow->y(), true, "xFilter-dynamic " + to_string(npart));
            filterwindow->hide();
            delete(filterwindow);
        }} {}
  }
  Function {make_null_window()} {} {
    Fl_Window effnullwindow {
      xywh {915 700 375 95} type Double box PLASTIC_THIN_UP_BOX color 221 hide
      class Fl_Group
    } {
      Fl_Text_Display noeffect {
        label {No Effects Applied}
        xywh {120 35 10 20} box NO_BOX labelfont 1 labelcolor 37 align 8
      }
    }
  }
  Function {make_reverb_window()} {} {
    Fl_Window effreverbwindow {
      xywh {1005 24 375 95} type Double box PLASTIC_UP_BOX color 221 labelsize 12 align 33 hide
      class Fl_Group
    } {
      Fl_Text_Display revname {
        label {Reverb }
        xywh {10 10 0 20} box NO_BOX labelfont 1 labelsize 12 labelcolor 36 align 8
      }
      Fl_Choice revp {
        label Preset
        callback {//
        send_data(TOPLEVEL::action::forceUpdate, 16, o->value(), EFFECT::type::reverb, TOPLEVEL::type::Integer);}
        xywh {115 13 90 15} down_box BORDER_BOX color 14 selection_color 0 labelsize 11 textfont 1 textsize 10 textcolor 7
        code0 {o->add("Cathedral 1");o->add("Cathedral 2");o->add("Cathedral 3");o->add("Hall 1");o->add("Hall 2");o->add("Room 1");o->add("Room 2");o->add("Basement");o->add("Tunnel");o->add("Echoed 1");o->add("Echoed 2");o->add("Very Long 1");o->add("Very Long 2");}
      } {}
      Fl_Choice revp10 {
        label Type
        callback {//
        send_data(TOPLEVEL::action::forceUpdate, 10, o->value(), EFFECT::type::reverb, TOPLEVEL::type::Integer);}
        xywh {240 13 75 15} down_box BORDER_BOX color 14 labelsize 11 textfont 1 textsize 10 textcolor 7
        code0 {o->add("Random");o->add("Freeverb");o->add("Bandwidth");}
      } {}
      Fl_Dial revp0 {
        label Vol
        callback {//
        send_data(0, 0, o->value(), EFFECT::type::reverb, TOPLEVEL::type::Integer);}
        tooltip {Effect volume} xywh {10 40 30 30} box ROUND_UP_BOX labelsize 11 maximum 127
        code1 {o->setValueType(VC_FXReverbVol);}
        class WidgetPDial
      }
      Fl_Dial revp1 {
        label Pan
        callback {//
        int butt = 1;
        send_data(0, butt, o->value(), EFFECT::type::reverb, TOPLEVEL::type::Integer);}
        xywh {45 40 30 30} box ROUND_UP_BOX labelsize 11 maximum 127
        code1 {o->setValueType(VC_PanningStd);}
        class WidgetPDial
      }
      Fl_Dial revp2 {
        label Time
        callback {//
        int butt = 2;
        send_data(0, butt, o->value(), EFFECT::type::reverb, TOPLEVEL::type::Integer);}
        tooltip {Duration of effect} xywh {80 40 30 30} box ROUND_UP_BOX labelsize 11 maximum 127
        code1 {o->setValueType(VC_FXReverbTime);}
        class WidgetPDial
      }
      Fl_Dial revp3 {
        label {I.del}
        callback {//
        int butt = 3;
        send_data(0, butt, o->value(), EFFECT::type::reverb, TOPLEVEL::type::Integer);}
        tooltip {Initial delay} xywh {120 40 30 30} box ROUND_UP_BOX labelsize 11 when 4 maximum 127
        code0 {o->setValueType(VC_FXReverbIDelay);}
        class WidgetPDial
      }
      Fl_Dial revp4 {
        label {I.delfb}
        callback {//
        int butt = 4;
        send_data(0, butt, o->value(), EFFECT::type::reverb, TOPLEVEL::type::Integer);}
        tooltip {Initial delay feedback} xywh {155 40 30 30} box ROUND_UP_BOX labelsize 11 maximum 127
        code0 {o->setValueType(VC_percent128);}
        class WidgetPDial
      }
      Fl_Dial revp12 {
        label BW
        callback {//
        int butt = 12;
        send_data(0, butt, o->value(), EFFECT::type::reverb, TOPLEVEL::type::Integer);}
        xywh {200 40 30 30} box ROUND_UP_BOX labelsize 11 when 4 maximum 127 deactivate
        code0 {if (eff->geteffectpar(10)==2) o->activate();}
        code1 {o->setValueType(VC_FXReverbBandwidth);}
        class WidgetPDial
      }
      Fl_Dial revp6 {
        label {E/R}
        callback {//
        int butt = 6;
        send_data(0, butt, o->value(), EFFECT::type::reverb, TOPLEVEL::type::Integer);}
        xywh {235 40 30 30} box ROUND_UP_BOX labelsize 11 maximum 127 deactivate
        class WidgetPDial
      }
      Fl_Dial revp7 {
        label LPF
        callback {//
        int butt = 7;
        send_data(0, butt, o->value(), EFFECT::type::reverb, TOPLEVEL::type::Integer);}
        tooltip {Low pass filter} xywh {270 40 30 30} box ROUND_UP_BOX labelsize 11 maximum 127
        code0 {o->setValueType(VC_FXReverbLowPass);}
        class WidgetPDial
      }
      Fl_Dial revp8 {
        label HPF
        callback {//
        int butt = 8;
        send_data(0, butt, o->value(), EFFECT::type::reverb, TOPLEVEL::type::Integer);}
        tooltip {High pass filter} xywh {305 40 30 30} box ROUND_UP_BOX labelsize 11 maximum 127
        code0 {o->setValueType(VC_FXReverbHighPass);}
        class WidgetPDial
      }
      Fl_Dial revp9 {
        label Damp
        callback {//
        int butt = 9;
        send_data(0, butt, o->value(), EFFECT::type::reverb, TOPLEVEL::type::Integer);}
        tooltip Dampening xywh {340 40 30 30} box ROUND_UP_BOX labelsize 11 minimum 64 maximum 127 step 1
        code0 {o->setValueType(VC_percent64_127);}
        class WidgetPDial
      }
      Fl_Dial revp11 {
        label {R.S.}
        callback {//
        int butt = 11;
        send_data(0, butt, o->value(), EFFECT::type::reverb, TOPLEVEL::type::Integer);}
        tooltip RoomSize xywh {342 8 25 25} box ROUND_UP_BOX labelsize 10 align 4 minimum 1 maximum 127 step 1
        code0 {o->setValueType(VC_percent127);}
        class WidgetPDial
      }
    }
  }
  Function {make_echo_window()} {} {
    Fl_Window effechowindow {
      xywh {979 149 375 95} type Double box PLASTIC_UP_BOX color 221 labelfont 1 labelsize 12 hide
      class Fl_Group
    } {
      Fl_Text_Display echoname {
        label Echo
        xywh {10 10 0 20} box NO_BOX labelfont 1 labelsize 12 align 8
      }
      Fl_Choice echop {
        label Preset
        callback {//
        send_data(TOPLEVEL::action::forceUpdate, 16, o->value(), EFFECT::type::echo, TOPLEVEL::type::Integer);}
        xywh {102 13 96 15} down_box BORDER_BOX color 14 selection_color 0 labelsize 11 textfont 1 textsize 10 textcolor 7
        code0 {o->add("Echo 1");o->add("Echo 2");o->add("Echo 3");o->add("Echo 4");o->add("Simple Echo");o->add("Canyon");o->add("Panning Echo 1");o->add("Panning Echo 2");o->add("Feedback Echo 3");}
      } {}
      Fl_Dial echop0 {
        label Vol
        callback {//
        send_data(0, 0, o->value(), EFFECT::type::echo, TOPLEVEL::type::Integer);}
        tooltip {Effect volume} xywh {10 40 30 30} box ROUND_UP_BOX labelsize 11 maximum 127
        code0 {o->setValueType(VC_FXEchoVol);}
        class WidgetPDial
      }
      Fl_Dial echop1 {
        label Pan
        callback {//
        int butt = 1;
        send_data(0, butt, o->value(), EFFECT::type::echo, TOPLEVEL::type::Integer);}
        xywh {59 40 30 30} box ROUND_UP_BOX labelsize 11 maximum 127
        code0 {o->setValueType(VC_PanningStd);}
        class WidgetPDial
      }
      Fl_Dial echop2 {
        label Delay
        callback {//
        int butt = 2;
        send_data(0, butt, o->value(), EFFECT::type::echo, TOPLEVEL::type::Integer);}
        xywh {111 40 30 30} box ROUND_UP_BOX labelsize 11 when 4 maximum 127
        code0 {o->setValueType(eff->geteffectpar(EFFECT::control::bpm) ? VC_FXlfofreqBPM : VC_FXEchoDelay);}
        class WidgetPDial
      }
      Fl_Dial echop3 {
        label {LRdl.}
        callback {//
        int butt = 3;
        send_data(0, butt, o->value(), EFFECT::type::echo, TOPLEVEL::type::Integer);}
        tooltip {Delay between L/R} xywh {164 40 30 30} box ROUND_UP_BOX labelsize 11 when 4 maximum 127
        code0 {o->setValueType(VC_FXEchoLRdel);}
        class WidgetPDial
      }
      Fl_Dial echop4 {
        label {LRc.}
        callback {//
        int butt = 4;
        send_data(0, butt, o->value(), EFFECT::type::echo, TOPLEVEL::type::Integer);}
        tooltip {L/R crossover} xywh {218 40 30 30} box ROUND_UP_BOX labelsize 11 maximum 127
        code0 {o->setValueType(VC_percent127);}
        class WidgetPDial
      }
      Fl_Dial echop5 {
        label {Fb.}
        callback {//
        int butt = 5;
        send_data(0, butt, o->value(), EFFECT::type::echo, TOPLEVEL::type::Integer);}
        tooltip Feedback xywh {273 40 30 30} box ROUND_UP_BOX labelsize 11 maximum 127
        code0 {o->setValueType(VC_percent127);}
        class WidgetPDial
      }
      Fl_Dial echop6 {
        label Damp
        callback {//
        int butt = 6;
        send_data(0, butt, o->value(), EFFECT::type::echo, TOPLEVEL::type::Integer);}
        tooltip Dampening xywh {334 40 30 30} box ROUND_UP_BOX labelsize 11 maximum 127
        code0 {o->setValueType(VC_percent127);}
        class WidgetPDial
      }
      Fl_Check_Button echop17 {
        label BPM
        callback {//
        send_data(0, EFFECT::control::bpm, o->value(), EFFECT::type::echo, TOPLEVEL::type::Integer);}
        tooltip {Synchronize the frequency to a multiple of the BPM. Note that the delay is capped at 5 seconds, even if the tempo is slower than this.} xywh {325 10 45 15} down_box DOWN_BOX labelsize 11
      }
    }
  }
  Function {make_chorus_window()} {} {
    Fl_Window effchoruswindow {
      xywh {881 316 375 95} type Double box PLASTIC_UP_BOX color 221 labelfont 1 hide
      class Fl_Group
    } {
      Fl_Text_Display chorusname {
        label Chorus
        xywh {10 10 0 20} box NO_BOX labelfont 1 labelsize 12 align 8
      }
      Fl_Choice chorusp {
        label Preset
        callback {//
        send_data(TOPLEVEL::action::forceUpdate, 16, o->value(), EFFECT::type::chorus, TOPLEVEL::type::Integer);}
        xywh {121 13 96 16} down_box BORDER_BOX color 14 selection_color 0 labelsize 11 textfont 1 textsize 10 textcolor 7
        code0 {o->add("Chorus 1");o->add("Chorus 2");o->add("Chorus 3");o->add("Celeste 1");o->add("Celeste 2");o->add("Flange 1");o->add("Flange 2");o->add("Flange 3");o->add("Flange 4");o->add("Flange 5");}
      } {}
      Fl_Choice chorusp4 {
        label {LFO type}
        callback {//
        send_data(0, 4, o->value(), EFFECT::type::chorus, TOPLEVEL::type::Integer);}
        tooltip {LFO function} xywh {189 65 43 15} down_box BORDER_BOX labelsize 10 align 2 textfont 1 textsize 9
        code0 {o->add("Sine");o->add("Tri");}
      } {}
      Fl_Dial chorusp0 {
        label Vol
        callback {//
        send_data(0, 0, o->value(), EFFECT::type::chorus, TOPLEVEL::type::Integer);}
        xywh {10 49 30 30} box ROUND_UP_BOX labelsize 11 maximum 127
        code0 {o->setValueType(VC_FXdefaultVol);}
        class WidgetPDial
      }
      Fl_Dial chorusp1 {
        label Pan
        callback {//
        int butt = 1;
        send_data(0, butt, o->value(), EFFECT::type::chorus, TOPLEVEL::type::Integer);}
        xywh {45 49 30 30} box ROUND_UP_BOX labelsize 11 maximum 127
        code0 {o->setValueType(VC_PanningStd);}
        class WidgetPDial
      }
      Fl_Dial chorusp2 {
        label Freq
        callback {//
        int butt = 2;
        send_data(0, butt, o->value(), EFFECT::type::chorus, TOPLEVEL::type::Integer);}
        tooltip {LFO frequency} xywh {85 49 30 30} box ROUND_UP_BOX labelsize 11 maximum 127
        code0 {o->setValueType(eff->geteffectpar(EFFECT::control::bpm) ? VC_FXlfofreqBPM : VC_FXlfofreq);}
        class WidgetPDial
      }
      Fl_Dial chorusp18 {
        label Start
        callback {//
        send_data(0, EFFECT::control::bpmStart, o->value(), EFFECT::type::chorus, TOPLEVEL::type::Integer);}
        tooltip {Start of LFO phase relative to start of beat. This has no effect unless you are syncing to a song position, using MIDI or a plugin host.} xywh {120 50 30 30} box ROUND_UP_BOX labelsize 11 when 4 maximum 127
        code0 {o->setValueType(VC_PhaseOffset);}
        code1 {if (eff->geteffectpar(EFFECT::control::bpm)) o->activate(); else o->deactivate();}
        class WidgetPDial
      }
      Fl_Dial chorusp3 {
        label Rnd
        callback {//
        int butt = 3;
        send_data(0, butt, o->value(), EFFECT::type::chorus, TOPLEVEL::type::Integer);}
        tooltip {LFO randomness} xywh {155 49 30 30} box ROUND_UP_BOX labelsize 11 when 4 maximum 127
        code0 {o->setValueType(VC_percent127);}
        class WidgetPDial
      }
      Fl_Dial chorusp5 {
        label {St.df}
        callback {//
        int butt = 5;
        send_data(0, butt, o->value(), EFFECT::type::chorus, TOPLEVEL::type::Integer);}
        tooltip {L/R phase shift} xywh {235 49 30 30} box ROUND_UP_BOX labelsize 11 maximum 127
        code0 {o->setValueType(VC_FXlfoStereo);}
        class WidgetPDial
      }
      Fl_Dial chorusp6 {
        label Dpth
        callback {//
        int butt = 6;
        send_data(0, butt, o->value(), EFFECT::type::chorus, TOPLEVEL::type::Integer);}
        tooltip {LFO depth} xywh {270 49 30 30} box ROUND_UP_BOX labelsize 11 maximum 127
        code0 {o->setValueType(VC_FXChorusDepth);}
        class WidgetPDial
      }
      Fl_Dial chorusp7 {
        label Delay
        callback {//
        int butt = 7;
        send_data(0, butt, o->value(), EFFECT::type::chorus, TOPLEVEL::type::Integer);}
        xywh {305 49 30 30} box ROUND_UP_BOX labelsize 11 maximum 127
        code0 {o->setValueType(VC_FXChorusDelay);}
        class WidgetPDial
      }
      Fl_Dial chorusp8 {
        label Fb
        callback {//
        int butt =8;
        send_data(0, butt, o->value(), EFFECT::type::chorus, TOPLEVEL::type::Integer);}
        tooltip Feedback xywh {340 49 30 30} box ROUND_UP_BOX labelsize 11 maximum 127
        code0 {o->setValueType(VC_FXdefaultFb);}
        class WidgetPDial
      }
      Fl_Dial chorusp9 {
        label {L/R}
        callback {//
        int butt = 9;
        send_data(0, butt, o->value(), EFFECT::type::chorus, TOPLEVEL::type::Integer);}
        tooltip {Channel routing} xywh {252 15 30 30} box ROUND_UP_BOX labelsize 11 align 1 maximum 127
        code0 {o->setValueType(VC_percent127);}
        class WidgetPDial
      }
      Fl_Check_Button chorusflange {
        label Flange
        callback {//
        send_data(0, 10, o->value(), EFFECT::type::chorus, TOPLEVEL::type::Integer);}
        xywh {120 10 55 20} box THIN_UP_BOX down_box DOWN_BOX color 230 labelfont 1 labelsize 10 hide deactivate
        code0 {o->value(eff->geteffectpar(10));}
        class Fl_Check_Button2
      }
      Fl_Check_Button chorusp11 {
        label Subtract
        callback {//
        send_data(0, 11, o->value(), EFFECT::type::chorus, TOPLEVEL::type::Integer);}
        tooltip {Inverts the output} xywh {295 19 70 16} down_box DOWN_BOX color 230 labelsize 11
        class Fl_Check_Button2
      }
      Fl_Check_Button chorusp17 {
        label BPM
        callback {//
        send_data(0, EFFECT::control::bpm, o->value(), EFFECT::type::chorus, TOPLEVEL::type::Integer);}
        tooltip {Synchronize the frequency to a multiple of the BPM.} xywh {190 45 50 15} down_box DOWN_BOX labelsize 11
      }
    }
  }
  Function {make_phaser_window()} {} {
    Fl_Window effphaserwindow {
      xywh {849 326 375 95} type Double box PLASTIC_UP_BOX color 221 labelsize 11 hide
      class Fl_Group
    } {
      Fl_Text_Display phasername {
        label Phaser
        xywh {10 10 0 20} box NO_BOX labelfont 1 labelsize 12 align 8
      }
      Fl_Choice phaserp {
        label Preset
        callback {//
        send_data(TOPLEVEL::action::forceUpdate, 16, o->value(), EFFECT::type::phaser, TOPLEVEL::type::Integer);}
        xywh {65 21 82 15} box UP_BOX down_box BORDER_BOX color 14 selection_color 0 labelsize 11 align 1 textfont 1 textsize 10 textcolor 7
        code0 {o->add("Phaser 1");o->add("Phaser 2");o->add("Phaser 3");o->add("Phaser 4");o->add("Phaser 5");o->add("Phaser 6");o->add("APhaser 1");o->add("APhaser 2");o->add("APhaser 3");o->add("APhaser 4");o->add("APhaser 5");o->add("APhaser 6");}
      } {}
      Fl_Choice phaserp4 {
        label {LFO Type}
        callback {//
        send_data(0, 4, o->value(), EFFECT::type::phaser, TOPLEVEL::type::Integer);}
        tooltip {LFO function} xywh {199 65 43 15} down_box BORDER_BOX labelsize 10 align 2 textfont 1 textsize 9
        code0 {o->add("Sine");o->add("Tri");}
      } {}
      Fl_Dial phaserp0 {
        label Vol
        callback {//
        send_data(0, 0, o->value(), EFFECT::type::phaser, TOPLEVEL::type::Integer);}
        tooltip {Effect volume} xywh {8 50 30 30} box ROUND_UP_BOX labelsize 11 maximum 127
        code0 {o->setValueType(VC_FXdefaultVol);}
        class WidgetPDial
      }
      Fl_Dial phaserp1 {
        label Pan
        callback {//
        int butt = 1;
        send_data(0, butt, o->value(), EFFECT::type::phaser, TOPLEVEL::type::Integer);}
        xywh {46 50 30 30} box ROUND_UP_BOX labelsize 11 maximum 127
        code0 {o->setValueType(VC_PanningStd);}
        class WidgetPDial
      }
      Fl_Dial phaserp2 {
        label Freq
        callback {//
        int butt = 2;
        send_data(0, butt, o->value(), EFFECT::type::phaser, TOPLEVEL::type::Integer);}
        tooltip {LFO frequency} xywh {84 50 30 30} box ROUND_UP_BOX labelsize 11 maximum 127
        code0 {o->setValueType(eff->geteffectpar(EFFECT::control::bpm) ? VC_FXlfofreqBPM : VC_FXlfofreq);}
        class WidgetPDial
      }
      Fl_Dial phaserp18 {
        label Start
        callback {//
        send_data(0, EFFECT::control::bpmStart, o->value(), EFFECT::type::phaser, TOPLEVEL::type::Integer);}
        tooltip {Start of LFO phase relative to start of beat. This has no effect unless you are syncing to a song position, using MIDI or a plugin host.} xywh {125 50 30 30} box ROUND_UP_BOX labelsize 11 when 4 maximum 127
        code0 {o->setValueType(VC_PhaseOffset);}
        code1 {if (eff->geteffectpar(EFFECT::control::bpm)) o->activate(); else o->deactivate();}
        class WidgetPDial
      }
      Fl_Dial phaserp3 {
        label Rnd
        callback {//
        int butt = 3;
        send_data(0, butt, o->value(), EFFECT::type::phaser, TOPLEVEL::type::Integer);}
        tooltip {LFO randomness} xywh {165 50 30 30} box ROUND_UP_BOX labelsize 11 when 4 maximum 127
        code0 {o->setValueType(VC_percent127);}
        class WidgetPDial
      }
      Fl_Check_Button phaserp17 {
        label BPM
        callback {//
        send_data(0, EFFECT::control::bpm, o->value(), EFFECT::type::phaser, TOPLEVEL::type::Integer);}
        tooltip {Synchronize the frequency to a multiple of the BPM.} xywh {200 47 17 15} down_box DOWN_BOX labelsize 11 align 8
        code0 {o->value(eff->geteffectpar(EFFECT::control::bpm));}
        class Fl_Check_Button2
      }
      Fl_Dial phaserp5 {
        label {St.df}
        callback {//
        int butt = 5;
        send_data(0, butt, o->value(), EFFECT::type::phaser, TOPLEVEL::type::Integer);}
        tooltip {Left/Right channel phase shift} xywh {248 50 30 30} box ROUND_UP_BOX labelsize 11 maximum 127
        code0 {o->setValueType(VC_FXlfoStereo);}
        class WidgetPDial
      }
      Fl_Dial phaserp6 {
        label Depth
        callback {//
        int butt = 6;
        send_data(0, butt, o->value(), EFFECT::type::phaser, TOPLEVEL::type::Integer);}
        tooltip {LFO depth} xywh {191 15 30 30} box ROUND_UP_BOX labelsize 11 align 1 maximum 127
        code0 {o->setValueType(VC_percent127);}
        class WidgetPDial
      }
      Fl_Dial phaserp7 {
        label Fb
        callback {//
        int butt = 7;
        send_data(0, butt, o->value(), EFFECT::type::phaser, TOPLEVEL::type::Integer);}
        tooltip Feedback xywh {286 50 30 30} box ROUND_UP_BOX labelsize 11 maximum 127
        code0 {o->setValueType(VC_FXdefaultFb);}
        class WidgetPDial
      }
      Fl_Counter phaserp8 {
        label Stages
        callback {//
        send_data(0, 8, o->value(), EFFECT::type::phaser, TOPLEVEL::type::Integer);}
        xywh {324 63 45 15} type Simple labelsize 11 minimum 1 maximum 12 step 1 textfont 1 textsize 11
      }
      Fl_Dial phaserp9 {
        label {L/R}
        callback {//
        int butt = 9;
        send_data(0, butt, o->value(), EFFECT::type::phaser, TOPLEVEL::type::Integer);}
        tooltip {Channel routing} xywh {229 15 30 30} box ROUND_UP_BOX labelsize 11 align 1 maximum 127
        code0 {o->setValueType(VC_percent127);}
        class WidgetPDial
      }
      Fl_Check_Button phaserp10 {
        label {Sub.}
        callback {//
        send_data(0, 10, o->value(), EFFECT::type::phaser, TOPLEVEL::type::Integer);}
        tooltip {Inverts the output} xywh {354 42 17 16} down_box DOWN_BOX color 230 labelsize 11 align 4
        class Fl_Check_Button2
      }
      Fl_Dial phaserp11 {
        label Phase
        callback {//
        int butt = 11;
        send_data(0, butt, o->value(), EFFECT::type::phaser, TOPLEVEL::type::Integer);}
        xywh {150 15 30 30} box ROUND_UP_BOX labelsize 11 align 1 maximum 127
        code0 {o->setValueType(VC_percent127);}
        class WidgetPDial
      }
      Fl_Check_Button phaserp12 {
        label Hyper
        callback {//
        send_data(0, 12, o->value(), EFFECT::type::phaser, TOPLEVEL::type::Integer);}
        tooltip {Hyper-sine} xywh {354 26 17 15} down_box DOWN_BOX labelsize 11 align 4 deactivate
        class Fl_Check_Button2
      }
      Fl_Dial phaserp13 {
        label Dist
        callback {//
        int butt = 13;
        send_data(0, butt, o->value(), EFFECT::type::phaser, TOPLEVEL::type::Integer);}
        tooltip Distortion xywh {267 15 30 30} box ROUND_UP_BOX labelsize 11 align 1 maximum 127 deactivate
        code0 {o->setValueType(VC_percent127);}
        class WidgetPDial
      }
      Fl_Check_Button phaserp14 {
        label Analog
        callback {//
        send_data(TOPLEVEL::action::forceUpdate, 14, o->value(), EFFECT::type::phaser, TOPLEVEL::type::Integer);}
        tooltip {Emulates FET} xywh {354 10 17 15} down_box DOWN_BOX labelsize 11 align 4
        class Fl_Check_Button2
      }
    }
  }
  Function {make_alienwah_window()} {} {
    Fl_Window effalienwahwindow {
      xywh {845 398 375 95} type Double box PLASTIC_UP_BOX color 221 labelfont 1 hide
      class Fl_Group
    } {
      Fl_Text_Display alienname {
        label AlienWah
        xywh {10 10 0 20} box NO_BOX labelfont 1 labelsize 12 align 8
      }
      Fl_Choice awp {
        label Preset
        callback {//
        send_data(TOPLEVEL::action::forceUpdate, 16, o->value(), EFFECT::type::alienWah, TOPLEVEL::type::Integer);}
        xywh {135 13 96 15} down_box BORDER_BOX color 14 selection_color 0 labelsize 11 textfont 1 textsize 10 textcolor 7
        code0 {o->add("Alienwah 1");o->add("Alienwah 2");o->add("Alienwah 3");o->add("Alienwah 4");}
      } {}
      Fl_Choice awp4 {
        label {LFO type}
        callback {//
        send_data(0, 4, o->value(), EFFECT::type::alienWah, TOPLEVEL::type::Integer);}
        tooltip {LFO function} xywh {185 65 43 15} down_box BORDER_BOX labelsize 10 align 2 textfont 1 textsize 9
        code0 {o->add("Sine");o->add("Tri");}
      } {}
      Fl_Dial awp0 {
        label Vol
        callback {//
        send_data(0, 0, o->value(), EFFECT::type::alienWah, TOPLEVEL::type::Integer);}
        tooltip {Effect volume} xywh {5 49 30 30} box ROUND_UP_BOX labelsize 11 maximum 127
        class WidgetPDial
      }
      Fl_Dial awp1 {
        label Pan
        callback {//
        int butt = 1;
        send_data(0, butt, o->value(), EFFECT::type::alienWah, TOPLEVEL::type::Integer);}
        xywh {40 49 30 30} box ROUND_UP_BOX labelsize 11 maximum 127
        class WidgetPDial
      }
      Fl_Dial awp2 {
        label Freq
        callback {//
        int butt = 2;
        send_data(0, butt, o->value(), EFFECT::type::alienWah, TOPLEVEL::type::Integer);}
        tooltip {LFO frequency} xywh {80 49 30 30} box ROUND_UP_BOX labelsize 11 maximum 127
        code0 {o->setValueType(eff->geteffectpar(EFFECT::control::bpm) ? VC_FXlfofreqBPM : VC_FXlfofreq);}
        class WidgetPDial
      }
      Fl_Dial awp3 {
        label Rnd
        callback {//
        int butt = 3;
        send_data(0, butt, o->value(), EFFECT::type::alienWah, TOPLEVEL::type::Integer);}
        tooltip {LFO randomness} xywh {150 50 30 30} box ROUND_UP_BOX labelsize 11 when 4 maximum 127
        code0 {o->setValueType(VC_percent127);}
        class WidgetPDial
      }
      Fl_Dial awp18 {
        label Start
        callback {//
        send_data(0, EFFECT::control::bpmStart, o->value(), EFFECT::type::alienWah, TOPLEVEL::type::Integer);}
        tooltip {Start of LFO phase relative to start of beat. This has no effect unless you are syncing to a song position, using MIDI or a plugin host.} xywh {115 50 30 30} box ROUND_UP_BOX labelsize 11 when 4 maximum 127
        code0 {o->setValueType(VC_PhaseOffset);}
        code1 {if (eff->geteffectpar(EFFECT::control::bpm)) o->activate(); else o->deactivate();}
        class WidgetPDial
      }
      Fl_Dial awp5 {
        label {St.df}
        callback {//
        int butt = 5;
        send_data(0, butt, o->value(), EFFECT::type::alienWah, TOPLEVEL::type::Integer);}
        tooltip {Left/Right channel phase shift} xywh {231 49 30 30} box ROUND_UP_BOX labelsize 11 maximum 127
        class WidgetPDial
      }
      Fl_Dial awp6 {
        label Dpth
        callback {//
        int butt = 6;
        send_data(0, butt, o->value(), EFFECT::type::alienWah, TOPLEVEL::type::Integer);}
        tooltip Depth xywh {266 49 30 30} box ROUND_UP_BOX labelsize 11 maximum 127
        class WidgetPDial
      }
      Fl_Dial awp7 {
        label Fb
        callback {//
        int butt = 7;
        send_data(0, butt, o->value(), EFFECT::type::alienWah, TOPLEVEL::type::Integer);}
        tooltip Feedback xywh {301 49 30 30} box ROUND_UP_BOX labelsize 11 maximum 127
        class WidgetPDial
      }
      Fl_Dial awp9 {
        label {L/R}
        callback {//
        int butt = 9;
        send_data(0, butt, o->value(), EFFECT::type::alienWah, TOPLEVEL::type::Integer);}
        xywh {285 15 30 30} box ROUND_UP_BOX labelsize 11 align 1 maximum 127
        class WidgetPDial
      }
      Fl_Dial awp10 {
        label Phase
        callback {//
        int butt = 10;
        send_data(0, butt, o->value(), EFFECT::type::alienWah, TOPLEVEL::type::Integer);}
        xywh {245 15 30 30} box ROUND_UP_BOX labelsize 11 align 1 maximum 127
        class WidgetPDial
      }
      Fl_Counter awp8 {
        label Delay
        callback {//
        send_data(0, 8, o->value(), EFFECT::type::alienWah, TOPLEVEL::type::Integer);}
        xywh {336 64 35 15} type Simple labelsize 11 minimum 0 maximum 100 step 1 textsize 11
      }
      Fl_Check_Button awp17 {
        label BPM
        callback {//
        send_data(0, EFFECT::control::bpm, o->value(), EFFECT::type::alienWah, TOPLEVEL::type::Integer);}
        tooltip {Synchronize the frequency to a multiple of the BPM.} xywh {185 45 45 15} down_box DOWN_BOX labelsize 11
        code0 {o->value(eff->geteffectpar(EFFECT::control::bpm));}
      }
    }
  }
  Function {make_distorsion_window()} {} {
    Fl_Window effdistorsionwindow {
      xywh {795 679 375 95} type Double box PLASTIC_UP_BOX color 221 labelfont 1 hide
      class Fl_Group
    } {
      Fl_Text_Display distname {
        label Distortion
        xywh {10 10 0 20} box NO_BOX labelfont 1 labelsize 12 align 8
      }
      Fl_Choice distp {
        label Preset
        callback {//
        send_data(TOPLEVEL::action::forceUpdate, 16, o->value(), EFFECT::type::distortion, TOPLEVEL::type::Integer);}
        xywh {139 13 96 16} down_box BORDER_BOX color 14 selection_color 0 labelsize 11 textfont 1 textsize 10 textcolor 7
        code0 {o->add("Overdrive 1");o->add("Overdrive 2");o->add("Exciter 1");o->add("Exciter 2");o->add("Guitar Amp");o->add("Quantize");}
      } {}
      Fl_Choice distp5 {
        label Type
        callback {//
        send_data(0, 5, o->value(), EFFECT::type::distortion, TOPLEVEL::type::Integer);}
        xywh {192 56 60 15} box UP_BOX down_box BORDER_BOX labelsize 10 align 2 textfont 1 textsize 9
        code0 {o->add("Atan");o->add("Asym 1");o->add("Power1");o->add("Sine");o->add("Quants");o->add("Zigzag");o->add("Limit");o->add("LimtiU");o->add("LimitL");o->add("ILimit");o->add("Clip");o->add("Asym 2");o->add("Power2");o->add("Sigm");}
      } {}
      Fl_Dial distp0 {
        label Vol
        callback {//
        send_data(0, 0, o->value(), EFFECT::type::distortion, TOPLEVEL::type::Integer);}
        tooltip {Effect volume} xywh {10 40 30 30} box ROUND_UP_BOX labelsize 11 maximum 127
        code0 {o->setValueType(VC_FXDistVol);}
        class WidgetPDial
      }
      Fl_Dial distp1 {
        label Pan
        callback {//
        int butt = 1;
        send_data(0, butt, o->value(), EFFECT::type::distortion, TOPLEVEL::type::Integer);}
        xywh {45 40 30 30} box ROUND_UP_BOX labelsize 11 maximum 127
        code0 {o->setValueType(VC_PanningStd);}
        class WidgetPDial
      }
      Fl_Dial distp2 {
        label {LRc.}
        callback {//
        int butt = 2;
        send_data(0, butt, o->value(), EFFECT::type::distortion, TOPLEVEL::type::Integer);}
        tooltip {L/R mix} xywh {80 40 30 30} box ROUND_UP_BOX labelsize 11 when 4 maximum 127
        code0 {o->setValueType(VC_percent127);}
        class WidgetPDial
      }
      Fl_Dial distp3 {
        label Drive
        callback {//
        int butt = 3;
        send_data(0, butt, o->value(), EFFECT::type::distortion, TOPLEVEL::type::Integer);}
        tooltip {Input amplification} xywh {120 40 30 30} box ROUND_UP_BOX labelsize 11 when 4 maximum 127
        code0 {o->setValueType(VC_percent127);}
        class WidgetPDial
      }
      Fl_Dial distp4 {
        label Level
        callback {//
        int butt = 4;
        send_data(0, butt, o->value(), EFFECT::type::distortion, TOPLEVEL::type::Integer);}
        tooltip {Output amplification} xywh {155 40 30 30} box ROUND_UP_BOX labelsize 11 maximum 127
        code0 {o->setValueType(VC_FXDistLevel);}
        class WidgetPDial
      }
      Fl_Dial distp7 {
        label LPF
        callback {//
        int butt = 7;
        send_data(0, butt, o->value(), EFFECT::type::distortion, TOPLEVEL::type::Integer);}
        tooltip {Low pass filter} xywh {285 40 30 30} box ROUND_UP_BOX labelsize 11 maximum 127
        code0 {o->setValueType(VC_FXDistLowPass);}
        class WidgetPDial
      }
      Fl_Dial distp8 {
        label HPF
        callback {//
        int butt = 8;
        send_data(0, butt, o->value(), EFFECT::type::distortion, TOPLEVEL::type::Integer);}
        tooltip {High pass filter} xywh {320 40 30 30} box ROUND_UP_BOX labelsize 11 maximum 127
        code0 {o->setValueType(VC_FXDistHighPass);}
        class WidgetPDial
      }
      Fl_Check_Button distp6 {
        label {Neg.}
        callback {//
        send_data(0, 6, o->value(), EFFECT::type::distortion, TOPLEVEL::type::Integer);}
        xywh {260 55 15 15} down_box DOWN_BOX labelsize 11 align 2
        class Fl_Check_Button2
      }
      Fl_Check_Button distp9 {
        label {St.}
        callback {//
        send_data(0, 9, o->value(), EFFECT::type::distortion, TOPLEVEL::type::Integer);}
        tooltip Stereo xywh {355 55 15 15} down_box DOWN_BOX labelsize 11 align 2
        class Fl_Check_Button2
      }
      Fl_Check_Button distp10 {
        label PF
        callback {//
        send_data(0, 10, o->value(), EFFECT::type::distortion, TOPLEVEL::type::Integer);}
        tooltip {Applies the filters(before or after) the distortion} xywh {355 38 15 15} down_box DOWN_BOX labelsize 11 align 1
        class Fl_Check_Button2
      }
    }
  }
  Function {make_eq_window()} {} {
    Fl_Window effeqwindow {
      xywh {1010 762 375 95} type Double box PLASTIC_UP_BOX color 221 labelfont 1 hide
      class Fl_Group
    } {
      Fl_Text_Display eqname {
        label EQ
        xywh {10 10 0 20} box NO_BOX labelfont 1 labelsize 12 align 8
      }
      Fl_Dial eqp0 {
        label Gain
        callback {//
        send_data(TOPLEVEL::action::forceUpdate, 0, o->value(), EFFECT::type::eq, TOPLEVEL::type::Integer);}
        xywh {10 41 30 30} box ROUND_UP_BOX labelsize 11 maximum 127
        code0 {o->setValueType(VC_FXEQgain);}
        class WidgetPDial
      }
      Fl_Counter bandcounter {
        label Band
        callback {//
        send_data(TOPLEVEL::action::forceUpdate, 1, o->value(), EFFECT::type::eq, TOPLEVEL::type::Integer);}
        tooltip {Band no.} xywh {263 20 45 15} type Simple labelsize 11 align 1 minimum 0 maximum 1 step 1 textsize 11
        code0 {o->bounds(0,MAX_EQ_BANDS-1);}
      }
      Fl_Group bandgroup {
        xywh {245 40 130 50} box ENGRAVED_FRAME
      } {
        Fl_Dial freqdial {
          label Freq
          callback {//;
          send_data(TOPLEVEL::action::forceUpdate, 11, o->value(), EFFECT::type::eq, TOPLEVEL::type::Integer);}
          xywh {250 50 25 25} box ROUND_UP_BOX labelsize 10 when 3 maximum 127
          code0 {o->setValueType(VC_FXEQfreq);}
          class WidgetPDial
        }
        Fl_Dial gaindial {
          label Gain
          callback {//
          send_data(TOPLEVEL::action::forceUpdate, 12, o->value(), EFFECT::type::eq, TOPLEVEL::type::Integer);}
          xywh {280 50 25 25} box ROUND_UP_BOX labelsize 10 when 3 maximum 127 step 1
          code0 {o->setValueType(VC_FXEQfilterGain);}
          class WidgetPDial
        }
        Fl_Dial qdial {
          label Q
          callback {//
          send_data(TOPLEVEL::action::forceUpdate, 13, o->value(), EFFECT::type::eq, TOPLEVEL::type::Integer);}
          tooltip {Resonance/Bandwidth} xywh {310 50 25 25} box ROUND_UP_BOX labelsize 10 when 3 maximum 127
          code0 {o->setValueType(VC_FXEQq);}
          class WidgetPDial
        }
        Fl_Counter stagescounter {
          label Stages
          callback {//
          send_data(TOPLEVEL::action::forceUpdate, 14, o->value(), EFFECT::type::eq, TOPLEVEL::type::Integer);}
          tooltip {Additional filter stages} xywh {340 60 30 15} type Simple labelsize 10 minimum 1 maximum 127 step 1 textfont 1 textsize 11
          code0 {o->bounds(0,MAX_FILTER_STAGES-1);}
        }
      }
      Fl_Choice typechoice {
        label Type
        callback {//
        send_data(TOPLEVEL::action::forceUpdate, 10, o->value(), EFFECT::type::eq, TOPLEVEL::type::Integer);}
        tooltip Type xywh {323 20 40 15} down_box BORDER_BOX labelsize 11 align 1 when 6 textfont 1 textsize 9
        code0 {o->add("Off");o->add("Lp1");o->add("Hp1");o->add("Lp2");o->add("Hp2");o->add("Bp2");o->add("N2");o->add("Pk");o->add("LSh");o->add("HSh");}
      } {}
      Fl_Box eqgraph {
        xywh {45 10 190 75} box BORDER_BOX color 178
        class EQGraph
      }
    }
  }
  Function {make_dynamicfilter_window()} {} {
    Fl_Window effdynamicfilterwindow {
      xywh {859 349 375 95} type Double box PLASTIC_UP_BOX color 221 labelfont 1 hide
      class Fl_Group
    } {
      Fl_Text_Display dfname {
        label DynFilter
        xywh {10 10 0 20} box NO_BOX labelfont 1 labelsize 12 align 8
      }
      Fl_Choice dfp {
        label Preset
        callback {//
        send_data(TOPLEVEL::action::forceUpdate, 16, o->value(), EFFECT::type::dynFilter, TOPLEVEL::type::Integer);}
        xywh {132 13 90 16} down_box BORDER_BOX color 14 selection_color 0 labelsize 11 textfont 1 textsize 10 textcolor 7
        code0 {o->add("WahWah");o->add("AutoWah");o->add("Sweep");o->add("VocalMorph1");o->add("VocalMorph2");}
      } {}
      Fl_Choice dfp4 {
        label {LFO type}
        callback {//
        send_data(0, 4, o->value(), EFFECT::type::dynFilter, TOPLEVEL::type::Integer);}
        tooltip {LFO function} xywh {190 64 43 15} down_box BORDER_BOX labelsize 10 align 2 textfont 1 textsize 9
        code0 {o->add("Sine");o->add("Tri");}
      } {}
      Fl_Dial dfp0 {
        label Vol
        callback {//
        send_data(0, 0, o->value(), EFFECT::type::dynFilter, TOPLEVEL::type::Integer);}
        tooltip {Effect volume} xywh {6 49 30 30} box ROUND_UP_BOX labelsize 11 maximum 127
        class WidgetPDial
      }
      Fl_Dial dfp1 {
        label Pan
        callback {//
        int butt = 1;
        send_data(0, butt, o->value(), EFFECT::type::dynFilter, TOPLEVEL::type::Integer);}
        xywh {42 49 30 30} box ROUND_UP_BOX labelsize 11 maximum 127
        class WidgetPDial
      }
      Fl_Dial dfp2 {
        label Freq
        callback {//
        int butt = 2;
        send_data(0, butt, o->value(), EFFECT::type::dynFilter, TOPLEVEL::type::Integer);}
        tooltip {LFO frequency} xywh {80 49 30 30} box ROUND_UP_BOX labelsize 11 maximum 127
        code0 {o->setValueType(eff->geteffectpar(EFFECT::control::bpm) ? VC_FXlfofreqBPM : VC_FXlfofreq);}
        class WidgetPDial
      }
      Fl_Dial dfp3 {
        label Rnd
        callback {//
        int butt = 3;
        send_data(0, butt, o->value(), EFFECT::type::dynFilter, TOPLEVEL::type::Integer);}
        tooltip {LFO randomness} xywh {155 49 30 30} box ROUND_UP_BOX labelsize 11 when 4 maximum 127
        code0 {o->setValueType(VC_percent127);}
        class WidgetPDial
      }
      Fl_Dial dfp18 {
        label Start
        callback {//
        send_data(0, EFFECT::control::bpmStart, o->value(), EFFECT::type::dynFilter, TOPLEVEL::type::Integer);}
        tooltip {Start of LFO phase relative to start of beat. This has no effect unless you are syncing to a song position, using MIDI or a plugin host.} xywh {118 49 30 30} box ROUND_UP_BOX labelsize 11 when 4 maximum 127
        code0 {o->setValueType(VC_PhaseOffset);}
        code1 {if (eff->geteffectpar(EFFECT::control::bpm)) o->activate(); else o->deactivate();}
        class WidgetPDial
      }
      Fl_Dial dfp5 {
        label {St.df}
        callback {int butt = 5;
        send_data(0, butt, o->value(), EFFECT::type::dynFilter, TOPLEVEL::type::Integer);}
        tooltip {Left/Right channel phase shift} xywh {240 49 30 30} box ROUND_UP_BOX labelsize 11 maximum 127
        class WidgetPDial
      }
      Fl_Dial dfp6 {
        label LfoD
        callback {int butt = 6;
        send_data(0, butt, o->value(), EFFECT::type::dynFilter, TOPLEVEL::type::Integer);}
        tooltip {LFO depth} xywh {240 10 30 30} box ROUND_UP_BOX labelsize 11 align 8 maximum 127
        class WidgetPDial
      }
      Fl_Button filter {
        label Filter
        callback {Showfilt();}
        xywh {325 14 37 16} box PLASTIC_THIN_UP_BOX labelsize 11
      }
      Fl_Group {} {
        xywh {275 42 100 53} box EMBOSSED_BOX color 181
      } {
        Fl_Dial dfp7 {
          label {A.S.}
          callback {int butt = 7;
          send_data(0, butt, o->value(), EFFECT::type::dynFilter, TOPLEVEL::type::Integer);}
          tooltip {Filter vs amplitude} xywh {280 49 30 30} box ROUND_UP_BOX labelsize 11 maximum 127
          class WidgetPDial
        }
        Fl_Dial dfp9 {
          label {A.M}
          callback {int butt = 9;
          send_data(0, butt, o->value(), EFFECT::type::dynFilter, TOPLEVEL::type::Integer);}
          tooltip {Rate that  amplitude changes the filter} xywh {316 49 30 30} box ROUND_UP_BOX labelsize 11 maximum 127
          class WidgetPDial
        }
        Fl_Check_Button dfp8 {
          label {Inv.}
          callback {//
          send_data(0, 8, o->value(), EFFECT::type::dynFilter, TOPLEVEL::type::Integer);}
          tooltip {Enable for filter frequency to lower with higher input amplitude} xywh {352 64 15 15} down_box DOWN_BOX labelsize 11 align 2
          class Fl_Check_Button2
        }
      }
      Fl_Check_Button dfp17 {
        label BPM
        callback {//
        send_data(0, EFFECT::control::bpm, o->value(), EFFECT::type::dynFilter, TOPLEVEL::type::Integer);}
        tooltip {Synchronize the frequency to a multiple of the BPM.} xywh {191 45 45 15} down_box DOWN_BOX labelsize 11
        code0 {o->value(eff->geteffectpar(EFFECT::control::bpm));}
      }
    }
  }
  Function {make_filter_window()} {} {
    Fl_Window filterwindow {
      label {Filter Parameters for DynFilter Eff.}
      callback {//
    filterclose->do_callback();}
      xywh {1109 779 290 110} type Double hide resizable
      code0 {filtDW = o->w(); filtDH = o->h();}
    } {
      Fl_Group fwin_filterui {
        label {DynFilter effect  - Filter}
        xywh {5 5 275 75} box FLAT_BOX color 50 labelsize 12 align 144
        code0 {o->init(eff->filterpars,NULL,NULL, npart, EFFECT::type::dynFilter, neff);}
        class FilterUI
      } {}
      Fl_Button filterclose {
        label Close
        callback {//
    saveWin(synth, filterwindow->w(), filterwindow->h(), filterwindow->x(), filterwindow->y(), false, "xFilter-dynamic " + to_string(npart));
    filterwindow->hide();}
        xywh {124 86 46 20} box THIN_UP_BOX labelsize 12
      }
    }
  }
  Function {send_data(int action, int control, float value, int group, int type)} {} {
    code {//
    type |= TOPLEVEL::type::Write;
    collect_data(synth, value, action, type, control, npart, group, neff);} {}
  }
  Function {fetchData(float value, int control, int part, int kititem = UNUSED, int engine = UNUSED, int insert = UNUSED, int parameter = UNUSED, int offset = UNUSED, int miscmsg = UNUSED, int request = UNUSED)} {return_type float
  } {
    code {//
        return collect_readData(synth, value, control, part, kititem, engine, insert, parameter, offset, miscmsg, request);} {}
  }
  Function {returns_update(CommandBlock *getData)} {} {
    code {//
    float value = getData->data.value;
    int value_int = int(value + 0.5f);
    unsigned char control = getData->data.control;
    unsigned char efftype = getData->data.kit;
    unsigned char effnum = getData->data.engine;
    bool isdynfilter = (effnum == EFFECT::type::dynFilter);
    unsigned char secondary = getData->data.offset;

    int textCol = 14;
    if (fetchData(0, 200, getData->data.part, efftype, effnum) != 0)
        textCol = FL_BLUE;
    //cout << "colour " << textCol << endl;
    //cout << "cont " << (int)control << "  type " << (int)efftype << "  num " << (int)effnum << endl;
    switch(efftype)
    {
        case EFFECT::type::none:
            break;

        case EFFECT::type::reverb:
            switch (control)
            {
                case EFFECT::control::level:
                    revp0->value(value);
                    break;
                case EFFECT::control::panning:
                    revp1->value(value);
                    break;
                case EFFECT::control::frequency: // time here
                    revp2->value(value);
                    break;
                case 3:
                    revp3->value(value);
                    break;
                case 4:
                    revp4->value(value);
                    break;
                case 6:
                    revp6->value(value);
                    break;
                case 7:
                    revp7->value(value);
                    break;
                case 8:
                    revp8->value(value);
                    break;
                case 9:
                    revp9->value(value);
                    break;
                case 10:
                    revp10->value(value_int);
                    if (value_int == 2)
                    {
                        revp12->activate();
                        revp12->value(secondary);
                    }
                    else
                        revp12->deactivate();
                    break;
                case 11:
                    revp11->value(value);
                    break;
                case 12:
                    revp12->value(value);
                    break;
                case EFFECT::control::preset:
                    refresh();
                    break;
            }
            revp->color(textCol);
            revp->redraw();
            break;

        case EFFECT::type::echo:
            switch (control)
            {
                case EFFECT::control::level:
                    echop0->value(value);
                    break;
                case EFFECT::control::panning:
                    echop1->value(value);
                    break;
                case EFFECT::control::frequency: // delay here
                    echop2->value(value);
                    break;
                case 3:
                    echop3->value(value);
                    break;
                case 4:
                    echop4->value(value);
                    break;
                case 5:
                    echop5->value(value);
                    break;
                case 6:
                    echop6->value(value);
                    break;
                case EFFECT::control::bpm:
                    echop17->value(value);
                    if (value)
                        echop2->setValueType(VC_FXlfofreqBPM);
                    else
                        echop2->setValueType(VC_FXEchoDelay);
                    break;
                case EFFECT::control::preset:
                    refresh();
                    break;
            }
            echop->color(textCol);
            echop->redraw();
            break;

        case EFFECT::type::chorus:
            switch (control)
            {
                case EFFECT::control::level:
                    chorusp0->value(value);
                    break;
                case EFFECT::control::panning:
                    chorusp1->value(value);
                    break;
                case EFFECT::control::frequency:
                    chorusp2->value(value);
                    break;
                case 3:
                    chorusp3->value(value);
                    break;
                case 5:
                    chorusp5->value(value);
                    break;
                case 6:
                    chorusp6->value(value_int);
                    break;
                case 7:
                    chorusp7->value(value);
                    break;
                case 8:
                    chorusp8->value(value);
                    break;
                case 9:
                    chorusp9->value(value);
                    break;
                case 11:
                    chorusp11->value(value_int);
                    break;
                case EFFECT::control::bpm:
                    chorusp17->value(value);
                    if (value)
                    {
                        chorusp2->setValueType(VC_FXlfofreqBPM);
                        chorusp18->activate();
                    }
                    else
                    {
                        chorusp2->setValueType(VC_FXlfofreq);
                        chorusp18->deactivate();
                    }
                    break;
                case EFFECT::control::bpmStart:
                    chorusp18->value(value);
                    break;
                case EFFECT::control::preset:
                    refresh();
                    break;
            }
            chorusp->color(textCol);
            chorusp->redraw();
            break;

        case EFFECT::type::phaser:
            switch (control)
            {
                case EFFECT::control::level:
                    phaserp0->value(value);
                    break;
                case EFFECT::control::panning:
                    phaserp1->value(value);
                    break;
                case EFFECT::control::frequency:
                    phaserp2->value(value);
                    break;
                case 3:
                    phaserp3->value(value);
                    break;
                case 4:
                    phaserp4->value(value_int);
                    break;
                case 5:
                    phaserp5->value(value);
                    break;
                case 6:
                    phaserp6->value(value);
                    break;
                case 7:
                   phaserp7->value(value);
                    break;
                case 8:
                    phaserp8->value(value_int);
                    break;
                case 9:
                    phaserp9->value(value);
                    break;
                case 10:
                    phaserp10->value(value_int);
                    break;
                case 11:
                    phaserp11->value(value);
                    break;
                case 12:
                    phaserp12->value(value_int);
                    break;
                case 13:
                    phaserp13->value(value);
                    break;
                case 14:
                    phaserp14->value(value_int);
                    if (value_int != 0)
                    {
                        phaserp9->deactivate();
                        phaserp7->deactivate();
                        phaserp12->activate();
                        phaserp13->activate();
                    }
                    else
                    {
                        phaserp9->activate();
                        phaserp7->activate();
                        phaserp12->deactivate();
                        phaserp13->deactivate();
                    }
                    break;
                case EFFECT::control::bpm:
                    phaserp17->value(value);
                    if (value)
                    {
                        phaserp2->setValueType(VC_FXlfofreqBPM);
                        phaserp18->activate();
                    }
                    else
                    {
                        phaserp2->setValueType(VC_FXlfofreq);
                        phaserp18->deactivate();
                    }
                    break;
                case EFFECT::control::bpmStart:
                    phaserp18->value(value);
                    break;
                case EFFECT::control::preset:
                    refresh();
                    break;
            }
            phaserp->color(textCol);
            phaserp->redraw();
            break;

        case EFFECT::type::alienWah:
            switch (control)
            {
                case EFFECT::control::level:
                    awp0->value(value);
                    break;
                case EFFECT::control::panning:
                    awp1->value(value);
                    break;
                case EFFECT::control::frequency:
                    awp2->value(value);
                    break;
                case 3:
                    awp3->value(value);
                    break;
                case 4:
                    awp4->value(value_int);
                    break;
                case 5:
                    awp5->value(value);
                    break;
                case 6:
                    awp6->value(value);
                    break;
                case 7:
                    awp7->value(value);
                    break;
                case 8:
                    awp8->value(value_int);
                    break;
                case 9:
                    awp9->value(value);
                    break;
                case 10:
                    awp10->value(value);
                    break;
                case EFFECT::control::bpm:
                    awp17->value(value);
                    if (value)
                    {
                        awp2->setValueType(VC_FXlfofreqBPM);
                        awp18->activate();
                    }
                    else
                    {
                        awp2->setValueType(VC_FXlfofreq);
                        awp18->deactivate();
                    }
                    break;
                case EFFECT::control::bpmStart:
                    awp18->value(value);
                    break;
                case EFFECT::control::preset:
                    refresh();
                    break;
            }
            awp->color(textCol);
            awp->redraw();
            break;

        case EFFECT::type::distortion:
            switch (control)
            {
                case EFFECT::control::level:
                    distp0->value(value);
                    break;
                case EFFECT::control::panning:
                    distp1->value(value);
                    break;
                case EFFECT::control::frequency: // LR-mix here
                    distp2->value(value);
                    break;
                case 3:
                    distp3->value(value);
                    break;
                case 4:
                    distp4->value(value);
                    break;
                case 5:
                    distp5->value(value_int);
                    break;
                case 6:
                    distp6->value(value_int);
                    break;
                case 7:
                    distp7->value(value);
                    break;
                case 8:
                    distp8->value(value);
                    break;
                case 9:
                    distp9->value(value_int);
                    break;
                case 10:
                    distp10->value(value_int);
                    break;
                case EFFECT::control::preset:
                    refresh();
                    break;
            }
            distp->color(textCol);
            distp->redraw();
            break;

        case EFFECT::type::eq:
            //synth->getRuntime().Log("EQ " + to_string(value_int) + "  " + to_string(int(control)));
            if (control == EFFECT::control::level)
            {
                eqp0->value(value);
            }
            else if (control == EFFECT::control::panning) // band numnber here!
            {
                eqband = value_int;
                EQbandUpdate();
            }
            else
            {
                switch (control)
                {
                case 10:
                    typechoice->value(value_int);
                    if (value_int == 0)
                        bandgroup->deactivate();
                    else
                        bandgroup->activate();
                    if (value_int > 2)
                        qdial->activate();
                    else
                        qdial->deactivate();
                    if (value_int > 6)
                        gaindial->activate();
                    else
                        gaindial->deactivate();
                    break;
                case 11:
                    freqdial->value(value);
                    break;
                case 12:
                    gaindial->value(value);
                    break;
                case 13:
                    qdial->value(value);
                    break;
                case 14:
                    stagescounter->value(value_int);
                }
            }
            effeqwindow->redraw();
            break;

        case EFFECT::type::dynFilter:
            if (isdynfilter)
            { // shouldn't get here
                //cout << "DyneFilter" << endl;
                return;
            }
            switch (control)
            {
                case EFFECT::control::level:
                    dfp0->value(value);
                    break;
                case EFFECT::control::panning:
                    dfp1->value(value);
                    break;
                case EFFECT::control::frequency:
                    dfp2->value(value);
                    break;
                case 3:
                    dfp3->value(value);
                    break;
                case 4:
                    dfp4->value(value_int);
                    break;
                case 5:
                    dfp5->value(value);
                    break;
                case 6:
                    dfp6->value(value);
                    break;
                case 7:
                    dfp7->value(value);
                    break;
                case 8:
                    dfp8->value(value_int);
                    break;
                case 9:
                    dfp9->value(value);
                    break;
                case EFFECT::control::bpm:
                    dfp17->value(value);
                    if (value)
                    {
                        dfp2->setValueType(VC_FXlfofreqBPM);
                        dfp18->activate();
                    }
                    else
                    {
                        dfp2->setValueType(VC_FXlfofreq);
                        dfp18->deactivate();
                    }
                    break;
                case EFFECT::control::bpmStart:
                    dfp18->value(value);
                    break;
                case EFFECT::control::preset:
                    refresh();
                    break;
            }
            dfp->color(textCol);
            dfp->redraw();
            break;
    }} {}
  }
  Function {init(EffectMgr *eff_, int npart_, int neff_)} {} {
    code {//
    eff=eff_;
    npart = npart_;
    neff = neff_;
    synth = eff->getSynthEngine();

    make_null_window();
    make_reverb_window();
    make_echo_window();
    make_chorus_window();
    make_phaser_window();
    make_alienwah_window();
    make_distorsion_window();
    make_eq_window();
    make_dynamicfilter_window();

    int px=this->parent()->x();
    int py=this->parent()->y();

    effnullwindow->position(px,py);
    effreverbwindow->position(px,py);
    effechowindow->position(px,py);
    effchoruswindow->position(px,py);
    effphaserwindow->position(px,py);
    effalienwahwindow->position(px,py);
    effdistorsionwindow->position(px,py);
    effeqwindow->position(px,py);
    effdynamicfilterwindow->position(px,py);
    refresh(eff, npart, neff);} {}
  }
  Function {refresh(EffectMgr *eff_, int npart_, int neff_)} {} {
    code {//
    eff = eff_;
    npart = npart_;
    neff = neff_;
    this->hide();
    effnullwindow->hide();
    effreverbwindow->hide();
    effechowindow->hide();
    effchoruswindow->hide();
    effphaserwindow->hide();
    effalienwahwindow->hide();
    effdistorsionwindow->hide();
    effeqwindow->hide();
    effdynamicfilterwindow->hide();
    eqband=0;
    if (filterwindow != NULL)
    {
        filterwindow->hide();
        delete(filterwindow);
        filterwindow=NULL;
    }
    switch(eff->geteffect())
    {
        case 1:
            revp->value(eff->getpreset());
            revp0->value(eff->geteffectpar(0));
            if (eff->insertion != 0)
            {
                revp0->label("D/W");
                revp0->setValueType(VC_FXReverbDW);
            }
            revp1->value(eff->geteffectpar(1));
            revp2->value(eff->geteffectpar(2));
            revp3->value(eff->geteffectpar(3));
            revp4->value(eff->geteffectpar(4));
            revp6->value(eff->geteffectpar(6));
            revp7->value(eff->geteffectpar(7));
            revp8->value(eff->geteffectpar(8));
            revp9->value(eff->geteffectpar(9));
            revp10->value(eff->geteffectpar(10));
            revp11->value(eff->geteffectpar(11));
            revp12->value(eff->geteffectpar(12));
            effreverbwindow->show();
            break;
        case 2:
            echop->value(eff->getpreset());
            echop0->value(eff->geteffectpar(0));
            if (eff->insertion != 0)
            {
                echop0->label("D/W");
                echop0->setValueType(VC_FXEchoDW);
            }
            echop1->value(eff->geteffectpar(1));
            echop2->value(eff->geteffectpar(2));
            echop3->value(eff->geteffectpar(3));
            echop4->value(eff->geteffectpar(4));
            echop5->value(eff->geteffectpar(5));
            echop6->value(eff->geteffectpar(6));
            echop17->value(eff->geteffectpar(17));
            effechowindow->show();
            break;
        case 3:
            chorusp->value(eff->getpreset());
            chorusp0->value(eff->geteffectpar(0));
            if (eff->insertion != 0)
            {
                chorusp0->label("D/W");
                chorusp0->setValueType(VC_FXdefaultDW);
            }
            chorusp1->value(eff->geteffectpar(1));
            chorusp2->value(eff->geteffectpar(2));
            chorusp3->value(eff->geteffectpar(3));
            chorusp4->value(eff->geteffectpar(4));
            chorusp5->value(eff->geteffectpar(5));
            chorusp6->value(eff->geteffectpar(6));
            chorusp7->value(eff->geteffectpar(7));
            chorusp8->value(eff->geteffectpar(8));
            chorusp9->value(eff->geteffectpar(9));
            chorusp11->value(eff->geteffectpar(11));
            chorusp17->value(eff->geteffectpar(17));
            if (chorusp17->value())
            {
                chorusp2->setValueType(VC_FXlfofreqBPM);
                chorusp18->activate();
            }
            else
            {
                chorusp2->setValueType(VC_FXlfofreq);
                chorusp18->deactivate();
            }
            chorusp18->value(eff->geteffectpar(18));
            effchoruswindow->show();
            break;
        case 4:
            phaserp->value(eff->getpreset());
            phaserp0->value(eff->geteffectpar(0));
            if (eff->insertion != 0)
            {
                phaserp0->label("D/W");
                phaserp0->setValueType(VC_FXdefaultDW);
            }
            phaserp1->value(eff->geteffectpar(1));
            phaserp2->value(eff->geteffectpar(2));
            phaserp3->value(eff->geteffectpar(3));
            phaserp4->value(eff->geteffectpar(4));
            phaserp5->value(eff->geteffectpar(5));
            phaserp6->value(eff->geteffectpar(6));
            phaserp7->value(eff->geteffectpar(7));
            phaserp8->value(eff->geteffectpar(8));
            phaserp9->value(eff->geteffectpar(9));
            phaserp10->value(eff->geteffectpar(10));
            phaserp11->value(eff->geteffectpar(11));
            phaserp12->value(eff->geteffectpar(12));
            phaserp13->value(eff->geteffectpar(13));
            phaserp14->value(eff->geteffectpar(14));
            if (phaserp14->value() != 0)
            {
                phaserp9->deactivate();
                //phaserp11->deactivate();
                phaserp12->activate();
                phaserp13->activate();
            }
            else
            {
                phaserp9->activate();
                //phaserp11->activate();
                phaserp12->deactivate();
                phaserp13->deactivate();
            }
            phaserp17->value(eff->geteffectpar(17));
            if (phaserp17->value())
            {
                phaserp2->setValueType(VC_FXlfofreqBPM);
                phaserp18->activate();
            }
            else
            {
                phaserp2->setValueType(VC_FXlfofreq);
                phaserp18->deactivate();
            }
            phaserp18->value(eff->geteffectpar(18));

            effphaserwindow->show();
            break;
        case 5:
            awp->value(eff->getpreset());
            awp0->value(eff->geteffectpar(0));
            if (eff->insertion != 0)
                awp0->label("D/W");
            awp1->value(eff->geteffectpar(1));
            awp2->value(eff->geteffectpar(2));
            awp3->value(eff->geteffectpar(3));
            awp4->value(eff->geteffectpar(4));
            awp5->value(eff->geteffectpar(5));
            awp6->value(eff->geteffectpar(6));
            awp7->value(eff->geteffectpar(7));
            awp8->value(eff->geteffectpar(8));
            awp9->value(eff->geteffectpar(9));
            awp10->value(eff->geteffectpar(10));
            awp17->value(eff->geteffectpar(17));
            if (awp17->value())
            {
                awp2->setValueType(VC_FXlfofreqBPM);
                awp18->activate();
            }
            else
            {
                awp2->setValueType(VC_FXlfofreq);
                awp18->deactivate();
            }
            awp18->value(eff->geteffectpar(18));
            effalienwahwindow->show();
            break;
        case 6:
            distp->value(eff->getpreset());
            distp0->value(eff->geteffectpar(0));
            if (eff->insertion != 0)
            {
                distp0->label("D/W");
                distp0->setValueType(VC_FXdefaultDW);
            }
            distp1->value(eff->geteffectpar(1));
            distp2->value(eff->geteffectpar(2));
            distp3->value(eff->geteffectpar(3));
            distp4->value(eff->geteffectpar(4));
            distp5->value(eff->geteffectpar(5));
            distp6->value(eff->geteffectpar(6));
            distp7->value(eff->geteffectpar(7));
            distp8->value(eff->geteffectpar(8));
            distp9->value(eff->geteffectpar(9));
            distp10->value(eff->geteffectpar(10));
            effdistorsionwindow->show();
            break;
        case 7:
        {
            eqband = 0;
            int type = eff->geteffectpar(10);
            eqp0->value(eff->geteffectpar(0));
            bandcounter->value(eqband);
            typechoice->value(type);
            freqdial->value(eff->geteffectpar(11));
            gaindial->value(eff->geteffectpar(12));
            qdial->value(eff->geteffectpar(13));
            if (type < 3)
                qdial->deactivate();
            if (type < 6)
                gaindial->deactivate();
            stagescounter->value(eff->geteffectpar(14));
            eqgraph->redraw();
            eqgraph->init(eff);
            effeqwindow->show();
            break;
        }
        case 8:
            make_filter_window();
            dfp->value(eff->getpreset());
            dfp0->value(eff->geteffectpar(0));
            if (eff->insertion!=0)
                dfp0->label("D/W");
            dfp1->value(eff->geteffectpar(1));
            dfp2->value(eff->geteffectpar(2));
            dfp3->value(eff->geteffectpar(3));
            dfp4->value(eff->geteffectpar(4));
            dfp5->value(eff->geteffectpar(5));
            dfp6->value(eff->geteffectpar(6));
            dfp7->value(eff->geteffectpar(7));
            dfp8->value(eff->geteffectpar(8));
            dfp9->value(eff->geteffectpar(9));
            dfp17->value(eff->geteffectpar(17));
            if (dfp17->value())
            {
                dfp2->setValueType(VC_FXlfofreqBPM);
                dfp18->activate();
            }
            else
            {
                dfp2->setValueType(VC_FXlfofreq);
                dfp18->deactivate();
            }
            dfp18->value(eff->geteffectpar(18));
            effdynamicfilterwindow->show();
            break;
        default:
            effnullwindow->show();
            break;
    }
    this->show();} {}
  }
  Function {refresh()} {} {
    code {refresh(eff, npart, neff);} {}
  }
  Function {UpdatePresetColour(int changed, int efftype)} {} {
    code {//
    int textCol = 14;
    if (changed)
         textCol = FL_BLUE;

    switch (efftype + EFFECT::type::none)
    {
        case EFFECT::type::reverb:
            revp->color(textCol);
            revp->redraw();
            break;
        case EFFECT::type::echo:
            echop->color(textCol);
            echop->redraw();
            break;
        case EFFECT::type::chorus:
            chorusp->color(textCol);
            chorusp->redraw();
            break;
        case EFFECT::type::phaser:
            phaserp->color(textCol);
            phaserp->redraw();
            break;
        case EFFECT::type::alienWah:
            awp->color(textCol);
            awp->redraw();
            break;
        case EFFECT::type::distortion:
            distp->color(textCol);
            distp->redraw();
            break;
        case EFFECT::type::eq:
            break;
        case EFFECT::type::dynFilter:
            dfp->color(textCol);
            dfp->redraw();
            break;
    }
    //cout << "Col " << textCol << "  eff " << efftype << endl;} {}
  }
  Function {effRtext(float dScale, int efftype)} {} {
    code {//
        //std::cout << "scale " << dScale << "  type " << efftype << std::endl;
        int size9 = int(9 * dScale);
        int size = int(10 * dScale);
        int size11 = int(11 * dScale);
        int size12 = int(12 * dScale);

        switch (efftype)
        {
            case 0:
                noeffect->labelsize(14 * dScale);
                break;
            case 1: // reverb
                revname->labelsize(size12);
                revp->labelsize(size11);
                    revp->textsize(size);
                revp10->labelsize(size11);
                    revp10->textsize(size);

                revp0->labelsize(size11);
                revp1->labelsize(size11);
                revp2->labelsize(size11);
                revp3->labelsize(size11);
                revp4->labelsize(size11);
                revp12->labelsize(size11);
                revp6->labelsize(size11);
                revp7->labelsize(size11);
                revp8->labelsize(size11);
                revp9->labelsize(size11);
                revp11->labelsize(size11);
                break;
            case 2: // echo
                echoname->labelsize(size12);
                echop->labelsize(size11);
                    echop->textsize(size);

                echop0->labelsize(size11);
                echop1->labelsize(size11);
                echop2->labelsize(size11);
                echop3->labelsize(size11);
                echop4->labelsize(size11);
                echop5->labelsize(size11);
                echop6->labelsize(size11);
                echop17->labelsize(size11);
            	break;
            case 3: // chorus
                chorusname->labelsize(size12);
                chorusp->labelsize(size11);
                    chorusp->textsize(size);
                chorusp4->labelsize(size);
                    chorusp4->textsize(size9);

                chorusp0->labelsize(size11);
                chorusp1->labelsize(size11);
                chorusp2->labelsize(size11);
                chorusp3->labelsize(size11);
                chorusp5->labelsize(size11);
                chorusp6->labelsize(size11);
                chorusp7->labelsize(size11);
                chorusp8->labelsize(size11);
                chorusp9->labelsize(size11);
                chorusflange->labelsize(size);
                chorusp11->labelsize(size11);
                chorusp17->labelsize(size11);
                chorusp18->labelsize(size11);
                break;
            case 4: // phaser
                phasername->labelsize(size12);
                phaserp->labelsize(size11);
                    phaserp->textsize(size);
                phaserp4->labelsize(size);
                    phaserp4->textsize(size9);

                phaserp0->labelsize(size11);
                phaserp1->labelsize(size11);
                phaserp2->labelsize(size11);
                phaserp3->labelsize(size11);
                phaserp5->labelsize(size11);
                phaserp6->labelsize(size11);
                phaserp7->labelsize(size11);
                phaserp8->labelsize(size11);
                    phaserp8->textsize(size11);
                phaserp9->labelsize(size11);
                phaserp10->labelsize(size11);
                phaserp11->labelsize(size11);
                phaserp12->labelsize(size11);
                phaserp13->labelsize(size11);
                phaserp14->labelsize(size11);
                phaserp17->labelsize(size11);
                phaserp18->labelsize(size11);
                break;
            case 5: // alienwah
                alienname->labelsize(size12);
                awp->labelsize(size11);
                    awp->textsize(size);
                awp4->labelsize(size);
                    awp4->textsize(size9);

                awp0->labelsize(size11);
                awp1->labelsize(size11);
                awp2->labelsize(size11);
                awp3->labelsize(size11);
                awp5->labelsize(size11);
                awp6->labelsize(size11);
                awp7->labelsize(size11);
                awp9->labelsize(size11);

                awp10->labelsize(size11);
                awp8->labelsize(size11);
                    awp8->textsize(size11);
                awp17->labelsize(size11);
                awp18->labelsize(size11);
                break;
            case 6: // distortion
                distname->labelsize(size12);
                distp->labelsize(size11);
                    distp->textsize(size);
                distp5->labelsize(size);
                    distp5->textsize(size9);

                distp0->labelsize(size11);
                distp1->labelsize(size11);
                distp2->labelsize(size11);
                distp3->labelsize(size11);
                distp4->labelsize(size11);
                distp7->labelsize(size11);
                distp8->labelsize(size11);

                distp6->labelsize(size11);
                distp9->labelsize(size11);
                distp10->labelsize(size11);
                break;
            case 7: // EQ
                eqname->labelsize(size12);
                eqp0->labelsize(size11);
                bandcounter->labelsize(size11);
                    bandcounter->textsize(size11);

                freqdial->labelsize(size11);
                gaindial->labelsize(size11);
                qdial->labelsize(size11);
                stagescounter->labelsize(size);
                    stagescounter->textsize(size11);

                typechoice->labelsize(size11);
                    typechoice->textsize(size9);
                break;
            case 8: // dynfilter
                dfname->labelsize(size12);
                dfp->labelsize(size11);
                    dfp->textsize(size);
                dfp4->labelsize(size);
                    dfp4->textsize(size9);

                dfp0->labelsize(size11);
                dfp1->labelsize(size11);
                dfp2->labelsize(size11);
                dfp3->labelsize(size11);
                dfp5->labelsize(size11);
                dfp6->labelsize(size11);

                filter->labelsize(size11);
                dfp7->labelsize(size11);
                dfp8->labelsize(size11);
                dfp9->labelsize(size11);
                dfp17->labelsize(size11);
                dfp18->labelsize(size11);

                filterclose->labelsize(size12);
                break;
            default:
                break;
        }} {}
  }
  Function {Showfilt()} {} {
    code {//
    int fetchW, fetchH, fetchX, fetchY, fetchO;
    loadWin(synth, fetchW, fetchH, fetchX, fetchY, fetchO, "xFilter-dynamic " + to_string(npart));

    if (fetchW < filtDW || fetchH < filtDH)
    {
        fetchW = filtDW;
        fetchH = filtDH;
    }
    checkSane(fetchX, fetchY, fetchW, fetchH, filtDW, filtDH);
    filterwindow->resize(fetchX, fetchY, fetchW, fetchH);
    filterwindow->show();
    lastfiltW = 0;} {}
  }
  Function {filtRtext()} {} {
    code {//
    if (lastfiltW == filterwindow->w())
        return;
    lastfiltW = filterwindow->w();
    float dW = filterwindow->w() / filtDW;
    float dH = filterwindow->h() / filtDH;
    float dScale;

    if (dW < dH)
        dScale = dW;
    else
        dScale = dH;
    if (dScale < 0.2f)
        dScale = 0.2f;

    filterclose->labelsize(12 * dScale);

    fwin_filterui->filterRtext(dScale);

    filterwindow->redraw();} {}
  }
  Function {EQbandUpdate()} {} {
    code {//
    int npb = eqband * 5 + 10;

    int type = eff->geteffectpar(npb);
    typechoice->value(type);

    if (type == 0)
        bandgroup->deactivate();
    else
        bandgroup->activate();

    if (type > 2)
        qdial->activate();
    else
        qdial->deactivate();

    if (type > 6)
        gaindial->activate();
    else
        gaindial->deactivate();

    int freq = eff->geteffectpar(npb + 1);
    freqdial->value(freq);

    int gain = eff->geteffectpar(npb + 2);
    gaindial->value(gain);

    int q = eff->geteffectpar(npb + 3);
    qdial->value(q);

    int dbl = eff->geteffectpar(npb + 4);
    stagescounter->value(dbl);} {}
  }
  decl {EffectMgr *eff;} {private local
  }
  decl {SynthEngine *synth;} {private local
  }
  decl {int eqband;} {private local
  }
  decl {int npart;} {private local
  }
  decl {int neff;} {private local
  }
  decl {float filtDW;} {private local
  }
  decl {float filtDH;} {private local
  }
  decl {int lastfiltW;} {private local
  }
}
