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>
28 #include <ardour/plugin.h>
35 class PluginSelector : public ArdourDialog
38 PluginSelector (ARDOUR::PluginManager *);
39 sigc::signal<void,boost::shared_ptr<ARDOUR::Plugin> > PluginCreated;
41 int run (); // XXX should we try not to overload the non-virtual Gtk::Dialog::run() ?
43 void set_session (ARDOUR::Session*);
47 ARDOUR::Session* session;
48 Gtk::ScrolledWindow scroller; // Available plugins
49 Gtk::ScrolledWindow ascroller; // Added plugins
51 Gtk::ComboBoxText filter_mode;
52 Gtk::Entry filter_entry;
53 Gtk::Button filter_button;
55 void filter_button_clicked ();
56 void filter_entry_changed ();
57 void filter_mode_changed ();
59 struct PluginColumns : public Gtk::TreeModel::ColumnRecord {
71 Gtk::TreeModelColumn<std::string> name;
72 Gtk::TreeModelColumn<std::string> type_name;
73 Gtk::TreeModelColumn<std::string> category;
74 Gtk::TreeModelColumn<std::string> creator;
75 Gtk::TreeModelColumn<std::string> audio_ins;
76 Gtk::TreeModelColumn<std::string> audio_outs;
77 Gtk::TreeModelColumn<std::string> midi_ins;
78 Gtk::TreeModelColumn<std::string> midi_outs;
79 Gtk::TreeModelColumn<ARDOUR::PluginInfoPtr> plugin;
81 PluginColumns plugin_columns;
82 Glib::RefPtr<Gtk::ListStore> plugin_model;
83 Gtk::TreeView plugin_display;
85 Gtk::Button* btn_remove;
87 struct AddedColumns : public Gtk::TreeModel::ColumnRecord {
92 Gtk::TreeModelColumn<std::string> text;
93 Gtk::TreeModelColumn<ARDOUR::PluginInfoPtr> plugin;
96 Glib::RefPtr<Gtk::ListStore> amodel;
97 Gtk::TreeView added_list;
100 void refiller (const ARDOUR::PluginInfoList& plugs, const::std::string& filterstr, const char* type);
101 void ladspa_refiller (const std::string&);
102 void lv2_refiller (const std::string&);
103 void vst_refiller (const std::string&);
104 void au_refiller (const std::string&);
106 ARDOUR::PluginManager *manager;
108 void row_clicked(GdkEventButton *);
109 void btn_add_clicked();
110 void btn_remove_clicked();
111 void btn_update_clicked();
112 void added_list_selection_changed();
113 void display_selection_changed();
114 void btn_apply_clicked();
115 void use_plugin (ARDOUR::PluginInfoPtr);
117 bool show_this_plugin (const ARDOUR::PluginInfoPtr&, const std::string&);
118 void setup_filter_string (std::string&);
121 #endif // __ardour_plugin_selector_h__