FP8: plugin GUI display options

This commit is contained in:
Robin Gareus 2017-07-02 02:06:48 +02:00
parent 496f83bf83
commit 34c0e3f1c8
5 changed files with 51 additions and 11 deletions

View File

@ -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<PluginInsert> 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;

View File

@ -103,6 +103,7 @@ FaderPort8::FaderPort8 (Session& s)
, _clock_mode (1)
, _scribble_mode (2)
, _two_line_text (false)
, _auto_pluginui (true)
{
boost::shared_ptr<ARDOUR::Port> inp;
boost::shared_ptr<ARDOUR::Port> 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<PluginInsert> pi = _plugin_insert.lock ();
if (pi) {
pi->HideUI (); /* EMIT SIGNAL */
}
}
_plugin_insert.reset ();
_show_presets = false;
processor_connections.drop_connections ();

View File

@ -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);

View File

@ -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 ("<span weight=\"bold\">%1</span>", _("Incoming MIDI on:")));
@ -179,16 +181,18 @@ FP8GUI::FP8GUI (FaderPort8& p)
l->set_markup (string_compose ("<span weight=\"bold\">%1</span>", _("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 ("<span weight=\"bold\">%1</span>", _("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 ());
}

View File

@ -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 ();