Fix I/O Plugin meter without session - amend c10c3ed6

The RecoderUI can show device input meters as long as a backend is
running regardless of a session. I/O Plugins are however
part of a specific session.
This commit is contained in:
Robin Gareus 2022-05-18 21:06:45 +02:00
parent 6f7adbda59
commit 5c18e64616
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
1 changed files with 27 additions and 20 deletions

View File

@ -785,7 +785,10 @@ bool
RecorderUI::update_meters ()
{
PortManager::AudioInputPorts const aip (AudioEngine::instance ()->audio_input_ports ());
boost::shared_ptr<IOPlugList> iop (_session->io_plugs ());
boost::shared_ptr<IOPlugList> iop;
if (_session) {
iop = _session->io_plugs ();
}
/* scope data needs to be read continuously */
for (PortManager::AudioInputPorts::const_iterator i = aip.begin (); i != aip.end (); ++i) {
@ -795,7 +798,8 @@ RecorderUI::update_meters ()
}
}
for (auto& p : *iop) {
if (iop) {
for (auto const& p : *iop) {
PortManager::AudioInputPorts const& aip (p->audio_input_ports ());
for (auto i = aip.begin (); i != aip.end (); ++i) {
InputPortMap::iterator im = _input_ports.find (i->first);
@ -804,6 +808,7 @@ RecorderUI::update_meters ()
}
}
}
}
if (!contents ().get_mapped ()) {
return true;
@ -825,7 +830,8 @@ RecorderUI::update_meters ()
}
}
for (auto& p : *iop) {
if (iop) {
for (auto const& p : *iop) {
PortManager::AudioInputPorts const& aip (p->audio_input_ports ());
PortManager::MIDIInputPorts const& mip (p->midi_input_ports ());
for (auto i = aip.begin (); i != aip.end (); ++i) {
@ -842,6 +848,7 @@ RecorderUI::update_meters ()
}
}
}
}
for (list<TrackRecordAxis*>::const_iterator i = _recorders.begin (); i != _recorders.end (); ++i) {
(*i)->fast_update ();