using namespace std;
using namespace std::placeholders;
+namespace {
+
+bool uses_device(const InputMapping &mapping, DeviceSpec device)
+{
+ for (const InputMapping::Bus &bus : mapping.buses) {
+ if (bus.device == device) {
+ return true;
+ }
+ }
+ return false;
+}
+
+} // namespace
+
InputMappingDialog::InputMappingDialog()
: ui(new Ui::InputMappingDialog),
mapping(global_audio_mixer->get_input_mapping()),
} else if (state == ALSAPool::Device::State::DEAD) {
label += " (dead)";
}
+ } else if (!global_audio_mixer->get_active(spec_and_info.first)) {
+ // Should nominally be skipped, but if we used it before it went away,
+ // we'll need to allow the user to still see it.
+ if (uses_device(mapping, spec_and_info.first) ||
+ uses_device(old_mapping, spec_and_info.first)) {
+ label += " (dead)";
+ } else {
+ continue;
+ }
}
++current_index;
if (unsigned(card_combo->count()) > current_index) {
QComboBox *channel_combo = new QComboBox;
channel_combo->addItem(QString("(none)"));
if (bus.device.type == InputSourceType::CAPTURE_CARD ||
- bus.device.type == InputSourceType::ALSA_INPUT ||
- bus.device.type == InputSourceType::FFMPEG_VIDEO_INPUT) {
+ bus.device.type == InputSourceType::ALSA_INPUT) {
auto device_it = devices.find(bus.device);
assert(device_it != devices.end());
unsigned num_device_channels = device_it->second.num_channels;