/* SpiralPlugin * Copyleft (C) 2000 David Griffiths * * This program 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. * * This program 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 for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "StereoMixerPluginGUI.h" #include #include static const int GUI_COLOUR = 179; static const int GUIBG_COLOUR = 144; static const int GUIBG2_COLOUR = 145; //////////////////////////////////////////// StereoMixerPluginGUI::StereoMixerPluginGUI(int w, int h,StereoMixerPlugin *o,const HostInfo *Info) : SpiralPluginGUI(w,h,o) { m_Plugin=o; int Width=20; int Height=100; for (int n=0; ntype (4); m_Chan[n]->selection_color (GUI_COLOUR); m_Chan[n]->labelsize (10); m_Chan[n]->maximum (2); m_Chan[n]->step (0.01); m_Chan[n]->value (1.0); m_Chan[n]->callback ((Fl_Callback*)cb_Chan, (void*)&Numbers[n]); add (m_Chan[n]); m_Pan[n] = new Fl_Knob (10 + (2 + Width * 2) * n, 122, 40, 40, "Pan"); m_Pan[n]->type (Fl_Knob::DOTLIN); m_Pan[n]->color (GUI_COLOUR); m_Pan[n]->labelsize (10); m_Pan[n]->maximum (1); m_Pan[n]->step (0.01); m_Pan[n]->value (0.5); m_Pan[n]->callback ((Fl_Callback*)cb_Pan, (void*)&Numbers[n]); // This line used to be // add (m_Chan[n]); // I'm guessing this an error, but I could be wrong there add (m_Pan[n]); } end(); } void StereoMixerPluginGUI::UpdateValues () { for (int n=0; nvalue (2.0f - m_Plugin->GetChannel (n)); // This line used to be // m_Pan[n]->value (m_Plugin->GetChannel (n)); // And that definately fixes the problem m_Pan[n]->value (m_Plugin->GetPan (n)); } } inline void StereoMixerPluginGUI::cb_Chan_i(Fl_Slider* o, void* v) { m_Plugin->SetChannel(*(int*)(v),2.0f-o->value()); } void StereoMixerPluginGUI::cb_Chan(Fl_Slider* o, void* v) { ((StereoMixerPluginGUI*)(o->parent()))->cb_Chan_i(o,v); } inline void StereoMixerPluginGUI::cb_Pan_i(Fl_Knob* o, void* v) { m_Plugin->SetPan(*(int*)(v),o->value()); } void StereoMixerPluginGUI::cb_Pan(Fl_Knob* o, void* v) { ((StereoMixerPluginGUI*)(o->parent()))->cb_Pan_i(o,v); }