Atlas - SDL_wasapi.h
Home / ext / SDL2 / src / audio / wasapi Lines: 1 | Size: 2748 bytes [Download] [Show on GitHub] [Search similar files] [Raw] [Raw (proxy)][FILE BEGIN]1/* 2 Simple DirectMedia Layer 3 Copyright (C) 1997-2018 Sam Lantinga <[email protected]> 4 5 This software is provided 'as-is', without any express or implied 6 warranty. In no event will the authors be held liable for any damages 7 arising from the use of this software. 8 9 Permission is granted to anyone to use this software for any purpose, 10 including commercial applications, and to alter it and redistribute it 11 freely, subject to the following restrictions: 12 13 1. The origin of this software must not be misrepresented; you must not 14 claim that you wrote the original software. If you use this software 15 in a product, an acknowledgment in the product documentation would be 16 appreciated but is not required. 17 2. Altered source versions must be plainly marked as such, and must not be 18 misrepresented as being the original software. 19 3. This notice may not be removed or altered from any source distribution. 20*/ 21#include "../../SDL_internal.h" 22 23#ifndef SDL_wasapi_h_ 24#define SDL_wasapi_h_ 25 26#ifdef __cplusplus 27extern "C" { 28#endif 29 30#include "../SDL_sysaudio.h" 31 32/* Hidden "this" pointer for the audio functions */ 33#ifdef __cplusplus 34#define _THIS SDL_AudioDevice *_this 35#else 36#define _THIS SDL_AudioDevice *this 37#endif 38 39struct SDL_PrivateAudioData 40{ 41 SDL_atomic_t refcount; 42 WCHAR *devid; 43 WAVEFORMATEX *waveformat; 44 IAudioClient *client; 45 IAudioRenderClient *render; 46 IAudioCaptureClient *capture; 47 SDL_AudioStream *capturestream; 48 HANDLE event; 49 HANDLE task; 50 SDL_bool coinitialized; 51 int framesize; 52 int default_device_generation; 53 SDL_bool device_lost; 54 void *activation_handler; 55 SDL_atomic_t just_activated; 56}; 57 58/* these increment as default devices change. Opened default devices pick up changes in their threads. */ 59extern SDL_atomic_t WASAPI_DefaultPlaybackGeneration; 60extern SDL_atomic_t WASAPI_DefaultCaptureGeneration; 61 62/* win32 and winrt implementations call into these. */ 63int WASAPI_PrepDevice(_THIS, const SDL_bool updatestream); 64void WASAPI_RefDevice(_THIS); 65void WASAPI_UnrefDevice(_THIS); 66void WASAPI_AddDevice(const SDL_bool iscapture, const char *devname, LPCWSTR devid); 67void WASAPI_RemoveDevice(const SDL_bool iscapture, LPCWSTR devid); 68 69/* These are functions that are implemented differently for Windows vs WinRT. */ 70int WASAPI_PlatformInit(void); 71void WASAPI_PlatformDeinit(void); 72void WASAPI_EnumerateEndpoints(void); 73int WASAPI_ActivateDevice(_THIS, const SDL_bool isrecovery); 74void WASAPI_PlatformThreadInit(_THIS); 75void WASAPI_PlatformThreadDeinit(_THIS); 76void WASAPI_PlatformDeleteActivationHandler(void *handler); 77void WASAPI_BeginLoopIteration(_THIS); 78 79#ifdef __cplusplus 80} 81#endif 82 83#endif /* SDL_wasapi_h_ */ 84 85/* vi: set ts=4 sw=4 expandtab: */ 86[FILE END](C) 2025 0x4248 (C) 2025 4248 Media and 4248 Systems, All part of 0x4248 See LICENCE files for more information. Not all files are by 0x4248 always check Licencing.