Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CLI driver selection #1348

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/cli/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ int main(int argc, char *argv[])
exit(0);
}

sSelectedDriver = sSelectedDriver.toLower();
if (sSelectedDriver == "auto") {
preferences->m_sAudioDriver = "Auto";
}
Expand All @@ -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() ) {
Expand Down
14 changes: 13 additions & 1 deletion src/gui/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
Expand All @@ -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;
Expand Down