From fa791ae9cc97a5d26a8050c7be7b7b5c0eb91ded Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 14 Jan 2021 01:47:25 +0100 Subject: [PATCH] Static input port meters, ignore dynamic ports for now Hotplugging devices will need to be special-cased. Currently there is no API to notify the PortManager about hotplugged devices. --- libs/ardour/port_manager.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libs/ardour/port_manager.cc b/libs/ardour/port_manager.cc index f801017478..688751df21 100644 --- a/libs/ardour/port_manager.cc +++ b/libs/ardour/port_manager.cc @@ -1487,6 +1487,11 @@ PortManager::run_input_meters (pframes_t n_samples, samplecnt_t rate) continue; } + if (_audio_port_meters.find (*p) == _audio_port_meters.end () || _audio_port_scopes.find (*p) == _audio_port_scopes.end ()) { + /* do not allocate ports during normal operation */ + continue; + } + if (reset) { _audio_port_meters[*p].reset (); } @@ -1530,6 +1535,11 @@ PortManager::run_input_meters (pframes_t n_samples, samplecnt_t rate) continue; } + if (_midi_port_meters.find (*p) == _midi_port_meters.end () || _midi_port_monitors.find (*p) == _midi_port_monitors.end ()) { + /* do not allocate ports during normal operation */ + continue; + } + for (size_t i = 0; i < 17; ++i) { /* falloff */ if (_midi_port_meters[*p].chn_active[i] > 1e-10) {