From b6ea47d888f43edf5cf46e3c8e5a8022062be5bd Mon Sep 17 00:00:00 2001 From: Colin McEwan Date: Tue, 17 Aug 2021 22:41:55 +0100 Subject: [PATCH] Fix CLI driver selection --- src/cli/main.cpp | 8 ++++++-- src/gui/src/main.cpp | 14 +++++++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/cli/main.cpp b/src/cli/main.cpp index 7770d46b0f..8f9f1cc8a5 100644 --- a/src/cli/main.cpp +++ b/src/cli/main.cpp @@ -230,6 +230,7 @@ int main(int argc, char *argv[]) exit(0); } + sSelectedDriver = sSelectedDriver.toLower(); if (sSelectedDriver == "auto") { preferences->m_sAudioDriver = "Auto"; } @@ -242,12 +243,15 @@ int main(int argc, char *argv[]) else if ( sSelectedDriver == "alsa" ) { preferences->m_sAudioDriver = "ALSA"; } - else if (sSelectedDriver == "CoreAudio") { + else if (sSelectedDriver == "coreaudio") { preferences->m_sAudioDriver = "CoreAudio"; } - else if (sSelectedDriver == "PulseAudio") { + else if (sSelectedDriver == "pulseaudio") { preferences->m_sAudioDriver = "PulseAudio"; } + else { + ___ERRORLOG( QString( "Unknown driver '%1'" ).arg( sSelectedDriver ) ); + } #ifdef H2CORE_HAVE_LASH if ( preferences->useLash() && lashClient->isConnected() ) { diff --git a/src/gui/src/main.cpp b/src/gui/src/main.cpp index 9ec5c05af2..1fcad14b04 100644 --- a/src/gui/src/main.cpp +++ b/src/gui/src/main.cpp @@ -370,7 +370,7 @@ int main(int argc, char *argv[]) H2Core::Drumkit::install( sDrumkitName ); exit(0); } - + sSelectedDriver = sSelectedDriver.toLower(); if (sSelectedDriver == "auto") { pPref->m_sAudioDriver = "Auto"; } @@ -383,6 +383,18 @@ int main(int argc, char *argv[]) else if ( sSelectedDriver == "alsa" ) { pPref->m_sAudioDriver = "ALSA"; } + else if ( sSelectedDriver == "portaudio" ) { + pPref->m_sAudioDriver = "PortAudio"; + } + else if ( sSelectedDriver == "pulseaudio" ) { + pPref->m_sAudioDriver = "PulseAudio"; + } + else if ( sSelectedDriver == "coreaudio" ) { + pPref->m_sAudioDriver = "CoreAudio"; + } + else { + ___ERRORLOG( QString( "Unknown driver '%1'" ).arg( sSelectedDriver ) ); + } // Bootstrap is complete, start GUI delete pBootStrApp;