13
0

RecorderUI: Fix monitoring when hot-plugging devices

When there are no input ports at the time the engine starts
running, MonitorInputChanged signal was not subscribed to.
This breaks AFL solo. This happens e.g. when re-starting the
engine with ALSA slave devices.
This commit is contained in:
Robin Gareus 2021-04-18 18:37:45 +02:00
parent d0f4665d5e
commit dd060b04dc
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -592,6 +592,12 @@ RecorderUI::add_or_remove_io (DataType dt, vector<string> ports, bool add)
_fast_screen_update_connection.disconnect ();
bool spill_changed = false;
if (_input_ports.empty () && add) {
_monitor_connection.disconnect ();
MonitorPort& mp (AudioEngine::instance()->monitor_port ());
mp.MonitorInputChanged.connect (_monitor_connection, invalidator (*this), boost::bind (&RecorderUI::update_monitorstate, this, _1, _2), gui_context());
}
if (add) {
for (vector<string>::const_iterator i = ports.begin (); i != ports.end (); ++i) {
_input_ports[*i] = boost::shared_ptr<RecorderUI::InputPort> (new InputPort (*i, dt, this, _vertical));