13
0

trigger_ui: cue_isolate deserves a button, not just a menu entry

This commit is contained in:
Ben Loftis 2022-01-25 07:20:15 -06:00
parent 0cf0de8c97
commit 2fa4eadf8e
2 changed files with 37 additions and 0 deletions

View File

@ -115,6 +115,7 @@ SlotPropertyTable::SlotPropertyTable ()
, _follow_length_adjustment (1, 1, 128, 1, 4)
, _follow_length_spinner (_follow_length_adjustment)
, _legato_button (ArdourButton::led_default_elements)
, _isolate_button (ArdourButton::led_default_elements)
, _ignore_changes(false)
{
@ -178,9 +179,13 @@ SlotPropertyTable::SlotPropertyTable ()
_launch_style_button.AddMenuElem (MenuElem (launch_style_to_string (Trigger::Repeat), sigc::bind (sigc::mem_fun (*this, &SlotPropertyTable::set_launch_style), Trigger::Repeat)));
_launch_style_button.set_name("FollowAction");
_legato_button.set_text (_("Legato"));
_legato_button.signal_event().connect (sigc::mem_fun (*this, (&SlotPropertyTable::legato_button_event)));
_isolate_button.set_text (_("Isolate"));
_isolate_button.signal_event().connect (sigc::mem_fun (*this, (&SlotPropertyTable::isolate_button_event)));
#define quantize_item(b) _quantize_button.AddMenuElem (MenuElem (quantize_length_to_string (b), sigc::bind (sigc::mem_fun (*this, &SlotPropertyTable::set_quantize), b)));
#if TRIGGER_PAGE_GLOBAL_QUANTIZATION_IMPLEMENTED
@ -283,6 +288,10 @@ SlotPropertyTable::SlotPropertyTable ()
_launch_table.attach(_legato_label, 0, 1, row, row+1, Gtk::FILL, Gtk::SHRINK );
_launch_table.attach(_legato_button, 1, 3, row, row+1, Gtk::FILL, Gtk::SHRINK ); row++;
_isolate_label.set_text(_("Cue Isolate:")); _isolate_label.set_alignment(1.0, 0.5);
_launch_table.attach(_isolate_label, 0, 1, row, row+1, Gtk::FILL, Gtk::SHRINK );
_launch_table.attach(_isolate_button, 1, 3, row, row+1, Gtk::FILL, Gtk::SHRINK ); row++;
/* ---- Follow settings ----- */
_follow_table.set_spacings (2);
@ -466,6 +475,25 @@ SlotPropertyTable::legato_button_event (GdkEvent* ev)
return false;
}
bool
SlotPropertyTable::isolate_button_event (GdkEvent* ev)
{
if (_ignore_changes) {
return false;
}
switch (ev->type) {
case GDK_BUTTON_PRESS:
trigger()->set_scene_isolated (!trigger()->scene_isolated());
return true;
default:
break;
}
return false;
}
void
SlotPropertyTable::set_launch_style (Trigger::LaunchStyle ls)
{
@ -539,6 +567,10 @@ SlotPropertyTable::on_trigger_changed (PropertyChange const& pc)
_legato_button.set_active_state (trigger()->legato() ? Gtkmm2ext::ExplicitActive : Gtkmm2ext::Off);
}
if (pc.contains (Properties::isolated)) {
_isolate_button.set_active_state (trigger()->scene_isolated() ? Gtkmm2ext::ExplicitActive : Gtkmm2ext::Off);
}
if (pc.contains (Properties::launch_style)) {
_launch_style_button.set_active (launch_style_to_string (trigger()->launch_style()));
}

View File

@ -100,9 +100,12 @@ class SlotPropertyTable : public TriggerUI, public Gtk::Table
Gtk::Label _launch_style_label;
Gtk::Label _launch_quant_label;
Gtk::Label _legato_label;
Gtk::Label _isolate_label;
ArdourWidgets::ArdourButton _legato_button;
ArdourWidgets::ArdourButton _isolate_button;
ArdourWidgets::ArdourDropdown _quantize_button;
ArdourWidgets::ArdourDropdown _launch_style_button;
@ -116,6 +119,8 @@ class SlotPropertyTable : public TriggerUI, public Gtk::Table
bool legato_button_event (GdkEvent*);
void follow_count_event ();
bool isolate_button_event (GdkEvent*);
void gain_change_event ();
bool use_follow_length_event (GdkEvent*);