From 2fa4eadf8e7a6f60d122f50003ff54ad6a0d6e02 Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Tue, 25 Jan 2022 07:20:15 -0600 Subject: [PATCH] trigger_ui: cue_isolate deserves a button, not just a menu entry --- gtk2_ardour/slot_properties_box.cc | 32 ++++++++++++++++++++++++++++++ gtk2_ardour/slot_properties_box.h | 5 +++++ 2 files changed, 37 insertions(+) diff --git a/gtk2_ardour/slot_properties_box.cc b/gtk2_ardour/slot_properties_box.cc index e7604ef84c..aca9e679c4 100644 --- a/gtk2_ardour/slot_properties_box.cc +++ b/gtk2_ardour/slot_properties_box.cc @@ -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())); } diff --git a/gtk2_ardour/slot_properties_box.h b/gtk2_ardour/slot_properties_box.h index 40fc3dd4aa..d2b1028d12 100644 --- a/gtk2_ardour/slot_properties_box.h +++ b/gtk2_ardour/slot_properties_box.h @@ -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*);