diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2016-09-23 13:56:27 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-09-27 14:59:32 -0500 |
commit | ae01ac238482311f08c706c594f7ed5717cd50ef (patch) | |
tree | 401852ed56e02931d3ed3a022187f62183b48e24 | |
parent | a9a3b71807cfb81f30a6f84482c921f1fd1f85a1 (diff) |
update pad colors when selected track colors chane
-rw-r--r-- | libs/surfaces/push2/push2.cc | 15 | ||||
-rw-r--r-- | libs/surfaces/push2/push2.h | 2 |
2 files changed, 17 insertions, 0 deletions
diff --git a/libs/surfaces/push2/push2.cc b/libs/surfaces/push2/push2.cc index ccc541296f..8f581f41da 100644 --- a/libs/surfaces/push2/push2.cc +++ b/libs/surfaces/push2/push2.cc @@ -1275,6 +1275,21 @@ Push2::pad_note (int row, int col) const } void +Push2::update_selection_color () +{ + boost::shared_ptr<MidiTrack> current_midi_track = current_pad_target.lock(); + + if (!current_midi_track) { + return; + } + + selection_color = get_color_index (current_midi_track->presentation_info().color()); + contrast_color = get_color_index (ArdourCanvas::HSV (current_midi_track->presentation_info().color()).opposite().color()); + + reset_pad_colors (); +} + +void Push2::reset_pad_colors () { set_pad_scale (_scale_root, _root_octave, _mode, _in_key); diff --git a/libs/surfaces/push2/push2.h b/libs/surfaces/push2/push2.h index 47e4ab051e..30422775d4 100644 --- a/libs/surfaces/push2/push2.h +++ b/libs/surfaces/push2/push2.h @@ -329,6 +329,8 @@ class Push2 : public ARDOUR::ControlProtocol int pad_note (int row, int col) const; PBD::Signal0<void> PadChange; + void update_selection_color (); + void set_pad_scale (int root, int octave, MusicalMode::Type mode, bool inkey); PBD::Signal0<void> ScaleChange; |