diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2009-09-16 01:08:51 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2009-09-16 01:08:51 +0000 |
commit | fa4e858eb351668bc6687819903d019703daef7a (patch) | |
tree | 1068e35899ec48cdd8ef514510fec56092466673 /libs/ardour/midi_source.cc | |
parent | 127b8a62b790c7515a27934b920e88b7de04b7fc (diff) |
do not allow smf_source's reads to stomp on cached read_end position in parent class, which creates chaos by being out of sync with MidiSource::_model_iterator. this doesn't totally fix MIDI playback, but it helps
git-svn-id: svn://localhost/ardour2/branches/3.0@5665 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/midi_source.cc')
-rw-r--r-- | libs/ardour/midi_source.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/libs/ardour/midi_source.cc b/libs/ardour/midi_source.cc index f16ebf186f..4da2dbb845 100644 --- a/libs/ardour/midi_source.cc +++ b/libs/ardour/midi_source.cc @@ -137,16 +137,15 @@ MidiSource::midi_read (MidiRingBuffer<nframes_t>& dst, sframes_t source_start, #define BEATS_TO_FRAMES(t) (converter.to(t) + stamp_offset - negative_stamp_offset) Evoral::Sequence<double>::const_iterator& i = _model_iter; - - if (_last_read_end == 0 || start != _last_read_end) { // || !i.valid()) { - //cerr << "MidiSource seeking to " << start << " from " << _last_read_end << endl; + + if (_last_read_end == 0 || start != _last_read_end || !i.valid()) { for (i = _model->begin(); i != _model->end(); ++i) { if (BEATS_TO_FRAMES(i->time()) >= start) { break; } } } - + _last_read_end = start + cnt; for (; i != _model->end(); ++i) { @@ -234,7 +233,7 @@ MidiSource::session_saved() stringstream ss(basename.substr(last_dash+1)); unsigned write_count = 0; ss >> write_count; - cerr << "WRITE COUNT: " << write_count << endl; + // cerr << "WRITE COUNT: " << write_count << endl; ++write_count; // start at 1 ss.clear(); ss << basename.substr(0, last_dash) << "-" << write_count; |