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.

124 lines
3.8KB

  1. /*******************************************************************************/
  2. /* Copyright (C) 2009 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 <FL/Fl_Pack.H>
  21. #include <FL/Fl_Button.H>
  22. #include "Module.H"
  23. #include "JACK/Port.H"
  24. #include <vector>
  25. #include <list>
  26. #include "Loggable.H"
  27. class Mixer_Strip;
  28. class Fl_Flowpack;
  29. class Fl_Tabs;
  30. class Chain : public Fl_Group, public Loggable {
  31. Fl_Pack *modules_pack;
  32. Fl_Flowpack *controls_pack;
  33. Fl_Tabs *tabs;
  34. void cb_handle(Fl_Widget*);
  35. static void cb_handle(Fl_Widget*, void*);
  36. /* int _ins; */
  37. /* int _outs; */
  38. Mixer_Strip *_strip;
  39. // sample_t **_buffer;
  40. // int _nbuffers;
  41. Fl_Callback *_configure_outputs_callback;
  42. void *_configure_outputs_userdata;
  43. const char *_name;
  44. void draw_connections ( Module *m );
  45. std::list<Module*> process_queue;
  46. void build_process_queue ( void );
  47. void add_to_process_queue ( Module *m );
  48. static std::vector <Module::Port> port;
  49. static std::list <Chain*> chain;
  50. protected:
  51. void get ( Log_Entry &e ) const;
  52. void set ( Log_Entry &e );
  53. int handle ( int m );
  54. void draw ( void );
  55. public:
  56. void resize ( int X, int Y, int W, int H );
  57. Mixer_Strip *strip ( void ) const { return _strip; }
  58. void strip ( Mixer_Strip *v );
  59. const char *name ( void ) const { return _name; }
  60. void name ( const char *name );
  61. void configure_ports ( void );
  62. int required_buffers ( void );
  63. Chain ( int X, int Y, int W, int H, const char *L = 0 );
  64. Chain ( );
  65. virtual ~Chain ( );
  66. bool can_support_input_channels ( int n );
  67. /* void ins ( int i ) { _ins = i; } */
  68. /* void outs ( int i ) { _outs = i; } */
  69. /* int ins ( void ) const { return _ins; } */
  70. /* int outs ( void ) const { return _outs; } */
  71. int modules ( void ) const { return modules_pack->children(); }
  72. Module *module ( int n ) const { return (Module*)modules_pack->child( n ); }
  73. void remove ( Module *m );
  74. bool add ( Module *m );
  75. bool insert ( Module *m, Module *n );
  76. void add_control ( Module *m );
  77. void initialize_with_default ( void );
  78. bool can_configure_outputs ( Module *m, int n ) const;
  79. void configure_outputs_callback ( Fl_Callback *cb, void *v )
  80. {
  81. _configure_outputs_callback = cb;
  82. _configure_outputs_userdata = v;
  83. }
  84. Fl_Callback * configure_outputs_callback ( void ) const { return _configure_outputs_callback; }
  85. void process ( nframes_t );
  86. void log_children ( void );
  87. LOG_CREATE_FUNC( Chain );
  88. };