From 6bfc9d400793627cb1db4029137d7ee55ad523d4 Mon Sep 17 00:00:00 2001 From: jthedering <51533355+jthedering@users.noreply.github.com> Date: Sun, 18 Jun 2017 09:49:16 +0000 Subject: [PATCH] Fixed: When a disconnected audio device was selected in the Configuration Editor, the analysis panel was inoperable. --- Editor/AnalysisThread.cpp | 7 +++++++ Editor/MainWindow.cpp | 9 ++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Editor/AnalysisThread.cpp b/Editor/AnalysisThread.cpp index bf1f13d..9a21b6c 100644 --- a/Editor/AnalysisThread.cpp +++ b/Editor/AnalysisThread.cpp @@ -149,8 +149,15 @@ void AnalysisThread::run() channelCount++; } } + if (channelCount == 0) + { + channelCount = 8; + channelMask = KSAUDIO_SPEAKER_7POINT1_SURROUND; + } unsigned sampleRate = device->getSampleRate(); + if (sampleRate == 0) + sampleRate = 48000; qint64 startTime = timer.nsecsElapsed(); diff --git a/Editor/MainWindow.cpp b/Editor/MainWindow.cpp index 644ea38..b076b90 100644 --- a/Editor/MainWindow.cpp +++ b/Editor/MainWindow.cpp @@ -424,8 +424,10 @@ void MainWindow::deviceSelected(int index) if (selectedInfo != NULL) channelConfigurationComboBox->addItem(tr("From device") + " (" + selectedInfo->name + ")", 0); - else + else if (apoInfo->getChannelCount() != 0) channelConfigurationComboBox->addItem(tr("From device") + " (" + apoInfo->getChannelCount() + " channels)", 0); + else + channelConfigurationComboBox->addItem(tr("From device") + " (? channels)", 0); } else { @@ -466,6 +468,11 @@ void MainWindow::channelConfigurationSelected(int index) channelCount++; } } + if (channelCount == 0) + { + channelCount = 8; + channelMask = KSAUDIO_SPEAKER_7POINT1_SURROUND; + } vector channelNames = ChannelHelper::getChannelNames(channelCount, channelMask); for (wstring channelName : channelNames)