diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2011-12-26 17:01:31 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2011-12-26 17:01:31 +0000 |
commit | 5558b3cf06b98060438d1e68c8d5d2f4a9c2f8f6 (patch) | |
tree | f760d3daccb5e4fdafe73c013a1c8bc11684a015 /libs/ardour/midi_diskstream.cc | |
parent | bda0f938fbf640ad60b6f1d3bc7ed18bcb2a0c2b (diff) |
a grab bag of changes correcting and improving the way MIDI note on/off tracking is done. may/should fix a number of problem with spurious note-offs under a variety of circumstances
git-svn-id: svn://localhost/ardour2/branches/3.0@11074 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/midi_diskstream.cc')
-rw-r--r-- | libs/ardour/midi_diskstream.cc | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/libs/ardour/midi_diskstream.cc b/libs/ardour/midi_diskstream.cc index c1d391fa4a..e3d7014457 100644 --- a/libs/ardour/midi_diskstream.cc +++ b/libs/ardour/midi_diskstream.cc @@ -737,16 +737,16 @@ MidiDiskstream::read (framepos_t& start, framecnt_t dur, bool reversed) start = loop_start + ((start - loop_start) % loop_length); //cerr << "to " << start << endl; } - //cerr << "start is " << start << " loopstart: " << loop_start << " loopend: " << loop_end << endl; + // cerr << "start is " << start << " loopstart: " << loop_start << " loopend: " << loop_end << endl; } while (dur) { /* take any loop into account. we can't read past the end of the loop. */ - if (loc && (loop_end - start < dur)) { + if (loc && (loop_end - start <= dur)) { this_read = loop_end - start; - //cerr << "reloop true: thisread: " << this_read << " dur: " << dur << endl; + // cerr << "reloop true: thisread: " << this_read << " dur: " << dur << endl; reloop = true; } else { reloop = false; @@ -1102,9 +1102,7 @@ MidiDiskstream::transport_stopped_wallclock (struct tm& /*when*/, time_t /*twhen no_capture_stuff_to_do: - if (_playlist) { - midi_playlist()->clear_note_trackers (); - } + reset_tracker (); } void @@ -1134,6 +1132,10 @@ MidiDiskstream::transport_looped (framepos_t transport_frame) last_recordable_frame = max_framepos; was_recording = true; } + + if (!Config->get_seamless_loop()) { + reset_tracker (); + } } void @@ -1477,3 +1479,15 @@ MidiDiskstream::get_gui_feed_buffer () const b->copy (_gui_feed_buffer); return b; } + +void +MidiDiskstream::reset_tracker () +{ + _playback_buf->reset_tracker (); + + boost::shared_ptr<MidiPlaylist> mp (midi_playlist()); + + if (mp) { + mp->clear_note_trackers (); + } +} |