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_Group.H>
22 #include <FL/Fl_Button.H>
23 #include "Widgets/Fl_Knob.H"
24 #include <FL/Fl_Value_Output.H>
25 
26 #include "GUIBase.h"
27 
28 #ifndef PATCHBANKGUI
29 #define PATCHBANKGUI
30 
31 const int NPSEL=20;
32 
33 class PatchBankGUI : public GUIBase
34 {
35 public:
36 	PatchBankGUI();
37 
38 	virtual void CreateGUI(int xoff, int yoff, char *name);
39 
40 	// returns current patch no. if changed, -1 if it hasn't changed
41 	// since it was last called.
42 	int GetOutput();
43 
44 	// sends the value of Save, and sets it to 0 after.
45 	bool IsSaving();
46 
47 private:
48 
49 	int m_CurrentPatch;
50 	int m_PatchList[NPSEL];
51 
52 	Fl_Group 		*GUIPatchBankGroup;
53 	Fl_Button		*Patch[NPSEL];
54 	Fl_Knob			*Select;
55 	Fl_Button		*Save;
56 	Fl_Button		*Rand;
57 	Fl_Value_Output *Num;
58 
59 	//// Callbacks ////
60 
61 	inline void cb_Patch_i(Fl_Button* o, void* v);
62     static void cb_Patch(Fl_Button* o, void* v);
63 	inline void cb_Select_i(Fl_Knob* o, void* v);
64 	static void cb_Select(Fl_Knob* o, void* v);
65 	inline void cb_Save_i(Fl_Button* o, void* v);
66     static void cb_Save(Fl_Button* o, void* v);
67 	inline void cb_Rand_i(Fl_Button* o, void* v);
68     static void cb_Rand(Fl_Button* o, void* v);
69 };
70 
71 #endif
72