diff options
author | Tim Mayberry <mojofunk@gmail.com> | 2016-02-10 22:55:37 +1000 |
---|---|---|
committer | Tim Mayberry <mojofunk@gmail.com> | 2016-02-11 08:17:18 +1000 |
commit | 90e35c7143b09669497370df33b8056275cede22 (patch) | |
tree | bea9746d986204d18c47373bdff27410d65fa299 /gtk2_ardour/midi_region_view.cc | |
parent | 2b42dc13fd60739727199f4dc9ed61e1a4a97912 (diff) |
Fix bug #6762, MIDNAM note read outs don't work when dragging MIDI note
Also fixes it so the key is selected in the piano roll header
Diffstat (limited to 'gtk2_ardour/midi_region_view.cc')
-rw-r--r-- | gtk2_ardour/midi_region_view.cc | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index c62686170a..0b13c3ff4e 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -3997,11 +3997,10 @@ MidiRegionView::delete_sysex (SysEx* /*sysex*/) // display_sysexes(); } -void -MidiRegionView::show_verbose_cursor (boost::shared_ptr<NoteType> n) const +std::string +MidiRegionView::get_note_name (boost::shared_ptr<NoteType> n, uint8_t note_value) const { using namespace MIDI::Name; - std::string name; MidiTimeAxisView* mtv = dynamic_cast<MidiTimeAxisView*>(&trackview); @@ -4014,19 +4013,36 @@ MidiRegionView::show_verbose_cursor (boost::shared_ptr<NoteType> n) const n->channel(), patch_key.bank(), patch_key.program(), - n->note()); + note_value); } - mtv->set_note_highlight (n->note()); } char buf[128]; snprintf (buf, sizeof (buf), "%d %s\nCh %d Vel %d", - (int) n->note (), - name.empty() ? Evoral::midi_note_name (n->note()).c_str() : name.c_str(), + (int) note_value, + name.empty() ? Evoral::midi_note_name (note_value).c_str() : name.c_str(), (int) n->channel() + 1, (int) n->velocity()); - show_verbose_cursor(buf, 10, 20); + return buf; +} + +void +MidiRegionView::show_verbose_cursor_for_new_note_value(boost::shared_ptr<NoteType> current_note, + uint8_t new_value) const +{ + MidiTimeAxisView* mtv = dynamic_cast<MidiTimeAxisView*>(&trackview); + if (mtv) { + mtv->set_note_highlight (new_value); + } + + show_verbose_cursor(get_note_name(current_note, new_value), 10, 20); +} + +void +MidiRegionView::show_verbose_cursor (boost::shared_ptr<NoteType> n) const +{ + show_verbose_cursor_for_new_note_value(n, n->note()); } void |