From 67e415e14ca8cbd07da02d5ac5f82fa8e24d0fea Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 28 Sep 2016 11:28:38 -0500 Subject: [PATCH] make Ben's cool range select hack work with Push 2 --- libs/surfaces/push2/buttons.cc | 11 +++++++++++ libs/surfaces/push2/push2.cc | 1 + libs/surfaces/push2/push2.h | 2 ++ 3 files changed, 14 insertions(+) diff --git a/libs/surfaces/push2/buttons.cc b/libs/surfaces/push2/buttons.cc index 43e4255f01..097e3debb5 100644 --- a/libs/surfaces/push2/buttons.cc +++ b/libs/surfaces/push2/buttons.cc @@ -364,6 +364,17 @@ Push2::button_play () return; } + if (_modifier_state & ModSelect) { + if (in_range_select) { + in_range_select = true; + access_action ("Editor/start-range-from-playhead"); + } else { + access_action ("Editor/finish-range-from-playhead"); + in_range_select = false; + } + return; + } + if (session->transport_rolling ()) { transport_stop (); } else { diff --git a/libs/surfaces/push2/push2.cc b/libs/surfaces/push2/push2.cc index 57160abee3..eb39562153 100644 --- a/libs/surfaces/push2/push2.cc +++ b/libs/surfaces/push2/push2.cc @@ -104,6 +104,7 @@ Push2::Push2 (ARDOUR::Session& s) , _pressure_mode (AfterTouch) , selection_color (LED::Green) , contrast_color (LED::Green) + , in_range_select (false) { build_maps (); diff --git a/libs/surfaces/push2/push2.h b/libs/surfaces/push2/push2.h index 2d4f17417e..ab98b92445 100644 --- a/libs/surfaces/push2/push2.h +++ b/libs/surfaces/push2/push2.h @@ -599,6 +599,8 @@ class Push2 : public ARDOUR::ControlProtocol uint8_t selection_color; uint8_t contrast_color; + + bool in_range_select; }; } /* namespace */