Skip to content

Commit

Permalink
Merge pull request #48 from colugomusic/main
Browse files Browse the repository at this point in the history
Fix audio settings device info retrieval
  • Loading branch information
abique authored Jul 12, 2024
2 parents fb6e26a + c0a6203 commit 5cc331f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions host/audio-settings-widget.cc
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ void AudioSettingsWidget::updateSampleRateList() {
_sampleRateChooser->clear();

bool didSelectSampleRate = false;
auto info = _audio->getDeviceInfo(_deviceChooser->currentIndex());
auto deviceIds = _audio->getDeviceIds();
auto info = _audio->getDeviceInfo(deviceIds[_deviceChooser->currentIndex()]);
for (size_t i = 0; i < info.sampleRates.size(); ++i) {
int sr = info.sampleRates[i];
_sampleRateChooser->addItem(QString::number(sr));
Expand All @@ -135,10 +136,12 @@ void AudioSettingsWidget::updateDeviceList() {

auto deviceCount = _audio->getDeviceCount();
bool deviceFound = false;
auto deviceIds = _audio->getDeviceIds();

// Populate the choices
for (int i = 0; i < deviceCount; ++i) {
auto deviceInfo = _audio->getDeviceInfo(i);
auto deviceId = deviceIds[i];
auto deviceInfo = _audio->getDeviceInfo(deviceId);
QString name = QString::fromStdString(deviceInfo.name);
_deviceChooser->addItem(name);

Expand Down

0 comments on commit 5cc331f

Please sign in to comment.