diff options
author | nick_m <mainsbridge@gmail.com> | 2016-06-18 23:24:05 +1000 |
---|---|---|
committer | nick_m <mainsbridge@gmail.com> | 2016-07-10 02:18:36 +1000 |
commit | 0e63fa65b5bf96040e752386083f80403042a6e6 (patch) | |
tree | 3a250d21abe924e613be947b739af396cb6facca /gtk2_ardour/midi_region_view.cc | |
parent | 93c24e4433d69fe1de28d4d2ed2045aa7cb3596b (diff) |
Remove frame conversion for MidiRegionView::note_in_region_range(), speed up tempo dilation
Diffstat (limited to 'gtk2_ardour/midi_region_view.cc')
-rw-r--r-- | gtk2_ardour/midi_region_view.cc | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index 5c460cdf48..fea3857a90 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -1670,12 +1670,9 @@ 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()); - const bool outside = ((note_start_frames <= -tick_frames) || - (note_start_frames >= _region->length())); + const boost::shared_ptr<ARDOUR::MidiRegion> midi_reg = midi_region(); + const bool outside = (note->time() < midi_reg->start_beats() || + note->time() > midi_reg->start_beats() + midi_reg->length_beats()); visible = (note->note() >= midi_stream_view()->lowest_note()) && (note->note() <= midi_stream_view()->highest_note()); |