You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
2.5KB

  1. /* SpiralPlugin
  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. #include <FL/Fl.H>
  19. #include <FL/Fl_Window.H>
  20. #include <FL/Fl_Group.H>
  21. #include <FL/Fl_Button.H>
  22. #include "../Widgets/Fl_Knob.H"
  23. #include "../Widgets/Fl_DragBar.H"
  24. #include "ScopePlugin.h"
  25. #include "../SpiralPluginGUI.h"
  26. #ifndef SCOPEGUI
  27. #define SCOPEGUI
  28. class ScopeWidget : public Fl_Widget
  29. {
  30. public:
  31. ScopeWidget (int x, int y, int w, int h, const char *l, int BUFSIZE);
  32. ~ScopeWidget();
  33. void draw();
  34. //void SetNumChannels (int s) { m_Channels=s; }
  35. void SetWaveColour (unsigned c) { m_WaveColour=(Fl_Color)c; }
  36. void SetAttenuation (float c) { m_Attenuation=c; }
  37. void SetTimeBase (float c) { m_TimeBase=c; }
  38. const float *m_Data;
  39. //int m_Channels;
  40. private:
  41. //int m_GUIColour, m_GUIBGColour;
  42. Fl_Color m_WaveColour;
  43. float m_Attenuation, m_TimeBase;
  44. int m_Bufsize;
  45. };
  46. class ScopePluginGUI : public SpiralPluginGUI
  47. {
  48. public:
  49. ScopePluginGUI (int w, int h, SpiralPlugin *o, ChannelHandler *ch, const HostInfo *Info);
  50. virtual void UpdateValues (SpiralPlugin* o);
  51. virtual void Update();
  52. virtual void draw();
  53. void Display (const float *data);
  54. protected:
  55. const string GetHelpText (const string &loc);
  56. private:
  57. bool m_Bypass;
  58. // Fl_Button *Bypass;
  59. ScopeWidget *m_Scope;
  60. Fl_Knob *m_Attenuation, *m_TimeBase;
  61. //// Callbacks ////
  62. inline void cb_Attenuation_i (Fl_Knob* o, void* v);
  63. static void cb_Attenuation (Fl_Knob* o, void* v);
  64. inline void cb_TimeBase_i (Fl_Knob* o, void* v);
  65. static void cb_TimeBase (Fl_Knob* o, void* v);
  66. // inline void cb_Bypass_i(Fl_Button* o, void* v);
  67. // static void cb_Bypass(Fl_Button* o, void* v);
  68. };
  69. #endif