summaryrefslogtreecommitdiff
path: root/gtk2_ardour/rc_option_editor.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2014-02-26 17:55:06 +0100
committerRobin Gareus <robin@gareus.org>2014-02-26 18:07:46 +0100
commit4aaae2eb3ba65f97e173b1751e1ee3bec8925ed5 (patch)
treea7d84646922ddc6c8fda48b94ac2964e1bcde004 /gtk2_ardour/rc_option_editor.cc
parentd5a780f46209013e0b62f79a3a607768355bd2e1 (diff)
user-configurable VST search paths (basic UI)
Diffstat (limited to 'gtk2_ardour/rc_option_editor.cc')
-rw-r--r--gtk2_ardour/rc_option_editor.cc82
1 files changed, 71 insertions, 11 deletions
diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc
index 0331597fac..d033bfdaf4 100644
--- a/gtk2_ardour/rc_option_editor.cc
+++ b/gtk2_ardour/rc_option_editor.cc
@@ -47,6 +47,7 @@
#include "ardour_dialog.h"
#include "gui_thread.h"
#include "midi_tracer.h"
+#include "paths_dialog.h"
#include "rc_option_editor.h"
#include "utils.h"
#include "midi_port_dialog.h"
@@ -996,37 +997,68 @@ private:
class PluginOptions : public OptionEditorBox
{
public:
- PluginOptions (RCConfiguration* c)
+ PluginOptions (Session *s, RCConfiguration* c)
: _rc_config (c)
+ , _session(s)
, _display_plugin_scan_progress (_("Display Plugin Scan Progress"))
- , _discover_vst_on_start (_("Scan for new VST Plugin on Application Start"))
+ , _discover_vst_on_start (_("Scan for new VST Plugins on Application Start"))
{
+ Label *l;
+ std::stringstream ss;
Table* t = manage (new Table (2, 6));
t->set_spacings (4);
Button* b;
+ int n = 0;
+
+ ss << "<b>" << _("General") << "</b>";
+ l = manage (left_aligned_label (ss.str()));
+ l->set_use_markup (true);
+ t->attach (*manage (new Label ("")), 0, 3, n, n+1, FILL | EXPAND); ++n;
+ t->attach (*l, 0, 2, n, n+1, FILL | EXPAND); ++n;
b = manage (new Button (_("Refresh Plugin List")));
b->signal_clicked().connect (sigc::mem_fun (*this, &PluginOptions::refresh_clicked));
- t->attach (*b, 0, 2, 0, 1, FILL);
+ t->attach (*b, 0, 2, n, n+1, FILL); ++n;
+
+ t->attach (_display_plugin_scan_progress, 0, 2, n, n+1); ++n;
+ _display_plugin_scan_progress.signal_toggled().connect (sigc::mem_fun (*this, &PluginOptions::display_plugin_scan_progress_toggled));
+ Gtkmm2ext::UI::instance()->set_tip (_display_plugin_scan_progress,
+ _("<b>When enabled</b> display a popup window showing plugin scan progress."));
+
+
+ ss << "<b>" << _("VST") << "</b>";
+ l = manage (left_aligned_label (ss.str()));
+ l->set_use_markup (true);
+ t->attach (*manage (new Label ("")), 0, 3, n, n+1, FILL | EXPAND); ++n;
+ t->attach (*l, 0, 2, n, n+1, FILL | EXPAND); ++n;
b = manage (new Button (_("Clear VST Cache")));
b->signal_clicked().connect (sigc::mem_fun (*this, &PluginOptions::clear_vst_cache_clicked));
- t->attach (*b, 0, 2, 1, 2, FILL);
+ t->attach (*b, 0, 1, n, n+1, FILL);
b = manage (new Button (_("Clear VST Blacklist")));
b->signal_clicked().connect (sigc::mem_fun (*this, &PluginOptions::clear_vst_blacklist_clicked));
- t->attach (*b, 0, 2, 2, 3, FILL);
+ t->attach (*b, 1, 2, n, n+1, FILL);
+ ++n;
- t->attach (_discover_vst_on_start, 0, 2, 3, 4);
+ t->attach (_discover_vst_on_start, 0, 2, n, n+1); ++n;
_discover_vst_on_start.signal_toggled().connect (sigc::mem_fun (*this, &PluginOptions::discover_vst_on_start_toggled));
Gtkmm2ext::UI::instance()->set_tip (_discover_vst_on_start,
_("<b>When enabled</b> VST plugins are searched and tested on application start. When disabled they a Refresh will have to be tiggered manually"));
- t->attach (_display_plugin_scan_progress, 0, 2, 4, 5);
- _display_plugin_scan_progress.signal_toggled().connect (sigc::mem_fun (*this, &PluginOptions::display_plugin_scan_progress_toggled));
- Gtkmm2ext::UI::instance()->set_tip (_display_plugin_scan_progress,
- _("<b>When enabled</b> display a popup window showing plugin scan progress."));
+#ifdef WINDOWS_VST_SUPPORT
+ t->attach (*manage (left_aligned_label (_("Windows VST Path:"))), 0, 1, n, n+1);
+ b = manage (new Button (_("Edit")));
+ b->signal_clicked().connect (sigc::mem_fun (*this, &PluginOptions::edit_vst_path_clicked));
+ t->attach (*b, 1, 2, n, n+1, FILL); ++n;
+#endif
+#ifdef LXVST_SUPPORT
+ t->attach (*manage (left_aligned_label (_("Linux VST:"))), 0, 1, n, n+1);
+ b = manage (new Button (_("Edit")));
+ b->signal_clicked().connect (sigc::mem_fun (*this, &PluginOptions::edit_lxvst_path_clicked));
+ t->attach (*b, 1, 2, n, n+1, FILL); ++n;
+#endif
_box->pack_start (*t,true,true);
}
@@ -1049,6 +1081,7 @@ public:
private:
RCConfiguration* _rc_config;
+ Session* _session;
CheckButton _display_plugin_scan_progress;
CheckButton _discover_vst_on_start;
@@ -1070,6 +1103,33 @@ private:
PluginManager::instance().clear_vst_blacklist();
}
+ void edit_vst_path_clicked () {
+ PathsDialog *pd = new PathsDialog(_session,
+ _rc_config->get_plugin_path_vst(),
+ PluginManager::instance().get_windows_vst_path()
+ );
+ ResponseType r = (ResponseType) pd->run ();
+ pd->hide();
+ if (r == RESPONSE_ACCEPT) {
+ _rc_config->set_plugin_path_vst(pd->get_serialized_paths());
+ }
+ delete pd;
+ }
+
+ // todo consolidate with edit_vst_path_clicked..
+ void edit_lxvst_path_clicked () {
+ PathsDialog *pd = new PathsDialog(_session,
+ _rc_config->get_plugin_path_lxvst(),
+ PluginManager::instance().get_lxvst_path()
+ );
+ ResponseType r = (ResponseType) pd->run ();
+ pd->hide();
+ if (r == RESPONSE_ACCEPT) {
+ printf("%s", pd->get_serialized_paths().c_str());
+ }
+ delete pd;
+ }
+
void refresh_clicked () {
PluginManager::instance().refresh();
}
@@ -2014,7 +2074,7 @@ RCOptionEditor::RCOptionEditor ()
#if (defined WINDOWS_VST_SUPPORT || defined LXVST_SUPPORT)
/* Plugin options (currrently VST only) */
- add_option (_("Plugin"), new PluginOptions (_rc_config));
+ add_option (_("Plugins"), new PluginOptions (_session, _rc_config));
#endif
/* INTERFACE */