2 /*******************************************************************************/
3 /* Copyright (C) 2009 Jonathan Moore Liles */
5 /* This program is free software; you can redistribute it and/or modify it */
6 /* under the terms of the GNU General Public License as published by the */
7 /* Free Software Foundation; either version 2 of the License, or (at your */
8 /* option) any later version. */
10 /* This program is distributed in the hope that it will be useful, but WITHOUT */
11 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
12 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for */
15 /* You should have received a copy of the GNU General Public License along */
16 /* with This program; see the file COPYING. If not,write to the Free Software */
17 /* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
18 /*******************************************************************************/
28 class Plugin_Module : public Module {
30 static Thread *plugin_discover_thread;
46 bool load ( unsigned long id );
52 void bbox ( int &X, int &Y, int &W, int &H )
60 void cb_handle(Fl_Widget*);
61 static void cb_handle(Fl_Widget*, void*);
63 Fl_Button *close_button;
65 struct ImplementationData;
67 ImplementationData *_idata;
74 static void *discover_thread ( void * );
75 static Plugin_Info* get_all_plugins ( void );
78 void set_input_buffer ( int n, void *buf );
79 void set_output_buffer ( int n, void *buf );
80 void set_control_buffer ( int n, void *buf );
81 void activate ( void );
82 void deactivate ( void );
83 void process ( unsigned long nframes );
84 bool active ( void ) const { return _active; }
86 bool plugin_instances ( unsigned int );
88 void connect_ports ( void );
93 static void spawn_discover_thread ( void );
94 static void join_discover_thread ( void );
97 virtual ~Plugin_Module();
99 static Plugin_Module * pick_plugin ( void );
100 static void add_plugins_to_menu ( Fl_Menu_Button *menu );
102 int plugin_ins ( void ) const { return _plugin_ins; }
103 int plugin_outs ( void ) const { return _plugin_outs; }
105 void select_plugin ( unsigned long id );
107 const char *name ( void ) const { return "Plugin"; }
109 int can_support_inputs ( int );
110 bool configure_inputs ( int );
112 void process ( nframes_t );
114 void handle_port_connection_change ( void );
116 LOG_CREATE_FUNC( Plugin_Module );
118 MODULE_CLONE_FUNC( Plugin_Module );
122 void get ( Log_Entry &e ) const;
123 void set ( Log_Entry &e );