diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index 7e6111ce0e..7b59824903 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -341,6 +341,7 @@ public: void show_ui_prefs (); void show_mixer_prefs (); + void show_plugin_prefs (); bool check_audioengine(Gtk::Window&); diff --git a/gtk2_ardour/ardour_ui2.cc b/gtk2_ardour/ardour_ui2.cc index e404987e33..a1bb19c01f 100644 --- a/gtk2_ardour/ardour_ui2.cc +++ b/gtk2_ardour/ardour_ui2.cc @@ -909,6 +909,7 @@ ARDOUR_UI::show_ui_prefs () rc_option_editor->set_current_page (_("Appearance")); } } + void ARDOUR_UI::show_mixer_prefs () { @@ -918,6 +919,15 @@ ARDOUR_UI::show_mixer_prefs () } } +void +ARDOUR_UI::show_plugin_prefs () +{ + if (rc_option_editor) { + show_tabbable (rc_option_editor); + rc_option_editor->set_current_page (_("Plugins")); + } +} + bool ARDOUR_UI::click_button_clicked (GdkEventButton* ev) { diff --git a/gtk2_ardour/plugin_manager_ui.cc b/gtk2_ardour/plugin_manager_ui.cc index d099dd7bb9..74c5350720 100644 --- a/gtk2_ardour/plugin_manager_ui.cc +++ b/gtk2_ardour/plugin_manager_ui.cc @@ -31,7 +31,9 @@ #include "ardour_message.h" #include "plugin_manager_ui.h" +#include "ardour_ui.h" #include "plugin_scan_dialog.h" +#include "rc_option_editor.h" #include "pbd/i18n.h" @@ -43,6 +45,7 @@ PluginManagerUI::PluginManagerUI () , _btn_rescan_err (_("Re-scan Faulty")) , _btn_rescan_sel (_("Re-scan Selected")) , _btn_clear (_("Clear Stale Scan Log")) + , _btn_prefs (_("Show Plugin Prefs")) , _in_row_change (false) { plugin_model = Gtk::ListStore::create (plugin_columns); @@ -127,11 +130,14 @@ PluginManagerUI::PluginManagerUI () Gtk::Label* lbl = Gtk::manage (new Gtk::Label ("")); // spacer Gtk::Frame* f_info = Gtk::manage (new Gtk::Frame (_("Plugin Count"))); + Gtk::Frame* f_paths = Gtk::manage (new Gtk::Frame (_("Preferences"))); + Gtk::VBox* b_paths = Gtk::manage (new Gtk::VBox ()); Gtk::Frame* f_actions = Gtk::manage (new Gtk::Frame (_("Scan Actions"))); Gtk::VBox* b_actions = Gtk::manage (new Gtk::VBox ()); f_info->add (_tbl_nfo); f_actions->add (*b_actions); + f_paths->add (*b_paths); _tbl_nfo.set_border_width (4); @@ -142,11 +148,31 @@ PluginManagerUI::PluginManagerUI () b_actions->set_spacing (4); b_actions->set_border_width (4); +#if defined LXVST_SUPPORT + ArdourWidgets::ArdourButton* btn_lxvst = manage (new ArdourWidgets::ArdourButton (_("Linux VST2 Path"))); + btn_lxvst->signal_clicked.connect (sigc::bind (sigc::mem_fun (*this, &PluginManagerUI::edit_vst_path), LXVST)); + b_paths->pack_start (*btn_lxvst); +#endif +#ifdef WINDOWS_VST_SUPPORT + ArdourWidgets::ArdourButton* btn_winvst = manage (new ArdourWidgets::ArdourButton (_("Windows VST2 Path"))); + btn_winvst->signal_clicked.connect (sigc::bind (sigc::mem_fun (*this, &PluginManagerUI::edit_vst_path), Windows_VST)); + b_paths->pack_start (*btn_winvst); +#endif +#ifdef VST3_SUPPORT + ArdourWidgets::ArdourButton* btn_vst3 = manage (new ArdourWidgets::ArdourButton (_("VST3 Path"))); + btn_vst3->signal_clicked.connect (sigc::bind (sigc::mem_fun (*this, &PluginManagerUI::edit_vst_path), VST3)); + b_paths->pack_start (*btn_vst3); +#endif + b_paths->pack_start (_btn_prefs); + b_paths->set_spacing (4); + b_paths->set_border_width (4); + /* top level packing */ _top.attach (*lbl, 0, 1, 0, 1, Gtk::SHRINK, Gtk::EXPAND | Gtk::FILL, 4, 0); _top.attach (*f_info, 0, 1, 1, 2, Gtk::FILL | Gtk::SHRINK, Gtk::SHRINK, 4, 4); _top.attach (*f_actions, 0, 1, 2, 3, Gtk::FILL | Gtk::SHRINK, Gtk::SHRINK, 4, 4); - _top.attach (_pane, 1, 2, 0, 3, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 4, 0); + _top.attach (*f_paths, 0, 1, 3, 4, Gtk::FILL | Gtk::SHRINK, Gtk::SHRINK, 4, 4); + _top.attach (_pane, 1, 2, 0, 4, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 4, 0); add (_top); _top.show_all (); @@ -163,6 +189,7 @@ PluginManagerUI::PluginManagerUI () _btn_rescan_err.signal_clicked.connect (sigc::mem_fun (*this, &PluginManagerUI::rescan_faulty)); _btn_rescan_sel.signal_clicked.connect (sigc::mem_fun (*this, &PluginManagerUI::rescan_selected)); _btn_clear.signal_clicked.connect (sigc::mem_fun (*this, &PluginManagerUI::clear_log)); + _btn_prefs.signal_clicked.connect (sigc::mem_fun (*this, &PluginManagerUI::show_plugin_prefs)); cell_fav->signal_toggled().connect (sigc::mem_fun (*this, &PluginManagerUI::favorite_changed)); cell_hidden->signal_toggled().connect (sigc::mem_fun (*this, &PluginManagerUI::hidden_changed)); @@ -397,6 +424,54 @@ PluginManagerUI::blacklist_changed (std::string const& path) } } +void +PluginManagerUI::show_plugin_prefs () +{ + ARDOUR_UI::instance()->show_plugin_prefs (); +} + +void +PluginManagerUI::edit_vst_path (ARDOUR::PluginType t) +{ + RCOptionEditor* rc_option_editor = ARDOUR_UI::instance()->get_rc_option_editor(); + if (rc_option_editor) { + switch (t) { +#ifdef WINDOWS_VST_SUPPORT + case Windows_VST: + rc_option_editor->edit_vst_path ( + _("Set Windows VST2 Search Path"), + PluginManager::instance()..get_default_windows_vst_path (), + sigc::mem_fun (*Config, &RCConfiguration::get_plugin_path_vst), + sigc::mem_fun (*Config, &RCConfiguration::set_plugin_path_vst) + ); + break; +#endif +#ifdef LXVST_SUPPORT + case LXVST: + rc_option_editor->edit_vst_path ( + _("Set Linux VST2 Search Path"), + PluginManager::instance().get_default_lxvst_path (), + sigc::mem_fun (*Config, &RCConfiguration::get_plugin_path_lxvst), + sigc::mem_fun (*Config, &RCConfiguration::set_plugin_path_lxvst) + ); + break; +#endif +#ifdef VST3_SUPPORT + case VST3: + rc_option_editor->edit_vst_path ( + _("Set Additional VST3 Search Path"), + "", /* default is blank */ + sigc::mem_fun (*Config, &RCConfiguration::get_plugin_path_vst3), + sigc::mem_fun (*Config, &RCConfiguration::set_plugin_path_vst3) + ); + break; +#endif + default: + break; + } + } +} + void PluginManagerUI::rescan_all () { diff --git a/gtk2_ardour/plugin_manager_ui.h b/gtk2_ardour/plugin_manager_ui.h index 58c37f39fd..102cf51d02 100644 --- a/gtk2_ardour/plugin_manager_ui.h +++ b/gtk2_ardour/plugin_manager_ui.h @@ -54,6 +54,8 @@ private: void rescan_faulty (); void rescan_selected (); void clear_log (); + void show_plugin_prefs (); + void edit_vst_path (ARDOUR::PluginType); void plugin_status_changed (ARDOUR::PluginType, std::string, ARDOUR::PluginManager::PluginStatusType); @@ -97,6 +99,7 @@ private: ArdourWidgets::ArdourButton _btn_rescan_err; ArdourWidgets::ArdourButton _btn_rescan_sel; ArdourWidgets::ArdourButton _btn_clear; + ArdourWidgets::ArdourButton _btn_prefs; Gtk::Table _tbl_nfo; Gtk::Table _top; diff --git a/gtk2_ardour/rc_option_editor.h b/gtk2_ardour/rc_option_editor.h index bac3d9ebea..df286cdde9 100644 --- a/gtk2_ardour/rc_option_editor.h +++ b/gtk2_ardour/rc_option_editor.h @@ -47,6 +47,7 @@ public: XMLNode& get_state (); bool on_key_release_event (GdkEventKey*); + void edit_vst_path (std::string const& title, std::string const& dflt, sigc::slot, sigc::slot); private: void parameter_changed (std::string const &); @@ -77,7 +78,6 @@ private: void clear_vst3_blacklist (); void clear_au_cache (); void clear_au_blacklist (); - void edit_vst_path (std::string const& title, std::string const& dflt, sigc::slot, sigc::slot); }; #endif /* __gtk_ardour_rc_option_editor_h__ */