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.

73 lines
2.4KB

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