ardour
plugin_selector.h
Go to the documentation of this file.
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 <gtkmm/dialog.h>
24 #include <gtkmm/notebook.h>
25 #include <gtkmm/treeview.h>
26 #include <gtkmm2ext/selector.h>
27 
28 #include "ardour/plugin.h"
29 #include "ardour/session_handle.h"
30 #include "plugin_interest.h"
31 
32 namespace ARDOUR {
33  class Session;
34  class PluginManager;
35 }
36 
38 {
39  public:
41  ~PluginSelector ();
42 
44 
45  int run (); // XXX should we try not to overload the non-virtual Gtk::Dialog::run() ?
46 
47  void on_show ();
48 
49  Gtk::Menu* plugin_menu ();
50  void show_manager ();
51 
52  private:
54 
55  Gtk::ScrolledWindow scroller; // Available plugins
56  Gtk::ScrolledWindow ascroller; // Added plugins
57 
58  Gtk::ComboBoxText filter_mode;
59  Gtk::Entry filter_entry;
60  Gtk::Button filter_button;
61 
62  void filter_button_clicked ();
63  void filter_entry_changed ();
64  void filter_mode_changed ();
65 
66  struct PluginColumns : public Gtk::TreeModel::ColumnRecord {
68  add (favorite);
69  add (hidden);
70  add (name);
71  add (type_name);
72  add (category);
73  add (creator);
74  add (audio_ins);
75  add (audio_outs);
76  add (midi_ins);
77  add (midi_outs);
78  add (plugin);
79  }
80  Gtk::TreeModelColumn<bool> favorite;
81  Gtk::TreeModelColumn<bool> hidden;
82  Gtk::TreeModelColumn<std::string> name;
83  Gtk::TreeModelColumn<std::string> type_name;
84  Gtk::TreeModelColumn<std::string> category;
85  Gtk::TreeModelColumn<std::string> creator;
86  Gtk::TreeModelColumn<std::string> audio_ins;
87  Gtk::TreeModelColumn<std::string> audio_outs;
88  Gtk::TreeModelColumn<std::string> midi_ins;
89  Gtk::TreeModelColumn<std::string> midi_outs;
90  Gtk::TreeModelColumn<ARDOUR::PluginInfoPtr> plugin;
91  };
93  Glib::RefPtr<Gtk::ListStore> plugin_model;
94  Gtk::TreeView plugin_display;
95  Gtk::Button* btn_add;
96  Gtk::Button* btn_remove;
97 
98  struct AddedColumns : public Gtk::TreeModel::ColumnRecord {
100  add (text);
101  add (plugin);
102  }
103  Gtk::TreeModelColumn<std::string> text;
104  Gtk::TreeModelColumn<ARDOUR::PluginInfoPtr> plugin;
105  };
107  Glib::RefPtr<Gtk::ListStore> amodel;
108  Gtk::TreeView added_list;
109 
110  void refill ();
111  void refiller (const ARDOUR::PluginInfoList& plugs, const::std::string& filterstr, const char* type);
112  void ladspa_refiller (const std::string&);
113  void lv2_refiller (const std::string&);
114  void vst_refiller (const std::string&);
115  void lxvst_refiller (const std::string&);
116  void au_refiller (const std::string&);
117 
118  Gtk::Menu* _plugin_menu;
120 
121  void row_activated(Gtk::TreeModel::Path path, Gtk::TreeViewColumn* col);
122  void btn_add_clicked();
123  void btn_remove_clicked();
124  void btn_update_clicked();
126  void added_row_clicked(GdkEventButton* event);
128  void btn_apply_clicked();
130  bool show_this_plugin (const ARDOUR::PluginInfoPtr&, const std::string&);
131  void setup_filter_string (std::string&);
132 
133  void favorite_changed (const std::string& path);
134  void hidden_changed (const std::string& path);
136 
138 
142  void build_plugin_menu ();
144 };
145 
146 #endif // __ardour_plugin_selector_h__
147 
void added_list_selection_changed()
Gtk::TreeModelColumn< bool > hidden
ARDOUR::PluginManager & manager
Gtk::TreeModelColumn< std::string > audio_outs
AddedColumns acols
void filter_mode_changed()
Gtk::Menu * plugin_menu()
void vst_refiller(const std::string &)
void refiller(const ARDOUR::PluginInfoList &plugs, const ::std::string &filterstr, const char *type)
Gtk::ComboBoxText filter_mode
bool show_this_plugin(const ARDOUR::PluginInfoPtr &, const std::string &)
void added_row_clicked(GdkEventButton *event)
void favorite_changed(const std::string &path)
void hidden_changed(const std::string &path)
void set_interested_object(PluginInterestedObject &)
Gtk::Button * btn_remove
Gtk::Button * btn_add
void filter_entry_changed()
void ladspa_refiller(const std::string &)
Gtk::Entry filter_entry
Gtk::TreeModelColumn< std::string > midi_ins
PluginSelector(ARDOUR::PluginManager &)
void plugin_chosen_from_menu(const ARDOUR::PluginInfoPtr &)
Gtk::Menu * create_by_category_menu(ARDOUR::PluginInfoList &)
LIBARDOUR_API uint64_t PluginManager
Definition: plugin.h:85
void lv2_refiller(const std::string &)
void lxvst_refiller(const std::string &)
PBD::ScopedConnectionList plugin_list_changed_connection
Gtk::TreeModelColumn< std::string > midi_outs
Definition: amp.h:29
void display_selection_changed()
PluginInterestedObject * interested_object
Gtk::ScrolledWindow ascroller
void filter_button_clicked()
ARDOUR::PluginPtr load_plugin(ARDOUR::PluginInfoPtr)
void row_activated(Gtk::TreeModel::Path path, Gtk::TreeViewColumn *col)
Gtk::TreeView plugin_display
Gtk::TreeModelColumn< std::string > category
Gtk::TreeModelColumn< std::string > audio_ins
void au_refiller(const std::string &)
Gtk::TreeModelColumn< std::string > creator
Gtk::TreeModelColumn< std::string > name
Gtk::Menu * _plugin_menu
Gtk::Button filter_button
Gtk::TreeModelColumn< bool > favorite
Gtk::Menu * create_favs_menu(ARDOUR::PluginInfoList &)
Glib::RefPtr< Gtk::ListStore > plugin_model
void btn_apply_clicked()
Glib::RefPtr< Gtk::ListStore > amodel
Gtk::ScrolledWindow scroller
Gtk::TreeModelColumn< std::string > type_name
std::list< PluginInfoPtr > PluginInfoList
Definition: plugin.h:90
Gtk::Menu * create_by_creator_menu(ARDOUR::PluginInfoList &)
void setup_filter_string(std::string &)
PluginColumns plugin_columns
Gtk::TreeModelColumn< ARDOUR::PluginInfoPtr > plugin
Gtk::TreeView added_list
Gtk::TreeModelColumn< ARDOUR::PluginInfoPtr > plugin
Gtk::TreeModelColumn< std::string > text