oleaut32: Add V_RECORD() and V_RECORDINFO() and use them for wine_dbgstr_variant().
[wine.git] / dlls / xaudio2_7 / xaudio_private.h
blob7772a5b59e902f2b2f1d54d0b6b8b213fe00d4a6
1 /*
2 * Copyright (c) 2015 Andrew Eikum for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #include "windef.h"
20 #include "winbase.h"
21 #include "winuser.h"
22 #include "wine/list.h"
24 #include "mmsystem.h"
25 #include "xaudio2.h"
26 #include "xaudio2fx.h"
27 #include "xapo.h"
28 #include "devpkey.h"
29 #include "mmdeviceapi.h"
30 #include "audioclient.h"
32 #include <AL/al.h>
33 #include <AL/alc.h>
34 #include <AL/alext.h>
36 typedef struct _XA2Buffer {
37 XAUDIO2_BUFFER xa2buffer;
38 DWORD offs_bytes;
39 UINT32 latest_al_buf, looped, loop_end_bytes, play_end_bytes, cur_end_bytes;
40 } XA2Buffer;
42 typedef struct _IXAudio2Impl IXAudio2Impl;
44 typedef struct _XA2SourceImpl {
45 IXAudio20SourceVoice IXAudio20SourceVoice_iface;
46 IXAudio23SourceVoice IXAudio23SourceVoice_iface;
47 IXAudio27SourceVoice IXAudio27SourceVoice_iface;
48 IXAudio2SourceVoice IXAudio2SourceVoice_iface;
50 IXAudio2Impl *xa2;
52 BOOL in_use;
54 CRITICAL_SECTION lock;
56 WAVEFORMATEX *fmt;
57 ALenum al_fmt;
58 UINT32 submit_blocksize;
60 IXAudio2VoiceCallback *cb;
62 DWORD nsends;
63 XAUDIO2_SEND_DESCRIPTOR *sends;
65 BOOL running;
67 UINT64 played_frames;
69 XA2Buffer buffers[XAUDIO2_MAX_QUEUED_BUFFERS];
70 UINT32 first_buf, cur_buf, nbufs, in_al_bytes;
72 UINT32 scratch_bytes, convert_bytes;
73 BYTE *scratch_buf, *convert_buf;
75 ALuint al_src;
76 /* most cases will only need about 4 AL buffers, but some corner cases
77 * could require up to MAX_QUEUED_BUFFERS */
78 ALuint al_bufs[XAUDIO2_MAX_QUEUED_BUFFERS];
79 DWORD first_al_buf, al_bufs_used;
81 struct list entry;
82 } XA2SourceImpl;
84 typedef struct _XA2SubmixImpl {
85 IXAudio20SubmixVoice IXAudio20SubmixVoice_iface;
86 IXAudio23SubmixVoice IXAudio23SubmixVoice_iface;
87 IXAudio2SubmixVoice IXAudio2SubmixVoice_iface;
89 BOOL in_use;
91 CRITICAL_SECTION lock;
93 struct list entry;
94 } XA2SubmixImpl;
96 struct _IXAudio2Impl {
97 IXAudio20 IXAudio20_iface;
98 IXAudio22 IXAudio22_iface;
99 IXAudio27 IXAudio27_iface;
100 IXAudio2 IXAudio2_iface;
101 IXAudio20MasteringVoice IXAudio20MasteringVoice_iface;
102 IXAudio23MasteringVoice IXAudio23MasteringVoice_iface;
103 IXAudio2MasteringVoice IXAudio2MasteringVoice_iface;
105 LONG ref;
107 CRITICAL_SECTION lock;
109 HANDLE engine, mmevt;
110 BOOL stop_engine;
112 DWORD version;
114 struct list source_voices;
115 struct list submix_voices;
117 IMMDeviceEnumerator *devenum;
119 WCHAR **devids;
120 UINT32 ndevs;
122 UINT32 last_query_glitches;
124 IAudioClient *aclient;
125 IAudioRenderClient *render;
127 UINT32 period_frames;
129 WAVEFORMATEXTENSIBLE fmt;
131 ALCdevice *al_device;
132 ALCcontext *al_ctx;
134 UINT32 ncbs;
135 IXAudio2EngineCallback **cbs;
137 BOOL running;
140 extern const IXAudio27SourceVoiceVtbl XAudio27SourceVoice_Vtbl DECLSPEC_HIDDEN;
141 extern const IXAudio27Vtbl XAudio27_Vtbl DECLSPEC_HIDDEN;
143 extern const IXAudio23SourceVoiceVtbl XAudio23SourceVoice_Vtbl DECLSPEC_HIDDEN;
144 extern const IXAudio23SubmixVoiceVtbl XAudio23SubmixVoice_Vtbl DECLSPEC_HIDDEN;
145 extern const IXAudio23MasteringVoiceVtbl XAudio23MasteringVoice_Vtbl DECLSPEC_HIDDEN;
147 extern const IXAudio22Vtbl XAudio22_Vtbl DECLSPEC_HIDDEN;
149 extern const IXAudio20Vtbl XAudio20_Vtbl DECLSPEC_HIDDEN;
150 extern const IXAudio20SourceVoiceVtbl XAudio20SourceVoice_Vtbl DECLSPEC_HIDDEN;
151 extern const IXAudio20SubmixVoiceVtbl XAudio20SubmixVoice_Vtbl DECLSPEC_HIDDEN;
152 extern const IXAudio20MasteringVoiceVtbl XAudio20MasteringVoice_Vtbl DECLSPEC_HIDDEN;