13
0

Compute delta time correctly when appending events; the converter must be used to convert a source time, not a delta time, otherwise tempo / meter changes are not correctly accounted for.

git-svn-id: svn://localhost/ardour2/branches/3.0@10963 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2011-12-10 13:48:50 +00:00
parent 1390a1510d
commit 2a9ceb74c4

View File

@ -369,9 +369,9 @@ SMFSource::append_event_unlocked_frames (const Evoral::Event<framepos_t>& ev, fr
_length_beats = max(_length_beats, ev_time_beats);
const framepos_t delta_time_frames = ev.time() - _last_ev_time_frames;
const double delta_time_beats = converter.from(delta_time_frames);
const uint32_t delta_time_ticks = (uint32_t)(lrint(delta_time_beats * (double)ppqn()));
const Evoral::MusicalTime last_time_beats = converter.from (_last_ev_time_frames);
const Evoral::MusicalTime delta_time_beats = ev_time_beats - last_time_beats;
const uint32_t delta_time_ticks = (uint32_t)(lrint(delta_time_beats * (double)ppqn()));
Evoral::SMF::append_event_delta(delta_time_ticks, ev.size(), ev.buffer(), event_id);
_last_ev_time_frames = ev.time();