mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Delete the current audio device when no inputs or outputs are specified in AudioDeviceManager::setAudioDeviceSetup() and ensure that the AudioDeviceSelectorComponent displays this correctly
This commit is contained in:
parent
31f6f9993b
commit
4fa131f5a7
2 changed files with 6 additions and 6 deletions
|
|
@ -463,10 +463,13 @@ String AudioDeviceManager::setAudioDeviceSetup (const AudioDeviceSetup& newSetup
|
|||
{
|
||||
jassert (&newSetup != ¤tSetup); // this will have no effect
|
||||
|
||||
if (newSetup == currentSetup && currentAudioDevice != nullptr)
|
||||
if (newSetup != currentSetup)
|
||||
sendChangeMessage();
|
||||
else if (currentAudioDevice != nullptr)
|
||||
return {};
|
||||
|
||||
if (getCurrentDeviceTypeObject() == nullptr)
|
||||
if (getCurrentDeviceTypeObject() == nullptr
|
||||
|| (newSetup.inputDeviceName.isEmpty() && newSetup.outputDeviceName.isEmpty()))
|
||||
{
|
||||
deleteCurrentDevice();
|
||||
|
||||
|
|
@ -478,9 +481,6 @@ String AudioDeviceManager::setAudioDeviceSetup (const AudioDeviceSetup& newSetup
|
|||
|
||||
stopDevice();
|
||||
|
||||
if (newSetup != currentSetup)
|
||||
sendChangeMessage();
|
||||
|
||||
String error;
|
||||
|
||||
if (currentSetup.inputDeviceName != newSetup.inputDeviceName
|
||||
|
|
|
|||
|
|
@ -542,7 +542,7 @@ private:
|
|||
auto* currentDevice = setup.manager->getCurrentAudioDevice();
|
||||
auto index = type.getIndexOfDevice (currentDevice, isInput);
|
||||
|
||||
box->setSelectedId (index + 1, dontSendNotification);
|
||||
box->setSelectedId (index < 0 ? index : index + 1, dontSendNotification);
|
||||
|
||||
if (testButton != nullptr && ! isInput)
|
||||
testButton->setEnabled (index >= 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue