// PADNoteUI.h
// generated by Fast Light User Interface Designer (fluid) version 1.0405

#ifndef PADnoteUI_h
#define PADnoteUI_h
#include <FL/Fl.H>
// Original ZynAddSubFX author Nasca Octavian Paul
// Copyright (C) 2002-2005 Nasca Octavian Paul
// Copyright 2009-2011, Alan Calvert
// Copyright 2015-2021, Will Godfrey
// Copyright 2022-2026, Ichthyostega, Will Godfrey

// This file is part of yoshimi, which is free software: you can redistribute
// it and/or modify it under the terms of the GNU 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 derivative of ZynAddSubFX original code


#include "ResonanceUI.h"
    #include "OscilGenUI.h"
#include <memory>
    using std::unique_ptr;
    class PADStatus;
#include "Interface/TextLists.h"

class PADnoteHarmonicProfile : public Fl_Box {
public:
  PADnoteHarmonicProfile(int x,int y, int w, int h, const char *label=0);
  void init(PADnoteParameters *pars);
  void draw();
  PADnoteParameters *pars;
};

class PADnoteOvertonePosition : public Fl_Box {
public:
  PADnoteOvertonePosition(int x,int y, int w, int h, const char *label=0);
  void init(PADnoteParameters *pars);
  void draw();
  PADnoteParameters *pars;
private:
  SynthEngine *synth;
};
#include <FL/Fl_Tabs.H>
#include <FL/Fl_Group.H>
#include <FL/Fl_Choice.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Value_Output.H>
#include <FL/Fl_Text_Display.H>
#include <FL/Fl_Counter.H>

class PADnoteUI : public PresetsUI_ {
public:
  ScaleTrackedWindow* make_window();
// randompan MUST be after panwidth
  ScaleTrackedWindow *padnotewindow;
private:
  inline void cb_padnotewindow_i(ScaleTrackedWindow*, void*);
  static void cb_padnotewindow(ScaleTrackedWindow*, void*);
  inline void cb__i(Fl_Tabs*, void*);
  static void cb_(Fl_Tabs*, void*);
public:
  Fl_Group *harmonicstructuregroup;
  Fl_Group *bwprofilegroup;
  Fl_Choice *hpbasetype;
private:
  inline void cb_hpbasetype_i(Fl_Choice*, void*);
  static void cb_hpbasetype(Fl_Choice*, void*);
public:
  WidgetPDial *hpbasepar1;
private:
  inline void cb_hpbasepar1_i(WidgetPDial*, void*);
  static void cb_hpbasepar1(WidgetPDial*, void*);
public:
  WidgetPDial *hpfreqmult;
private:
  inline void cb_hpfreqmult_i(WidgetPDial*, void*);
  static void cb_hpfreqmult(WidgetPDial*, void*);
public:
  WidgetPDial *hpmpar1;
private:
  inline void cb_hpmpar1_i(WidgetPDial*, void*);
  static void cb_hpmpar1(WidgetPDial*, void*);
public:
  WidgetPDial *hpmfreq;
private:
  inline void cb_hpmfreq_i(WidgetPDial*, void*);
  static void cb_hpmfreq(WidgetPDial*, void*);
public:
  WidgetPDial *hpwidth;
private:
  inline void cb_hpwidth_i(WidgetPDial*, void*);
  static void cb_hpwidth(WidgetPDial*, void*);
public:
  Fl_Choice *hponehalf;
private:
  inline void cb_hponehalf_i(Fl_Choice*, void*);
  static void cb_hponehalf(Fl_Choice*, void*);
public:
  Fl_Group *ampgroup;
  Fl_Choice *hpampmode;
private:
  inline void cb_hpampmode_i(Fl_Choice*, void*);
  static void cb_hpampmode(Fl_Choice*, void*);
public:
  WidgetPDial *hpamppar1;
private:
  inline void cb_hpamppar1_i(WidgetPDial*, void*);
  static void cb_hpamppar1(WidgetPDial*, void*);
public:
  WidgetPDial *hpamppar2;
private:
  inline void cb_hpamppar2_i(WidgetPDial*, void*);
  static void cb_hpamppar2(WidgetPDial*, void*);
public:
  Fl_Choice *hpamptype;
private:
  inline void cb_hpamptype_i(Fl_Choice*, void*);
  static void cb_hpamptype(Fl_Choice*, void*);
public:
  Fl_Check_Button2 *hpautoscale;
private:
  inline void cb_hpautoscale_i(Fl_Check_Button2*, void*);
  static void cb_hpautoscale(Fl_Check_Button2*, void*);
public:
  Fl_Box *cbwidget;
private:
  inline void cb_cbwidget_i(Fl_Box*, void*);
  static void cb_cbwidget(Fl_Box*, void*);
public:
  Fl_Button *resonance;
private:
  inline void cb_resonance_i(Fl_Button*, void*);
  static void cb_resonance(Fl_Button*, void*);
public:
  Fl_Button *waveform;
private:
  inline void cb_waveform_i(Fl_Button*, void*);
  static void cb_waveform(Fl_Button*, void*);
public:
  WidgetPDial *bwdial;
private:
  inline void cb_bwdial_i(WidgetPDial*, void*);
  static void cb_bwdial(WidgetPDial*, void*);
public:
  Fl_Value_Output *bwcents;
  Fl_Choice *bwscale;
private:
  inline void cb_bwscale_i(Fl_Choice*, void*);
  static void cb_bwscale(Fl_Choice*, void*);
public:
  Fl_Choice *spectrummode;
private:
  inline void cb_spectrummode_i(Fl_Choice*, void*);
  static void cb_spectrummode(Fl_Choice*, void*);
public:
  Fl_Group *hrgroup;
  WidgetPDial *hrpospar1;
private:
  inline void cb_hrpospar1_i(WidgetPDial*, void*);
  static void cb_hrpospar1(WidgetPDial*, void*);
public:
  WidgetPDial *hrpospar2;
private:
  inline void cb_hrpospar2_i(WidgetPDial*, void*);
  static void cb_hrpospar2(WidgetPDial*, void*);
public:
  WidgetPDial *hrpospar3;
private:
  inline void cb_hrpospar3_i(WidgetPDial*, void*);
  static void cb_hrpospar3(WidgetPDial*, void*);
public:
  Fl_Choice *hrpostype;
private:
  inline void cb_hrpostype_i(Fl_Choice*, void*);
  static void cb_hrpostype(Fl_Choice*, void*);
public:
  Fl_Group *overtonepos;
  Fl_Choice *qbasenote;
private:
  inline void cb_qbasenote_i(Fl_Choice*, void*);
  static void cb_qbasenote(Fl_Choice*, void*);
public:
  Fl_Choice *qsmpoct;
private:
  inline void cb_qsmpoct_i(Fl_Choice*, void*);
  static void cb_qsmpoct(Fl_Choice*, void*);
public:
  Fl_Choice *qoct;
private:
  inline void cb_qoct_i(Fl_Choice*, void*);
  static void cb_qoct(Fl_Choice*, void*);
public:
  Fl_Box *sampleFrame;
  Fl_Choice *qsamplesize;
private:
  inline void cb_qsamplesize_i(Fl_Choice*, void*);
  static void cb_qsamplesize(Fl_Choice*, void*);
public:
  WidgetPDial *xFadeDial;
private:
  inline void cb_xFadeDial_i(WidgetPDial*, void*);
  static void cb_xFadeDial(WidgetPDial*, void*);
public:
  Fl_Button *randWalkUI;
private:
  inline void cb_randWalkUI_i(Fl_Button*, void*);
  static void cb_randWalkUI(Fl_Button*, void*);
public:
  Fl_Group *hprofile;
  Fl_Box *harmonicprofile;
  Fl_Group *envelopes;
  Fl_Group *ampgrp;
  WidgetPDial *volume;
private:
  inline void cb_volume_i(WidgetPDial*, void*);
  static void cb_volume(WidgetPDial*, void*);
public:
  WidgetPDial *vsns;
private:
  inline void cb_vsns_i(WidgetPDial*, void*);
  static void cb_vsns(WidgetPDial*, void*);
public:
  WidgetPDial *pan;
private:
  inline void cb_pan_i(WidgetPDial*, void*);
  static void cb_pan(WidgetPDial*, void*);
public:
  WidgetPDial *panwidth;
private:
  inline void cb_panwidth_i(WidgetPDial*, void*);
  static void cb_panwidth(WidgetPDial*, void*);
public:
  Fl_Check_Button2 *randompan;
private:
  inline void cb_randompan_i(Fl_Check_Button2*, void*);
  static void cb_randompan(Fl_Check_Button2*, void*);
public:
  Fl_Check_Button2 *stereo;
private:
  inline void cb_stereo_i(Fl_Check_Button2*, void*);
  static void cb_stereo(Fl_Check_Button2*, void*);
public:
  WidgetPDial *dpop;
private:
  inline void cb_dpop_i(WidgetPDial*, void*);
  static void cb_dpop(WidgetPDial*, void*);
public:
  WidgetPDial *pstr;
private:
  inline void cb_pstr_i(WidgetPDial*, void*);
  static void cb_pstr(WidgetPDial*, void*);
public:
  WidgetPDial *pt;
private:
  inline void cb_pt_i(WidgetPDial*, void*);
  static void cb_pt(WidgetPDial*, void*);
public:
  WidgetPDial *pstc;
private:
  inline void cb_pstc_i(WidgetPDial*, void*);
  static void cb_pstc(WidgetPDial*, void*);
public:
  WidgetPDial *pvel;
private:
  inline void cb_pvel_i(WidgetPDial*, void*);
  static void cb_pvel(WidgetPDial*, void*);
public:
  EnvelopeUI *ampenv;
  LFOUI *amplfo;
  Fl_Box *amplabel;
  Fl_Group *filtergrp;
  EnvelopeUI *filterenv;
  LFOUI *filterlfo;
  FilterUI *filterui;
  Fl_Box *filterlabel;
  Fl_Group *frequencygrp;
  EnvelopeUI *freqenv;
  LFOUI *freqlfo;
  WidgetPDial *bend;
private:
  inline void cb_bend_i(WidgetPDial*, void*);
  static void cb_bend(WidgetPDial*, void*);
public:
  WidgetPDial *offset;
private:
  inline void cb_offset_i(WidgetPDial*, void*);
  static void cb_offset(WidgetPDial*, void*);
public:
  Fl_Check_Button2 *hz440;
private:
  inline void cb_hz440_i(Fl_Check_Button2*, void*);
  static void cb_hz440(Fl_Check_Button2*, void*);
public:
  WidgetPDial *fixedfreqetdial;
private:
  inline void cb_fixedfreqetdial_i(WidgetPDial*, void*);
  static void cb_fixedfreqetdial(WidgetPDial*, void*);
public:
  mwheel_slider_rev *detune;
private:
  inline void cb_detune_i(mwheel_slider_rev*, void*);
  static void cb_detune(mwheel_slider_rev*, void*);
public:
  Fl_Value_Output *detunevalueoutput;
private:
  inline void cb_detunevalueoutput_i(Fl_Value_Output*, void*);
  static void cb_detunevalueoutput(Fl_Value_Output*, void*);
public:
  Fl_Text_Display *octavetext;
  Fl_Counter *octave;
private:
  inline void cb_octave_i(Fl_Counter*, void*);
  static void cb_octave(Fl_Counter*, void*);
public:
  Fl_Choice *detunetype;
private:
  inline void cb_detunetype_i(Fl_Choice*, void*);
  static void cb_detunetype(Fl_Choice*, void*);
public:
  Fl_Counter *coarsedet;
private:
  inline void cb_coarsedet_i(Fl_Counter*, void*);
  static void cb_coarsedet(Fl_Counter*, void*);
public:
  Fl_Button *padExport;
private:
  inline void cb_padExport_i(Fl_Button*, void*);
  static void cb_padExport(Fl_Button*, void*);
public:
  Fl_Button *applybutton;
private:
  inline void cb_applybutton_i(Fl_Button*, void*);
  static void cb_applybutton(Fl_Button*, void*);
public:
  Fl_Button *padCopy;
private:
  inline void cb_padCopy_i(Fl_Button*, void*);
  static void cb_padCopy(Fl_Button*, void*);
public:
  Fl_Button *padPaste;
private:
  inline void cb_padPaste_i(Fl_Button*, void*);
  static void cb_padPaste(Fl_Button*, void*);
public:
  Fl_Button *padClose;
private:
  inline void cb_padClose_i(Fl_Button*, void*);
  static void cb_padClose(Fl_Button*, void*);
public:
  ScaleTrackedWindow* make_randWalkWindow();
  ScaleTrackedWindow *randWalkWindow;
  Fl_Group *randomProp;
  Fl_Box *plinth;
  WidgetPDial *rebuildTrigger;
private:
  inline void cb_rebuildTrigger_i(WidgetPDial*, void*);
  static void cb_rebuildTrigger(WidgetPDial*, void*);
public:
  WidgetPDial *randWalkDetune;
private:
  inline void cb_randWalkDetune_i(WidgetPDial*, void*);
  static void cb_randWalkDetune(WidgetPDial*, void*);
public:
  WidgetPDial *randWalkFilterFreq;
private:
  inline void cb_randWalkFilterFreq_i(WidgetPDial*, void*);
  static void cb_randWalkFilterFreq(WidgetPDial*, void*);
public:
  WidgetPDial *randWalkBandwidth;
private:
  inline void cb_randWalkBandwidth_i(WidgetPDial*, void*);
  static void cb_randWalkBandwidth(WidgetPDial*, void*);
public:
  WidgetPDial *randWalkProfileWidth;
private:
  inline void cb_randWalkProfileWidth_i(WidgetPDial*, void*);
  static void cb_randWalkProfileWidth(WidgetPDial*, void*);
public:
  WidgetPDial *randWalkProfileStretch;
private:
  inline void cb_randWalkProfileStretch_i(WidgetPDial*, void*);
  static void cb_randWalkProfileStretch(WidgetPDial*, void*);
public:
  Fl_Button *randClose;
private:
  inline void cb_randClose_i(Fl_Button*, void*);
  static void cb_randClose(Fl_Button*, void*);
public:
  void show_randWalk();
  void randRtext();
  void Showpad();
  void padRtext();
  void theme();
  void send_data(int action, int control, float value, int type, int insert = UNUSED, int miscmsg = UNUSED);
  void returns_update(CommandBlock *getData);
  void paste(CommandBlock *getData);
  void applyButton(Fl_Color colour, const char *const text);
  PADnoteUI(PADnoteParameters *parameters);
  void refresh();
  virtual ~PADnoteUI();
  PADnoteParameters *pars;
  OscilEditor *oscui;
  Oscilloscope *osc;
  ResonanceUI *resui;
private:
  SynthEngine *synth;
  int npart;
  int kititem;
  float padDW;
  float padDH;
  float randDW;
  float randDH;
  int lastpadW;
  bool padSeen;
  bool randSeen;
  int lastWaveW;
  int lastRandW;
  int lastResuiW;
  unique_ptr<PADStatus> padStatus;
};
#endif
