1 /* SpiralSynth 2 * Copyleft (C) 2000 David Griffiths <dave@pawfal.org> 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 */ 18 19 #include <FL/Fl.H> 20 #include <FL/Fl_Window.H> 21 #include <FL/Fl_Pack.H> 22 #include <FL/Fl_Check_Button.H> 23 #include "Widgets/Fl_Knob.H" 24 #include <FL/Fl_Slider.H> 25 #include <FL/Fl_Button.H> 26 #include <FL/Fl_Pixmap.H> 27 28 #include "GUIBase.h" 29 #include "../SpiralSound/Oscillator.h" 30 31 #ifndef OSCGUI 32 #define OSCGUI 33 34 class OscillatorGUI : public GUIBase 35 { 36 public: 37 OscillatorGUI(Oscillator *o); 38 39 virtual void CreateGUI(int xoff=0, int yoff=0, char *name=""); 40 virtual void UpdateValues(); 41 42 void MidiPitchBend(int amount); 43 44 Oscillator *m_osc; 45 46 protected: 47 48 Fl_Group *GUIOscGroup; 49 Fl_Check_Button *ShapeSquare; 50 Fl_Pixmap pixmap_Square; 51 Fl_Check_Button *ShapeNoise; 52 Fl_Pixmap pixmap_Noise; 53 Fl_Check_Button *ShapeSaw; 54 Fl_Pixmap pixmap_Saw; 55 Fl_Knob *Freq; 56 Fl_Knob *ModAmount; 57 Fl_Knob *FineTune; 58 Fl_Slider *PulseWidth; 59 Fl_Slider *SHLen; 60 Fl_Slider *Portmento; 61 62 //// Callbacks //// 63 64 inline void cb_Freq_i(Fl_Knob* o, void* v); 65 static void cb_Freq(Fl_Knob*, void*); 66 inline void cb_FineTune_i(Fl_Knob* o, void* v); 67 static void cb_FineTune(Fl_Knob* o, void* v); 68 inline void cb_ModAmount_i(Fl_Knob* o, void* v); 69 static void cb_ModAmount(Fl_Knob* o, void* v); 70 inline void cb_PulseWidth_i(Fl_Slider* o, void* v); 71 static void cb_PulseWidth(Fl_Slider* o, void* v); 72 inline void cb_Portmento_i(Fl_Slider* o, void* v); 73 static void cb_Portmento(Fl_Slider* o, void* v); 74 inline void cb_SHLen_i(Fl_Slider* o, void* v); 75 static void cb_SHLen(Fl_Slider* o, void* v); 76 inline void cb_Square_i(Fl_Check_Button* o, void* v); 77 static void cb_Square(Fl_Check_Button*, void*); 78 inline void cb_Saw_i(Fl_Check_Button* o, void* v); 79 static void cb_Saw(Fl_Check_Button*, void*); 80 inline void cb_Noise_i(Fl_Check_Button* o, void* v); 81 static void cb_Noise(Fl_Check_Button* o, void* v); 82 83 }; 84 85 class LFOGUI : public OscillatorGUI 86 { 87 public: 88 LFOGUI(Oscillator *o); 89 90 virtual void CreateGUI(int xoff=0, int yoff=0, char *name=""); 91 virtual void UpdateValues(); 92 93 protected: 94 95 Fl_Slider *Volume; 96 97 //// Callbacks //// 98 99 inline void cb_FineTune_i(Fl_Knob* o, void* v); 100 static void cb_FineTune(Fl_Knob* o, void* v); 101 inline void cb_Volume_i(Fl_Slider* o, void* v); 102 static void cb_Volume(Fl_Slider*, void*); 103 }; 104 105 #endif 106