Commit 0a8e8d19 authored by Andrew Eikum's avatar Andrew Eikum Committed by Alexandre Julliard

xaudio2: Remove run-time versioning of xapo objects.

parent fb9f616b
...@@ -53,8 +53,6 @@ typedef struct _VUMeterImpl { ...@@ -53,8 +53,6 @@ typedef struct _VUMeterImpl {
IXAPOParameters IXAPOParameters_iface; IXAPOParameters IXAPOParameters_iface;
LONG ref; LONG ref;
DWORD version;
} VUMeterImpl; } VUMeterImpl;
static VUMeterImpl *VUMeterImpl_from_IXAPO(IXAPO *iface) static VUMeterImpl *VUMeterImpl_from_IXAPO(IXAPO *iface)
...@@ -258,8 +256,6 @@ typedef struct _ReverbImpl { ...@@ -258,8 +256,6 @@ typedef struct _ReverbImpl {
IXAPOParameters IXAPOParameters_iface; IXAPOParameters IXAPOParameters_iface;
LONG ref; LONG ref;
DWORD version;
} ReverbImpl; } ReverbImpl;
static ReverbImpl *ReverbImpl_from_IXAPO(IXAPO *iface) static ReverbImpl *ReverbImpl_from_IXAPO(IXAPO *iface)
...@@ -461,8 +457,6 @@ typedef struct _EQImpl { ...@@ -461,8 +457,6 @@ typedef struct _EQImpl {
IXAPOParameters IXAPOParameters_iface; IXAPOParameters IXAPOParameters_iface;
LONG ref; LONG ref;
DWORD version;
} EQImpl; } EQImpl;
static EQImpl *EQImpl_from_IXAPO(IXAPO *iface) static EQImpl *EQImpl_from_IXAPO(IXAPO *iface)
...@@ -662,7 +656,6 @@ static const IXAPOParametersVtbl EQXAPOParameters_Vtbl = { ...@@ -662,7 +656,6 @@ static const IXAPOParametersVtbl EQXAPOParameters_Vtbl = {
struct xapo_cf { struct xapo_cf {
IClassFactory IClassFactory_iface; IClassFactory IClassFactory_iface;
LONG ref; LONG ref;
DWORD version;
const CLSID *class; const CLSID *class;
}; };
...@@ -726,14 +719,13 @@ static HRESULT WINAPI xapocf_CreateInstance(IClassFactory *iface, IUnknown *pOut ...@@ -726,14 +719,13 @@ static HRESULT WINAPI xapocf_CreateInstance(IClassFactory *iface, IUnknown *pOut
object->IXAPO_iface.lpVtbl = &VUMXAPO_Vtbl; object->IXAPO_iface.lpVtbl = &VUMXAPO_Vtbl;
object->IXAPOParameters_iface.lpVtbl = &VUMXAPOParameters_Vtbl; object->IXAPOParameters_iface.lpVtbl = &VUMXAPOParameters_Vtbl;
object->version = This->version;
hr = IXAPO_QueryInterface(&object->IXAPO_iface, riid, ppobj); hr = IXAPO_QueryInterface(&object->IXAPO_iface, riid, ppobj);
if(FAILED(hr)){ if(FAILED(hr)){
HeapFree(GetProcessHeap(), 0, object); HeapFree(GetProcessHeap(), 0, object);
return hr; return hr;
} }
}else if(IsEqualGUID(This->class, &CLSID_AudioReverb27)){ }else if(IsEqualGUID(This->class, &CLSID_FXReverb)){
ReverbImpl *object; ReverbImpl *object;
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
...@@ -742,7 +734,6 @@ static HRESULT WINAPI xapocf_CreateInstance(IClassFactory *iface, IUnknown *pOut ...@@ -742,7 +734,6 @@ static HRESULT WINAPI xapocf_CreateInstance(IClassFactory *iface, IUnknown *pOut
object->IXAPO_iface.lpVtbl = &RVBXAPO_Vtbl; object->IXAPO_iface.lpVtbl = &RVBXAPO_Vtbl;
object->IXAPOParameters_iface.lpVtbl = &RVBXAPOParameters_Vtbl; object->IXAPOParameters_iface.lpVtbl = &RVBXAPOParameters_Vtbl;
object->version = This->version;
hr = IXAPO_QueryInterface(&object->IXAPO_iface, riid, ppobj); hr = IXAPO_QueryInterface(&object->IXAPO_iface, riid, ppobj);
if(FAILED(hr)){ if(FAILED(hr)){
...@@ -758,7 +749,6 @@ static HRESULT WINAPI xapocf_CreateInstance(IClassFactory *iface, IUnknown *pOut ...@@ -758,7 +749,6 @@ static HRESULT WINAPI xapocf_CreateInstance(IClassFactory *iface, IUnknown *pOut
object->IXAPO_iface.lpVtbl = &EQXAPO_Vtbl; object->IXAPO_iface.lpVtbl = &EQXAPO_Vtbl;
object->IXAPOParameters_iface.lpVtbl = &EQXAPOParameters_Vtbl; object->IXAPOParameters_iface.lpVtbl = &EQXAPOParameters_Vtbl;
object->version = This->version;
hr = IXAPO_QueryInterface(&object->IXAPO_iface, riid, ppobj); hr = IXAPO_QueryInterface(&object->IXAPO_iface, riid, ppobj);
if(FAILED(hr)){ if(FAILED(hr)){
...@@ -766,6 +756,7 @@ static HRESULT WINAPI xapocf_CreateInstance(IClassFactory *iface, IUnknown *pOut ...@@ -766,6 +756,7 @@ static HRESULT WINAPI xapocf_CreateInstance(IClassFactory *iface, IUnknown *pOut
return hr; return hr;
} }
}else }else
/* TODO FXECHO, FXMasteringLimiter, */
return E_INVALIDARG; return E_INVALIDARG;
return S_OK; return S_OK;
...@@ -786,11 +777,10 @@ static const IClassFactoryVtbl xapo_Vtbl = ...@@ -786,11 +777,10 @@ static const IClassFactoryVtbl xapo_Vtbl =
xapocf_LockServer xapocf_LockServer
}; };
IClassFactory *make_xapo_factory(REFCLSID clsid, DWORD version) IClassFactory *make_xapo_factory(REFCLSID clsid)
{ {
struct xapo_cf *ret = HeapAlloc(GetProcessHeap(), 0, sizeof(struct xapo_cf)); struct xapo_cf *ret = HeapAlloc(GetProcessHeap(), 0, sizeof(struct xapo_cf));
ret->IClassFactory_iface.lpVtbl = &xapo_Vtbl; ret->IClassFactory_iface.lpVtbl = &xapo_Vtbl;
ret->version = version;
ret->class = clsid; ret->class = clsid;
ret->ref = 0; ret->ref = 0;
return &ret->IClassFactory_iface; return &ret->IClassFactory_iface;
...@@ -802,7 +792,7 @@ HRESULT WINAPI CreateAudioVolumeMeter(IUnknown **out) ...@@ -802,7 +792,7 @@ HRESULT WINAPI CreateAudioVolumeMeter(IUnknown **out)
IClassFactory *cf; IClassFactory *cf;
HRESULT hr; HRESULT hr;
cf = make_xapo_factory(&CLSID_AudioVolumeMeter27, 28); cf = make_xapo_factory(&CLSID_AudioVolumeMeter27);
hr = IClassFactory_CreateInstance(cf, NULL, &IID_IUnknown, (void**)out); hr = IClassFactory_CreateInstance(cf, NULL, &IID_IUnknown, (void**)out);
...@@ -816,7 +806,7 @@ HRESULT WINAPI CreateAudioReverb(IUnknown **out) ...@@ -816,7 +806,7 @@ HRESULT WINAPI CreateAudioReverb(IUnknown **out)
IClassFactory *cf; IClassFactory *cf;
HRESULT hr; HRESULT hr;
cf = make_xapo_factory(&CLSID_AudioReverb27, 28); cf = make_xapo_factory(&CLSID_FXReverb);
hr = IClassFactory_CreateInstance(cf, NULL, &IID_IUnknown, (void**)out); hr = IClassFactory_CreateInstance(cf, NULL, &IID_IUnknown, (void**)out);
...@@ -836,13 +826,13 @@ HRESULT CDECL CreateFX(REFCLSID clsid, IUnknown **out, void *initdata, UINT32 in ...@@ -836,13 +826,13 @@ HRESULT CDECL CreateFX(REFCLSID clsid, IUnknown **out, void *initdata, UINT32 in
if(IsEqualGUID(clsid, &CLSID_FXReverb27) || if(IsEqualGUID(clsid, &CLSID_FXReverb27) ||
IsEqualGUID(clsid, &CLSID_FXReverb)) IsEqualGUID(clsid, &CLSID_FXReverb))
class = &CLSID_AudioReverb27; class = &CLSID_FXReverb;
else if(IsEqualGUID(clsid, &CLSID_FXEQ27) || else if(IsEqualGUID(clsid, &CLSID_FXEQ27) ||
IsEqualGUID(clsid, &CLSID_FXEQ)) IsEqualGUID(clsid, &CLSID_FXEQ))
class = &CLSID_FXEQ; class = &CLSID_FXEQ;
if(class){ if(class){
cf = make_xapo_factory(class, 20 + XAUDIO2_VER); cf = make_xapo_factory(class);
hr = IClassFactory_CreateInstance(cf, NULL, &IID_IUnknown, (void**)&obj); hr = IClassFactory_CreateInstance(cf, NULL, &IID_IUnknown, (void**)&obj);
IClassFactory_Release(cf); IClassFactory_Release(cf);
...@@ -893,13 +883,14 @@ HRESULT CDECL CreateFX(REFCLSID clsid, IUnknown **out) ...@@ -893,13 +883,14 @@ HRESULT CDECL CreateFX(REFCLSID clsid, IUnknown **out)
if(IsEqualGUID(clsid, &CLSID_FXReverb27) || if(IsEqualGUID(clsid, &CLSID_FXReverb27) ||
IsEqualGUID(clsid, &CLSID_FXReverb)) IsEqualGUID(clsid, &CLSID_FXReverb))
class = &CLSID_AudioReverb27; class = &CLSID_FXReverb;
else if(IsEqualGUID(clsid, &CLSID_FXEQ27) || else if(IsEqualGUID(clsid, &CLSID_FXEQ27) ||
IsEqualGUID(clsid, &CLSID_FXEQ)) IsEqualGUID(clsid, &CLSID_FXEQ))
class = &CLSID_FXEQ; class = &CLSID_FXEQ;
/* TODO FXECHO, FXMasteringLimiter, */
if(class){ if(class){
cf = make_xapo_factory(class, 20 + XAUDIO2_VER); cf = make_xapo_factory(class);
hr = IClassFactory_CreateInstance(cf, NULL, &IID_IUnknown, (void**)&obj); hr = IClassFactory_CreateInstance(cf, NULL, &IID_IUnknown, (void**)&obj);
IClassFactory_Release(cf); IClassFactory_Release(cf);
......
...@@ -2020,46 +2020,25 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void **ppv) ...@@ -2020,46 +2020,25 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void **ppv)
IsEqualGUID(rclsid, &CLSID_XAudio27)){ IsEqualGUID(rclsid, &CLSID_XAudio27)){
factory = make_xaudio2_factory(); factory = make_xaudio2_factory();
}else if(IsEqualGUID(rclsid, &CLSID_AudioVolumeMeter20)){ }else if(IsEqualGUID(rclsid, &CLSID_AudioVolumeMeter20) ||
factory = make_xapo_factory(&CLSID_AudioVolumeMeter27, 20); IsEqualGUID(rclsid, &CLSID_AudioVolumeMeter21) ||
}else if(IsEqualGUID(rclsid, &CLSID_AudioVolumeMeter21)){ IsEqualGUID(rclsid, &CLSID_AudioVolumeMeter22) ||
factory = make_xapo_factory(&CLSID_AudioVolumeMeter27, 21); IsEqualGUID(rclsid, &CLSID_AudioVolumeMeter23) ||
}else if(IsEqualGUID(rclsid, &CLSID_AudioVolumeMeter22)){ IsEqualGUID(rclsid, &CLSID_AudioVolumeMeter24) ||
factory = make_xapo_factory(&CLSID_AudioVolumeMeter27, 22); IsEqualGUID(rclsid, &CLSID_AudioVolumeMeter25) ||
}else if(IsEqualGUID(rclsid, &CLSID_AudioVolumeMeter23)){ IsEqualGUID(rclsid, &CLSID_AudioVolumeMeter26) ||
factory = make_xapo_factory(&CLSID_AudioVolumeMeter27, 23); IsEqualGUID(rclsid, &CLSID_AudioVolumeMeter27)){
}else if(IsEqualGUID(rclsid, &CLSID_AudioVolumeMeter24)){ factory = make_xapo_factory(&CLSID_AudioVolumeMeter27);
factory = make_xapo_factory(&CLSID_AudioVolumeMeter27, 24);
}else if(IsEqualGUID(rclsid, &CLSID_AudioVolumeMeter25)){ }else if(IsEqualGUID(rclsid, &CLSID_AudioReverb20) ||
factory = make_xapo_factory(&CLSID_AudioVolumeMeter27, 25); IsEqualGUID(rclsid, &CLSID_AudioReverb21) ||
}else if(IsEqualGUID(rclsid, &CLSID_AudioVolumeMeter26)){ IsEqualGUID(rclsid, &CLSID_AudioReverb22) ||
factory = make_xapo_factory(&CLSID_AudioVolumeMeter27, 26); IsEqualGUID(rclsid, &CLSID_AudioReverb23) ||
}else if(IsEqualGUID(rclsid, &CLSID_AudioVolumeMeter27)){ IsEqualGUID(rclsid, &CLSID_AudioReverb24) ||
factory = make_xapo_factory(&CLSID_AudioVolumeMeter27, 27); IsEqualGUID(rclsid, &CLSID_AudioReverb25) ||
IsEqualGUID(rclsid, &CLSID_AudioReverb26) ||
}else if(IsEqualGUID(rclsid, &CLSID_AudioReverb20)){ IsEqualGUID(rclsid, &CLSID_AudioReverb27)){
factory = make_xapo_factory(&CLSID_AudioReverb27, 20); factory = make_xapo_factory(&CLSID_FXReverb);
}else if(IsEqualGUID(rclsid, &CLSID_AudioReverb21)){
factory = make_xapo_factory(&CLSID_AudioReverb27, 21);
}else if(IsEqualGUID(rclsid, &CLSID_AudioReverb22)){
factory = make_xapo_factory(&CLSID_AudioReverb27, 22);
}else if(IsEqualGUID(rclsid, &CLSID_AudioReverb23)){
factory = make_xapo_factory(&CLSID_AudioReverb27, 23);
}else if(IsEqualGUID(rclsid, &CLSID_AudioReverb24)){
factory = make_xapo_factory(&CLSID_AudioReverb27, 24);
}else if(IsEqualGUID(rclsid, &CLSID_AudioReverb25)){
factory = make_xapo_factory(&CLSID_AudioReverb27, 25);
}else if(IsEqualGUID(rclsid, &CLSID_AudioReverb26)){
factory = make_xapo_factory(&CLSID_AudioReverb27, 26);
}else if(IsEqualGUID(rclsid, &CLSID_AudioReverb27)){
factory = make_xapo_factory(&CLSID_AudioReverb27, 27);
} }
if(!factory) return CLASS_E_CLASSNOTAVAILABLE; if(!factory) return CLASS_E_CLASSNOTAVAILABLE;
......
...@@ -149,4 +149,4 @@ extern const IXAudio20SourceVoiceVtbl XAudio20SourceVoice_Vtbl DECLSPEC_HIDDEN; ...@@ -149,4 +149,4 @@ extern const IXAudio20SourceVoiceVtbl XAudio20SourceVoice_Vtbl DECLSPEC_HIDDEN;
extern const IXAudio20SubmixVoiceVtbl XAudio20SubmixVoice_Vtbl DECLSPEC_HIDDEN; extern const IXAudio20SubmixVoiceVtbl XAudio20SubmixVoice_Vtbl DECLSPEC_HIDDEN;
extern const IXAudio20MasteringVoiceVtbl XAudio20MasteringVoice_Vtbl DECLSPEC_HIDDEN; extern const IXAudio20MasteringVoiceVtbl XAudio20MasteringVoice_Vtbl DECLSPEC_HIDDEN;
extern IClassFactory *make_xapo_factory(REFCLSID clsid, DWORD version); extern IClassFactory *make_xapo_factory(REFCLSID clsid) 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