mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-23 00:34:03 +02:00
More work on the Windows Cosmopolitan build.
The Windows build now compilers with this commit.
This commit is contained in:
+62
-37
@@ -11330,27 +11330,12 @@ IMPLEMENTATION
|
|||||||
#include <float.h> /* For _controlfp_s constants */
|
#include <float.h> /* For _controlfp_s constants */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MA_WIN32
|
#if defined(MA_WIN32) || defined(__COSMOPOLITAN__)
|
||||||
#include <windows.h>
|
#if !defined(__COSMOPOLITAN__)
|
||||||
#else
|
#include <windows.h>
|
||||||
#include <stdlib.h> /* For malloc(), free(), wcstombs(). */
|
#endif
|
||||||
#include <string.h> /* For memset() */
|
|
||||||
#include <sched.h>
|
|
||||||
#include <sys/time.h> /* select() (used for ma_sleep()). */
|
|
||||||
#include <pthread.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MA_NX
|
#if defined(__COSMOPOLITAN__)
|
||||||
#include <time.h> /* For nanosleep() */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <sys/stat.h> /* For fstat(), etc. */
|
|
||||||
|
|
||||||
#ifdef MA_EMSCRIPTEN
|
|
||||||
#include <emscripten/emscripten.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __COSMOPOLITAN__
|
|
||||||
typedef uint64_t HWND;
|
typedef uint64_t HWND;
|
||||||
typedef uint64_t HANDLE;
|
typedef uint64_t HANDLE;
|
||||||
typedef uint32_t HRESULT;
|
typedef uint32_t HRESULT;
|
||||||
@@ -11358,6 +11343,8 @@ IMPLEMENTATION
|
|||||||
typedef uint16_t WORD;
|
typedef uint16_t WORD;
|
||||||
typedef uint32_t DWORD;
|
typedef uint32_t DWORD;
|
||||||
typedef int32_t BOOL;
|
typedef int32_t BOOL;
|
||||||
|
typedef int32_t LONG; /* `long` is always 32-bit on Windows. */
|
||||||
|
typedef uint32_t ULONG;
|
||||||
|
|
||||||
#define TRUE 1
|
#define TRUE 1
|
||||||
#define FALSE 0
|
#define FALSE 0
|
||||||
@@ -11397,8 +11384,46 @@ IMPLEMENTATION
|
|||||||
{
|
{
|
||||||
return memcmp(a, b, sizeof(GUID)) == 0;
|
return memcmp(a, b, sizeof(GUID)) == 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
WORD vt;
|
||||||
|
WORD wReserved1;
|
||||||
|
WORD wReserved2;
|
||||||
|
WORD wReserved3;
|
||||||
|
union
|
||||||
|
{
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
ULONG cbSize;
|
||||||
|
BYTE* pBlobData;
|
||||||
|
} blob;
|
||||||
|
wchar_t* pwszVal;
|
||||||
|
char pad[16]; /* Just to ensure the size of the struct matches the official version. */
|
||||||
|
};
|
||||||
|
} MA_PROPVARIANT;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef MA_POSIX
|
||||||
|
#include <stdlib.h> /* For malloc(), free(), wcstombs(). */
|
||||||
|
#include <string.h> /* For memset() */
|
||||||
|
#include <sched.h>
|
||||||
|
#include <sys/time.h> /* select() (used for ma_sleep()). */
|
||||||
|
#include <pthread.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef MA_NX
|
||||||
|
#include <time.h> /* For nanosleep() */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <sys/stat.h> /* For fstat(), etc. */
|
||||||
|
|
||||||
|
#ifdef MA_EMSCRIPTEN
|
||||||
|
#include <emscripten/emscripten.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if !defined(MA_64BIT) && !defined(MA_32BIT)
|
#if !defined(MA_64BIT) && !defined(MA_32BIT)
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#ifdef _WIN64
|
#ifdef _WIN64
|
||||||
@@ -18221,7 +18246,7 @@ typedef HRESULT (WINAPI * MA_PFN_CoInitializeEx)(void* pvReserved, DWORD dwCoIn
|
|||||||
typedef void (WINAPI * MA_PFN_CoUninitialize)(void);
|
typedef void (WINAPI * MA_PFN_CoUninitialize)(void);
|
||||||
typedef HRESULT (WINAPI * MA_PFN_CoCreateInstance)(const IID* rclsid, void* pUnkOuter, DWORD dwClsContext, const IID* riid, void* ppv);
|
typedef HRESULT (WINAPI * MA_PFN_CoCreateInstance)(const IID* rclsid, void* pUnkOuter, DWORD dwClsContext, const IID* riid, void* ppv);
|
||||||
typedef void (WINAPI * MA_PFN_CoTaskMemFree)(void* pv);
|
typedef void (WINAPI * MA_PFN_CoTaskMemFree)(void* pv);
|
||||||
typedef HRESULT (WINAPI * MA_PFN_PropVariantClear)(PROPVARIANT *pvar);
|
typedef HRESULT (WINAPI * MA_PFN_PropVariantClear)(MA_PROPVARIANT *pvar);
|
||||||
typedef int (WINAPI * MA_PFN_StringFromGUID2)(const GUID* const rguid, wchar_t* lpsz, int cchMax);
|
typedef int (WINAPI * MA_PFN_StringFromGUID2)(const GUID* const rguid, wchar_t* lpsz, int cchMax);
|
||||||
|
|
||||||
typedef HWND (WINAPI * MA_PFN_GetForegroundWindow)(void);
|
typedef HWND (WINAPI * MA_PFN_GetForegroundWindow)(void);
|
||||||
@@ -20064,7 +20089,7 @@ typedef struct
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Some compilers don't define PropVariantInit(). We just do this ourselves since it's just a memset(). */
|
/* Some compilers don't define PropVariantInit(). We just do this ourselves since it's just a memset(). */
|
||||||
static MA_INLINE void ma_PropVariantInit(PROPVARIANT* pProp)
|
static MA_INLINE void ma_PropVariantInit(MA_PROPVARIANT* pProp)
|
||||||
{
|
{
|
||||||
MA_ZERO_OBJECT(pProp);
|
MA_ZERO_OBJECT(pProp);
|
||||||
}
|
}
|
||||||
@@ -20265,7 +20290,7 @@ static MA_INLINE ULONG ma_IUnknown_Release(ma_IUnknown* pThis)
|
|||||||
ULONG (STDMETHODCALLTYPE * Release) (ma_IMMDevice* pThis);
|
ULONG (STDMETHODCALLTYPE * Release) (ma_IMMDevice* pThis);
|
||||||
|
|
||||||
/* IMMDevice */
|
/* IMMDevice */
|
||||||
HRESULT (STDMETHODCALLTYPE * Activate) (ma_IMMDevice* pThis, const IID* const iid, DWORD dwClsCtx, PROPVARIANT* pActivationParams, void** ppInterface);
|
HRESULT (STDMETHODCALLTYPE * Activate) (ma_IMMDevice* pThis, const IID* const iid, DWORD dwClsCtx, MA_PROPVARIANT* pActivationParams, void** ppInterface);
|
||||||
HRESULT (STDMETHODCALLTYPE * OpenPropertyStore)(ma_IMMDevice* pThis, DWORD stgmAccess, ma_IPropertyStore** ppProperties);
|
HRESULT (STDMETHODCALLTYPE * OpenPropertyStore)(ma_IMMDevice* pThis, DWORD stgmAccess, ma_IPropertyStore** ppProperties);
|
||||||
HRESULT (STDMETHODCALLTYPE * GetId) (ma_IMMDevice* pThis, LPWSTR *pID);
|
HRESULT (STDMETHODCALLTYPE * GetId) (ma_IMMDevice* pThis, LPWSTR *pID);
|
||||||
HRESULT (STDMETHODCALLTYPE * GetState) (ma_IMMDevice* pThis, DWORD *pState);
|
HRESULT (STDMETHODCALLTYPE * GetState) (ma_IMMDevice* pThis, DWORD *pState);
|
||||||
@@ -20277,7 +20302,7 @@ static MA_INLINE ULONG ma_IUnknown_Release(ma_IUnknown* pThis)
|
|||||||
static MA_INLINE HRESULT ma_IMMDevice_QueryInterface(ma_IMMDevice* pThis, const IID* const riid, void** ppObject) { return pThis->lpVtbl->QueryInterface(pThis, riid, ppObject); }
|
static MA_INLINE HRESULT ma_IMMDevice_QueryInterface(ma_IMMDevice* pThis, const IID* const riid, void** ppObject) { return pThis->lpVtbl->QueryInterface(pThis, riid, ppObject); }
|
||||||
static MA_INLINE ULONG ma_IMMDevice_AddRef(ma_IMMDevice* pThis) { return pThis->lpVtbl->AddRef(pThis); }
|
static MA_INLINE ULONG ma_IMMDevice_AddRef(ma_IMMDevice* pThis) { return pThis->lpVtbl->AddRef(pThis); }
|
||||||
static MA_INLINE ULONG ma_IMMDevice_Release(ma_IMMDevice* pThis) { return pThis->lpVtbl->Release(pThis); }
|
static MA_INLINE ULONG ma_IMMDevice_Release(ma_IMMDevice* pThis) { return pThis->lpVtbl->Release(pThis); }
|
||||||
static MA_INLINE HRESULT ma_IMMDevice_Activate(ma_IMMDevice* pThis, const IID* const iid, DWORD dwClsCtx, PROPVARIANT* pActivationParams, void** ppInterface) { return pThis->lpVtbl->Activate(pThis, iid, dwClsCtx, pActivationParams, ppInterface); }
|
static MA_INLINE HRESULT ma_IMMDevice_Activate(ma_IMMDevice* pThis, const IID* const iid, DWORD dwClsCtx, MA_PROPVARIANT* pActivationParams, void** ppInterface) { return pThis->lpVtbl->Activate(pThis, iid, dwClsCtx, pActivationParams, ppInterface); }
|
||||||
static MA_INLINE HRESULT ma_IMMDevice_OpenPropertyStore(ma_IMMDevice* pThis, DWORD stgmAccess, ma_IPropertyStore** ppProperties) { return pThis->lpVtbl->OpenPropertyStore(pThis, stgmAccess, ppProperties); }
|
static MA_INLINE HRESULT ma_IMMDevice_OpenPropertyStore(ma_IMMDevice* pThis, DWORD stgmAccess, ma_IPropertyStore** ppProperties) { return pThis->lpVtbl->OpenPropertyStore(pThis, stgmAccess, ppProperties); }
|
||||||
static MA_INLINE HRESULT ma_IMMDevice_GetId(ma_IMMDevice* pThis, LPWSTR *pID) { return pThis->lpVtbl->GetId(pThis, pID); }
|
static MA_INLINE HRESULT ma_IMMDevice_GetId(ma_IMMDevice* pThis, LPWSTR *pID) { return pThis->lpVtbl->GetId(pThis, pID); }
|
||||||
static MA_INLINE HRESULT ma_IMMDevice_GetState(ma_IMMDevice* pThis, DWORD *pState) { return pThis->lpVtbl->GetState(pThis, pState); }
|
static MA_INLINE HRESULT ma_IMMDevice_GetState(ma_IMMDevice* pThis, DWORD *pState) { return pThis->lpVtbl->GetState(pThis, pState); }
|
||||||
@@ -20314,8 +20339,8 @@ typedef struct
|
|||||||
/* IPropertyStore */
|
/* IPropertyStore */
|
||||||
HRESULT (STDMETHODCALLTYPE * GetCount)(ma_IPropertyStore* pThis, DWORD* pPropCount);
|
HRESULT (STDMETHODCALLTYPE * GetCount)(ma_IPropertyStore* pThis, DWORD* pPropCount);
|
||||||
HRESULT (STDMETHODCALLTYPE * GetAt) (ma_IPropertyStore* pThis, DWORD propIndex, PROPERTYKEY* pPropKey);
|
HRESULT (STDMETHODCALLTYPE * GetAt) (ma_IPropertyStore* pThis, DWORD propIndex, PROPERTYKEY* pPropKey);
|
||||||
HRESULT (STDMETHODCALLTYPE * GetValue)(ma_IPropertyStore* pThis, const PROPERTYKEY* const pKey, PROPVARIANT* pPropVar);
|
HRESULT (STDMETHODCALLTYPE * GetValue)(ma_IPropertyStore* pThis, const PROPERTYKEY* const pKey, MA_PROPVARIANT* pPropVar);
|
||||||
HRESULT (STDMETHODCALLTYPE * SetValue)(ma_IPropertyStore* pThis, const PROPERTYKEY* const pKey, const PROPVARIANT* const pPropVar);
|
HRESULT (STDMETHODCALLTYPE * SetValue)(ma_IPropertyStore* pThis, const PROPERTYKEY* const pKey, const MA_PROPVARIANT* const pPropVar);
|
||||||
HRESULT (STDMETHODCALLTYPE * Commit) (ma_IPropertyStore* pThis);
|
HRESULT (STDMETHODCALLTYPE * Commit) (ma_IPropertyStore* pThis);
|
||||||
} ma_IPropertyStoreVtbl;
|
} ma_IPropertyStoreVtbl;
|
||||||
struct ma_IPropertyStore
|
struct ma_IPropertyStore
|
||||||
@@ -20327,8 +20352,8 @@ static MA_INLINE ULONG ma_IPropertyStore_AddRef(ma_IPropertyStore* pThis)
|
|||||||
static MA_INLINE ULONG ma_IPropertyStore_Release(ma_IPropertyStore* pThis) { return pThis->lpVtbl->Release(pThis); }
|
static MA_INLINE ULONG ma_IPropertyStore_Release(ma_IPropertyStore* pThis) { return pThis->lpVtbl->Release(pThis); }
|
||||||
static MA_INLINE HRESULT ma_IPropertyStore_GetCount(ma_IPropertyStore* pThis, DWORD* pPropCount) { return pThis->lpVtbl->GetCount(pThis, pPropCount); }
|
static MA_INLINE HRESULT ma_IPropertyStore_GetCount(ma_IPropertyStore* pThis, DWORD* pPropCount) { return pThis->lpVtbl->GetCount(pThis, pPropCount); }
|
||||||
static MA_INLINE HRESULT ma_IPropertyStore_GetAt(ma_IPropertyStore* pThis, DWORD propIndex, PROPERTYKEY* pPropKey) { return pThis->lpVtbl->GetAt(pThis, propIndex, pPropKey); }
|
static MA_INLINE HRESULT ma_IPropertyStore_GetAt(ma_IPropertyStore* pThis, DWORD propIndex, PROPERTYKEY* pPropKey) { return pThis->lpVtbl->GetAt(pThis, propIndex, pPropKey); }
|
||||||
static MA_INLINE HRESULT ma_IPropertyStore_GetValue(ma_IPropertyStore* pThis, const PROPERTYKEY* const pKey, PROPVARIANT* pPropVar) { return pThis->lpVtbl->GetValue(pThis, pKey, pPropVar); }
|
static MA_INLINE HRESULT ma_IPropertyStore_GetValue(ma_IPropertyStore* pThis, const PROPERTYKEY* const pKey, MA_PROPVARIANT* pPropVar) { return pThis->lpVtbl->GetValue(pThis, pKey, pPropVar); }
|
||||||
static MA_INLINE HRESULT ma_IPropertyStore_SetValue(ma_IPropertyStore* pThis, const PROPERTYKEY* const pKey, const PROPVARIANT* const pPropVar) { return pThis->lpVtbl->SetValue(pThis, pKey, pPropVar); }
|
static MA_INLINE HRESULT ma_IPropertyStore_SetValue(ma_IPropertyStore* pThis, const PROPERTYKEY* const pKey, const MA_PROPVARIANT* const pPropVar) { return pThis->lpVtbl->SetValue(pThis, pKey, pPropVar); }
|
||||||
static MA_INLINE HRESULT ma_IPropertyStore_Commit(ma_IPropertyStore* pThis) { return pThis->lpVtbl->Commit(pThis); }
|
static MA_INLINE HRESULT ma_IPropertyStore_Commit(ma_IPropertyStore* pThis) { return pThis->lpVtbl->Commit(pThis); }
|
||||||
|
|
||||||
|
|
||||||
@@ -20533,7 +20558,7 @@ static MA_INLINE HRESULT ma_IAudioCaptureClient_GetNextPacketSize(ma_IAudioCaptu
|
|||||||
|
|
||||||
#if defined(MA_WIN32_UWP)
|
#if defined(MA_WIN32_UWP)
|
||||||
/* mmdevapi Functions */
|
/* mmdevapi Functions */
|
||||||
typedef HRESULT (WINAPI * MA_PFN_ActivateAudioInterfaceAsync)(const wchar_t* deviceInterfacePath, const IID* riid, PROPVARIANT* activationParams, ma_IActivateAudioInterfaceCompletionHandler* completionHandler, ma_IActivateAudioInterfaceAsyncOperation** activationOperation);
|
typedef HRESULT (WINAPI * MA_PFN_ActivateAudioInterfaceAsync)(const wchar_t* deviceInterfacePath, const IID* riid, MA_PROPVARIANT* activationParams, ma_IActivateAudioInterfaceCompletionHandler* completionHandler, ma_IActivateAudioInterfaceAsyncOperation** activationOperation);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Avrt Functions */
|
/* Avrt Functions */
|
||||||
@@ -21159,7 +21184,7 @@ static ma_result ma_context_get_device_info_from_IAudioClient__wasapi(ma_context
|
|||||||
*/
|
*/
|
||||||
hr = ma_IMMDevice_OpenPropertyStore((ma_IMMDevice*)pMMDevice, STGM_READ, &pProperties);
|
hr = ma_IMMDevice_OpenPropertyStore((ma_IMMDevice*)pMMDevice, STGM_READ, &pProperties);
|
||||||
if (SUCCEEDED(hr)) {
|
if (SUCCEEDED(hr)) {
|
||||||
PROPVARIANT var;
|
MA_PROPVARIANT var;
|
||||||
ma_PropVariantInit(&var);
|
ma_PropVariantInit(&var);
|
||||||
|
|
||||||
hr = ma_IPropertyStore_GetValue(pProperties, &MA_PKEY_AudioEngine_DeviceFormat, &var);
|
hr = ma_IPropertyStore_GetValue(pProperties, &MA_PKEY_AudioEngine_DeviceFormat, &var);
|
||||||
@@ -21422,7 +21447,7 @@ static ma_result ma_context_get_device_info_from_MMDevice__wasapi(ma_context* pC
|
|||||||
ma_IPropertyStore *pProperties;
|
ma_IPropertyStore *pProperties;
|
||||||
hr = ma_IMMDevice_OpenPropertyStore(pMMDevice, STGM_READ, &pProperties);
|
hr = ma_IMMDevice_OpenPropertyStore(pMMDevice, STGM_READ, &pProperties);
|
||||||
if (SUCCEEDED(hr)) {
|
if (SUCCEEDED(hr)) {
|
||||||
PROPVARIANT var;
|
MA_PROPVARIANT var;
|
||||||
|
|
||||||
ma_PropVariantInit(&var);
|
ma_PropVariantInit(&var);
|
||||||
hr = ma_IPropertyStore_GetValue(pProperties, &MA_PKEY_Device_FriendlyName, &var);
|
hr = ma_IPropertyStore_GetValue(pProperties, &MA_PKEY_Device_FriendlyName, &var);
|
||||||
@@ -21513,7 +21538,7 @@ done:
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ma_result ma_context_get_IAudioClient_Desktop__wasapi(ma_context* pContext, ma_device_type deviceType, const ma_device_id* pDeviceID, PROPVARIANT* pActivationParams, ma_IAudioClient** ppAudioClient, ma_IMMDevice** ppMMDevice)
|
static ma_result ma_context_get_IAudioClient_Desktop__wasapi(ma_context* pContext, ma_device_type deviceType, const ma_device_id* pDeviceID, MA_PROPVARIANT* pActivationParams, ma_IAudioClient** ppAudioClient, ma_IMMDevice** ppMMDevice)
|
||||||
{
|
{
|
||||||
ma_result result;
|
ma_result result;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
@@ -21535,7 +21560,7 @@ static ma_result ma_context_get_IAudioClient_Desktop__wasapi(ma_context* pContex
|
|||||||
return MA_SUCCESS;
|
return MA_SUCCESS;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
static ma_result ma_context_get_IAudioClient_UWP__wasapi(ma_context* pContext, ma_device_type deviceType, const ma_device_id* pDeviceID, PROPVARIANT* pActivationParams, ma_IAudioClient** ppAudioClient, ma_IUnknown** ppActivatedInterface)
|
static ma_result ma_context_get_IAudioClient_UWP__wasapi(ma_context* pContext, ma_device_type deviceType, const ma_device_id* pDeviceID, MA_PROPVARIANT* pActivationParams, ma_IAudioClient** ppAudioClient, ma_IUnknown** ppActivatedInterface)
|
||||||
{
|
{
|
||||||
ma_IActivateAudioInterfaceAsyncOperation *pAsyncOp = NULL;
|
ma_IActivateAudioInterfaceAsyncOperation *pAsyncOp = NULL;
|
||||||
ma_completion_handler_uwp completionHandler;
|
ma_completion_handler_uwp completionHandler;
|
||||||
@@ -21671,8 +21696,8 @@ static ma_result ma_context_get_IAudioClient__wasapi(ma_context* pContext, ma_de
|
|||||||
ma_result result;
|
ma_result result;
|
||||||
ma_bool32 usingProcessLoopback = MA_FALSE;
|
ma_bool32 usingProcessLoopback = MA_FALSE;
|
||||||
MA_AUDIOCLIENT_ACTIVATION_PARAMS audioclientActivationParams;
|
MA_AUDIOCLIENT_ACTIVATION_PARAMS audioclientActivationParams;
|
||||||
PROPVARIANT activationParams;
|
MA_PROPVARIANT activationParams;
|
||||||
PROPVARIANT* pActivationParams = NULL;
|
MA_PROPVARIANT* pActivationParams = NULL;
|
||||||
ma_device_id virtualDeviceID;
|
ma_device_id virtualDeviceID;
|
||||||
|
|
||||||
/* Activation parameters specific to loopback mode. Note that process-specific loopback will only work when a default device ID is specified. */
|
/* Activation parameters specific to loopback mode. Note that process-specific loopback will only work when a default device ID is specified. */
|
||||||
@@ -21977,7 +22002,7 @@ static ma_result ma_device_init_internal__wasapi(ma_context* pContext, ma_device
|
|||||||
ma_IPropertyStore* pStore = NULL;
|
ma_IPropertyStore* pStore = NULL;
|
||||||
hr = ma_IMMDevice_OpenPropertyStore(pDeviceInterface, STGM_READ, &pStore);
|
hr = ma_IMMDevice_OpenPropertyStore(pDeviceInterface, STGM_READ, &pStore);
|
||||||
if (SUCCEEDED(hr)) {
|
if (SUCCEEDED(hr)) {
|
||||||
PROPVARIANT prop;
|
MA_PROPVARIANT prop;
|
||||||
ma_PropVariantInit(&prop);
|
ma_PropVariantInit(&prop);
|
||||||
hr = ma_IPropertyStore_GetValue(pStore, &MA_PKEY_AudioEngine_DeviceFormat, &prop);
|
hr = ma_IPropertyStore_GetValue(pStore, &MA_PKEY_AudioEngine_DeviceFormat, &prop);
|
||||||
if (SUCCEEDED(hr)) {
|
if (SUCCEEDED(hr)) {
|
||||||
@@ -22267,7 +22292,7 @@ static ma_result ma_device_init_internal__wasapi(ma_context* pContext, ma_device
|
|||||||
ma_IPropertyStore *pProperties;
|
ma_IPropertyStore *pProperties;
|
||||||
hr = ma_IMMDevice_OpenPropertyStore(pDeviceInterface, STGM_READ, &pProperties);
|
hr = ma_IMMDevice_OpenPropertyStore(pDeviceInterface, STGM_READ, &pProperties);
|
||||||
if (SUCCEEDED(hr)) {
|
if (SUCCEEDED(hr)) {
|
||||||
PROPVARIANT varName;
|
MA_PROPVARIANT varName;
|
||||||
ma_PropVariantInit(&varName);
|
ma_PropVariantInit(&varName);
|
||||||
hr = ma_IPropertyStore_GetValue(pProperties, &MA_PKEY_Device_FriendlyName, &varName);
|
hr = ma_IPropertyStore_GetValue(pProperties, &MA_PKEY_Device_FriendlyName, &varName);
|
||||||
if (SUCCEEDED(hr)) {
|
if (SUCCEEDED(hr)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user