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

#ifndef fabla_h
#define fabla_h
#include <FL/Fl.H>
#include <FL/Fl_Double_Window.H>
#include "avtk.h"
#include <libgen.h>
using namespace Avtk;
#include <FL/x.H>
#include "lv2/lv2plug.in/ns/lv2core/lv2.h"
#include <FL/Fl_Box.H>
#include "../dsp/ports.h"
#include "lv2/lv2plug.in/ns/extensions/ui/ui.h"
#include "../dsp/shared.h"
#include "fabla.hxx"
#include "header.c"
#include <string>
#include <FL/Fl_Native_File_Chooser.H>
extern void writeLoadSample(Fabla* self, int pad, const char* filename, size_t filename_len);
extern void writePadPlay(Fabla* self, int pad );

class FablaUI {
public:
  FablaUI();
  FablaUI(void* xParentWindow, Fabla* f);
  Fl_Double_Window* setupUI();
  Fl_Double_Window *w;
private:
  void cb_w_i(Fl_Double_Window*, void*);
  static void cb_w(Fl_Double_Window*, void*);
public:
  ADSR *adsr;
  Compressor *compressor;
private:
  void cb_compressor_i(Compressor*, void*);
  static void cb_compressor(Compressor*, void*);
public:
  Fl_Box *compressorBox;
  Volume *masterVol;
private:
  void cb_masterVol_i(Volume*, void*);
  static void cb_masterVol(Volume*, void*);
public:
  Fl_Box *adsrBox;
  Dial *compRelease;
private:
  void cb_compRelease_i(Dial*, void*);
  static void cb_compRelease(Dial*, void*);
public:
  Waveform *waveform;
  Image *image;
  Pad *p13;
private:
  void cb_p13_i(Pad*, void*);
  static void cb_p13(Pad*, void*);
public:
  Pad *p14;
private:
  void cb_p14_i(Pad*, void*);
  static void cb_p14(Pad*, void*);
public:
  Pad *p15;
private:
  void cb_p15_i(Pad*, void*);
  static void cb_p15(Pad*, void*);
public:
  Pad *p16;
private:
  void cb_p16_i(Pad*, void*);
  static void cb_p16(Pad*, void*);
public:
  Pad *p9;
private:
  void cb_p9_i(Pad*, void*);
  static void cb_p9(Pad*, void*);
public:
  Pad *p5;
private:
  void cb_p5_i(Pad*, void*);
  static void cb_p5(Pad*, void*);
public:
  Pad *p1;
private:
  void cb_p1_i(Pad*, void*);
  static void cb_p1(Pad*, void*);
public:
  Pad *p10;
private:
  void cb_p10_i(Pad*, void*);
  static void cb_p10(Pad*, void*);
public:
  Pad *p6;
private:
  void cb_p6_i(Pad*, void*);
  static void cb_p6(Pad*, void*);
public:
  Pad *p2;
private:
  void cb_p2_i(Pad*, void*);
  static void cb_p2(Pad*, void*);
public:
  Pad *p11;
private:
  void cb_p11_i(Pad*, void*);
  static void cb_p11(Pad*, void*);
public:
  Pad *p7;
private:
  void cb_p7_i(Pad*, void*);
  static void cb_p7(Pad*, void*);
public:
  Pad *p3;
private:
  void cb_p3_i(Pad*, void*);
  static void cb_p3(Pad*, void*);
public:
  Pad *p12;
private:
  void cb_p12_i(Pad*, void*);
  static void cb_p12(Pad*, void*);
public:
  Pad *p8;
private:
  void cb_p8_i(Pad*, void*);
  static void cb_p8(Pad*, void*);
public:
  Pad *p4;
private:
  void cb_p4_i(Pad*, void*);
  static void cb_p4(Pad*, void*);
public:
  Dial *compAttack;
private:
  void cb_compAttack_i(Dial*, void*);
  static void cb_compAttack(Dial*, void*);
public:
  Dial *compThres;
private:
  void cb_compThres_i(Dial*, void*);
  static void cb_compThres(Dial*, void*);
public:
  Dial *compRatio;
private:
  void cb_compRatio_i(Dial*, void*);
  static void cb_compRatio(Dial*, void*);
public:
  Dial *gain;
private:
  void cb_gain_i(Dial*, void*);
  static void cb_gain(Dial*, void*);
public:
  Dial *d;
private:
  void cb_d_i(Dial*, void*);
  static void cb_d(Dial*, void*);
public:
  Dial *speed;
private:
  void cb_speed_i(Dial*, void*);
  static void cb_speed(Dial*, void*);
public:
  Dial *a;
private:
  void cb_a_i(Dial*, void*);
  static void cb_a(Dial*, void*);
public:
  Dial *r;
private:
  void cb_r_i(Dial*, void*);
  static void cb_r(Dial*, void*);
public:
  Dial *s;
private:
  void cb_s_i(Dial*, void*);
  static void cb_s(Dial*, void*);
public:
  Dial *pan;
private:
  void cb_pan_i(Dial*, void*);
  static void cb_pan(Dial*, void*);
public:
  Fabla* fabla; 
  void idle();
  void select_pad(int p);
  int selectedPad; 
  void pad_click(int id, int rclick);
  LV2UI_Controller controller; 
  LV2UI_Write_Function writeFunction; 
  /**
     holds all pad individual data
  */
  UIPadData padData[16]; 
  void close_cb(Fl_Widget* o, void*);
  std::string lastUsedPath;
};
#endif
