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.

125 lines
4.0KB

  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_Scroll.H>
  22. #include <FL/Fl_Slider.H>
  23. #include <FL/Fl_Counter.H>
  24. #include <FL/Fl_Output.H>
  25. #include <FL/Fl_Input.H>
  26. #include "SequencerPlugin.h"
  27. #include "../SpiralPluginGUI.h"
  28. #include "../Widgets/Fl_Knob.H"
  29. #include "../Widgets/Fl_EventMap.h"
  30. #ifndef MixerGUI
  31. #define MixerGUI
  32. class SequencerPluginGUI : public SpiralPluginGUI
  33. {
  34. public:
  35. SequencerPluginGUI(int w, int h, SequencerPlugin *o, ChannelHandler *ch,const HostInfo *Info);
  36. virtual void UpdateValues(SpiralPlugin *o);
  37. virtual void Update();
  38. private:
  39. Fl_Scroll* m_Scroll;
  40. Fl_Button* m_NewPattern;
  41. Fl_Button* m_NoteCut;
  42. Fl_Knob* m_Zoom;
  43. Fl_Knob* m_Speed;
  44. Fl_Button* m_Clear;
  45. Fl_Input* m_Length;
  46. Fl_Input* m_BeatsPerBar;
  47. Fl_Knob* m_BarLength;
  48. int m_NextPatternID;
  49. class PatternWin : public Fl_Double_Window
  50. {
  51. public:
  52. PatternWin(int w,int h,const char* n);
  53. Fl_EventMap *GetEventMap() { return m_Melody; }
  54. private:
  55. Fl_Scroll* m_Scroll;
  56. Fl_EventMap* m_Melody;
  57. int m_NextNoteID;
  58. };
  59. map<int,PatternWin*> m_PatternWinMap;
  60. Fl_EventMap* m_ArrangementMap;
  61. // get the notes from the audio thread
  62. void LoadPatternData(int ID);
  63. void ChangeSequenceHelper(Fl_SEvent *event);
  64. //// Callbacks ////
  65. inline void cb_Zoom_i(Fl_Knob* o, void* v);
  66. static void cb_Zoom(Fl_Knob* o, void* v);
  67. inline void cb_NoteCut_i(Fl_Button* o, void* v);
  68. static void cb_NoteCut(Fl_Button* o, void* v);
  69. inline void cb_Pattern_i(Fl_Counter* o, void* v);
  70. static void cb_Pattern(Fl_Counter* o, void* v);
  71. inline void cb_Length_i(Fl_Input* o, void* v);
  72. static void cb_Length(Fl_Input* o, void* v);
  73. inline void cb_BeatsPerBar_i(Fl_Input* o, void* v);
  74. static void cb_BeatsPerBar(Fl_Input* o, void* v);
  75. inline void cb_BarLength_i(Fl_Knob* o, void* v);
  76. static void cb_BarLength(Fl_Knob* o, void* v);
  77. inline void cb_Speed_i(Fl_Knob* o, void* v);
  78. static void cb_Speed(Fl_Knob* o, void* v);
  79. inline void cb_Clear_i(Fl_Button* o, void* v);
  80. static void cb_Clear(Fl_Button* o, void* v);
  81. inline void cb_NewPattern_i(Fl_Button* o, void* v);
  82. static void cb_NewPattern(Fl_Button* o, void* v);
  83. // sequence event callbacks
  84. inline void cb_ArrangeRM_i(Fl_Button* o, void* v);
  85. static void cb_ArrangeRM(Fl_Button* o, void* v);
  86. inline void cb_MoveSequence_i(Fl_Widget* o, void* v);
  87. static void cb_MoveSequence(Fl_Widget* o, void* v);
  88. inline void cb_Rename_i(Fl_Widget* o, void* v);
  89. static void cb_Rename(Fl_Widget* o, void* v);
  90. inline void cb_Recolour_i(Fl_Widget* o, void* v);
  91. static void cb_Recolour(Fl_Widget* o, void* v);
  92. inline void cb_Copy_i(Fl_Widget* o, void* v);
  93. static void cb_Copy(Fl_Widget* o, void* v);
  94. inline void cb_RemoveSequence_i(Fl_Widget* o, void* v);
  95. static void cb_RemoveSequence(Fl_Widget* o, void* v);
  96. inline void cb_Edit_i(Fl_Widget* o, void* v);
  97. static void cb_Edit(Fl_Widget* o, void* v);
  98. // note event callbacks
  99. inline void cb_NewNote_i(Fl_Widget* o, void* v);
  100. static void cb_NewNote(Fl_Widget* o, void* v);
  101. inline void cb_MoveNote_i(Fl_Widget* o, void* v);
  102. static void cb_MoveNote(Fl_Widget* o, void* v);
  103. inline void cb_RemoveNote_i(Fl_Widget* o, void* v);
  104. static void cb_RemoveNote(Fl_Widget* o, void* v);
  105. };
  106. #endif