diff options
author | Carl Hetherington <carl@carlh.net> | 2011-03-01 02:03:52 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2011-03-01 02:03:52 +0000 |
commit | 78310ad79206939c99a78f8d6d97c1fb919edf03 (patch) | |
tree | 24fcd4401b1048f260e355a499ff91c8c437b208 /libs/ardour/midi_source.cc | |
parent | f9b1e437a5ef408fe6ab279625bf9cc081bd897a (diff) |
Hopefully fix disappearing MIDI recorded regions on the first record of a new session.
git-svn-id: svn://localhost/ardour2/branches/3.0@8993 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/midi_source.cc')
-rw-r--r-- | libs/ardour/midi_source.cc | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/libs/ardour/midi_source.cc b/libs/ardour/midi_source.cc index d330eb2bcd..16ff6ac7ac 100644 --- a/libs/ardour/midi_source.cc +++ b/libs/ardour/midi_source.cc @@ -267,18 +267,33 @@ MidiSource::midi_write (MidiRingBuffer<framepos_t>& source, framepos_t source_st void MidiSource::mark_streaming_midi_write_started (NoteMode mode, framepos_t start_frame) { - set_timeline_position(start_frame); - if (_model) { _model->set_note_mode(mode); _model->start_write(); } - _last_write_end = start_frame; _writing = true; } void +MidiSource::mark_write_starting_now () +{ + /* I'm not sure if this is the best way to approach this, but + _last_write_end needs to be set up with the transport frame + when a record actually starts, as it is used by + SMFSource::write_unlocked to decide whether incoming notes + are within the correct time range. + mark_streaming_midi_write_started (perhaps a more logical + place to do this) is not called at exactly the time when + record starts, and I don't think it necessarily can be + because it is not RT-safe. + */ + + set_timeline_position (_session.transport_frame ()); + _last_write_end = _session.transport_frame (); +} + +void MidiSource::mark_streaming_write_started () { NoteMode note_mode = _model ? _model->note_mode() : Sustained; |