summaryrefslogtreecommitdiff
path: root/gtk2_ardour/note_base.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2018-07-05 14:56:56 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2018-07-05 14:56:56 -0400
commit44c40bc06529c4c1b6a3dca6fec96f1515f19fc9 (patch)
tree7ed050f78ca4d4355557601a866da5cb7a0c6957 /gtk2_ardour/note_base.cc
parentb4b2fbb6edc4874375a7e1d14b625557fd4c9ce6 (diff)
use MIDI meter colors (themeable) to show MIDI note velocity.
Selected notes no longer show the selected color for fill, following Alex Mitchell's proof-of-concept patch that showed it was easier to see what you're doing when the fill color shows velocity and we just use outline for selection status.
Diffstat (limited to 'gtk2_ardour/note_base.cc')
-rw-r--r--gtk2_ardour/note_base.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/gtk2_ardour/note_base.cc b/gtk2_ardour/note_base.cc
index afc72551a1..52ee88a2d6 100644
--- a/gtk2_ardour/note_base.cc
+++ b/gtk2_ardour/note_base.cc
@@ -330,3 +330,21 @@ NoteBase::big_enough_to_trim () const
return (x1() - x0()) > 10;
}
+
+uint32_t
+NoteBase::meter_style_fill_color(uint8_t vel, bool selected)
+{
+ if (vel < 32) {
+ return UINT_INTERPOLATE(UIConfiguration::instance().color ("midi meter color0"), UIConfiguration::instance().color ("midi meter color1"), (vel / 32.0));
+ } else if (vel < 64) {
+ return UINT_INTERPOLATE(UIConfiguration::instance().color ("midi meter color2"), UIConfiguration::instance().color ("midi meter color3"), ((vel-32) / 32.0));
+ } else if (vel < 100) {
+ return UINT_INTERPOLATE(UIConfiguration::instance().color ("midi meter color4"), UIConfiguration::instance().color ("midi meter color5"), ((vel-64) / 32.0));
+ } else if (vel < 112) {
+ return UINT_INTERPOLATE(UIConfiguration::instance().color ("midi meter color6"), UIConfiguration::instance().color ("midi meter color7"), ((vel-100) / 36.0));
+ } else {
+ return UINT_INTERPOLATE(UIConfiguration::instance().color ("midi meter color8"), UIConfiguration::instance().color ("midi meter color9"), ((vel-112) / 17.0));
+ }
+}
+
+