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

@ -99,7 +99,13 @@ nframes_t
MidiSource::read (MidiRingBuffer& dst, nframes_t start, nframes_t cnt, nframes_t stamp_offset) const
{
Glib::Mutex::Lock lm (_lock);
return read_unlocked (dst, start, cnt, stamp_offset);
if (_model_loaded && _model) {
/*const size_t n_events = */_model->read(dst, start, cnt, stamp_offset);
//cout << "Read " << n_events << " events from model." << endl;
return cnt;
} else {
return read_unlocked (dst, start, cnt, stamp_offset);
}
}
nframes_t
@ -119,3 +125,26 @@ MidiSource::file_changed (string path)
return ( !e1 );
}
void
MidiSource::mark_streaming_midi_write_started (NoteMode mode)
{
if (_model) {
_model->set_note_mode(mode);
_model->start_write();
}
}
void
MidiSource::mark_streaming_write_started ()
{
if (_model)
_model->start_write();
}
void
MidiSource::mark_streaming_write_completed ()
{
if (_model)
_model->end_write(false); // FIXME: param?
}