src/audio/xaudio2/SDL_xaudio2.h
author Ryan C. Gordon
Mon, 23 Jan 2017 12:06:10 -0500
changeset 10837 c2f241c2f6ad
parent 10737 3406a0f8b041
child 11382 2c50e79b19e0
permissions -rw-r--r--
audio: Fix same bug as last commit, but for _mm_bslli_si128 vs _mm_slli_si128.
dludwig@9931
     1
/*
dludwig@9931
     2
  Simple DirectMedia Layer
slouken@10737
     3
  Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
dludwig@9931
     4
dludwig@9931
     5
  This software is provided 'as-is', without any express or implied
dludwig@9931
     6
  warranty.  In no event will the authors be held liable for any damages
dludwig@9931
     7
  arising from the use of this software.
dludwig@9931
     8
dludwig@9931
     9
  Permission is granted to anyone to use this software for any purpose,
dludwig@9931
    10
  including commercial applications, and to alter it and redistribute it
dludwig@9931
    11
  freely, subject to the following restrictions:
dludwig@9931
    12
dludwig@9931
    13
  1. The origin of this software must not be misrepresented; you must not
dludwig@9931
    14
     claim that you wrote the original software. If you use this software
dludwig@9931
    15
     in a product, an acknowledgment in the product documentation would be
dludwig@9931
    16
     appreciated but is not required.
dludwig@9931
    17
  2. Altered source versions must be plainly marked as such, and must not be
dludwig@9931
    18
     misrepresented as being the original software.
dludwig@9931
    19
  3. This notice may not be removed or altered from any source distribution.
dludwig@9931
    20
*/
dludwig@9931
    21
dludwig@9931
    22
#ifndef _SDL_XAUDIO2_H
dludwig@9931
    23
#define _SDL_XAUDIO2_H
dludwig@9931
    24
dludwig@9931
    25
#include <windows.h>
dludwig@9931
    26
#include <mmreg.h>
dludwig@9931
    27
#include <objbase.h>
dludwig@9931
    28
dludwig@9931
    29
/* XAudio2 packs its structure members together as tightly as possible.
dludwig@9931
    30
   This pragma is needed to ensure compatibility with XAudio2 on 64-bit
dludwig@9931
    31
   platforms.
dludwig@9931
    32
*/
dludwig@9931
    33
#pragma pack(push, 1)
dludwig@9931
    34
dludwig@9931
    35
typedef interface IXAudio2 IXAudio2;
dludwig@9931
    36
typedef interface IXAudio2SourceVoice IXAudio2SourceVoice;
dludwig@9931
    37
typedef interface IXAudio2MasteringVoice IXAudio2MasteringVoice;
dludwig@9931
    38
typedef interface IXAudio2EngineCallback IXAudio2EngineCallback;
dludwig@9931
    39
typedef interface IXAudio2VoiceCallback IXAudio2VoiceCallback;
dludwig@9931
    40
typedef interface IXAudio2Voice IXAudio2Voice;
dludwig@9931
    41
typedef interface IXAudio2SubmixVoice IXAudio2SubmixVoice;
dludwig@9931
    42
dludwig@9931
    43
typedef enum _AUDIO_STREAM_CATEGORY {
dludwig@9931
    44
    AudioCategory_Other = 0,
dludwig@9931
    45
    AudioCategory_ForegroundOnlyMedia,
dludwig@9931
    46
    AudioCategory_BackgroundCapableMedia,
dludwig@9931
    47
    AudioCategory_Communications,
dludwig@9931
    48
    AudioCategory_Alerts,
dludwig@9931
    49
    AudioCategory_SoundEffects,
dludwig@9931
    50
    AudioCategory_GameEffects,
dludwig@9931
    51
    AudioCategory_GameMedia,
dludwig@9931
    52
    AudioCategory_GameChat,
dludwig@9931
    53
    AudioCategory_Movie,
dludwig@9931
    54
    AudioCategory_Media
dludwig@9931
    55
} AUDIO_STREAM_CATEGORY;
dludwig@9931
    56
dludwig@9931
    57
typedef struct XAUDIO2_BUFFER {
dludwig@9931
    58
    UINT32     Flags;
dludwig@9931
    59
    UINT32     AudioBytes;
dludwig@9931
    60
    const BYTE *pAudioData;
dludwig@9931
    61
    UINT32     PlayBegin;
dludwig@9931
    62
    UINT32     PlayLength;
dludwig@9931
    63
    UINT32     LoopBegin;
dludwig@9931
    64
    UINT32     LoopLength;
dludwig@9931
    65
    UINT32     LoopCount;
dludwig@9931
    66
    void       *pContext;
dludwig@9931
    67
} XAUDIO2_BUFFER;
dludwig@9931
    68
dludwig@9931
    69
typedef struct XAUDIO2_BUFFER_WMA {
dludwig@9931
    70
    const UINT32 *pDecodedPacketCumulativeBytes;
dludwig@9931
    71
    UINT32       PacketCount;
dludwig@9931
    72
} XAUDIO2_BUFFER_WMA;
dludwig@9931
    73
dludwig@9931
    74
typedef struct XAUDIO2_SEND_DESCRIPTOR {
dludwig@9931
    75
    UINT32        Flags;
dludwig@9931
    76
    IXAudio2Voice *pOutputVoice;
dludwig@9931
    77
} XAUDIO2_SEND_DESCRIPTOR;
dludwig@9931
    78
dludwig@9931
    79
typedef struct XAUDIO2_VOICE_SENDS {
dludwig@9931
    80
    UINT32                  SendCount;
dludwig@9931
    81
    XAUDIO2_SEND_DESCRIPTOR *pSends;
dludwig@9931
    82
} XAUDIO2_VOICE_SENDS;
dludwig@9931
    83
dludwig@9931
    84
typedef struct XAUDIO2_EFFECT_DESCRIPTOR {
dludwig@9931
    85
    IUnknown *pEffect;
dludwig@9931
    86
    BOOL     InitialState;
dludwig@9931
    87
    UINT32   OutputChannels;
dludwig@9931
    88
} XAUDIO2_EFFECT_DESCRIPTOR;
dludwig@9931
    89
dludwig@9931
    90
typedef struct XAUDIO2_EFFECT_CHAIN {
dludwig@9931
    91
    UINT32                    EffectCount;
dludwig@9931
    92
    XAUDIO2_EFFECT_DESCRIPTOR *pEffectDescriptors;
dludwig@9931
    93
} XAUDIO2_EFFECT_CHAIN;
dludwig@9931
    94
dludwig@9931
    95
typedef struct XAUDIO2_PERFORMANCE_DATA {
dludwig@9931
    96
    UINT64 AudioCyclesSinceLastQuery;
dludwig@9931
    97
    UINT64 TotalCyclesSinceLastQuery;
dludwig@9931
    98
    UINT32 MinimumCyclesPerQuantum;
dludwig@9931
    99
    UINT32 MaximumCyclesPerQuantum;
dludwig@9931
   100
    UINT32 MemoryUsageInBytes;
dludwig@9931
   101
    UINT32 CurrentLatencyInSamples;
dludwig@9931
   102
    UINT32 GlitchesSinceEngineStarted;
dludwig@9931
   103
    UINT32 ActiveSourceVoiceCount;
dludwig@9931
   104
    UINT32 TotalSourceVoiceCount;
dludwig@9931
   105
    UINT32 ActiveSubmixVoiceCount;
dludwig@9931
   106
    UINT32 ActiveResamplerCount;
dludwig@9931
   107
    UINT32 ActiveMatrixMixCount;
dludwig@9931
   108
    UINT32 ActiveXmaSourceVoices;
dludwig@9931
   109
    UINT32 ActiveXmaStreams;
dludwig@9931
   110
} XAUDIO2_PERFORMANCE_DATA;
dludwig@9931
   111
dludwig@9931
   112
typedef struct XAUDIO2_DEBUG_CONFIGURATION {
dludwig@9931
   113
    UINT32 TraceMask;
dludwig@9931
   114
    UINT32 BreakMask;
dludwig@9931
   115
    BOOL   LogThreadID;
dludwig@9931
   116
    BOOL   LogFileline;
dludwig@9931
   117
    BOOL   LogFunctionName;
dludwig@9931
   118
    BOOL   LogTiming;
dludwig@9931
   119
} XAUDIO2_DEBUG_CONFIGURATION;
dludwig@9931
   120
dludwig@9931
   121
typedef struct XAUDIO2_VOICE_DETAILS {
dludwig@9931
   122
    UINT32 CreationFlags;
dludwig@9931
   123
    UINT32 ActiveFlags;
dludwig@9931
   124
    UINT32 InputChannels;
dludwig@9931
   125
    UINT32 InputSampleRate;
dludwig@9931
   126
} XAUDIO2_VOICE_DETAILS;
dludwig@9931
   127
dludwig@9931
   128
typedef enum XAUDIO2_FILTER_TYPE {
dludwig@9931
   129
    LowPassFilter = 0,
dludwig@9931
   130
    BandPassFilter = 1,
dludwig@9931
   131
    HighPassFilter = 2,
dludwig@9931
   132
    NotchFilter = 3,
dludwig@9931
   133
    LowPassOnePoleFilter = 4,
dludwig@9931
   134
    HighPassOnePoleFilter = 5
dludwig@9931
   135
} XAUDIO2_FILTER_TYPE;
dludwig@9931
   136
dludwig@9931
   137
typedef struct XAUDIO2_FILTER_PARAMETERS {
dludwig@9931
   138
    XAUDIO2_FILTER_TYPE Type;
dludwig@9931
   139
    float               Frequency;
dludwig@9931
   140
    float               OneOverQ;
dludwig@9931
   141
} XAUDIO2_FILTER_PARAMETERS;
dludwig@9931
   142
dludwig@9931
   143
typedef struct XAUDIO2_VOICE_STATE {
dludwig@9931
   144
    void   *pCurrentBufferContext;
dludwig@9931
   145
    UINT32 BuffersQueued;
dludwig@9931
   146
    UINT64 SamplesPlayed;
dludwig@9931
   147
} XAUDIO2_VOICE_STATE;
dludwig@9931
   148
dludwig@9931
   149
dludwig@9931
   150
typedef UINT32 XAUDIO2_PROCESSOR;
dludwig@9931
   151
#define Processor1 0x00000001
dludwig@9931
   152
#define XAUDIO2_DEFAULT_PROCESSOR Processor1
dludwig@9931
   153
dludwig@9931
   154
#define XAUDIO2_E_DEVICE_INVALIDATED 0x88960004
dludwig@9931
   155
#define XAUDIO2_COMMIT_NOW 0
dludwig@9931
   156
#define XAUDIO2_VOICE_NOSAMPLESPLAYED 0x0100
dludwig@9931
   157
#define XAUDIO2_DEFAULT_CHANNELS 0
dludwig@9931
   158
dludwig@9931
   159
extern HRESULT __stdcall XAudio2Create(
dludwig@9931
   160
    _Out_ IXAudio2          **ppXAudio2,
dludwig@9931
   161
    _In_  UINT32            Flags,
dludwig@9931
   162
    _In_  XAUDIO2_PROCESSOR XAudio2Processor
dludwig@9931
   163
    );
dludwig@9931
   164
dludwig@9931
   165
#undef INTERFACE
dludwig@9931
   166
#define INTERFACE IXAudio2
dludwig@9931
   167
typedef interface IXAudio2 {
dludwig@9931
   168
    const struct IXAudio2Vtbl FAR* lpVtbl;
dludwig@9931
   169
} IXAudio2;
dludwig@9931
   170
typedef const struct IXAudio2Vtbl IXAudio2Vtbl;
dludwig@9931
   171
const struct IXAudio2Vtbl
dludwig@9931
   172
{
dludwig@9931
   173
    /* IUnknown */
dludwig@9931
   174
    STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
dludwig@9931
   175
    STDMETHOD_(ULONG, AddRef)(THIS) PURE;
dludwig@9931
   176
    STDMETHOD_(ULONG, Release)(THIS) PURE;
dludwig@9931
   177
dludwig@9931
   178
    /* IXAudio2 */
dludwig@9931
   179
    STDMETHOD_(HRESULT, RegisterForCallbacks)(THIS, IXAudio2EngineCallback *pCallback) PURE;
dludwig@9931
   180
    STDMETHOD_(VOID, UnregisterForCallbacks)(THIS, IXAudio2EngineCallback *pCallback) PURE;
dludwig@9931
   181
    STDMETHOD_(HRESULT, CreateSourceVoice)(THIS, IXAudio2SourceVoice **ppSourceVoice,
dludwig@9931
   182
                                           const WAVEFORMATEX *pSourceFormat,
dludwig@9931
   183
                                           UINT32 Flags,
dludwig@9931
   184
                                           float MaxFrequencyRatio,
dludwig@9931
   185
                                           IXAudio2VoiceCallback *pCallback,
dludwig@9931
   186
                                           const XAUDIO2_VOICE_SENDS *pSendList,
dludwig@9931
   187
                                           const XAUDIO2_EFFECT_CHAIN *pEffectChain) PURE;
dludwig@9931
   188
    STDMETHOD_(HRESULT, CreateSubmixVoice)(THIS, IXAudio2SubmixVoice **ppSubmixVoice,
dludwig@9931
   189
                                           UINT32 InputChannels,
dludwig@9931
   190
                                           UINT32 InputSampleRate,
dludwig@9931
   191
                                           UINT32 Flags,
dludwig@9931
   192
                                           UINT32 ProcessingStage,
dludwig@9931
   193
                                           const XAUDIO2_VOICE_SENDS *pSendList,
dludwig@9931
   194
                                           const XAUDIO2_EFFECT_CHAIN *pEffectChain) PURE;
dludwig@9931
   195
    STDMETHOD_(HRESULT, CreateMasteringVoice)(THIS, IXAudio2MasteringVoice **ppMasteringVoice,
dludwig@9931
   196
                                              UINT32 InputChannels,
dludwig@9931
   197
                                              UINT32 InputSampleRate,
dludwig@9931
   198
                                              UINT32 Flags,
dludwig@9931
   199
                                              LPCWSTR szDeviceId,
dludwig@9931
   200
                                              const XAUDIO2_EFFECT_CHAIN *pEffectChain,
dludwig@9931
   201
                                              AUDIO_STREAM_CATEGORY StreamCategory) PURE;
dludwig@9931
   202
    STDMETHOD_(HRESULT, StartEngine)(THIS) PURE;
dludwig@9931
   203
    STDMETHOD_(VOID, StopEngine)(THIS) PURE;
dludwig@9931
   204
    STDMETHOD_(HRESULT, CommitChanges)(THIS, UINT32 OperationSet) PURE;
dludwig@9931
   205
    STDMETHOD_(HRESULT, GetPerformanceData)(THIS, XAUDIO2_PERFORMANCE_DATA *pPerfData) PURE;
dludwig@9931
   206
    STDMETHOD_(HRESULT, SetDebugConfiguration)(THIS, XAUDIO2_DEBUG_CONFIGURATION *pDebugConfiguration,
dludwig@9931
   207
                                               VOID *pReserved) PURE;
dludwig@9931
   208
};
dludwig@9931
   209
dludwig@9931
   210
#define IXAudio2_Release(A) ((A)->lpVtbl->Release(A))
dludwig@9931
   211
#define IXAudio2_CreateSourceVoice(A,B,C,D,E,F,G,H) ((A)->lpVtbl->CreateSourceVoice(A,B,C,D,E,F,G,H))
dludwig@9931
   212
#define IXAudio2_CreateMasteringVoice(A,B,C,D,E,F,G,H) ((A)->lpVtbl->CreateMasteringVoice(A,B,C,D,E,F,G,H))
dludwig@9931
   213
#define IXAudio2_StartEngine(A) ((A)->lpVtbl->StartEngine(A))
dludwig@9931
   214
#define IXAudio2_StopEngine(A) ((A)->lpVtbl->StopEngine(A))
dludwig@9931
   215
dludwig@9931
   216
dludwig@9931
   217
#undef INTERFACE
dludwig@9931
   218
#define INTERFACE IXAudio2SourceVoice
dludwig@9931
   219
typedef interface IXAudio2SourceVoice {
dludwig@9931
   220
    const struct IXAudio2SourceVoiceVtbl FAR* lpVtbl;
dludwig@9931
   221
} IXAudio2SourceVoice;
dludwig@9931
   222
typedef const struct IXAudio2SourceVoiceVtbl IXAudio2SourceVoiceVtbl;
dludwig@9931
   223
const struct IXAudio2SourceVoiceVtbl
dludwig@9931
   224
{
dludwig@9931
   225
    /* MSDN says that IXAudio2Voice inherits from IXAudio2, but MSVC's debugger
dludwig@9931
   226
     * says otherwise, and that IXAudio2Voice doesn't inherit from any other
dludwig@9931
   227
     * interface!
dludwig@9931
   228
     */
dludwig@9931
   229
dludwig@9931
   230
    /* IXAudio2Voice */
dludwig@9931
   231
    STDMETHOD_(VOID, GetVoiceDetails)(THIS, XAUDIO2_VOICE_DETAILS *pVoiceDetails) PURE;
dludwig@9931
   232
    STDMETHOD_(HRESULT, SetOutputVoices)(THIS, const XAUDIO2_VOICE_SENDS *pSendList) PURE;
dludwig@9931
   233
    STDMETHOD_(HRESULT, SetEffectChain)(THIS, const XAUDIO2_EFFECT_CHAIN *pEffectChain) PURE;
dludwig@9931
   234
    STDMETHOD_(HRESULT, EnableEffect)(THIS, UINT32 EffectIndex, UINT32 OperationSet) PURE;
dludwig@9931
   235
    STDMETHOD_(HRESULT, DisableEffect)(THIS, UINT32 EffectIndex, UINT32 OperationSet) PURE;
dludwig@9931
   236
    STDMETHOD_(VOID, GetEffectState)(THIS, UINT32 EffectIndex, BOOL *pEnabled) PURE;
dludwig@9931
   237
    STDMETHOD_(HRESULT, SetEffectParameters)(THIS, UINT32 EffectIndex,
dludwig@9931
   238
                                             const void *pParameters,
dludwig@9931
   239
                                             UINT32 ParametersByteSize,
dludwig@9931
   240
                                             UINT32 OperationSet) PURE;
dludwig@9931
   241
    STDMETHOD_(VOID, GetEffectParameters)(THIS, UINT32 EffectIndex,
dludwig@9931
   242
                                          void *pParameters,
dludwig@9931
   243
                                          UINT32 ParametersByteSize) PURE;
dludwig@9931
   244
    STDMETHOD_(HRESULT, SetFilterParameters)(THIS, const XAUDIO2_FILTER_PARAMETERS *pParameters,
dludwig@9931
   245
                                             UINT32 OperationSet) PURE;
dludwig@9931
   246
    STDMETHOD_(VOID, GetFilterParameters)(THIS, XAUDIO2_FILTER_PARAMETERS *pParameters) PURE;
dludwig@9931
   247
    STDMETHOD_(HRESULT, SetOutputFilterParameters)(THIS, IXAudio2Voice *pDestinationVoice,
dludwig@9931
   248
                                                   XAUDIO2_FILTER_PARAMETERS *pParameters,
dludwig@9931
   249
                                                   UINT32 OperationSet) PURE;
dludwig@9931
   250
    STDMETHOD_(VOID, GetOutputFilterParameters)(THIS, IXAudio2Voice *pDestinationVoice,
dludwig@9931
   251
                                                XAUDIO2_FILTER_PARAMETERS *pParameters) PURE;
dludwig@9931
   252
    STDMETHOD_(HRESULT, SetVolume)(THIS, float Volume,
dludwig@9931
   253
                                   UINT32 OperationSet) PURE;
dludwig@9931
   254
    STDMETHOD_(VOID, GetVolume)(THIS, float *pVolume) PURE;
dludwig@9931
   255
    STDMETHOD_(HRESULT, SetChannelVolumes)(THIS, UINT32 Channels,
dludwig@9931
   256
                                           const float *pVolumes,
dludwig@9931
   257
                                           UINT32 OperationSet) PURE;
dludwig@9931
   258
    STDMETHOD_(VOID, GetChannelVolumes)(THIS, UINT32 Channels,
dludwig@9931
   259
                                        float *pVolumes) PURE;
dludwig@9931
   260
    STDMETHOD_(HRESULT, SetOutputMatrix)(THIS, IXAudio2Voice *pDestinationVoice,
dludwig@9931
   261
                                         UINT32 SourceChannels,
dludwig@9931
   262
                                         UINT32 DestinationChannels,
dludwig@9931
   263
                                         const float *pLevelMatrix,
dludwig@9931
   264
                                         UINT32 OperationSet) PURE;
dludwig@9931
   265
    STDMETHOD_(VOID, GetOutputMatrix)(THIS, IXAudio2Voice *pDestinationVoice,
dludwig@9931
   266
                                      UINT32 SourceChannels,
dludwig@9931
   267
                                      UINT32 DestinationChannels,
dludwig@9931
   268
                                      float *pLevelMatrix) PURE;
dludwig@9931
   269
    STDMETHOD_(VOID, DestroyVoice)(THIS) PURE;
dludwig@9931
   270
dludwig@9931
   271
    /* IXAudio2SourceVoice */
dludwig@9931
   272
    STDMETHOD_(HRESULT, Start)(THIS, UINT32 Flags,
dludwig@9931
   273
                               UINT32 OperationSet) PURE;
dludwig@9931
   274
    STDMETHOD_(HRESULT, Stop)(THIS, UINT32 Flags,
dludwig@9931
   275
                              UINT32 OperationSet) PURE;
dludwig@9931
   276
    STDMETHOD_(HRESULT, SubmitSourceBuffer)(THIS, const XAUDIO2_BUFFER *pBuffer,
dludwig@9931
   277
                                            const XAUDIO2_BUFFER_WMA *pBufferWMA) PURE;
dludwig@9931
   278
    STDMETHOD_(HRESULT, FlushSourceBuffers)(THIS) PURE;
dludwig@9931
   279
    STDMETHOD_(HRESULT, Discontinuity)(THIS) PURE;
dludwig@9931
   280
    STDMETHOD_(HRESULT, ExitLoop)(THIS, UINT32 OperationSet) PURE;
dludwig@9931
   281
    STDMETHOD_(VOID, GetState)(THIS, XAUDIO2_VOICE_STATE *pVoiceState,
dludwig@9931
   282
                               UINT32 Flags) PURE;
dludwig@9931
   283
    STDMETHOD_(HRESULT, SetFrequencyRatio)(THIS, float Ratio,
dludwig@9931
   284
                                           UINT32 OperationSet) PURE;
dludwig@9931
   285
    STDMETHOD_(VOID, GetFrequencyRatio)(THIS, float *pRatio) PURE;
dludwig@9931
   286
    STDMETHOD_(HRESULT, SetSourceSampleRate)(THIS, UINT32 NewSourceSampleRate) PURE;
dludwig@9931
   287
};
dludwig@9931
   288
dludwig@9931
   289
#define IXAudio2SourceVoice_DestroyVoice(A) ((A)->lpVtbl->DestroyVoice(A))
dludwig@9931
   290
#define IXAudio2SourceVoice_Start(A,B,C) ((A)->lpVtbl->Start(A,B,C))
dludwig@9931
   291
#define IXAudio2SourceVoice_Stop(A,B,C) ((A)->lpVtbl->Stop(A,B,C))
dludwig@9931
   292
#define IXAudio2SourceVoice_SubmitSourceBuffer(A,B,C) ((A)->lpVtbl->SubmitSourceBuffer(A,B,C))
dludwig@9931
   293
#define IXAudio2SourceVoice_FlushSourceBuffers(A) ((A)->lpVtbl->FlushSourceBuffers(A))
dludwig@9931
   294
#define IXAudio2SourceVoice_Discontinuity(A) ((A)->lpVtbl->Discontinuity(A))
dludwig@9931
   295
#define IXAudio2SourceVoice_GetState(A,B,C) ((A)->lpVtbl->GetState(A,B,C))
dludwig@9931
   296
dludwig@9931
   297
dludwig@9931
   298
#undef INTERFACE
dludwig@9931
   299
#define INTERFACE IXAudio2MasteringVoice
dludwig@9931
   300
typedef interface IXAudio2MasteringVoice {
dludwig@9931
   301
    const struct IXAudio2MasteringVoiceVtbl FAR* lpVtbl;
dludwig@9931
   302
} IXAudio2MasteringVoice;
dludwig@9931
   303
typedef const struct IXAudio2MasteringVoiceVtbl IXAudio2MasteringVoiceVtbl;
dludwig@9931
   304
const struct IXAudio2MasteringVoiceVtbl
dludwig@9931
   305
{
dludwig@9931
   306
    /* MSDN says that IXAudio2Voice inherits from IXAudio2, but MSVC's debugger
dludwig@9931
   307
     * says otherwise, and that IXAudio2Voice doesn't inherit from any other
dludwig@9931
   308
     * interface!
dludwig@9931
   309
     */
dludwig@9931
   310
dludwig@9931
   311
    /* IXAudio2Voice */
dludwig@9931
   312
    STDMETHOD_(VOID, GetVoiceDetails)(THIS, XAUDIO2_VOICE_DETAILS *pVoiceDetails) PURE;
dludwig@9931
   313
    STDMETHOD_(HRESULT, SetOutputVoices)(THIS, const XAUDIO2_VOICE_SENDS *pSendList) PURE;
dludwig@9931
   314
    STDMETHOD_(HRESULT, SetEffectChain)(THIS, const XAUDIO2_EFFECT_CHAIN *pEffectChain) PURE;
dludwig@9931
   315
    STDMETHOD_(HRESULT, EnableEffect)(THIS, UINT32 EffectIndex, UINT32 OperationSet) PURE;
dludwig@9931
   316
    STDMETHOD_(HRESULT, DisableEffect)(THIS, UINT32 EffectIndex, UINT32 OperationSet) PURE;
dludwig@9931
   317
    STDMETHOD_(VOID, GetEffectState)(THIS, UINT32 EffectIndex, BOOL *pEnabled) PURE;
dludwig@9931
   318
    STDMETHOD_(HRESULT, SetEffectParameters)(THIS, UINT32 EffectIndex,
dludwig@9931
   319
                                             const void *pParameters,
dludwig@9931
   320
                                             UINT32 ParametersByteSize,
dludwig@9931
   321
                                             UINT32 OperationSet) PURE;
dludwig@9931
   322
    STDMETHOD_(VOID, GetEffectParameters)(THIS, UINT32 EffectIndex,
dludwig@9931
   323
                                          void *pParameters,
dludwig@9931
   324
                                          UINT32 ParametersByteSize) PURE;
dludwig@9931
   325
    STDMETHOD_(HRESULT, SetFilterParameters)(THIS, const XAUDIO2_FILTER_PARAMETERS *pParameters,
dludwig@9931
   326
                                             UINT32 OperationSet) PURE;
dludwig@9931
   327
    STDMETHOD_(VOID, GetFilterParameters)(THIS, XAUDIO2_FILTER_PARAMETERS *pParameters) PURE;
dludwig@9931
   328
    STDMETHOD_(HRESULT, SetOutputFilterParameters)(THIS, IXAudio2Voice *pDestinationVoice,
dludwig@9931
   329
                                                   XAUDIO2_FILTER_PARAMETERS *pParameters,
dludwig@9931
   330
                                                   UINT32 OperationSet) PURE;
dludwig@9931
   331
    STDMETHOD_(VOID, GetOutputFilterParameters)(THIS, IXAudio2Voice *pDestinationVoice,
dludwig@9931
   332
                                                XAUDIO2_FILTER_PARAMETERS *pParameters) PURE;
dludwig@9931
   333
    STDMETHOD_(HRESULT, SetVolume)(THIS, float Volume,
dludwig@9931
   334
                                   UINT32 OperationSet) PURE;
dludwig@9931
   335
    STDMETHOD_(VOID, GetVolume)(THIS, float *pVolume) PURE;
dludwig@9931
   336
    STDMETHOD_(HRESULT, SetChannelVolumes)(THIS, UINT32 Channels,
dludwig@9931
   337
                                           const float *pVolumes,
dludwig@9931
   338
                                           UINT32 OperationSet) PURE;
dludwig@9931
   339
    STDMETHOD_(VOID, GetChannelVolumes)(THIS, UINT32 Channels,
dludwig@9931
   340
                                        float *pVolumes) PURE;
dludwig@9931
   341
    STDMETHOD_(HRESULT, SetOutputMatrix)(THIS, IXAudio2Voice *pDestinationVoice,
dludwig@9931
   342
                                         UINT32 SourceChannels,
dludwig@9931
   343
                                         UINT32 DestinationChannels,
dludwig@9931
   344
                                         const float *pLevelMatrix,
dludwig@9931
   345
                                         UINT32 OperationSet) PURE;
dludwig@9931
   346
    STDMETHOD_(VOID, GetOutputMatrix)(THIS, IXAudio2Voice *pDestinationVoice,
dludwig@9931
   347
                                      UINT32 SourceChannels,
dludwig@9931
   348
                                      UINT32 DestinationChannels,
dludwig@9931
   349
                                      float *pLevelMatrix) PURE;
dludwig@9931
   350
    STDMETHOD_(VOID, DestroyVoice)(THIS) PURE;
dludwig@9931
   351
dludwig@9931
   352
    /* IXAudio2SourceVoice */
dludwig@9931
   353
    STDMETHOD_(VOID, GetChannelMask)(THIS, DWORD *pChannelMask) PURE;
dludwig@9931
   354
};
dludwig@9931
   355
dludwig@9931
   356
#define IXAudio2MasteringVoice_DestroyVoice(A) ((A)->lpVtbl->DestroyVoice(A))
dludwig@9931
   357
dludwig@9931
   358
dludwig@9931
   359
#undef INTERFACE
dludwig@9931
   360
#define INTERFACE IXAudio2VoiceCallback
dludwig@9931
   361
typedef interface IXAudio2VoiceCallback {
dludwig@9931
   362
    const struct IXAudio2VoiceCallbackVtbl FAR* lpVtbl;
dludwig@9931
   363
} IXAudio2VoiceCallback;
dludwig@9931
   364
typedef const struct IXAudio2VoiceCallbackVtbl IXAudio2VoiceCallbackVtbl;
dludwig@9931
   365
const struct IXAudio2VoiceCallbackVtbl
dludwig@9931
   366
{
dludwig@9931
   367
    /* MSDN says that IXAudio2VoiceCallback inherits from IXAudio2, but SDL's
dludwig@9931
   368
     * own code says otherwise, and that IXAudio2VoiceCallback doesn't inherit
dludwig@9931
   369
     * from any other interface!
dludwig@9931
   370
     */
dludwig@9931
   371
dludwig@9931
   372
    /* IXAudio2VoiceCallback */
dludwig@9931
   373
    STDMETHOD_(VOID, OnVoiceProcessingPassStart)(THIS, UINT32 BytesRequired) PURE;
dludwig@9931
   374
    STDMETHOD_(VOID, OnVoiceProcessingPassEnd)(THIS) PURE;
dludwig@9931
   375
    STDMETHOD_(VOID, OnStreamEnd)(THIS) PURE;
dludwig@9931
   376
    STDMETHOD_(VOID, OnBufferStart)(THIS, void *pBufferContext) PURE;
dludwig@9931
   377
    STDMETHOD_(VOID, OnBufferEnd)(THIS, void *pBufferContext) PURE;
dludwig@9931
   378
    STDMETHOD_(VOID, OnLoopEnd)(THIS, void *pBufferContext) PURE;
dludwig@9931
   379
    STDMETHOD_(VOID, OnVoiceError)(THIS, void *pBufferContext, HRESULT Error) PURE;
dludwig@9931
   380
};
dludwig@9931
   381
dludwig@9931
   382
#pragma pack(pop)   /* Undo pragma push */
dludwig@9931
   383
dludwig@9931
   384
#endif  /* _SDL_XAUDIO2_H */
dludwig@9931
   385
dludwig@9931
   386
/* vi: set ts=4 sw=4 expandtab: */