fprintf(stderr, "%s: Probed successfully.\n", address);
reset_device(internal_dev_index); // Restarts it if it is held (ie., we just replaced a dead card).
+ if (global_audio_mixer) {
+ global_audio_mixer->trigger_state_changed_callback();
+ }
return ALSAPool::ProbeResult::SUCCESS;
}
bool silence = (state != ALSAPool::Device::State::RUNNING);
while (!global_audio_mixer->silence_card(spec, silence))
;
+ global_audio_mixer->trigger_state_changed_callback();
}
unsigned ALSAPool::find_free_device_index(const string &name, const string &info, unsigned num_channels, const string &address)
while (!global_audio_mixer->silence_card(spec, true))
;
- lock_guard<mutex> lock(mu);
- if (devices[index].held) {
- devices[index].state = Device::State::DEAD;
- } else {
- devices[index].state = Device::State::EMPTY;
- inputs[index].reset();
- }
- while (!devices.empty() && devices.back().state == Device::State::EMPTY) {
- devices.pop_back();
- inputs.pop_back();
+ {
+ lock_guard<mutex> lock(mu);
+ if (devices[index].held) {
+ devices[index].state = Device::State::DEAD;
+ } else {
+ devices[index].state = Device::State::EMPTY;
+ inputs[index].reset();
+ }
+ while (!devices.empty() && devices.back().state == Device::State::EMPTY) {
+ devices.pop_back();
+ inputs.pop_back();
+ }
}
+
+ global_audio_mixer->trigger_state_changed_callback();
}