History

Select Audio DLL at runtime

Atlante45 committed 9 years ago

Commit db263df1 parent 881e0cb3 files · +29 −30Browse files

Showing the changes to interface/src/Application.cpp (1 of 3 files). Show all

Unified · Split

interface/src/Application.cpp+12−0
@@ -166,6 +166,8 @@ · 165 unmodified lines
166166 // On Windows PC, NVidia Optimus laptop, we want to enable NVIDIA GPU
167167 // FIXME seems to be broken.
168168 #if defined(Q_OS_WIN)
169+#include <VersionHelpers.h>
170+
169171 extern "C" {
170172 _declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
171173 }
@@ -416,6 +418,16 @@ bool setupEssentials(int& argc, char** argv) { · 244 unmodified lines
416418
417419 Setting::preInit();
418420
421+#if defined(Q_OS_WIN)
422+ // Select appropriate audio DLL
423+ QString audioDLLPath = QCoreApplication::applicationDirPath();
424+ if (IsWindows8OrGreater()) {
425+ audioDLLPath += "/audioWin8";
426+ } else {
427+ audioDLLPath += "/audioWin7";
428+ }
429+ QCoreApplication::addLibraryPath(audioDLLPath);
430+#endif
419431
420432 static const auto SUPPRESS_SETTINGS_RESET = "--suppress-settings-reset";
421433 bool suppressPrompt = cmdOptionExists(argc, const_cast<const char**>(argv), SUPPRESS_SETTINGS_RESET);