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.

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