update pad colors when selected track colors chane
authorPaul Davis <paul@linuxaudiosystems.com>
Fri, 23 Sep 2016 18:56:27 +0000 (13:56 -0500)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 27 Sep 2016 19:59:32 +0000 (14:59 -0500)
libs/surfaces/push2/push2.cc
libs/surfaces/push2/push2.h

index ccc541296f0eb0dd4e64f08cba159b6781787625..8f581f41da2178788e86d8e679512bf70fa0b95c 100644 (file)
@@ -1274,6 +1274,21 @@ Push2::pad_note (int row, int col) const
        return 0;
 }
 
        return 0;
 }
 
+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 ()
 {
 void
 Push2::reset_pad_colors ()
 {
index 47e4ab051e69e9598e951b66b26477ea94dc6481..30422775d45751e18908656ae4bd1794421d5080 100644 (file)
@@ -329,6 +329,8 @@ class Push2 : public ARDOUR::ControlProtocol
        int pad_note (int row, int col) const;
        PBD::Signal0<void> PadChange;
 
        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;
 
        void set_pad_scale (int root, int octave, MusicalMode::Type mode, bool inkey);
        PBD::Signal0<void> ScaleChange;