Initial Commit
Added Device logic to Sinks Started on UI for selecting devices
This commit is contained in:
@@ -21,6 +21,12 @@ ConfigureAudio::ConfigureAudio(QWidget* parent) :
|
||||
ui->output_sink_combo_box->addItem(sink_detail.id);
|
||||
}
|
||||
|
||||
ui->audio_device_combo_box->clear();
|
||||
ui->audio_device_combo_box->addItem("auto");
|
||||
//for (const auto& device : AudioCore:) {
|
||||
// ui->audio_device_combo_box->addItem(device.second.c_str());
|
||||
//}
|
||||
|
||||
this->setConfiguration();
|
||||
}
|
||||
|
||||
@@ -36,9 +42,20 @@ void ConfigureAudio::setConfiguration() {
|
||||
}
|
||||
}
|
||||
ui->output_sink_combo_box->setCurrentIndex(new_sink_index);
|
||||
|
||||
|
||||
int new_device_index = -1;
|
||||
for (int index = 0; index < ui->audio_device_combo_box->count(); index++) {
|
||||
if (ui->audio_device_combo_box->itemText(index).toStdString() == Settings::values.audio_device_id) {
|
||||
new_device_index = index;
|
||||
break;
|
||||
}
|
||||
}
|
||||
ui->audio_device_combo_box->setCurrentIndex(new_sink_index);
|
||||
}
|
||||
|
||||
void ConfigureAudio::applyConfiguration() {
|
||||
Settings::values.sink_id = ui->output_sink_combo_box->itemText(ui->output_sink_combo_box->currentIndex()).toStdString();
|
||||
Settings::values.audio_device_id = ui->audio_device_combo_box->itemText(ui->audio_device_combo_box->currentIndex()).toStdString();
|
||||
Settings::Apply();
|
||||
}
|
||||
|
||||
@@ -25,6 +25,21 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout">
|
||||
<item>
|
||||
<widget class="QLabel">
|
||||
<property name="text">
|
||||
<string>Audio Device:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="audio_device_combo_box">
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
Reference in New Issue
Block a user