Initial import of gtk2_ardour.
[ardour.git] / gtk2_ardour / plugin_selector.h
1 /*
2     Copyright (C) 2000 Paul Davis 
3
4     This program is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.
8
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13
14     You should have received a copy of the GNU General Public License
15     along with this program; if not, write to the Free Software
16     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 */
19
20 #ifndef __ardour_plugin_selector_h__
21 #define __ardour_plugin_selector_h__
22
23 #include <gtk--.h>
24 #include <gtk--/ctree.h>
25 #include <gtkmmext/selector.h>
26
27 #include <ardour_dialog.h>
28
29 namespace ARDOUR {
30         class Session;
31         class PluginManager;
32         class Plugin;
33 }
34
35 class PluginSelector : public ArdourDialog 
36 {
37   public:
38         PluginSelector (ARDOUR::PluginManager *);
39         SigC::Signal1<void,ARDOUR::Plugin *> PluginCreated;
40
41         void set_session (ARDOUR::Session*);
42
43   private:
44         ARDOUR::Session* session;
45         Gtk::Notebook notebook;
46
47         // page 1
48         Gtkmmext::Selector ladspa_display;
49         void column_clicked (int column, GtkCList* clist);
50
51 #ifdef VST_SUPPORT
52         // page 2
53         Gtkmmext::Selector vst_display;
54         static void _vst_refiller (Gtk::CList &, void *);
55         void vst_refiller (Gtk::CList &);
56 #endif  
57         Gtkmmext::Selector o_selector;
58
59         ARDOUR::PluginInfo* i_selected_plug;
60
61         // We need an integer for the output side because
62         // the name isn't promised to be unique.
63         gint o_selected_plug;
64
65         ARDOUR::PluginManager *manager;
66         list<ARDOUR::PluginInfo*> added_plugins;
67
68         static void _input_refiller (Gtk::CList &, void *);
69         static void _output_refiller (Gtk::CList &, void *);
70
71         void input_refiller (Gtk::CList &);
72         void output_refiller (Gtk::CList &);
73         void i_plugin_selected (Gtkmmext::Selector *selector,
74                               Gtkmmext::SelectionResult *res);
75         void i_plugin_chosen (Gtkmmext::Selector *selector,
76                             Gtkmmext::SelectionResult *res);
77         void o_plugin_selected (Gtkmmext::Selector *selector,
78                               Gtkmmext::SelectionResult *res);
79         void o_plugin_chosen (Gtkmmext::Selector *selector,
80                             Gtkmmext::SelectionResult *res);
81         
82         void btn_add_clicked();
83         void btn_remove_clicked();
84         void btn_ok_clicked();
85         void btn_update_clicked();
86         void btn_apply_clicked();
87         void btn_cancel_clicked();
88         void use_plugin (ARDOUR::PluginInfo*);
89         gint wm_close(GdkEventAny* ev);
90 };
91
92 #endif // __ardour_plugin_selector_h__