include/mscvpdb.h: Use flexible array members for the rest of structures.
[wine.git] / dlls / xaudio2_7 / xaudio_private.h
blobfc907edf9c109b77413c1b37150cd5f74b6dec20
1 /*
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
20 #include "windef.h"
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>
31 #include "xapo.h"
33 #include <FAudio.h>
34 #include <FAPO.h>
36 #if XAUDIO2_VER == 0
37 #define COMPAT_E_INVALID_CALL E_INVALIDARG
38 #define COMPAT_E_DEVICE_INVALIDATED XAUDIO20_E_DEVICE_INVALIDATED
39 #else
40 #define COMPAT_E_INVALID_CALL XAUDIO2_E_INVALID_CALL
41 #define COMPAT_E_DEVICE_INVALIDATED XAUDIO2_E_DEVICE_INVALIDATED
42 #endif
44 typedef struct _XA2XAPOImpl {
45 IXAPO *xapo;
46 IXAPOParameters *xapo_params;
48 LONG ref;
50 FAPO FAPO_vtbl;
51 } XA2XAPOImpl;
53 typedef struct _XA2XAPOFXImpl {
54 IXAPO IXAPO_iface;
55 IXAPOParameters IXAPOParameters_iface;
57 FAPO *fapo;
58 } XA2XAPOFXImpl;
60 typedef struct _XA2VoiceImpl {
61 IXAudio2SourceVoice IXAudio2SourceVoice_iface;
63 IXAudio2SubmixVoice IXAudio2SubmixVoice_iface;
65 IXAudio2MasteringVoice IXAudio2MasteringVoice_iface;
67 FAudioVoiceCallback FAudioVoiceCallback_vtbl;
68 FAudioEffectChain *effect_chain;
70 BOOL in_use;
72 CRITICAL_SECTION lock;
74 IXAudio2VoiceCallback *cb;
76 FAudioVoice *faudio_voice;
78 struct {
79 FAudioEngineCallEXT proc;
80 FAudio *faudio;
81 float *stream;
82 } engine_params;
84 struct list entry;
85 } XA2VoiceImpl;
87 typedef struct _IXAudio2Impl {
88 IXAudio2 IXAudio2_iface;
90 CRITICAL_SECTION lock;
92 struct list voices;
94 FAudio *faudio;
96 FAudioEngineCallback FAudioEngineCallback_vtbl;
98 XA2VoiceImpl mst;
100 DWORD last_query_glitches;
102 UINT32 ncbs;
103 IXAudio2EngineCallback **cbs;
104 } IXAudio2Impl;
106 /* xaudio_dll.c */
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);
112 /* xapo.c */
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);