2 Copyright (C) 2000 Paul Davis
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.
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.
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.
20 #ifndef __ardour_plugin_selector_h__
21 #define __ardour_plugin_selector_h__
23 #include <gtkmm/dialog.h>
24 #include <gtkmm/notebook.h>
25 #include <gtkmm/treeview.h>
26 #include <gtkmm2ext/selector.h>
34 class PluginSelector : public ArdourDialog
37 PluginSelector (ARDOUR::PluginManager *);
38 sigc::signal<void,boost::shared_ptr<ARDOUR::Plugin> > PluginCreated;
40 int run (); // XXX should we try not to overload the non-virtual Gtk::Dialog::run() ?
42 void set_session (ARDOUR::Session*);
45 ARDOUR::Session* session;
46 Gtk::Notebook notebook;
47 Gtk::ScrolledWindow lscroller;
48 Gtk::ScrolledWindow vscroller;
49 Gtk::ScrolledWindow ascroller;
52 struct LadspaColumns : public Gtk::TreeModel::ColumnRecord {
60 Gtk::TreeModelColumn<std::string> name;
61 Gtk::TreeModelColumn<std::string> type;
62 Gtk::TreeModelColumn<std::string> ins;
63 Gtk::TreeModelColumn<std::string> outs;
64 Gtk::TreeModelColumn<ARDOUR::PluginInfo *> plugin;
67 Glib::RefPtr<Gtk::ListStore> lmodel;
68 Glib::RefPtr<Gtk::TreeSelection> lselection;
69 Gtk::TreeView ladspa_display;
71 Gtk::Button* btn_remove;
73 struct AddedColumns : public Gtk::TreeModel::ColumnRecord {
78 Gtk::TreeModelColumn<std::string> text;
79 Gtk::TreeModelColumn<ARDOUR::PluginInfo *> plugin;
82 Glib::RefPtr<Gtk::ListStore> amodel;
83 Glib::RefPtr<Gtk::TreeSelection> aselection;
84 Gtk::TreeView added_list;
88 struct VstColumns : public Gtk::TreeModel::ColumnRecord {
95 Gtk::TreeModelColumn<std::string> name;
96 Gtk::TreeModelColumn<std::string> ins;
97 Gtk::TreeModelColumn<std::string> outs;
98 Gtk::TreeModelColumn<ARDOUR::PluginInfo *> plugin;
101 Glib::RefPtr<Gtk::ListStore> vmodel;
102 Glib::RefPtr<Gtk::TreeSelection> vselection;
103 Gtk::TreeView vst_display;
104 static void _vst_refiller (void *);
105 void vst_refiller ();
106 void vst_display_selection_changed();
109 ARDOUR::PluginInfo* i_selected_plug;
111 // We need an integer for the output side because
112 // the name isn't promised to be unique.
113 gint o_selected_plug;
115 ARDOUR::PluginManager *manager;
116 list<ARDOUR::PluginInfo*> added_plugins;
118 static void _input_refiller (void *);
120 void input_refiller ();
121 void row_clicked(GdkEventButton *);
122 void btn_add_clicked();
123 void btn_remove_clicked();
124 void btn_update_clicked();
125 void added_list_selection_changed();
126 void ladspa_display_selection_changed();
127 void btn_apply_clicked();
128 void use_plugin (ARDOUR::PluginInfo*);
132 #endif // __ardour_plugin_selector_h__