Commit d9e6a31c authored by Andrew Eikum's avatar Andrew Eikum Committed by Alexandre Julliard

xaudio2: Don't build interfaces for other versions.

parent fb954b7b
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -1087,6 +1087,9 @@ START_TEST(xaudio2)
hr = pXAudio2Create(&xa, 0, XAUDIO2_DEFAULT_PROCESSOR);
ok(hr == S_OK, "XAudio2Create failed: %08x\n", hr);
hr = IXAudio2_QueryInterface(xa, &IID_IXAudio27, (void**)&xa27);
ok(hr == E_NOINTERFACE, "XA28 object should support IXAudio27, gave: %08x\n", hr);
has_devices = check_has_devices(xa);
if(has_devices){
test_simple_streaming(xa);
......
......@@ -1198,10 +1198,12 @@ static HRESULT WINAPI IXAudio2Impl_QueryInterface(IXAudio2 *iface, REFIID riid,
/* all xaudio versions before 28 share an IID */
#if XAUDIO2_VER == 0
*ppvObject = &This->IXAudio20_iface;
#elif XAUDIO2_VER == 1 || XAUDIO2_VER == 2
#elif XAUDIO2_VER <= 2
*ppvObject = &This->IXAudio22_iface;
#else
#elif XAUDIO2_VER <= 7
*ppvObject = &This->IXAudio27_iface;
#else
*ppvObject = NULL;
#endif
}else
*ppvObject = NULL;
......@@ -1374,10 +1376,15 @@ static HRESULT WINAPI IXAudio2Impl_CreateSourceVoice(IXAudio2 *iface,
list_add_head(&This->source_voices, &src->entry);
src->IXAudio2SourceVoice_iface.lpVtbl = &XAudio2SourceVoice_Vtbl;
#if XAUDIO2_VER == 0
src->IXAudio20SourceVoice_iface.lpVtbl = &XAudio20SourceVoice_Vtbl;
#elif XAUDIO2_VER <= 3
src->IXAudio23SourceVoice_iface.lpVtbl = &XAudio23SourceVoice_Vtbl;
#elif XAUDIO2_VER <= 7
src->IXAudio27SourceVoice_iface.lpVtbl = &XAudio27SourceVoice_Vtbl;
src->IXAudio2SourceVoice_iface.lpVtbl = &XAudio2SourceVoice_Vtbl;
#endif
InitializeCriticalSection(&src->lock);
src->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": XA2SourceImpl.lock");
......@@ -1458,9 +1465,13 @@ static HRESULT WINAPI IXAudio2Impl_CreateSubmixVoice(IXAudio2 *iface,
list_add_head(&This->submix_voices, &sub->entry);
sub->IXAudio2SubmixVoice_iface.lpVtbl = &XAudio2SubmixVoice_Vtbl;
#if XAUDIO2_VER == 0
sub->IXAudio20SubmixVoice_iface.lpVtbl = &XAudio20SubmixVoice_Vtbl;
#elif XAUDIO2_VER <= 3
sub->IXAudio23SubmixVoice_iface.lpVtbl = &XAudio23SubmixVoice_Vtbl;
sub->IXAudio2SubmixVoice_iface.lpVtbl = &XAudio2SubmixVoice_Vtbl;
#endif
InitializeCriticalSection(&sub->lock);
sub->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": XA2SubmixImpl.lock");
......@@ -1944,13 +1955,22 @@ static HRESULT WINAPI XAudio2CF_CreateInstance(IClassFactory *iface, IUnknown *p
if(!object)
return E_OUTOFMEMORY;
object->IXAudio2_iface.lpVtbl = &XAudio2_Vtbl;
object->IXAudio2MasteringVoice_iface.lpVtbl = &XAudio2MasteringVoice_Vtbl;
#if XAUDIO2_VER == 0
object->IXAudio20_iface.lpVtbl = &XAudio20_Vtbl;
#elif XAUDIO2_VER <= 2
object->IXAudio22_iface.lpVtbl = &XAudio22_Vtbl;
#elif XAUDIO2_VER <= 7
object->IXAudio27_iface.lpVtbl = &XAudio27_Vtbl;
object->IXAudio2_iface.lpVtbl = &XAudio2_Vtbl;
#endif
#if XAUDIO2_VER == 0
object->IXAudio20MasteringVoice_iface.lpVtbl = &XAudio20MasteringVoice_Vtbl;
#elif XAUDIO2_VER <= 3
object->IXAudio23MasteringVoice_iface.lpVtbl = &XAudio23MasteringVoice_Vtbl;
object->IXAudio2MasteringVoice_iface.lpVtbl = &XAudio2MasteringVoice_Vtbl;
#endif
list_init(&object->source_voices);
list_init(&object->submix_voices);
......
......@@ -42,10 +42,15 @@ typedef struct _XA2Buffer {
typedef struct _IXAudio2Impl IXAudio2Impl;
typedef struct _XA2SourceImpl {
IXAudio2SourceVoice IXAudio2SourceVoice_iface;
#if XAUDIO2_VER == 0
IXAudio20SourceVoice IXAudio20SourceVoice_iface;
#elif XAUDIO2_VER <= 3
IXAudio23SourceVoice IXAudio23SourceVoice_iface;
#elif XAUDIO2_VER <= 7
IXAudio27SourceVoice IXAudio27SourceVoice_iface;
IXAudio2SourceVoice IXAudio2SourceVoice_iface;
#endif
IXAudio2Impl *xa2;
......@@ -82,9 +87,13 @@ typedef struct _XA2SourceImpl {
} XA2SourceImpl;
typedef struct _XA2SubmixImpl {
IXAudio2SubmixVoice IXAudio2SubmixVoice_iface;
#if XAUDIO2_VER == 0
IXAudio20SubmixVoice IXAudio20SubmixVoice_iface;
#elif XAUDIO2_VER <= 3
IXAudio23SubmixVoice IXAudio23SubmixVoice_iface;
IXAudio2SubmixVoice IXAudio2SubmixVoice_iface;
#endif
BOOL in_use;
......@@ -94,13 +103,22 @@ typedef struct _XA2SubmixImpl {
} XA2SubmixImpl;
struct _IXAudio2Impl {
IXAudio2 IXAudio2_iface;
IXAudio2MasteringVoice IXAudio2MasteringVoice_iface;
#if XAUDIO2_VER == 0
IXAudio20 IXAudio20_iface;
#elif XAUDIO2_VER <= 2
IXAudio22 IXAudio22_iface;
#elif XAUDIO2_VER <= 7
IXAudio27 IXAudio27_iface;
IXAudio2 IXAudio2_iface;
#endif
#if XAUDIO2_VER == 0
IXAudio20MasteringVoice IXAudio20MasteringVoice_iface;
#elif XAUDIO2_VER <= 3
IXAudio23MasteringVoice IXAudio23MasteringVoice_iface;
IXAudio2MasteringVoice IXAudio2MasteringVoice_iface;
#endif
LONG ref;
......@@ -135,19 +153,25 @@ struct _IXAudio2Impl {
BOOL running;
};
extern const IXAudio27SourceVoiceVtbl XAudio27SourceVoice_Vtbl DECLSPEC_HIDDEN;
extern const IXAudio27Vtbl XAudio27_Vtbl DECLSPEC_HIDDEN;
#if XAUDIO2_VER == 0
extern const IXAudio20SourceVoiceVtbl XAudio20SourceVoice_Vtbl DECLSPEC_HIDDEN;
extern const IXAudio20SubmixVoiceVtbl XAudio20SubmixVoice_Vtbl DECLSPEC_HIDDEN;
extern const IXAudio20MasteringVoiceVtbl XAudio20MasteringVoice_Vtbl DECLSPEC_HIDDEN;
#elif XAUDIO2_VER <= 3
extern const IXAudio23SourceVoiceVtbl XAudio23SourceVoice_Vtbl DECLSPEC_HIDDEN;
extern const IXAudio23SubmixVoiceVtbl XAudio23SubmixVoice_Vtbl DECLSPEC_HIDDEN;
extern const IXAudio23MasteringVoiceVtbl XAudio23MasteringVoice_Vtbl DECLSPEC_HIDDEN;
#elif XAUDIO2_VER <= 7
extern const IXAudio27SourceVoiceVtbl XAudio27SourceVoice_Vtbl DECLSPEC_HIDDEN;
#endif
extern const IXAudio22Vtbl XAudio22_Vtbl DECLSPEC_HIDDEN;
#if XAUDIO2_VER == 0
extern const IXAudio20Vtbl XAudio20_Vtbl DECLSPEC_HIDDEN;
extern const IXAudio20SourceVoiceVtbl XAudio20SourceVoice_Vtbl DECLSPEC_HIDDEN;
extern const IXAudio20SubmixVoiceVtbl XAudio20SubmixVoice_Vtbl DECLSPEC_HIDDEN;
extern const IXAudio20MasteringVoiceVtbl XAudio20MasteringVoice_Vtbl DECLSPEC_HIDDEN;
#elif XAUDIO2_VER <= 2
extern const IXAudio22Vtbl XAudio22_Vtbl DECLSPEC_HIDDEN;
#elif XAUDIO2_VER <= 7
extern const IXAudio27Vtbl XAudio27_Vtbl DECLSPEC_HIDDEN;
#endif
extern IClassFactory *make_xapo_factory(REFCLSID clsid) DECLSPEC_HIDDEN;
extern HRESULT xaudio2_initialize(IXAudio2Impl *This, UINT32 flags, XAUDIO2_PROCESSOR proc) DECLSPEC_HIDDEN;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment