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.

80 lines
3.1KB

  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 StreamGUI
  19. #define StreamGUI
  20. #include <FL/Fl.H>
  21. #include <FL/Fl_Slider.H>
  22. #include <FL/Fl_Input.H>
  23. #include <FL/Fl_Repeat_Button.H>
  24. #include <FL/Fl_Button.H>
  25. #include "StreamPlugin.h"
  26. #include "../SpiralPluginGUI.h"
  27. #include "../Widgets/Fl_SevenSeg.H"
  28. #include "../Widgets/Fl_Knob.H"
  29. class StreamPluginGUI : public SpiralPluginGUI {
  30. public:
  31. StreamPluginGUI(int w, int h, StreamPlugin *o, ChannelHandler *ch, const HostInfo *Info);
  32. virtual ~StreamPluginGUI ();
  33. virtual void Update ();
  34. virtual void UpdateValues (SpiralPlugin *o);
  35. protected:
  36. const std::string GetHelpText (const std::string &loc);
  37. private:
  38. bool m_Playing;
  39. float m_PitchValue;
  40. char m_TextBuf[256], m_PitchLabel[256];
  41. void SetMaxTime (float t) { m_Pos->maximum(t); }
  42. void UpdatePitch (bool UpdateIt = true, bool DrawIt = true, bool SendIt = true);
  43. void UpdatePlayStatus (void);
  44. // Widgets
  45. Fl_SevenSeg *m_Display[6];
  46. Fl_Knob *m_Volume;
  47. Fl_Input *m_FileName;
  48. Fl_Slider *m_Pitch, *m_Pos;
  49. Fl_Button *m_Load, *m_ToStart, *m_Play, *m_Reset, *m_Rev, *m_Div, *m_Dbl;
  50. Fl_Repeat_Button* m_Nudge;
  51. //// Callbacks ////
  52. inline void cb_Volume_i (Fl_Knob* o, void* v);
  53. static void cb_Volume (Fl_Knob* o, void* v);
  54. inline void cb_Pitch_i (Fl_Slider* o, void* v);
  55. static void cb_Pitch (Fl_Slider* o, void* v);
  56. inline void cb_Pos_i (Fl_Slider* o, void* v);
  57. static void cb_Pos (Fl_Slider* o, void* v);
  58. inline void cb_Load_i (Fl_Button* o, void* v);
  59. static void cb_Load (Fl_Button* o, void* v);
  60. inline void cb_ToStart_i (Fl_Button* o, void* v);
  61. static void cb_ToStart (Fl_Button* o, void* v);
  62. inline void cb_Play_i (Fl_Button* o, void* v);
  63. static void cb_Play (Fl_Button* o, void* v);
  64. inline void cb_Reset_i (Fl_Button* o, void* v);
  65. static void cb_Reset (Fl_Button* o, void* v);
  66. inline void cb_Rev_i (Fl_Button* o, void* v);
  67. static void cb_Rev (Fl_Button* o, void* v);
  68. inline void cb_Div_i (Fl_Button* o, void* v);
  69. static void cb_Div (Fl_Button* o, void* v);
  70. inline void cb_Dbl_i (Fl_Button* o, void* v);
  71. static void cb_Dbl (Fl_Button* o, void* v);
  72. inline void cb_Nudge_i (Fl_Button* o, void* v);
  73. static void cb_Nudge (Fl_Button* o, void* v);
  74. };
  75. #endif