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/dndtreeview.h"
27 #include <gtkmm2ext/selector.h>
29 #include "ardour/plugin.h"
30 #include "ardour/session_handle.h"
31 #include "plugin_interest.h"
33 #include "ardour_button.h"
34 #include "ardour_dialog.h"
41 class PluginSelector : public ArdourDialog
44 PluginSelector (ARDOUR::PluginManager&);
47 void set_interested_object (PluginInterestedObject&);
49 int run (); // XXX should we try not to overload the non-virtual Gtk::Dialog::run() ?
53 Gtk::Menu* plugin_menu ();
57 PluginInterestedObject* interested_object;
59 Gtk::ScrolledWindow scroller; // Available plugins
60 Gtk::ScrolledWindow ascroller; // Added plugins
62 Gtk::ComboBoxText filter_mode;
63 Gtk::Entry filter_entry;
64 Gtk::Button filter_button;
66 ArdourButton fil_hidden_button;
67 ArdourButton fil_instruments_button;
68 ArdourButton fil_analysis_button;
69 ArdourButton fil_utils_button;
71 void filter_button_clicked ();
72 void filter_entry_changed ();
73 void filter_mode_changed ();
75 struct PluginColumns : public Gtk::TreeModel::ColumnRecord {
89 Gtk::TreeModelColumn<bool> favorite;
90 Gtk::TreeModelColumn<bool> hidden;
91 Gtk::TreeModelColumn<std::string> name;
92 Gtk::TreeModelColumn<std::string> type_name;
93 Gtk::TreeModelColumn<std::string> category;
94 Gtk::TreeModelColumn<std::string> creator;
95 Gtk::TreeModelColumn<std::string> audio_ins;
96 Gtk::TreeModelColumn<std::string> audio_outs;
97 Gtk::TreeModelColumn<std::string> midi_ins;
98 Gtk::TreeModelColumn<std::string> midi_outs;
99 Gtk::TreeModelColumn<ARDOUR::PluginInfoPtr> plugin;
101 PluginColumns plugin_columns;
102 Glib::RefPtr<Gtk::ListStore> plugin_model;
103 Gtkmm2ext::DnDTreeView<ARDOUR::PluginInfoPtr> plugin_display;
104 Gtk::Button* btn_add;
105 Gtk::Button* btn_remove;
107 struct AddedColumns : public Gtk::TreeModel::ColumnRecord {
112 Gtk::TreeModelColumn<std::string> text;
113 Gtk::TreeModelColumn<ARDOUR::PluginInfoPtr> plugin;
116 Glib::RefPtr<Gtk::ListStore> amodel;
117 Gtk::TreeView added_list;
120 void refiller (const ARDOUR::PluginInfoList& plugs, const::std::string& filterstr, const char* type);
121 void ladspa_refiller (const std::string&);
122 void lv2_refiller (const std::string&);
123 void vst_refiller (const std::string&);
124 void lxvst_refiller (const std::string&);
125 void au_refiller (const std::string&);
127 Gtk::Menu* _plugin_menu;
128 ARDOUR::PluginManager& manager;
130 void row_activated(Gtk::TreeModel::Path path, Gtk::TreeViewColumn* col);
131 void btn_add_clicked();
132 void btn_remove_clicked();
133 void added_list_selection_changed();
134 void added_row_clicked(GdkEventButton* event);
135 void display_selection_changed();
136 void btn_apply_clicked();
137 ARDOUR::PluginPtr load_plugin (ARDOUR::PluginInfoPtr);
138 bool show_this_plugin (const ARDOUR::PluginInfoPtr&, const std::string&);
139 void setup_filter_string (std::string&);
141 bool fil_hidden_button_release (GdkEventButton*);
142 bool fil_instruments_button_release (GdkEventButton*);
143 bool fil_analysis_button_release (GdkEventButton*);
144 bool fil_utils_button_release (GdkEventButton*);
146 void favorite_changed (const std::string& path);
147 void hidden_changed (const std::string& path);
150 void plugin_chosen_from_menu (const ARDOUR::PluginInfoPtr&);
152 Gtk::Menu* create_favs_menu (ARDOUR::PluginInfoList&);
153 Gtk::Menu* create_by_creator_menu (ARDOUR::PluginInfoList&);
154 Gtk::Menu* create_by_category_menu (ARDOUR::PluginInfoList&);
155 void build_plugin_menu ();
156 PBD::ScopedConnectionList plugin_list_changed_connection;
159 Gtkmm2ext::ActiveState _show_instruments;
160 Gtkmm2ext::ActiveState _show_analysers;
161 Gtkmm2ext::ActiveState _show_utils;
164 #endif // __ardour_plugin_selector_h__