aboutsummaryrefslogtreecommitdiffstats
path: root/alc/alconfig.cpp
diff options
context:
space:
mode:
authorDeal(一线灵) <[email protected]>2023-05-31 15:24:11 +0800
committerGitHub <[email protected]>2023-05-31 07:24:11 +0000
commit3caadcf616074c6bedcd45e8af2854379f08e275 (patch)
tree1c82f3e74906393c1ba767c4e6c330190c308c5f /alc/alconfig.cpp
parentcd27f8551dc593cc4fb29e1093ae45a57e6ca58e (diff)
Improve wasapi backend UWP support (#853)
* Improve wasapi, support uwp build * Fix compile errors * [UWP] Support ReadALConfig from app roaming * [UWP] Post disconnect event when default device changed * [UWP] Fix appveyor ci * [WIN32] Default device change notification support * Fix warnings * Add event to notify the app when the default device changes - Event type: AL_EVENT_TYPE_DEFAULT_DEVICE_CHANGED_SOFT=0x19A7 - Event callback parameters: void _onALSoftEvent(ALenum eventType, ALuint object, // dataFlow: 0(render), 1(capture) ALuint param, // 0 ALsizei length, // 0 const ALchar* message, // Default device changed:<deviceId> void* userParam); * Fix warnings * Fire default device changed event in mixerProc thread * Fix compile warning * [UWP] Improve cmake * Revert changes * Notify default device change by system event callback * Revert insignificant change * Remove duplicate call
Diffstat (limited to 'alc/alconfig.cpp')
-rw-r--r--alc/alconfig.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/alc/alconfig.cpp b/alc/alconfig.cpp
index 56cad9e0..3c9a9777 100644
--- a/alc/alconfig.cpp
+++ b/alc/alconfig.cpp
@@ -329,9 +329,14 @@ const char *GetConfigValue(const char *devName, const char *blockName, const cha
#ifdef _WIN32
void ReadALConfig()
{
- WCHAR buffer[MAX_PATH];
- if(SHGetSpecialFolderPathW(nullptr, buffer, CSIDL_APPDATA, FALSE) != FALSE)
{
+#if !defined(ALSOFT_UWP)
+ WCHAR buffer[MAX_PATH];
+ if (!SHGetSpecialFolderPathW(nullptr, buffer, CSIDL_APPDATA, FALSE))
+ return;
+#else
+ auto buffer = Windows::Storage::ApplicationData::Current->RoamingFolder->Path->Data();
+#endif
std::string filepath{wstr_to_utf8(buffer)};
filepath += "\\alsoft.ini";
@@ -341,6 +346,7 @@ void ReadALConfig()
LoadConfigFromFile(f);
}
+
std::string ppath{GetProcBinary().path};
if(!ppath.empty())
{