Playback from MIDI model, playback of clicked-in events.

Note the diskstream chunk size affects reading of clicked-in, so you may need to seek away and back again to have new events read (this will be fixed).


git-svn-id: svn://localhost/ardour2/trunk@2183 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
David Robillard 2007-07-28 07:09:21 +00:00
parent 71452634a7
commit 6e167cb1a8
19 changed files with 304 additions and 91 deletions

View file

@ -408,7 +408,12 @@ SMFSource::write_unlocked (MidiRingBuffer& src, nframes_t cnt)
const nframes_t oldlen = _length;
update_length(oldlen, cnt);
_model->append(buf);
if (_model) {
if ( ! _model->currently_writing()) {
_model->start_write();
}
_model->append(buf);
}
ViewDataRangeReady (buf_ptr, oldlen, cnt); /* EMIT SIGNAL */
@ -463,6 +468,8 @@ SMFSource::mark_for_remove ()
void
SMFSource::mark_streaming_write_completed ()
{
MidiSource::mark_streaming_write_completed();
if (!writable()) {
return;
}
@ -828,7 +835,6 @@ SMFSource::load_model(bool lock, bool force_reload)
const double ev_time = (double)(time * frames_per_beat / (double)_ppqn); // in frames
if (ret > 0) { // didn't skip (meta) event
//cerr << "ADDING EVENT TO MODEL: " << ev.time << endl;
_model->append(ev_time, ev.size, ev.buffer);
}