diff options
author | nick_m <mainsbridge@gmail.com> | 2016-11-23 08:04:14 +1100 |
---|---|---|
committer | nick_m <mainsbridge@gmail.com> | 2016-11-23 08:04:14 +1100 |
commit | fcad5a337fd4a7119fdd213ddb1df8eeb6a42bf4 (patch) | |
tree | dde1db3c23255f35a078ae796b7788b0802d4315 /gtk2_ardour/midi_region_view.h | |
parent | cef341631b55526e4b2bad940064491922c07701 (diff) |
decouple midi region note range and height from midi streamview.
- this allows a midi region drag to update the visible notes
correctly while crossing MIDI streamviews with a differing
note range.
as a side effect, fixes a bug where changing
note range on a track did not draw some notes
(apply_note_range redisplays the model).
Diffstat (limited to 'gtk2_ardour/midi_region_view.h')
-rw-r--r-- | gtk2_ardour/midi_region_view.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gtk2_ardour/midi_region_view.h b/gtk2_ardour/midi_region_view.h index 9c85401593..93ce1e5011 100644 --- a/gtk2_ardour/midi_region_view.h +++ b/gtk2_ardour/midi_region_view.h @@ -355,6 +355,7 @@ private: friend class MidiRubberbandSelectDrag; friend class MidiVerticalSelectDrag; + friend class NoteDrag; friend class NoteCreateDrag; friend class HitCreateDrag; @@ -519,6 +520,13 @@ private: ARDOUR::ChannelMode get_channel_mode() const; uint16_t get_selected_channels () const; + + inline double contents_height() const { return (_height - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 2); } + inline double contents_note_range () const { return (double)(_current_range_max - _current_range_min + 1); } + inline double note_height() const { return contents_height() / contents_note_range(); } + + double note_to_y (uint8_t note) const; + uint8_t y_to_note (double y) const; }; |