From f67d39fa6629dd10982710b1a5d0fa693d17ef9c Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Wed, 4 Aug 2021 09:13:55 -0500 Subject: [PATCH] RecorderUI: Do not show input meters for control-only ports Faderport, Mackie, etc --- gtk2_ardour/recorder_ui.cc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/recorder_ui.cc b/gtk2_ardour/recorder_ui.cc index 4033b83875..97c866992c 100644 --- a/gtk2_ardour/recorder_ui.cc +++ b/gtk2_ardour/recorder_ui.cc @@ -583,6 +583,10 @@ RecorderUI::start_updating () /* MIDI */ for (PortManager::MIDIInputPorts::const_iterator i = mip.begin (); i != mip.end (); ++i) { + string pn = AudioEngine::instance()->get_pretty_name_by_name (i->first); + if (PortManager::port_is_control_only (pn)) { + continue; + } _input_ports[i->first] = boost::shared_ptr (new InputPort (i->first, DataType::MIDI, this, _vertical)); set_connections (i->first); } @@ -631,6 +635,10 @@ RecorderUI::add_or_remove_io (DataType dt, vector ports, bool add) if (add) { for (vector::const_iterator i = ports.begin (); i != ports.end (); ++i) { + string pn = AudioEngine::instance()->get_pretty_name_by_name (*i); + if (dt==DataType::MIDI && PortManager::port_is_control_only (pn)) { + continue; + } _input_ports[*i] = boost::shared_ptr (new InputPort (*i, dt, this, _vertical)); set_connections (*i); } @@ -705,8 +713,10 @@ RecorderUI::update_meters () PortManager::MIDIInputPorts const mip (AudioEngine::instance ()->midi_input_ports ()); for (PortManager::MIDIInputPorts::const_iterator i = mip.begin (); i != mip.end (); ++i) { InputPortMap::iterator im = _input_ports.find (i->first); - im->second->update ((float const*)i->second.meter->chn_active); - im->second->update (*(i->second.monitor)); + if (im != _input_ports.end()) { + im->second->update ((float const*)i->second.meter->chn_active); + im->second->update (*(i->second.monitor)); + } } for (list::const_iterator i = _recorders.begin (); i != _recorders.end (); ++i) {