Commit of the century, right here.
git-svn-id: svn://localhost/ardour2/branches/3.0@4580 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
64e69c36da
commit
4c9ec5c9c0
@ -197,8 +197,7 @@ SMFSource::read_unlocked (MidiRingBuffer<nframes_t>& dst, nframes_t start, nfram
|
|||||||
if (ev_size > scratch_size) {
|
if (ev_size > scratch_size) {
|
||||||
scratch_size = ev_size;
|
scratch_size = ev_size;
|
||||||
}
|
}
|
||||||
|
ev_size = scratch_size; // ensure read_event only allocates if necessary
|
||||||
ev_size = scratch_size; // minimize realloc in read_event
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return dur;
|
return dur;
|
||||||
@ -642,7 +641,9 @@ SMFSource::load_model(bool lock, bool force_reload)
|
|||||||
size_t scratch_size = 0; // keep track of scratch and minimize reallocs
|
size_t scratch_size = 0; // keep track of scratch and minimize reallocs
|
||||||
|
|
||||||
// FIXME: assumes tempo never changes after start
|
// FIXME: assumes tempo never changes after start
|
||||||
const double frames_per_beat = _session.tempo_map().tempo_at(_timeline_position).frames_per_beat(
|
const Tempo& tempo = _session.tempo_map().tempo_at(_timeline_position);
|
||||||
|
|
||||||
|
const double frames_per_beat = tempo.frames_per_beat(
|
||||||
_session.engine().frame_rate(),
|
_session.engine().frame_rate(),
|
||||||
_session.tempo_map().meter_at(_timeline_position));
|
_session.tempo_map().meter_at(_timeline_position));
|
||||||
|
|
||||||
@ -651,7 +652,6 @@ SMFSource::load_model(bool lock, bool force_reload)
|
|||||||
uint8_t* buf = NULL;
|
uint8_t* buf = NULL;
|
||||||
int ret;
|
int ret;
|
||||||
while ((ret = read_event(&delta_t, &size, &buf)) >= 0) {
|
while ((ret = read_event(&delta_t, &size, &buf)) >= 0) {
|
||||||
|
|
||||||
ev.set(buf, size, 0.0);
|
ev.set(buf, size, 0.0);
|
||||||
time += delta_t;
|
time += delta_t;
|
||||||
|
|
||||||
@ -664,9 +664,8 @@ SMFSource::load_model(bool lock, bool force_reload)
|
|||||||
|
|
||||||
if (ev.size() > scratch_size) {
|
if (ev.size() > scratch_size) {
|
||||||
scratch_size = ev.size();
|
scratch_size = ev.size();
|
||||||
} else {
|
|
||||||
ev.size() = scratch_size;
|
|
||||||
}
|
}
|
||||||
|
ev.size() = scratch_size; // ensure read_event only allocates if necessary
|
||||||
}
|
}
|
||||||
|
|
||||||
set_default_controls_interpolation();
|
set_default_controls_interpolation();
|
||||||
|
Loading…
Reference in New Issue
Block a user