diff options
author | David Robillard <d@drobilla.net> | 2007-07-28 07:09:21 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-07-28 07:09:21 +0000 |
commit | 6e167cb1a835cb0b44990cc4c2b2a47db9dd2b9e (patch) | |
tree | e31d6aac9c2ca21a46f18a24822b47c2003aee4c /libs/ardour/smf_source.cc | |
parent | 71452634a711cfeae4cf7eb9fbe7667210a071f1 (diff) |
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
Diffstat (limited to 'libs/ardour/smf_source.cc')
-rw-r--r-- | libs/ardour/smf_source.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libs/ardour/smf_source.cc b/libs/ardour/smf_source.cc index 08ec1d87a8..eac782853f 100644 --- a/libs/ardour/smf_source.cc +++ b/libs/ardour/smf_source.cc @@ -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); } |