Assists music production by grouping standalone programs into sessions. Community version of "Non Session Manager".
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.

170 lines
4.8KB

  1. /*******************************************************************************/
  2. /* Copyright (C) 2010 Jonathan Moore Liles */
  3. /* */
  4. /* This program is free software; you can redistribute it and/or modify it */
  5. /* under the terms of the GNU General Public License as published by the */
  6. /* Free Software Foundation; either version 2 of the License, or (at your */
  7. /* option) any later version. */
  8. /* */
  9. /* This program is distributed in the hope that it will be useful, but WITHOUT */
  10. /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
  11. /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for */
  12. /* more details. */
  13. /* */
  14. /* You should have received a copy of the GNU General Public License along */
  15. /* with This program; see the file COPYING. If not,write to the Free Software */
  16. /* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
  17. /*******************************************************************************/
  18. #pragma once
  19. #include <FL/Fl.H>
  20. #include "DPM.H"
  21. #include "Panner.H"
  22. #include <FL/Fl_Scalepack.H>
  23. #include <FL/Fl_Pack.H>
  24. #include <FL/Fl_Flip_Button.H>
  25. #include <FL/Fl_Dial.H>
  26. #include <FL/Fl_Group.H>
  27. #include <FL/Fl_Box.H>
  28. #include <FL/Fl_Button.H>
  29. #include <FL/Fl_Value_Slider.H>
  30. #include <FL/Fl_Counter.H>
  31. #include <FL/Fl_Progress.H>
  32. #include <JACK/Port.H>
  33. #include "../FL/Fl_Sometimes_Input.H"
  34. #include "Loggable.H"
  35. class Chain;
  36. class Fl_Flowpack;
  37. class Controller_Module;
  38. class Meter_Indicator_Module;
  39. class Module;
  40. class Fl_Flip_Button;
  41. class Fl_Input;
  42. class Fl_Menu_;
  43. class Fl_Menu_Button;
  44. class Fl_Choice;
  45. class Group;
  46. class Mixer_Strip : public Fl_Group, public Loggable {
  47. public:
  48. static int min_h ( void ) { return 333; }
  49. Mixer_Strip( const char *strip_name );
  50. Mixer_Strip(); /* for log create */
  51. virtual ~Mixer_Strip();
  52. void chain ( Chain *c );
  53. Chain *chain ( void ) { return _chain; }
  54. virtual void log_children ( void ) const;
  55. virtual void color ( Fl_Color c );
  56. virtual Fl_Color color ( void ) const;
  57. LOG_CREATE_FUNC( Mixer_Strip );
  58. static void configure_outputs ( Fl_Widget *o, void *v );
  59. void configure_outputs ( void );
  60. bool configure_ports ( int n );
  61. void handle_module_added ( Module *m );
  62. void handle_module_removed ( Module *m );
  63. void update ( void );
  64. void name ( const char *name );
  65. const char *name ( void ) const { return label(); }
  66. private:
  67. /* used to defer setting the mode of the gain controller until the
  68. chain has been added and the controller connected to a default
  69. module */
  70. int _gain_controller_mode;
  71. Fl_Flip_Button *width_button;
  72. Fl_Flip_Button *tab_button;
  73. Fl_Button *close_button;
  74. Fl_Input *name_field;
  75. Fl_Choice *group_choice;
  76. Fl_Flowpack *controls_pack;
  77. Fl_Group *tab_group;
  78. Fl_Group *signal_tab;
  79. Fl_Group *fader_tab;
  80. Fl_Pack *panner_pack;
  81. Chain *_chain;
  82. Group *_group;
  83. Fl_Box *spatialization_label;
  84. Controller_Module *gain_controller;
  85. Controller_Module *jack_input_controller;
  86. Controller_Module *spatialization_controller;
  87. Meter_Indicator_Module *meter_indicator;
  88. Fl_Progress *dsp_load_progress;
  89. Fl_Box *color_box;
  90. nframes_t nframes;
  91. Fl_Color _color;
  92. void init ( );
  93. void cb_handle(Fl_Widget*);
  94. static void cb_handle(Fl_Widget*, void*);
  95. void set_tab ( void );
  96. void update_port_names ( void );
  97. void menu_cb ( const Fl_Menu_ *m );
  98. static void menu_cb ( Fl_Widget *w, void *v );
  99. Fl_Menu_Button & menu ( void ) const;
  100. static void snapshot ( void *v );
  101. void snapshot ( void );
  102. bool export_strip ( const char *filename );
  103. void set_spatializer_visibility ( void );
  104. protected:
  105. void get ( Log_Entry &e ) const;
  106. void set ( Log_Entry &e );
  107. virtual int handle ( int m );
  108. virtual void draw ( void );
  109. public:
  110. void update_group_choice ( void );
  111. Controller_Module *spatializer ( void );
  112. Group *group ( void ) { return _group;}
  113. // int group ( void ) const;
  114. void group ( Group * );
  115. void send_feedback ( void );
  116. int number ( void ) const;
  117. static bool import_strip ( const char *filename );
  118. void command_move_left ( void );
  119. void command_move_right ( void );
  120. void command_close ( void );
  121. void command_rename ( const char * s );
  122. void command_width ( bool b );
  123. void command_view ( bool b );
  124. };