diff options
author | David Robillard <d@drobilla.net> | 2015-01-16 14:52:40 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2015-01-16 14:52:40 -0500 |
commit | 85654707973efeb9af0b37b0e14fec90284989fd (patch) | |
tree | 7ff5a04adf29a3ce5abc2167d6591713b954525e /gtk2_ardour/midi_region_view.cc | |
parent | ade1c4923ca58a56c5160826253091f67f03fd2f (diff) |
Fix hidden notes at trimmed region start.
Diffstat (limited to 'gtk2_ardour/midi_region_view.cc')
-rw-r--r-- | gtk2_ardour/midi_region_view.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index b64c116b3f..ad7b618f5d 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -1657,8 +1657,12 @@ MidiRegionView::start_playing_midi_chord (vector<boost::shared_ptr<NoteType> > n bool MidiRegionView::note_in_region_range (const boost::shared_ptr<NoteType> note, bool& visible) const { + /* This is imprecise due to all the conversion conversion involved, so only + hide notes if they seem to start more than one tick before the start. */ + const framecnt_t tick_frames = Evoral::Beats::tick().to_ticks(trackview.session()->frame_rate()); const framepos_t note_start_frames = source_beats_to_region_frames (note->time()); - bool outside = (note_start_frames < 0) || (note_start_frames > _region->last_frame()); + const bool outside = ((note_start_frames <= -tick_frames) || + (note_start_frames > _region->last_frame())); visible = (note->note() >= midi_stream_view()->lowest_note()) && (note->note() <= midi_stream_view()->highest_note()); |