summaryrefslogtreecommitdiff
path: root/libs/surfaces/push2/push2.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2016-09-21 23:06:45 -0500
committerPaul Davis <paul@linuxaudiosystems.com>2016-09-27 14:59:31 -0500
commita4cd0d7dae33e2243c75b008c77b6865ead3652c (patch)
treefe1ca45173852b22f570c9592126e291de5d4637 /libs/surfaces/push2/push2.cc
parent06683b1bda1b85febb77ab2e73c9ea0b7e8890fb (diff)
push2: set and use selected track color for root notes on pads
Diffstat (limited to 'libs/surfaces/push2/push2.cc')
-rw-r--r--libs/surfaces/push2/push2.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/libs/surfaces/push2/push2.cc b/libs/surfaces/push2/push2.cc
index 24a11be29d..8a444b8c73 100644
--- a/libs/surfaces/push2/push2.cc
+++ b/libs/surfaces/push2/push2.cc
@@ -135,6 +135,7 @@ Push2::Push2 (ARDOUR::Session& s)
, octave_shift (0)
, percussion (false)
, _pressure_mode (AfterTouch)
+ , selection_color (LED::Green)
{
build_maps ();
@@ -1315,8 +1316,8 @@ Push2::set_pad_scale (int root, int octave, MusicalMode::Type mode, bool inkey)
pad->filtered = notenum;
if ((notenum % 12) == original_root) {
- pad->set_color (LED::Green);
- pad->perma_color = LED::Green;
+ pad->set_color (selection_color);
+ pad->perma_color = selection_color;
} else {
pad->set_color (LED::White);
pad->perma_color = LED::White;
@@ -1353,8 +1354,8 @@ Push2::set_pad_scale (int root, int octave, MusicalMode::Type mode, bool inkey)
if (mode_map.find (note) != mode_map.end()) {
if ((note % 12) == original_root) {
- pad->set_color (LED::Green);
- pad->perma_color = LED::Green;
+ pad->set_color (selection_color);
+ pad->perma_color = selection_color;
} else {
pad->set_color (LED::White);
pad->perma_color = LED::White;
@@ -1472,9 +1473,13 @@ Push2::stripable_selection_change (StripableNotificationListPtr selected)
if (new_pad_target && pad_port) {
new_pad_target->input()->connect (new_pad_target->input()->nth (0), pad_port->name(), this);
current_pad_target = new_pad_target;
+ selection_color = get_color_index (new_pad_target->presentation_info().color());
} else {
current_pad_target.reset ();
+ selection_color = LED::Green;
}
+
+ reset_pad_colors ();
}
Push2::Button*