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.

105 lines
3.3KB

  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. public:
  45. std::vector <Module::Port> port;
  46. const char *name ( void ) const { return _name; }
  47. void name ( const char *name );
  48. void configure_ports ( void );
  49. int required_buffers ( void );
  50. Chain ( int X, int Y, int W, int H, const char *L = 0 );
  51. bool can_support_input_channels ( int n );
  52. void ins ( int i ) { _ins = i; }
  53. void outs ( int i ) { _outs = i; }
  54. int ins ( void ) const { return _ins; }
  55. int outs ( void ) const { return _outs; }
  56. int modules ( void ) const { return modules_pack->children(); }
  57. Module *module ( int n ) const { return (Module*)modules_pack->child( n ); }
  58. void remove ( Module *m );
  59. bool insert ( Module *m, Module *n );
  60. void add_control ( Module *m );
  61. void initialize_with_default ( void );
  62. bool can_configure_outputs ( Module *m, int n ) const;
  63. void configure_outputs_callback ( Fl_Callback *cb, void *v )
  64. {
  65. _configure_outputs_callback = cb;
  66. _configure_outputs_userdata = v;
  67. }
  68. Fl_Callback * configure_outputs_callback ( void ) const { return _configure_outputs_callback; }
  69. void process ( nframes_t );
  70. protected:
  71. int handle ( int m );
  72. void draw ( void );
  73. void resize ( int X, int Y, int W, int H );
  74. };