Fix crash on save of MIDI data.
git-svn-id: svn://localhost/ardour2/branches/3.0@5875 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
3fd5f15e26
commit
106b728d34
|
@ -77,7 +77,7 @@ private:
|
|||
sframes_t stamp_offset,
|
||||
sframes_t negative_stamp_offset,
|
||||
MidiStateTracker* tracker) const;
|
||||
|
||||
|
||||
nframes_t write_unlocked (MidiRingBuffer<nframes_t>& src,
|
||||
sframes_t position,
|
||||
nframes_t cnt);
|
||||
|
|
|
@ -688,12 +688,14 @@ MidiModel::write_to(boost::shared_ptr<MidiSource> source)
|
|||
set_percussive(false);
|
||||
|
||||
source->drop_model();
|
||||
source->mark_streaming_midi_write_started(note_mode(), _midi_source->timeline_position());
|
||||
|
||||
for (Evoral::Sequence<TimeType>::const_iterator i = begin(); i != end(); ++i) {
|
||||
source->append_event_unlocked_beats(*i);
|
||||
}
|
||||
|
||||
set_percussive(old_percussive);
|
||||
source->mark_streaming_write_completed();
|
||||
|
||||
set_edited(false);
|
||||
|
||||
|
|
|
@ -219,14 +219,8 @@ MidiSource::mark_streaming_midi_write_started (NoteMode mode, sframes_t start_fr
|
|||
void
|
||||
MidiSource::mark_streaming_write_started ()
|
||||
{
|
||||
sframes_t start_frame = _session.transport_frame();
|
||||
|
||||
if (_model) {
|
||||
_model->start_write();
|
||||
}
|
||||
|
||||
_last_write_end = start_frame;
|
||||
_writing = true;
|
||||
NoteMode note_mode = _model ? _model->note_mode() : Sustained;
|
||||
mark_streaming_midi_write_started(note_mode, _session.transport_frame());
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -183,7 +183,7 @@ SMFSource::read_unlocked (MidiRingBuffer<nframes_t>& destination, sframes_t sour
|
|||
} else {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
_read_data_count += ev_size;
|
||||
|
||||
if (ev_size > scratch_size) {
|
||||
|
@ -268,6 +268,7 @@ SMFSource::write_unlocked (MidiRingBuffer<nframes_t>& source, sframes_t position
|
|||
void
|
||||
SMFSource::append_event_unlocked_beats (const Evoral::Event<double>& ev)
|
||||
{
|
||||
assert(_writing);
|
||||
if (ev.size() == 0) {
|
||||
return;
|
||||
}
|
||||
|
@ -301,6 +302,7 @@ SMFSource::append_event_unlocked_beats (const Evoral::Event<double>& ev)
|
|||
void
|
||||
SMFSource::append_event_unlocked_frames (const Evoral::Event<nframes_t>& ev, sframes_t position)
|
||||
{
|
||||
assert(_writing);
|
||||
if (ev.size() == 0) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user