SDL 2.0
SDL_wasapi.h
Go to the documentation of this file.
1/*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
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
40{
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;
56};
57
58/* these increment as default devices change. Opened default devices pick up changes in their threads. */
61
62/* win32 and winrt implementations call into these. */
63int WASAPI_PrepDevice(_THIS, const SDL_bool updatestream);
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. */
73int WASAPI_ActivateDevice(_THIS, const SDL_bool isrecovery);
78
79#ifdef __cplusplus
80}
81#endif
82
83#endif /* SDL_wasapi_h_ */
84
85/* vi: set ts=4 sw=4 expandtab: */
SDL_bool
Definition: SDL_stdinc.h:162
void WASAPI_PlatformDeleteActivationHandler(void *handler)
void WASAPI_RemoveDevice(const SDL_bool iscapture, LPCWSTR devid)
#define _THIS
Definition: SDL_wasapi.h:36
SDL_atomic_t WASAPI_DefaultPlaybackGeneration
void WASAPI_PlatformThreadDeinit(_THIS)
int WASAPI_ActivateDevice(_THIS, const SDL_bool isrecovery)
void WASAPI_RefDevice(_THIS)
void WASAPI_BeginLoopIteration(_THIS)
SDL_atomic_t WASAPI_DefaultCaptureGeneration
void WASAPI_PlatformThreadInit(_THIS)
int WASAPI_PlatformInit(void)
int WASAPI_PrepDevice(_THIS, const SDL_bool updatestream)
void WASAPI_EnumerateEndpoints(void)
void WASAPI_PlatformDeinit(void)
void WASAPI_AddDevice(const SDL_bool iscapture, const char *devname, LPCWSTR devid)
void WASAPI_UnrefDevice(_THIS)
SDL_bool device_lost
Definition: SDL_wasapi.h:53
IAudioRenderClient * render
Definition: SDL_wasapi.h:45
SDL_atomic_t just_activated
Definition: SDL_wasapi.h:55
IAudioClient * client
Definition: SDL_wasapi.h:44
WAVEFORMATEX * waveformat
Definition: SDL_wasapi.h:43
IAudioCaptureClient * capture
Definition: SDL_wasapi.h:46
void * activation_handler
Definition: SDL_wasapi.h:54
SDL_atomic_t refcount
Definition: SDL_wasapi.h:41
SDL_bool coinitialized
Definition: SDL_wasapi.h:50
SDL_AudioStream * capturestream
Definition: SDL_wasapi.h:47
A type representing an atomic integer value. It is a struct so people don't accidentally use numeric ...
Definition: SDL_atomic.h:216