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.

115 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. #pragma once
  19. #include "Module.H"
  20. class Plugin_Module : Module {
  21. void init ( void );
  22. int _ins;
  23. int _outs;
  24. int _instances;
  25. void bbox ( int &X, int &Y, int &W, int &H )
  26. {
  27. X = x();
  28. Y = y() + 5;
  29. W = w();
  30. H = h() - 10;
  31. }
  32. void cb_handle(Fl_Widget*);
  33. static void cb_handle(Fl_Widget*, void*);
  34. Fl_Button *close_button;
  35. struct ImplementationData;
  36. ImplementationData *_idata;
  37. bool _active;
  38. int _plugin_ins;
  39. int _plugin_outs;
  40. bool _crosswire;
  41. struct Plugin_Info
  42. {
  43. const char *path;
  44. unsigned long id;
  45. Plugin_Info ( )
  46. {
  47. path = 0;
  48. id = 0;
  49. }
  50. };
  51. static Plugin_Info* discover ( void );
  52. bool load ( Plugin_Info * );
  53. void set_input_buffer ( int n, void *buf );
  54. void set_output_buffer ( int n, void *buf );
  55. void set_control_buffer ( int n, void *buf );
  56. void activate ( void );
  57. void deactivate ( void );
  58. void process ( unsigned long nframes );
  59. bool active ( void ) const { return _active; }
  60. public:
  61. Plugin_Module( int W, int H, const char *L = 0 );
  62. Plugin_Module ( );
  63. virtual ~Plugin_Module();
  64. static Plugin_Module * pick_plugin ( void );
  65. int plugin_ins ( void ) const { return _plugin_ins; }
  66. int plugin_outs ( void ) const { return _plugin_outs; }
  67. bool ins ( int i );
  68. int ins ( void ) const { return _ins; }
  69. int outs ( void ) const { return plugin_outs() * _instances; }
  70. bool controllable ( void ) const { return false; }
  71. int instances ( void ) const { return _instances; }
  72. void instances ( int i ) { _instances = i; }
  73. void select_plugin ( unsigned long id );
  74. const char *name ( void ) const { return "Plugin"; }
  75. int can_support_inputs ( int );
  76. bool configure_inputs ( int );
  77. void process ( void );
  78. protected:
  79. // virtual void draw ( void );
  80. virtual int handle ( int );
  81. };