1 /* SpiralSound 2 * Copyleft (C) 2001 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 #ifndef MIXER_PLUGIN_H 20 #define MIXER_PLUGIN_H 21 22 #include "../SpiralPlugin.h" 23 24 static const int MAX_CHANNELS = 16; 25 26 class MixerPlugin : public SpiralPlugin { 27 public: 28 MixerPlugin(); 29 virtual ~MixerPlugin(); 30 virtual PluginInfo &Initialise(const HostInfo *Host); 31 virtual SpiralGUIType *CreateGUI(); 32 virtual void Execute(); 33 virtual void ExecuteCommands(); 34 virtual void StreamOut(std::ostream &s); 35 virtual void StreamIn(std::istream &s); 36 // has to be defined in the plugin UpdateGUI()37 virtual void UpdateGUI() { Fl::check(); } 38 enum GUICommands { NONE, SETCH, SETNUM }; 39 struct GUIArgs { 40 int Num; 41 float Value; 42 bool Peak; 43 }; GetChannel(int n)44 float GetChannel (int n) { return m_ChannelVal[n]; } GetChannels(void)45 int GetChannels (void) { return m_NumChannels; } 46 private: 47 void CreatePorts (int n = 4, bool AddPorts = false); 48 GUIArgs m_GUIArgs; 49 int m_NumChannels; 50 void SetChannels (int n); 51 float m_ChannelVal[MAX_CHANNELS]; 52 }; 53 54 #endif 55