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.

109 lines
3.1KB

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