AU state handling, including changes to PathScanner so that it can now do recursive...
[ardour2.git] / gtk2_ardour / plugin_selector.h
blobab5495b3487cdd42a8cbb730bc81e08660ec8cab
1 /*
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>
29 #include "plugin_interest.h"
31 namespace ARDOUR {
32 class Session;
33 class PluginManager;
36 class PluginSelector : public ArdourDialog
38 public:
39 PluginSelector (ARDOUR::PluginManager *);
41 void set_interested_object (PluginInterestedObject&);
43 int run (); // XXX should we try not to overload the non-virtual Gtk::Dialog::run() ?
45 void set_session (ARDOUR::Session*);
46 void on_show ();
48 Gtk::Menu& plugin_menu ();
49 void show_manager ();
51 private:
52 PluginInterestedObject* interested_object;
54 ARDOUR::Session* session;
55 Gtk::ScrolledWindow scroller; // Available plugins
56 Gtk::ScrolledWindow ascroller; // Added plugins
58 Gtk::ComboBoxText filter_mode;
59 Gtk::Entry filter_entry;
60 Gtk::Button filter_button;
62 void filter_button_clicked ();
63 void filter_entry_changed ();
64 void filter_mode_changed ();
66 struct PluginColumns : public Gtk::TreeModel::ColumnRecord {
67 PluginColumns () {
68 add (favorite);
69 add (name);
70 add (type_name);
71 add (category);
72 add (creator);
73 add (ins);
74 add (outs);
75 add (plugin);
77 Gtk::TreeModelColumn<bool> favorite;
78 Gtk::TreeModelColumn<std::string> name;
79 Gtk::TreeModelColumn<std::string> type_name;
80 Gtk::TreeModelColumn<std::string> category;
81 Gtk::TreeModelColumn<std::string> creator;
82 Gtk::TreeModelColumn<std::string> ins;
83 Gtk::TreeModelColumn<std::string> outs;
84 Gtk::TreeModelColumn<ARDOUR::PluginInfoPtr> plugin;
86 PluginColumns plugin_columns;
87 Glib::RefPtr<Gtk::ListStore> plugin_model;
88 Gtk::TreeView plugin_display;
89 Gtk::Button* btn_add;
90 Gtk::Button* btn_remove;
92 struct AddedColumns : public Gtk::TreeModel::ColumnRecord {
93 AddedColumns () {
94 add (text);
95 add (plugin);
97 Gtk::TreeModelColumn<std::string> text;
98 Gtk::TreeModelColumn<ARDOUR::PluginInfoPtr> plugin;
100 AddedColumns acols;
101 Glib::RefPtr<Gtk::ListStore> amodel;
102 Gtk::TreeView added_list;
104 void refill ();
105 void refiller (const ARDOUR::PluginInfoList& plugs, const::std::string& filterstr, const char* type);
106 void ladspa_refiller (const std::string&);
107 void lv2_refiller (const std::string&);
108 void vst_refiller (const std::string&);
109 void au_refiller (const std::string&);
111 ARDOUR::PluginManager *manager;
113 void row_clicked(GdkEventButton *);
114 void btn_add_clicked();
115 void btn_remove_clicked();
116 void btn_update_clicked();
117 void added_list_selection_changed();
118 void display_selection_changed();
119 void btn_apply_clicked();
120 ARDOUR::PluginPtr load_plugin (ARDOUR::PluginInfoPtr);
121 bool show_this_plugin (const ARDOUR::PluginInfoPtr&, const std::string&);
122 void setup_filter_string (std::string&);
124 void favorite_changed (const Glib::ustring& path);
125 bool in_row_change;
127 void plugin_chosen_from_menu (const ARDOUR::PluginInfoPtr&);
128 Gtk::Menu* _menu;
131 #endif // __ardour_plugin_selector_h__