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.

108 lines
3.4KB

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