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

#ifndef ConfigUI_h
#define ConfigUI_h
#include <FL/Fl.H>
#include <cmath>
// Original ZynAddSubFX author Nasca Octavian Paul
// Copyright (C) 2002-2005 Nasca Octavian Paul
// Copyright 2009-2011, Alan Calvert
// Copyright 2014 -2024, 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 <iostream>
#include "Misc/Config.h"
#include "UI/WidgetCheckButton.h"
#include "UI/WidgetSpinner.h"
#include "UI/ScaleTrackedWindow.h"
#include <FL/Fl_Button.H>
#include <FL/Fl_Group.H>
#include <FL/Fl_Choice.H>
#include <FL/Fl_Counter.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Text_Display.H>
#include <FL/Fl_Input.H>
#include <FL/Fl_Browser.H>
#include <FL/Fl_Check_Button.H>

class ConfigUI {
public:
  bool isLV2();
  ScaleTrackedWindow* make_window();
  ScaleTrackedWindow *configwindow;
private:
  inline void cb_configwindow_i(ScaleTrackedWindow*, void*);
  static void cb_configwindow(ScaleTrackedWindow*, void*);
public:
  Fl_Button *Tab1;
private:
  inline void cb_Tab1_i(Fl_Button*, void*);
  static void cb_Tab1(Fl_Button*, void*);
public:
  Fl_Button *Tab2;
private:
  inline void cb_Tab2_i(Fl_Button*, void*);
  static void cb_Tab2(Fl_Button*, void*);
public:
  Fl_Button *Tab3;
private:
  inline void cb_Tab3_i(Fl_Button*, void*);
  static void cb_Tab3(Fl_Button*, void*);
public:
  Fl_Button *Tab4;
private:
  inline void cb_Tab4_i(Fl_Button*, void*);
  static void cb_Tab4(Fl_Button*, void*);
public:
  Fl_Button *Tab5;
private:
  inline void cb_Tab5_i(Fl_Button*, void*);
  static void cb_Tab5(Fl_Button*, void*);
public:
  Fl_Button *Tab6;
private:
  inline void cb_Tab6_i(Fl_Button*, void*);
  static void cb_Tab6(Fl_Button*, void*);
public:
  Fl_Group *configTabs;
  Fl_Group *mainTab;
  Fl_Choice *buff_size;
private:
  inline void cb_buff_size_i(Fl_Choice*, void*);
  static void cb_buff_size(Fl_Choice*, void*);
public:
  Fl_Choice *osc_size;
private:
  inline void cb_osc_size_i(Fl_Choice*, void*);
  static void cb_osc_size(Fl_Choice*, void*);
public:
  Fl_Choice *pad_interpol;
private:
  inline void cb_pad_interpol_i(Fl_Choice*, void*);
  static void cb_pad_interpol(Fl_Choice*, void*);
public:
  Fl_Choice *handlePadSynthBuild;
private:
  inline void cb_handlePadSynthBuild_i(Fl_Choice*, void*);
  static void cb_handlePadSynthBuild(Fl_Choice*, void*);
public:
  Fl_Choice *v_keyboard;
private:
  inline void cb_v_keyboard_i(Fl_Choice*, void*);
  static void cb_v_keyboard(Fl_Choice*, void*);
public:
  Fl_Choice *reports;
private:
  inline void cb_reports_i(Fl_Choice*, void*);
  static void cb_reports(Fl_Choice*, void*);
public:
  Fl_Counter *logText;
private:
  inline void cb_logText_i(Fl_Counter*, void*);
  static void cb_logText(Fl_Counter*, void*);
public:
  Fl_Counter *compression;
private:
  inline void cb_compression_i(Fl_Counter*, void*);
  static void cb_compression(Fl_Counter*, void*);
public:
  Fl_Choice *instrument;
private:
  inline void cb_instrument_i(Fl_Choice*, void*);
  static void cb_instrument(Fl_Choice*, void*);
public:
  Fl_Choice *PanelLayout;
private:
  inline void cb_PanelLayout_i(Fl_Choice*, void*);
  static void cb_PanelLayout(Fl_Choice*, void*);
public:
  Fl_Box *settingsNote;
  Fl_Group *switchesTab;
  Fl_Check_Button2 *bankHighlight;
private:
  inline void cb_bankHighlight_i(Fl_Check_Button2*, void*);
  static void cb_bankHighlight(Fl_Check_Button2*, void*);
public:
  Fl_Check_Button2 *partReports;
private:
  inline void cb_partReports_i(Fl_Check_Button2*, void*);
  static void cb_partReports(Fl_Check_Button2*, void*);
public:
  Fl_Check_Button2 *nonFatal;
private:
  inline void cb_nonFatal_i(Fl_Check_Button2*, void*);
  static void cb_nonFatal(Fl_Check_Button2*, void*);
public:
  Fl_Check_Button2 *showSplash;
private:
  inline void cb_showSplash_i(Fl_Check_Button2*, void*);
  static void cb_showSplash(Fl_Check_Button2*, void*);
public:
  Fl_Check_Button2 *logXML;
private:
  inline void cb_logXML_i(Fl_Check_Button2*, void*);
  static void cb_logXML(Fl_Check_Button2*, void*);
public:
  Fl_Check_Button2 *logTimes;
private:
  inline void cb_logTimes_i(Fl_Check_Button2*, void*);
  static void cb_logTimes(Fl_Check_Button2*, void*);
public:
  Fl_Check_Button2 *saveAllXML;
private:
  inline void cb_saveAllXML_i(Fl_Check_Button2*, void*);
  static void cb_saveAllXML(Fl_Check_Button2*, void*);
public:
  Fl_Check_Button2 *enableGUI;
private:
  inline void cb_enableGUI_i(Fl_Check_Button2*, void*);
  static void cb_enableGUI(Fl_Check_Button2*, void*);
public:
  Fl_Check_Button2 *enableCLI;
private:
  inline void cb_enableCLI_i(Fl_Check_Button2*, void*);
  static void cb_enableCLI(Fl_Check_Button2*, void*);
public:
  Fl_Check_Button2 *enableAuto;
private:
  inline void cb_enableAuto_i(Fl_Check_Button2*, void*);
  static void cb_enableAuto(Fl_Check_Button2*, void*);
public:
  Fl_Check_Button2 *singleMaster;
private:
  inline void cb_singleMaster_i(Fl_Check_Button2*, void*);
  static void cb_singleMaster(Fl_Check_Button2*, void*);
public:
  Fl_Check_Button2 *setDefaultState;
private:
  inline void cb_setDefaultState_i(Fl_Check_Button2*, void*);
  static void cb_setDefaultState(Fl_Check_Button2*, void*);
public:
  Fl_Text_Display *historyLocks;
  Fl_Check_Button2 *H_instrument;
private:
  inline void cb_H_instrument_i(Fl_Check_Button2*, void*);
  static void cb_H_instrument(Fl_Check_Button2*, void*);
public:
  Fl_Check_Button2 *H_patchset;
private:
  inline void cb_H_patchset_i(Fl_Check_Button2*, void*);
  static void cb_H_patchset(Fl_Check_Button2*, void*);
public:
  Fl_Check_Button2 *H_scale;
private:
  inline void cb_H_scale_i(Fl_Check_Button2*, void*);
  static void cb_H_scale(Fl_Check_Button2*, void*);
public:
  Fl_Check_Button2 *H_state;
private:
  inline void cb_H_state_i(Fl_Check_Button2*, void*);
  static void cb_H_state(Fl_Check_Button2*, void*);
public:
  Fl_Check_Button2 *H_vector;
private:
  inline void cb_H_vector_i(Fl_Check_Button2*, void*);
  static void cb_H_vector(Fl_Check_Button2*, void*);
public:
  Fl_Check_Button2 *H_mlearn;
private:
  inline void cb_H_mlearn_i(Fl_Check_Button2*, void*);
  static void cb_H_mlearn(Fl_Check_Button2*, void*);
public:
  Fl_Box *switchesNote;
  Fl_Group *jackTab;
  Fl_Input *jackSource;
private:
  inline void cb_jackSource_i(Fl_Input*, void*);
  static void cb_jackSource(Fl_Input*, void*);
public:
  Fl_Check_Button2 *jackMidi;
private:
  inline void cb_jackMidi_i(Fl_Check_Button2*, void*);
  static void cb_jackMidi(Fl_Check_Button2*, void*);
public:
  Fl_Input *jackServer;
private:
  inline void cb_jackServer_i(Fl_Input*, void*);
  static void cb_jackServer(Fl_Input*, void*);
public:
  Fl_Check_Button2 *jackAudio;
private:
  inline void cb_jackAudio_i(Fl_Check_Button2*, void*);
  static void cb_jackAudio(Fl_Check_Button2*, void*);
public:
  Fl_Check_Button2 *connectJackAudio;
private:
  inline void cb_connectJackAudio_i(Fl_Check_Button2*, void*);
  static void cb_connectJackAudio(Fl_Check_Button2*, void*);
public:
  Fl_Box *jackNote;
  Fl_Group *alsaTab;
  Fl_Choice *alsaType;
private:
  inline void cb_alsaType_i(Fl_Choice*, void*);
  static void cb_alsaType(Fl_Choice*, void*);
public:
  Fl_Input *alsaSource;
private:
  inline void cb_alsaSource_i(Fl_Input*, void*);
  static void cb_alsaSource(Fl_Input*, void*);
public:
  Fl_Check_Button2 *alsaMidi;
private:
  inline void cb_alsaMidi_i(Fl_Check_Button2*, void*);
  static void cb_alsaMidi(Fl_Check_Button2*, void*);
public:
  Fl_Input *alsaDevice;
private:
  inline void cb_alsaDevice_i(Fl_Input*, void*);
  static void cb_alsaDevice(Fl_Input*, void*);
public:
  Fl_Choice *alsaSamplerate;
private:
  inline void cb_alsaSamplerate_i(Fl_Choice*, void*);
  static void cb_alsaSamplerate(Fl_Choice*, void*);
public:
  Fl_Check_Button2 *alsaAudio;
private:
  inline void cb_alsaAudio_i(Fl_Check_Button2*, void*);
  static void cb_alsaAudio(Fl_Check_Button2*, void*);
public:
  Fl_Box *alsaNote;
  Fl_Group *midiTab;
private:
  inline void cb_midiTab_i(Fl_Group*, void*);
  static void cb_midiTab(Fl_Group*, void*);
public:
  Fl_Choice *bankrootchange;
private:
  inline void cb_bankrootchange_i(Fl_Choice*, void*);
  static void cb_bankrootchange(Fl_Choice*, void*);
public:
  Fl_Choice *bankchange;
private:
  inline void cb_bankchange_i(Fl_Choice*, void*);
  static void cb_bankchange(Fl_Choice*, void*);
public:
  Fl_Check_Button2 *progenable;
private:
  inline void cb_progenable_i(Fl_Check_Button2*, void*);
  static void cb_progenable(Fl_Check_Button2*, void*);
public:
  WidgetSpinner *EPCspinner;
private:
  inline void cb_EPCspinner_i(WidgetSpinner*, void*);
  static void cb_EPCspinner(WidgetSpinner*, void*);
public:
  Fl_Button *Epend;
private:
  inline void cb_Epend_i(Fl_Button*, void*);
  static void cb_Epend(Fl_Button*, void*);
public:
  Fl_Check_Button2 *Epcheck;
private:
  inline void cb_Epcheck_i(Fl_Check_Button2*, void*);
  static void cb_Epcheck(Fl_Check_Button2*, void*);
public:
  Fl_Check_Button2 *enableOmniChange;
private:
  inline void cb_enableOmniChange_i(Fl_Check_Button2*, void*);
  static void cb_enableOmniChange(Fl_Check_Button2*, void*);
public:
  Fl_Check_Button2 *enableNRPN;
private:
  inline void cb_enableNRPN_i(Fl_Check_Button2*, void*);
  static void cb_enableNRPN(Fl_Check_Button2*, void*);
public:
  Fl_Check_Button2 *ignoreReset;
private:
  inline void cb_ignoreReset_i(Fl_Check_Button2*, void*);
  static void cb_ignoreReset(Fl_Check_Button2*, void*);
public:
  Fl_Check_Button2 *midiMon;
private:
  inline void cb_midiMon_i(Fl_Check_Button2*, void*);
  static void cb_midiMon(Fl_Check_Button2*, void*);
public:
  Fl_Check_Button2 *midiLearned;
private:
  inline void cb_midiLearned_i(Fl_Check_Button2*, void*);
  static void cb_midiLearned(Fl_Check_Button2*, void*);
public:
  Fl_Group *themeTab;
private:
  inline void cb_themeTab_i(Fl_Group*, void*);
  static void cb_themeTab(Fl_Group*, void*);
public:
  Fl_Browser *theme_browser;
private:
  inline void cb_theme_browser_i(Fl_Browser*, void*);
  static void cb_theme_browser(Fl_Browser*, void*);
public:
  Fl_Button *themeImport;
private:
  inline void cb_themeImport_i(Fl_Button*, void*);
  static void cb_themeImport(Fl_Button*, void*);
public:
  Fl_Button *themeExport;
private:
  inline void cb_themeExport_i(Fl_Button*, void*);
  static void cb_themeExport(Fl_Button*, void*);
public:
  Fl_Box *storedLabel;
  Fl_Button *storedTheme;
  Fl_Group *nuTheme;
  Fl_Box *currentLabel;
  Fl_Button *setAsStored;
private:
  inline void cb_setAsStored_i(Fl_Button*, void*);
  static void cb_setAsStored(Fl_Button*, void*);
public:
  Fl_Button *selectedTheme;
  Fl_Check_Button *monochrome;
private:
  inline void cb_monochrome_i(Fl_Check_Button*, void*);
  static void cb_monochrome(Fl_Check_Button*, void*);
public:
  Fl_Box *patch1;
  Fl_Box *patch2;
  Fl_Box *patch3;
  Fl_Box *patch4;
  Fl_Box *patch5;
  Fl_Box *patch6;
  Fl_Button *close;
private:
  inline void cb_close_i(Fl_Button*, void*);
  static void cb_close(Fl_Button*, void*);
public:
  ScaleTrackedWindow *presets;
private:
  inline void cb_presets_i(ScaleTrackedWindow*, void*);
  static void cb_presets(ScaleTrackedWindow*, void*);
public:
  Fl_Browser *presetbrowse;
private:
  inline void cb_presetbrowse_i(Fl_Browser*, void*);
  static void cb_presetbrowse(Fl_Browser*, void*);
public:
  Fl_Button *addpreset;
private:
  inline void cb_addpreset_i(Fl_Button*, void*);
  static void cb_addpreset(Fl_Button*, void*);
public:
  Fl_Button *removepresetbutton;
private:
  inline void cb_removepresetbutton_i(Fl_Button*, void*);
  static void cb_removepresetbutton(Fl_Button*, void*);
public:
  Fl_Button *makedefaultpresetbutton;
private:
  inline void cb_makedefaultpresetbutton_i(Fl_Button*, void*);
  static void cb_makedefaultpresetbutton(Fl_Button*, void*);
public:
  Fl_Button *pClose;
private:
  inline void cb_pClose_i(Fl_Button*, void*);
  static void cb_pClose(Fl_Button*, void*);
public:
  void send_data(int action, int control, float value, int type, int part = UNUSED, int kit = UNUSED, int engine = UNUSED, int insert = UNUSED, int par = UNUSED, int miscmsg = UNUSED);
  float 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);
  void returns_update(CommandBlock *getData);
  ConfigUI(SynthEngine *_synth, int _current_ID);
  ~ConfigUI();
  void halfSecTimer();
  void fillNative();
  void getNativeLine(int line);
  int fillThemes();
  void manageThemes();
  bool checkVersions();
  bool findRemote();
  void setNativeTable();
  void setNativeLine(int line);
  bool setClassicTable();
  int setUserTable(string table);
  bool setGreyTint(string text, float &R, float &G, float &B);
  int setGreyScale(string text);
  int setColourLine(string text, int item);
  void activatebutton_presetdir(bool active);
  void themeError(int errLine);
  int recoverID();
  void readpresetcfg();
  int convertSrate(int source);
  void update_config(int tabnumber);
  void Show(SynthEngine *synth);
  void Showpresets(SynthEngine *synth);
  void configRtext();
  void presetsRtext();
  string testCC(int value, int control);
private:
  SynthEngine *synth;
  int current_ID;
  long selectedRootID;
  int EPCvalue;
  int BankRootvalue;
  int oldBank;
  float confDW;
  float confDH;
  float preDW;
  float preDH;
  int lastconfigW;
public:
  int lastpresetW;
private:
  bool configSeen;
  bool presetsSeen;
  string defaultTheme;
  string currentTheme;
  int nativeTable[768];
  int monoChrome;
  size_t themeTime;
  size_t themeDirTime;
};
#endif
