2 * Copyright (c) 2015 Andrew Eikum for CodeWeavers
3 * Copyright (c) 2018 Ethan Lee for CodeWeavers
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include "wine/list.h"
23 /* Don't include xaudio2.h directly; it's generated from an IDL with ifdefs and
24 * hence is frozen at version 2.7. Instead include that IDL in a local IDL and
25 * include the generated header.
27 * Because shared sources are compiled from the C file in the xaudio2_7
28 * directory, we need to use angle brackets here to prevent the compiler from
29 * picking up xaudio_classes.h from that directory for other versions. */
30 #include <xaudio_classes.h>
37 #define COMPAT_E_INVALID_CALL E_INVALIDARG
38 #define COMPAT_E_DEVICE_INVALIDATED XAUDIO20_E_DEVICE_INVALIDATED
40 #define COMPAT_E_INVALID_CALL XAUDIO2_E_INVALID_CALL
41 #define COMPAT_E_DEVICE_INVALIDATED XAUDIO2_E_DEVICE_INVALIDATED
44 typedef struct _XA2XAPOImpl
{
46 IXAPOParameters
*xapo_params
;
53 typedef struct _XA2XAPOFXImpl
{
55 IXAPOParameters IXAPOParameters_iface
;
60 typedef struct _XA2VoiceImpl
{
61 IXAudio2SourceVoice IXAudio2SourceVoice_iface
;
63 IXAudio2SubmixVoice IXAudio2SubmixVoice_iface
;
65 IXAudio2MasteringVoice IXAudio2MasteringVoice_iface
;
67 FAudioVoiceCallback FAudioVoiceCallback_vtbl
;
68 FAudioEffectChain
*effect_chain
;
72 CRITICAL_SECTION lock
;
74 IXAudio2VoiceCallback
*cb
;
76 FAudioVoice
*faudio_voice
;
79 FAudioEngineCallEXT proc
;
87 typedef struct _IXAudio2Impl
{
88 IXAudio2 IXAudio2_iface
;
90 CRITICAL_SECTION lock
;
96 FAudioEngineCallback FAudioEngineCallback_vtbl
;
100 DWORD last_query_glitches
;
103 IXAudio2EngineCallback
**cbs
;
107 extern HRESULT
xaudio2_initialize(IXAudio2Impl
*This
, UINT32 flags
, XAUDIO2_PROCESSOR proc
);
108 extern FAudioEffectChain
*wrap_effect_chain(const XAUDIO2_EFFECT_CHAIN
*pEffectChain
);
109 extern void engine_cb(FAudioEngineCallEXT proc
, FAudio
*faudio
, float *stream
, void *user
);
110 extern DWORD WINAPI
engine_thread(void *user
);
113 extern HRESULT
make_xapo_factory(REFCLSID clsid
, REFIID riid
, void **ppv
);
115 /* xaudio_allocator.c */
116 extern void* XAudio_Internal_Malloc(size_t size
);
117 extern void XAudio_Internal_Free(void* ptr
);
118 extern void* XAudio_Internal_Realloc(void* ptr
, size_t size
);