LV2Plugin: do not unconditionally call TempoMap::get_grid
This commit is contained in:
parent
8145e92b43
commit
8d97db101e
@ -2762,11 +2762,6 @@ LV2Plugin::connect_and_run(BufferSet& bufs,
|
|||||||
TempoMap::SharedPtr tmap (TempoMap::use());
|
TempoMap::SharedPtr tmap (TempoMap::use());
|
||||||
TempoMetric metric (tmap->metric_at (timepos_t (start0)));
|
TempoMetric metric (tmap->metric_at (timepos_t (start0)));
|
||||||
|
|
||||||
TempoMapPoints tempo_map_points;
|
|
||||||
tmap->get_grid (tempo_map_points,
|
|
||||||
samples_to_superclock (start0, TEMPORAL_SAMPLE_RATE),
|
|
||||||
samples_to_superclock (end, TEMPORAL_SAMPLE_RATE), 0);
|
|
||||||
|
|
||||||
if (_freewheel_control_port) {
|
if (_freewheel_control_port) {
|
||||||
*_freewheel_control_port = _session.engine().freewheeling() ? 1.f : 0.f;
|
*_freewheel_control_port = _session.engine().freewheeling() ? 1.f : 0.f;
|
||||||
}
|
}
|
||||||
@ -2809,6 +2804,9 @@ LV2Plugin::connect_and_run(BufferSet& bufs,
|
|||||||
uint32_t midi_out_index = 0;
|
uint32_t midi_out_index = 0;
|
||||||
uint32_t atom_port_index = 0;
|
uint32_t atom_port_index = 0;
|
||||||
|
|
||||||
|
TempoMapPoints tempo_map_points;
|
||||||
|
bool got_grid = false;
|
||||||
|
|
||||||
for (uint32_t port_index = 0; port_index < num_ports; ++port_index) {
|
for (uint32_t port_index = 0; port_index < num_ports; ++port_index) {
|
||||||
void* buf = NULL;
|
void* buf = NULL;
|
||||||
uint32_t index = nil_index;
|
uint32_t index = nil_index;
|
||||||
@ -2888,6 +2886,13 @@ LV2Plugin::connect_and_run(BufferSet& bufs,
|
|||||||
const uint32_t type = _uri_map.urids.midi_MidiEvent;
|
const uint32_t type = _uri_map.urids.midi_MidiEvent;
|
||||||
const samplepos_t tend = end;
|
const samplepos_t tend = end;
|
||||||
|
|
||||||
|
if (!got_grid) {
|
||||||
|
got_grid = true;
|
||||||
|
tmap->get_grid (tempo_map_points,
|
||||||
|
samples_to_superclock (start0, TEMPORAL_SAMPLE_RATE),
|
||||||
|
samples_to_superclock (end, TEMPORAL_SAMPLE_RATE), 0);
|
||||||
|
}
|
||||||
|
|
||||||
/* move to next explicit point
|
/* move to next explicit point
|
||||||
* (if any)
|
* (if any)
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user