mechanism to allow Track (or other Route-derived type) to add its own processors...
[ardour.git] / gtk2_ardour / plugin_selector.h
index 06e746853fa4d06390e4266f48cd79352de92367..e4fb89d5707ec576945972b2936a81de50ac0198 100644 (file)
 #ifndef __ardour_plugin_selector_h__
 #define __ardour_plugin_selector_h__
 
-#include <gtkmm/dialog.h>
+#include <gtkmm/button.h>
+#include <gtkmm/comboboxtext.h>
+#include <gtkmm/entry.h>
+#include <gtkmm/liststore.h>
 #include <gtkmm/notebook.h>
+#include <gtkmm/scrolledwindow.h>
+#include <gtkmm/treemodel.h>
 #include <gtkmm/treeview.h>
-#include <gtkmm2ext/selector.h>
+
+#include "gtkmm2ext/dndtreeview.h"
 
 #include "ardour/plugin.h"
+#include "ardour/session_handle.h"
+
+#include "widgets/ardour_button.h"
+
 #include "plugin_interest.h"
+#include "ardour_dialog.h"
 
 namespace ARDOUR {
        class Session;
@@ -35,24 +46,22 @@ namespace ARDOUR {
 
 class PluginSelector : public ArdourDialog
 {
-  public:
-       PluginSelector (ARDOUR::PluginManager *);
+public:
+       PluginSelector (ARDOUR::PluginManager&);
        ~PluginSelector ();
 
        void set_interested_object (PluginInterestedObject&);
 
        int run (); // XXX should we try not to overload the non-virtual Gtk::Dialog::run() ?
 
-       void set_session (ARDOUR::Session*);
        void on_show ();
 
        Gtk::Menu* plugin_menu ();
        void show_manager ();
 
-  private:
+private:
        PluginInterestedObject* interested_object;
 
-       ARDOUR::Session* session;
        Gtk::ScrolledWindow scroller;   // Available plugins
        Gtk::ScrolledWindow ascroller;  // Added plugins
 
@@ -60,6 +69,11 @@ class PluginSelector : public ArdourDialog
        Gtk::Entry filter_entry;
        Gtk::Button filter_button;
 
+       ArdourWidgets::ArdourButton fil_hidden_button;
+       ArdourWidgets::ArdourButton fil_instruments_button;
+       ArdourWidgets::ArdourButton fil_analysis_button;
+       ArdourWidgets::ArdourButton fil_utils_button;
+
        void filter_button_clicked ();
        void filter_entry_changed ();
        void filter_mode_changed ();
@@ -92,7 +106,7 @@ class PluginSelector : public ArdourDialog
        };
        PluginColumns plugin_columns;
        Glib::RefPtr<Gtk::ListStore> plugin_model;
-       Gtk::TreeView plugin_display;
+       Gtkmm2ext::DnDTreeView<ARDOUR::PluginInfoPtr> plugin_display;
        Gtk::Button* btn_add;
        Gtk::Button* btn_remove;
 
@@ -113,24 +127,32 @@ class PluginSelector : public ArdourDialog
        void ladspa_refiller (const std::string&);
        void lv2_refiller (const std::string&);
        void vst_refiller (const std::string&);
+       void lxvst_refiller (const std::string&);
+       void mac_vst_refiller (const std::string&);
        void au_refiller (const std::string&);
+       void lua_refiller (const std::string&);
 
        Gtk::Menu* _plugin_menu;
-       ARDOUR::PluginManager *manager;
+       ARDOUR::PluginManagermanager;
 
-       void row_clicked(GdkEventButton *);
+       void row_activated(Gtk::TreeModel::Path path, Gtk::TreeViewColumn* col);
        void btn_add_clicked();
        void btn_remove_clicked();
-       void btn_update_clicked();
        void added_list_selection_changed();
+       void added_row_clicked(GdkEventButton* event);
        void display_selection_changed();
        void btn_apply_clicked();
        ARDOUR::PluginPtr load_plugin (ARDOUR::PluginInfoPtr);
        bool show_this_plugin (const ARDOUR::PluginInfoPtr&, const std::string&);
        void setup_filter_string (std::string&);
 
-       void favorite_changed (const Glib::ustring& path);
-       void hidden_changed (const Glib::ustring& path);
+       bool fil_hidden_button_release (GdkEventButton*);
+       bool fil_instruments_button_release (GdkEventButton*);
+       bool fil_analysis_button_release (GdkEventButton*);
+       bool fil_utils_button_release (GdkEventButton*);
+
+       void favorite_changed (const std::string& path);
+       void hidden_changed (const std::string& path);
        bool in_row_change;
 
        void plugin_chosen_from_menu (const ARDOUR::PluginInfoPtr&);
@@ -139,6 +161,12 @@ class PluginSelector : public ArdourDialog
        Gtk::Menu* create_by_creator_menu (ARDOUR::PluginInfoList&);
        Gtk::Menu* create_by_category_menu (ARDOUR::PluginInfoList&);
        void build_plugin_menu ();
+       PBD::ScopedConnectionList plugin_list_changed_connection;
+
+       bool _show_hidden;
+       Gtkmm2ext::ActiveState _show_instruments;
+       Gtkmm2ext::ActiveState _show_analysers;
+       Gtkmm2ext::ActiveState _show_utils;
 };
 
 #endif // __ardour_plugin_selector_h__