src/audio/xaudio2/SDL_xaudio2_winrthelpers.h
author Ryan C. Gordon
Tue, 24 Jan 2017 16:18:25 -0500
changeset 10850 c9dc0068b0e7
parent 10737 3406a0f8b041
permissions -rw-r--r--
configure: report libsamplerate support status.
     1 /*
     2   Simple DirectMedia Layer
     3   Copyright (C) 1997-2017 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 
    22 //
    23 // Re-implementation of methods removed from XAudio2 (in WinRT):
    24 //
    25 
    26 typedef struct XAUDIO2_DEVICE_DETAILS
    27 {
    28     WCHAR DeviceID[256];
    29     WCHAR DisplayName[256];
    30     /* Other fields exist in the pre-Windows 8 version of this struct, however
    31        they weren't used by SDL, so they weren't added.
    32     */
    33 } XAUDIO2_DEVICE_DETAILS;
    34 
    35 
    36 #ifdef __cplusplus
    37 extern "C" {
    38 #endif
    39 
    40 HRESULT IXAudio2_GetDeviceCount(IXAudio2 * unused, UINT32 * devcount);
    41 HRESULT IXAudio2_GetDeviceDetails(IXAudio2 * unused, UINT32 index, XAUDIO2_DEVICE_DETAILS * details);
    42 
    43 #ifdef __cplusplus
    44 }
    45 #endif
    46 
    47 
    48 //
    49 // C-style macros to call XAudio2's methods in C++:
    50 //
    51 #ifdef __cplusplus
    52 /*
    53 #define IXAudio2_CreateMasteringVoice(A, B, C, D, E, F, G) (A)->CreateMasteringVoice((B), (C), (D), (E), (F), (G))
    54 #define IXAudio2_CreateSourceVoice(A, B, C, D, E, F, G, H) (A)->CreateSourceVoice((B), (C), (D), (E), (F), (G), (H))
    55 #define IXAudio2_QueryInterface(A, B, C) (A)->QueryInterface((B), (C))
    56 #define IXAudio2_Release(A) (A)->Release()
    57 #define IXAudio2_StartEngine(A) (A)->StartEngine()
    58 #define IXAudio2_StopEngine(A) (A)->StopEngine()
    59 
    60 #define IXAudio2MasteringVoice_DestroyVoice(A) (A)->DestroyVoice()
    61 
    62 #define IXAudio2SourceVoice_DestroyVoice(A) (A)->DestroyVoice()
    63 #define IXAudio2SourceVoice_Discontinuity(A) (A)->Discontinuity()
    64 #define IXAudio2SourceVoice_FlushSourceBuffers(A) (A)->FlushSourceBuffers()
    65 #define IXAudio2SourceVoice_GetState(A, B) (A)->GetState((B))
    66 #define IXAudio2SourceVoice_Start(A, B, C) (A)->Start((B), (C))
    67 #define IXAudio2SourceVoice_Stop(A, B, C) (A)->Stop((B), (C))
    68 #define IXAudio2SourceVoice_SubmitSourceBuffer(A, B, C) (A)->SubmitSourceBuffer((B), (C))
    69 */
    70 #endif // ifdef __cplusplus