From 34c0e3f1c826e5e04064ec29e5670e11f8538889 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 2 Jul 2017 02:06:48 +0200 Subject: FP8: plugin GUI display options --- libs/surfaces/faderport8/actions.cc | 17 ++++++++++++++--- libs/surfaces/faderport8/faderport8.cc | 11 +++++++++++ libs/surfaces/faderport8/faderport8.h | 4 ++++ libs/surfaces/faderport8/gui.cc | 26 +++++++++++++++++++------- libs/surfaces/faderport8/gui.h | 4 +++- 5 files changed, 51 insertions(+), 11 deletions(-) (limited to 'libs/surfaces') diff --git a/libs/surfaces/faderport8/actions.cc b/libs/surfaces/faderport8/actions.cc index 85fd106d69..f0a3289b10 100644 --- a/libs/surfaces/faderport8/actions.cc +++ b/libs/surfaces/faderport8/actions.cc @@ -96,12 +96,12 @@ FaderPort8::setup_actions () BindMethod (BtnBypass, button_bypass); - BindAction (BtnBypassAll, "Mixer", "ab-plugins"); // XXX + BindAction (BtnBypassAll, "Mixer", "ab-plugins"); BindAction (BtnMacro, "Mixer", "show-editor"); BindAction (BtnLink, "Window", "show-mixer"); - BindAction (BtnOpen, "Common", "addExistingAudioFiles"); + BindMethod (BtnOpen, button_open); BindAction (BtnLock, "Editor", "lock"); // user-specific @@ -168,6 +168,17 @@ FaderPort8::button_bypass () } } +void +FaderPort8::button_open () +{ + boost::shared_ptr pi = _plugin_insert.lock(); + if (pi) { + pi->ToggleUI (); /* EMIT SIGNAL */ + } else { + AccessAction ("Common", "addExistingAudioFiles"); + } +} + void FaderPort8::button_automation (ARDOUR::AutoState as) { @@ -585,7 +596,7 @@ FaderPort8::encoder_parameter (bool neg, int steps) case ModePlugins: case ModeSend: while (steps > 0) { - bank_param (neg, false); + bank_param (neg, shift_mod()); --steps; } break; diff --git a/libs/surfaces/faderport8/faderport8.cc b/libs/surfaces/faderport8/faderport8.cc index 77a4556b15..bac6f13e03 100644 --- a/libs/surfaces/faderport8/faderport8.cc +++ b/libs/surfaces/faderport8/faderport8.cc @@ -103,6 +103,7 @@ FaderPort8::FaderPort8 (Session& s) , _clock_mode (1) , _scribble_mode (2) , _two_line_text (false) + , _auto_pluginui (true) { boost::shared_ptr inp; boost::shared_ptr outp; @@ -1224,6 +1225,10 @@ FaderPort8::select_plugin (int num) plugin->PresetRemoved.connect (processor_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort8::preset_changed, this), this); plugin->PresetLoaded.connect (processor_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort8::preset_changed, this), this); plugin->PresetDirty.connect (processor_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort8::preset_changed, this), this); + + if (_auto_pluginui) { + pi->ShowUI (); /* EMIT SIGNAL */ + } } // switching to "Mode Track" -> calls FaderPort8::notify_fader_mode_changed() @@ -1538,6 +1543,12 @@ void FaderPort8::drop_ctrl_connections () { _proc_params.clear(); + if (_auto_pluginui) { + boost::shared_ptr pi = _plugin_insert.lock (); + if (pi) { + pi->HideUI (); /* EMIT SIGNAL */ + } + } _plugin_insert.reset (); _show_presets = false; processor_connections.drop_connections (); diff --git a/libs/surfaces/faderport8/faderport8.h b/libs/surfaces/faderport8/faderport8.h index 70dcfb8790..81f615835a 100644 --- a/libs/surfaces/faderport8/faderport8.h +++ b/libs/surfaces/faderport8/faderport8.h @@ -91,10 +91,12 @@ public: void set_clock_mode (uint32_t m) { _clock_mode = m; } void set_scribble_mode (uint32_t m) { _scribble_mode = m; } void set_two_line_text (bool yn) { _two_line_text = yn; } + void set_auto_pluginui (bool yn) { _auto_pluginui = yn; } uint32_t clock_mode () const { return _clock_mode; } uint32_t scribble_mode () const { return _scribble_mode; } bool twolinetext () const { return _two_line_text; } + bool auto_pluginui () const { return _auto_pluginui; } int stop (); void do_request (FaderPort8Request*); @@ -268,6 +270,7 @@ private: void button_loop (); void button_metronom (); void button_bypass (); + void button_open (); void button_varispeed (bool); #ifdef FP8_MUTESOLO_UNDO void button_solo_clear (); @@ -294,6 +297,7 @@ private: uint32_t _clock_mode; uint32_t _scribble_mode; bool _two_line_text; + bool _auto_pluginui; /* user bound actions */ void button_user (bool, FP8Controls::ButtonId); diff --git a/libs/surfaces/faderport8/gui.cc b/libs/surfaces/faderport8/gui.cc index 19edafde92..3a620d3607 100644 --- a/libs/surfaces/faderport8/gui.cc +++ b/libs/surfaces/faderport8/gui.cc @@ -82,7 +82,8 @@ FP8GUI::FP8GUI (FaderPort8& p) : fp (p) , table (2, 3) , ignore_active_change (false) - , two_line_text (_("Two Line Trackname")) + , two_line_text_cb (_("Two Line Trackname")) + , auto_pluginui_cb (_("Auto Show/Hide Plugin GUIs")) { set_border_width (12); @@ -115,7 +116,8 @@ FP8GUI::FP8GUI (FaderPort8& p) clock_combo.signal_changed().connect (sigc::mem_fun (*this, &FP8GUI::clock_mode_changed)); scribble_combo.signal_changed().connect (sigc::mem_fun (*this, &FP8GUI::scribble_mode_changed)); - two_line_text.signal_toggled().connect(sigc::mem_fun (*this, &FP8GUI::twolinetext_toggled)); + two_line_text_cb.signal_toggled().connect(sigc::mem_fun (*this, &FP8GUI::twolinetext_toggled)); + auto_pluginui_cb.signal_toggled().connect(sigc::mem_fun (*this, &FP8GUI::auto_pluginui_toggled)); l = manage (new Gtk::Label); l->set_markup (string_compose ("%1", _("Incoming MIDI on:"))); @@ -179,16 +181,18 @@ FP8GUI::FP8GUI (FaderPort8& p) l->set_markup (string_compose ("%1", _("Clock:"))); l->set_alignment (1.0, 0.5); table.attach (*l, 0, 1, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions(0)); - table.attach (clock_combo, 1, 5, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0); + table.attach (clock_combo, 1, 4, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0); - table.attach (two_line_text, 5, 8, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0); + table.attach (two_line_text_cb, 4, 8, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0); row++; l = manage (new Gtk::Label); l->set_markup (string_compose ("%1", _("Display:"))); l->set_alignment (1.0, 0.5); table.attach (*l, 0, 1, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions(0)); - table.attach (scribble_combo, 1, 5, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0); + table.attach (scribble_combo, 1, 4, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0); + + table.attach (auto_pluginui_cb, 4, 8, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0); row++; /* update the port connection combos */ @@ -527,7 +531,8 @@ FP8GUI::update_prefs_combos () scribble_combo.set_active_text (_("Meter + Pan")); break; } - two_line_text.set_active (fp.twolinetext ()); + two_line_text_cb.set_active (fp.twolinetext ()); + auto_pluginui_cb.set_active (fp.auto_pluginui ()); } void @@ -561,5 +566,12 @@ FP8GUI::scribble_mode_changed () void FP8GUI::twolinetext_toggled () { - fp.set_two_line_text (two_line_text.get_active ()); + fp.set_two_line_text (two_line_text_cb.get_active ()); +} + + +void +FP8GUI::auto_pluginui_toggled () +{ + fp.set_auto_pluginui (auto_pluginui_cb.get_active ()); } diff --git a/libs/surfaces/faderport8/gui.h b/libs/surfaces/faderport8/gui.h index 2ee51645f2..58d8a2dfce 100644 --- a/libs/surfaces/faderport8/gui.h +++ b/libs/surfaces/faderport8/gui.h @@ -77,13 +77,15 @@ private: /* misc Prefs */ Gtk::ComboBoxText clock_combo; Gtk::ComboBoxText scribble_combo; - Gtk::CheckButton two_line_text; + Gtk::CheckButton two_line_text_cb; + Gtk::CheckButton auto_pluginui_cb; void build_prefs_combos (); void update_prefs_combos (); void clock_mode_changed (); void scribble_mode_changed (); void twolinetext_toggled (); + void auto_pluginui_toggled (); /* user actions */ void build_available_action_menu (); -- cgit v1.2.3