src/audio/xaudio2/SDL_xaudio2_winrthelpers.h
author Sam Lantinga <slouken@libsdl.org>
Tue, 26 May 2015 06:27:46 -0700
changeset 9619 b94b6d0bff0f
parent 8616 ec011c16e2fd
child 9998 f67cf37e9cd4
permissions -rw-r--r--
Updated the copyright year to 2015
slouken@8616
     1
/*
slouken@8616
     2
  Simple DirectMedia Layer
slouken@9619
     3
  Copyright (C) 1997-2015 Sam Lantinga <slouken@libsdl.org>
slouken@8582
     4
slouken@8616
     5
  This software is provided 'as-is', without any express or implied
slouken@8616
     6
  warranty.  In no event will the authors be held liable for any damages
slouken@8616
     7
  arising from the use of this software.
slouken@8616
     8
slouken@8616
     9
  Permission is granted to anyone to use this software for any purpose,
slouken@8616
    10
  including commercial applications, and to alter it and redistribute it
slouken@8616
    11
  freely, subject to the following restrictions:
slouken@8616
    12
slouken@8616
    13
  1. The origin of this software must not be misrepresented; you must not
slouken@8616
    14
     claim that you wrote the original software. If you use this software
slouken@8616
    15
     in a product, an acknowledgment in the product documentation would be
slouken@8616
    16
     appreciated but is not required.
slouken@8616
    17
  2. Altered source versions must be plainly marked as such, and must not be
slouken@8616
    18
     misrepresented as being the original software.
slouken@8616
    19
  3. This notice may not be removed or altered from any source distribution.
slouken@8616
    20
*/
slouken@8582
    21
slouken@8582
    22
//
slouken@8582
    23
// Re-implementation of methods removed from XAudio2 (in WinRT):
slouken@8582
    24
//
slouken@8582
    25
slouken@8582
    26
typedef struct XAUDIO2_DEVICE_DETAILS
slouken@8582
    27
{
slouken@8582
    28
    WCHAR DeviceID[256];
slouken@8582
    29
    WCHAR DisplayName[256];
slouken@8582
    30
    /* Other fields exist in the pre-Windows 8 version of this struct, however
slouken@8582
    31
       they weren't used by SDL, so they weren't added.
slouken@8582
    32
    */
slouken@8582
    33
} XAUDIO2_DEVICE_DETAILS;
slouken@8582
    34
slouken@8582
    35
slouken@8582
    36
#ifdef __cplusplus
slouken@8582
    37
extern "C" {
slouken@8582
    38
#endif
slouken@8582
    39
slouken@8582
    40
HRESULT IXAudio2_GetDeviceCount(IXAudio2 * unused, UINT32 * devcount);
slouken@8582
    41
HRESULT IXAudio2_GetDeviceDetails(IXAudio2 * unused, UINT32 index, XAUDIO2_DEVICE_DETAILS * details);
slouken@8582
    42
slouken@8582
    43
#ifdef __cplusplus
slouken@8582
    44
}
slouken@8582
    45
#endif
slouken@8582
    46
slouken@8582
    47
slouken@8582
    48
//
slouken@8582
    49
// C-style macros to call XAudio2's methods in C++:
slouken@8582
    50
//
slouken@8582
    51
#ifdef __cplusplus
slouken@8582
    52
/*
slouken@8582
    53
#define IXAudio2_CreateMasteringVoice(A, B, C, D, E, F, G) (A)->CreateMasteringVoice((B), (C), (D), (E), (F), (G))
slouken@8582
    54
#define IXAudio2_CreateSourceVoice(A, B, C, D, E, F, G, H) (A)->CreateSourceVoice((B), (C), (D), (E), (F), (G), (H))
slouken@8582
    55
#define IXAudio2_QueryInterface(A, B, C) (A)->QueryInterface((B), (C))
slouken@8582
    56
#define IXAudio2_Release(A) (A)->Release()
slouken@8582
    57
#define IXAudio2_StartEngine(A) (A)->StartEngine()
slouken@8582
    58
#define IXAudio2_StopEngine(A) (A)->StopEngine()
slouken@8582
    59
slouken@8582
    60
#define IXAudio2MasteringVoice_DestroyVoice(A) (A)->DestroyVoice()
slouken@8582
    61
slouken@8582
    62
#define IXAudio2SourceVoice_DestroyVoice(A) (A)->DestroyVoice()
slouken@8582
    63
#define IXAudio2SourceVoice_Discontinuity(A) (A)->Discontinuity()
slouken@8582
    64
#define IXAudio2SourceVoice_FlushSourceBuffers(A) (A)->FlushSourceBuffers()
slouken@8582
    65
#define IXAudio2SourceVoice_GetState(A, B) (A)->GetState((B))
slouken@8582
    66
#define IXAudio2SourceVoice_Start(A, B, C) (A)->Start((B), (C))
slouken@8582
    67
#define IXAudio2SourceVoice_Stop(A, B, C) (A)->Stop((B), (C))
slouken@8582
    68
#define IXAudio2SourceVoice_SubmitSourceBuffer(A, B, C) (A)->SubmitSourceBuffer((B), (C))
slouken@8582
    69
*/
slouken@8582
    70
#endif // ifdef __cplusplus