respond to changes in use-note-color-for-velocity
authorPaul Davis <paul@linuxaudiosystems.com>
Tue, 3 Jul 2018 21:02:20 +0000 (17:02 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 3 Jul 2018 21:02:20 +0000 (17:02 -0400)
gtk2_ardour/editor.cc
gtk2_ardour/note_base.cc

index 9acda77b4c40b8ad388f748b002501b63d07d1e3..ef5068a5ed2864e1a69e5bb51c956039e0605047 100644 (file)
@@ -6169,6 +6169,8 @@ Editor::ui_parameter_changed (string parameter)
        } else if (parameter == "use-note-bars-for-velocity") {
                ArdourCanvas::Note::set_show_velocity_bars (UIConfiguration::instance().get_use_note_bars_for_velocity());
                _track_canvas->request_redraw (_track_canvas->visible_area());
+       } else if (parameter == "use-note-color-for-velocity") {
+               UIConfiguration::instance().ColorsChanged(); /* EMIT SIGNAL */
        }
 }
 
index 283910d1c86e9c4ed8e3ca1351b761640b2c4c2a..afc72551a186f2b75f243e24fbc798ee01a204a7 100644 (file)
@@ -201,7 +201,13 @@ NoteBase::base_color()
                                          _selected_col, 0.5);
 
        default:
-               return meter_style_fill_color(_note->velocity(), selected());
+               if (UIConfiguration::instance().get_use_note_color_for_velocity()) {
+                       return meter_style_fill_color(_note->velocity(), selected());
+               } else {
+                       const uint32_t region_color = _region.midi_stream_view()->get_region_color();
+                       return UINT_INTERPOLATE (UINT_RGBA_CHANGE_A (region_color, opacity), _selected_col,
+                                                0.5);
+               }
        };
 
        return 0;