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.

121 lines
3.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. #include <FL/Fl.H>
  19. #include <FL/Fl_Window.H>
  20. #include <FL/Fl_Group.H>
  21. #include <FL/Fl_Counter.H>
  22. #include <FL/Fl_Slider.H>
  23. #include <FL/Fl_Output.H>
  24. #include <FL/Fl_Repeat_Button.H>
  25. #include "StreamPlugin.h"
  26. #include "../SpiralPluginGUI.h"
  27. #include "../Widgets/Fl_Knob.H"
  28. #include "../Widgets/Fl_SevenSeg.H"
  29. #ifndef MixerGUI
  30. #define MixerGUI
  31. class StreamPluginGUI;
  32. /*struct Compare_thingy
  33. {
  34. bool operator() (const StreamPluginGUI* s1,const StreamPluginGUI* s2) const
  35. {
  36. return s1<s2;
  37. }
  38. };*/
  39. class StreamPluginGUI : public SpiralPluginGUI
  40. {
  41. public:
  42. StreamPluginGUI(int w, int h, StreamPlugin *o,ChannelHandler *ch,const HostInfo *Info);
  43. virtual ~StreamPluginGUI();
  44. virtual void UpdateValues(SpiralPlugin *o);
  45. void SetTime();
  46. void SetMaxTime(float t) { m_Pos->maximum(t); }
  47. //Stuff for the timer
  48. static bool TimerSet;
  49. /*static struct Compare_thingy
  50. {
  51. bool operator() (const StreamPluginGUI* s1,const StreamPluginGUI* s2) const
  52. {
  53. return s1<s2;
  54. }
  55. };*/
  56. //static set<const StreamPluginGUI*,Compare_thingy> PluginList;
  57. static vector<StreamPluginGUI*> PluginList;
  58. static void StartTimer(StreamPluginGUI* p);
  59. static void StopTimer(StreamPluginGUI* p);
  60. static void TimerCallBack(void* x);
  61. private:
  62. Fl_Button* m_Load;
  63. Fl_Knob* m_Volume;
  64. Fl_Slider* m_Pitch;
  65. Fl_Button* m_Loop;
  66. Fl_Button* m_ToStart;
  67. Fl_Button* m_Stop;
  68. Fl_Button* m_Play;
  69. Fl_Button* m_Reset;
  70. Fl_Button* m_Div;
  71. Fl_Repeat_Button* m_Nudge;
  72. Fl_Output* m_Pout;
  73. Fl_SevenSeg* m_Display[6];
  74. Fl_Slider* m_Pos;
  75. char m_TextBuf[256];
  76. float m_PitchValue;
  77. //// Callbacks ////
  78. inline void cb_Load_i(Fl_Button* o, void* v);
  79. static void cb_Load(Fl_Button* o, void* v);
  80. inline void cb_Volume_i(Fl_Knob* o, void* v);
  81. static void cb_Volume(Fl_Knob* o, void* v);
  82. inline void cb_Pitch_i(Fl_Slider* o, void* v);
  83. static void cb_Pitch(Fl_Slider* o, void* v);
  84. inline void cb_Loop_i(Fl_Button* o, void* v);
  85. static void cb_Loop(Fl_Button* o, void* v);
  86. inline void cb_Div_i(Fl_Button* o, void* v);
  87. static void cb_Div(Fl_Button* o, void* v);
  88. inline void cb_ToStart_i(Fl_Button* o, void* v);
  89. static void cb_ToStart(Fl_Button* o, void* v);
  90. inline void cb_Stop_i(Fl_Button* o, void* v);
  91. static void cb_Stop(Fl_Button* o, void* v);
  92. inline void cb_Play_i(Fl_Button* o, void* v);
  93. static void cb_Play(Fl_Button* o, void* v);
  94. inline void cb_Reset_i(Fl_Button* o, void* v);
  95. static void cb_Reset(Fl_Button* o, void* v);
  96. inline void cb_Nudge_i(Fl_Button* o, void* v);
  97. static void cb_Nudge(Fl_Button* o, void* v);
  98. inline void cb_Pos_i(Fl_Slider* o, void* v);
  99. static void cb_Pos(Fl_Slider* o, void* v);
  100. };
  101. #endif