LV2 MIDI synths: only tx tempo-map if plugin asks for it

This is a slight improvement on 8d97db101 to further mitigate
excessive overhead introduce in a591fb64a.
This commit is contained in:
Robin Gareus 2023-07-11 21:48:10 +02:00
parent 8d97db101e
commit fd6d88583f
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -2872,6 +2872,13 @@ LV2Plugin::connect_and_run(BufferSet& bufs,
write_position(&_impl->forge, _ev_buffers[port_index],
metric, bbt, speed, time_scale, bpm, start, 0);
}
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);
}
}
// Get MIDI iterator range (empty range if no MIDI)
@ -2886,13 +2893,6 @@ LV2Plugin::connect_and_run(BufferSet& bufs,
const uint32_t type = _uri_map.urids.midi_MidiEvent;
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
* (if any)
*/