audio: Cleaned out most remaining /* */
comments for //
style.
Fully committing to it...! This left SDL_wave.* alone for now, since there's a ton of comments in there and this code hasn't changed much from SDL2 so far. But as SDL2 ages out a little more, I'll likely switch this over, too.
This commit is contained in:
parent
0ff67dc21b
commit
9d7c57234a
37 changed files with 378 additions and 384 deletions
|
@ -37,7 +37,7 @@
|
|||
|
||||
#include "SDL_wasapi.h"
|
||||
|
||||
/* handle to Avrt.dll--Vista and later!--for flagging the callback thread as "Pro Audio" (low latency). */
|
||||
// handle to Avrt.dll--Vista and later!--for flagging the callback thread as "Pro Audio" (low latency).
|
||||
static HMODULE libavrt = NULL;
|
||||
typedef HANDLE(WINAPI *pfnAvSetMmThreadCharacteristicsW)(LPCWSTR, LPDWORD);
|
||||
typedef BOOL(WINAPI *pfnAvRevertMmThreadCharacteristics)(HANDLE);
|
||||
|
@ -46,7 +46,7 @@ static pfnAvRevertMmThreadCharacteristics pAvRevertMmThreadCharacteristics = NUL
|
|||
|
||||
static SDL_bool immdevice_initialized = SDL_FALSE;
|
||||
|
||||
/* Some GUIDs we need to know without linking to libraries that aren't available before Vista. */
|
||||
// Some GUIDs we need to know without linking to libraries that aren't available before Vista.
|
||||
static const IID SDL_IID_IAudioClient = { 0x1cb9ad4c, 0xdbfa, 0x4c32, { 0xb1, 0x78, 0xc2, 0xf5, 0x68, 0xa7, 0x03, 0xb2 } };
|
||||
|
||||
int WASAPI_PlatformInit(void)
|
||||
|
@ -59,7 +59,7 @@ int WASAPI_PlatformInit(void)
|
|||
|
||||
immdevice_initialized = SDL_TRUE;
|
||||
|
||||
libavrt = LoadLibrary(TEXT("avrt.dll")); /* this library is available in Vista and later. No WinXP, so have to LoadLibrary to use it for now! */
|
||||
libavrt = LoadLibrary(TEXT("avrt.dll")); // this library is available in Vista and later. No WinXP, so have to LoadLibrary to use it for now!
|
||||
if (libavrt) {
|
||||
pAvSetMmThreadCharacteristicsW = (pfnAvSetMmThreadCharacteristicsW)GetProcAddress(libavrt, "AvSetMmThreadCharacteristicsW");
|
||||
pAvRevertMmThreadCharacteristics = (pfnAvRevertMmThreadCharacteristics)GetProcAddress(libavrt, "AvRevertMmThreadCharacteristics");
|
||||
|
@ -98,12 +98,12 @@ void WASAPI_PlatformDeinitializeStart(void)
|
|||
|
||||
void WASAPI_PlatformThreadInit(SDL_AudioDevice *device)
|
||||
{
|
||||
/* this thread uses COM. */
|
||||
if (SUCCEEDED(WIN_CoInitialize())) { /* can't report errors, hope it worked! */
|
||||
// this thread uses COM.
|
||||
if (SUCCEEDED(WIN_CoInitialize())) { // can't report errors, hope it worked!
|
||||
device->hidden->coinitialized = SDL_TRUE;
|
||||
}
|
||||
|
||||
/* Set this thread to very high "Pro Audio" priority. */
|
||||
// Set this thread to very high "Pro Audio" priority.
|
||||
if (pAvSetMmThreadCharacteristicsW) {
|
||||
DWORD idx = 0;
|
||||
device->hidden->task = pAvSetMmThreadCharacteristicsW(L"Pro Audio", &idx);
|
||||
|
@ -115,7 +115,7 @@ void WASAPI_PlatformThreadInit(SDL_AudioDevice *device)
|
|||
|
||||
void WASAPI_PlatformThreadDeinit(SDL_AudioDevice *device)
|
||||
{
|
||||
/* Set this thread back to normal priority. */
|
||||
// Set this thread back to normal priority.
|
||||
if (device->hidden->task && pAvRevertMmThreadCharacteristics) {
|
||||
pAvRevertMmThreadCharacteristics(device->hidden->task);
|
||||
device->hidden->task = NULL;
|
||||
|
@ -132,10 +132,10 @@ int WASAPI_ActivateDevice(SDL_AudioDevice *device)
|
|||
IMMDevice *immdevice = NULL;
|
||||
if (SDL_IMMDevice_Get(device, &immdevice, device->iscapture) < 0) {
|
||||
device->hidden->client = NULL;
|
||||
return -1; /* This is already set by SDL_IMMDevice_Get */
|
||||
return -1; // This is already set by SDL_IMMDevice_Get
|
||||
}
|
||||
|
||||
/* this is _not_ async in standard win32, yay! */
|
||||
// this is _not_ async in standard win32, yay!
|
||||
HRESULT ret = IMMDevice_Activate(immdevice, &SDL_IID_IAudioClient, CLSCTX_ALL, NULL, (void **)&device->hidden->client);
|
||||
IMMDevice_Release(immdevice);
|
||||
|
||||
|
@ -145,11 +145,11 @@ int WASAPI_ActivateDevice(SDL_AudioDevice *device)
|
|||
}
|
||||
|
||||
SDL_assert(device->hidden->client != NULL);
|
||||
if (WASAPI_PrepDevice(device) == -1) { /* not async, fire it right away. */
|
||||
if (WASAPI_PrepDevice(device) == -1) { // not async, fire it right away.
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0; /* good to go. */
|
||||
return 0; // good to go.
|
||||
}
|
||||
|
||||
void WASAPI_EnumerateEndpoints(SDL_AudioDevice **default_output, SDL_AudioDevice **default_capture)
|
||||
|
@ -159,7 +159,7 @@ void WASAPI_EnumerateEndpoints(SDL_AudioDevice **default_output, SDL_AudioDevice
|
|||
|
||||
void WASAPI_PlatformDeleteActivationHandler(void *handler)
|
||||
{
|
||||
/* not asynchronous. */
|
||||
// not asynchronous.
|
||||
SDL_assert(!"This function should have only been called on WinRT.");
|
||||
}
|
||||
|
||||
|
@ -168,4 +168,4 @@ void WASAPI_PlatformFreeDeviceHandle(SDL_AudioDevice *device)
|
|||
SDL_IMMDevice_FreeDeviceHandle(device);
|
||||
}
|
||||
|
||||
#endif /* SDL_AUDIO_DRIVER_WASAPI && !defined(__WINRT__) */
|
||||
#endif // SDL_AUDIO_DRIVER_WASAPI && !defined(__WINRT__)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue