xaudio2: Add stub interface for FXEQ.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
9da38fdbee
commit
daed36fbe3
|
@ -56,6 +56,9 @@ HRESULT CDECL CreateFX(REFCLSID clsid, IUnknown **out)
|
|||
if(IsEqualGUID(clsid, &CLSID_FXReverb27) ||
|
||||
IsEqualGUID(clsid, &CLSID_FXReverb))
|
||||
class = &CLSID_WINE_FXReverb11;
|
||||
else if(IsEqualGUID(clsid, &CLSID_FXEQ27) ||
|
||||
IsEqualGUID(clsid, &CLSID_FXEQ))
|
||||
class = &CLSID_WINE_FXEQ11;
|
||||
|
||||
return CoCreateInstance(class, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void**)out);
|
||||
}
|
||||
|
|
|
@ -56,6 +56,9 @@ HRESULT CDECL CreateFX(REFCLSID clsid, IUnknown **out)
|
|||
if(IsEqualGUID(clsid, &CLSID_FXReverb27) ||
|
||||
IsEqualGUID(clsid, &CLSID_FXReverb))
|
||||
class = &CLSID_WINE_FXReverb12;
|
||||
else if(IsEqualGUID(clsid, &CLSID_FXEQ27) ||
|
||||
IsEqualGUID(clsid, &CLSID_FXEQ))
|
||||
class = &CLSID_WINE_FXEQ12;
|
||||
|
||||
return CoCreateInstance(class, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void**)out);
|
||||
}
|
||||
|
|
|
@ -51,6 +51,9 @@ HRESULT CDECL CreateFX(REFCLSID clsid, IUnknown **out)
|
|||
if(IsEqualGUID(clsid, &CLSID_FXReverb27) ||
|
||||
IsEqualGUID(clsid, &CLSID_FXReverb))
|
||||
class = &CLSID_WINE_FXReverb13;
|
||||
else if(IsEqualGUID(clsid, &CLSID_FXEQ27) ||
|
||||
IsEqualGUID(clsid, &CLSID_FXEQ))
|
||||
class = &CLSID_WINE_FXEQ13;
|
||||
|
||||
return CoCreateInstance(class, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void**)out);
|
||||
}
|
||||
|
|
|
@ -51,6 +51,9 @@ HRESULT CDECL CreateFX(REFCLSID clsid, IUnknown **out)
|
|||
if(IsEqualGUID(clsid, &CLSID_FXReverb27) ||
|
||||
IsEqualGUID(clsid, &CLSID_FXReverb))
|
||||
class = &CLSID_WINE_FXReverb14;
|
||||
else if(IsEqualGUID(clsid, &CLSID_FXEQ27) ||
|
||||
IsEqualGUID(clsid, &CLSID_FXEQ))
|
||||
class = &CLSID_WINE_FXEQ14;
|
||||
|
||||
return CoCreateInstance(class, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void**)out);
|
||||
}
|
||||
|
|
|
@ -51,6 +51,9 @@ HRESULT CDECL CreateFX(REFCLSID clsid, IUnknown **out)
|
|||
if(IsEqualGUID(clsid, &CLSID_FXReverb27) ||
|
||||
IsEqualGUID(clsid, &CLSID_FXReverb))
|
||||
class = &CLSID_WINE_FXReverb15;
|
||||
else if(IsEqualGUID(clsid, &CLSID_FXEQ27) ||
|
||||
IsEqualGUID(clsid, &CLSID_FXEQ))
|
||||
class = &CLSID_WINE_FXEQ15;
|
||||
|
||||
return CoCreateInstance(class, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void**)out);
|
||||
}
|
||||
|
|
|
@ -807,12 +807,12 @@ static void test_xapo_creation_legacy(const char *module, unsigned int version)
|
|||
const GUID *clsid;
|
||||
BOOL todo;
|
||||
} const_clsids[] = {
|
||||
{ &CLSID_FXEQ27, TRUE },
|
||||
{ &CLSID_FXEQ27, FALSE },
|
||||
{ &CLSID_FXMasteringLimiter27, TRUE },
|
||||
{ &CLSID_FXReverb27, FALSE },
|
||||
{ &CLSID_FXEcho27, TRUE},
|
||||
/* older versions of xapofx actually have support for new clsids */
|
||||
{ &CLSID_FXEQ, TRUE },
|
||||
{ &CLSID_FXEQ, FALSE },
|
||||
{ &CLSID_FXMasteringLimiter, TRUE },
|
||||
{ &CLSID_FXReverb, FALSE },
|
||||
{ &CLSID_FXEcho, TRUE}
|
||||
|
@ -919,12 +919,11 @@ static void test_xapo_creation_modern(const char *module)
|
|||
const GUID *clsid;
|
||||
BOOL todo;
|
||||
} const_clsids[] = {
|
||||
{ &CLSID_FXEQ27, TRUE },
|
||||
{ &CLSID_FXEQ27, FALSE },
|
||||
{ &CLSID_FXMasteringLimiter27, TRUE },
|
||||
{ &CLSID_FXReverb27, FALSE },
|
||||
{ &CLSID_FXEcho27, TRUE},
|
||||
/* older versions of xapofx actually have support for new clsids */
|
||||
{ &CLSID_FXEQ, TRUE },
|
||||
{ &CLSID_FXEQ, FALSE },
|
||||
{ &CLSID_FXMasteringLimiter, TRUE },
|
||||
{ &CLSID_FXReverb, FALSE },
|
||||
{ &CLSID_FXEcho, TRUE}
|
||||
|
|
|
@ -438,6 +438,209 @@ static const IXAPOParametersVtbl RVBXAPOParameters_Vtbl = {
|
|||
RVBXAPOParams_GetParameters
|
||||
};
|
||||
|
||||
typedef struct _EQImpl {
|
||||
IXAPO IXAPO_iface;
|
||||
IXAPOParameters IXAPOParameters_iface;
|
||||
|
||||
LONG ref;
|
||||
|
||||
DWORD version;
|
||||
} EQImpl;
|
||||
|
||||
static EQImpl *EQImpl_from_IXAPO(IXAPO *iface)
|
||||
{
|
||||
return CONTAINING_RECORD(iface, EQImpl, IXAPO_iface);
|
||||
}
|
||||
|
||||
static EQImpl *EQImpl_from_IXAPOParameters(IXAPOParameters *iface)
|
||||
{
|
||||
return CONTAINING_RECORD(iface, EQImpl, IXAPOParameters_iface);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI EQXAPO_QueryInterface(IXAPO *iface, REFIID riid, void **ppvObject)
|
||||
{
|
||||
EQImpl *This = EQImpl_from_IXAPO(iface);
|
||||
|
||||
TRACE("%p, %s, %p\n", This, wine_dbgstr_guid(riid), ppvObject);
|
||||
|
||||
if(IsEqualGUID(riid, &IID_IUnknown) ||
|
||||
IsEqualGUID(riid, &IID_IXAPO) ||
|
||||
IsEqualGUID(riid, &IID_IXAPO27))
|
||||
*ppvObject = &This->IXAPO_iface;
|
||||
else if(IsEqualGUID(riid, &IID_IXAPOParameters))
|
||||
*ppvObject = &This->IXAPOParameters_iface;
|
||||
else
|
||||
*ppvObject = NULL;
|
||||
|
||||
if(*ppvObject){
|
||||
IUnknown_AddRef((IUnknown*)*ppvObject);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
static ULONG WINAPI EQXAPO_AddRef(IXAPO *iface)
|
||||
{
|
||||
EQImpl *This = EQImpl_from_IXAPO(iface);
|
||||
ULONG ref = InterlockedIncrement(&This->ref);
|
||||
TRACE("(%p)->(): Refcount now %u\n", This, ref);
|
||||
return ref;
|
||||
}
|
||||
|
||||
static ULONG WINAPI EQXAPO_Release(IXAPO *iface)
|
||||
{
|
||||
EQImpl *This = EQImpl_from_IXAPO(iface);
|
||||
ULONG ref = InterlockedDecrement(&This->ref);
|
||||
|
||||
TRACE("(%p)->(): Refcount now %u\n", This, ref);
|
||||
|
||||
if(!ref)
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI EQXAPO_GetRegistrationProperties(IXAPO *iface,
|
||||
XAPO_REGISTRATION_PROPERTIES **props)
|
||||
{
|
||||
EQImpl *This = EQImpl_from_IXAPO(iface);
|
||||
TRACE("%p, %p\n", This, props);
|
||||
/* TODO: check for version == 20 and use XAPO20_REGISTRATION_PROPERTIES */
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI EQXAPO_IsInputFormatSupported(IXAPO *iface,
|
||||
const WAVEFORMATEX *output_fmt, const WAVEFORMATEX *input_fmt,
|
||||
WAVEFORMATEX **supported_fmt)
|
||||
{
|
||||
EQImpl *This = EQImpl_from_IXAPO(iface);
|
||||
TRACE("%p, %p, %p, %p\n", This, output_fmt, input_fmt, supported_fmt);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI EQXAPO_IsOutputFormatSupported(IXAPO *iface,
|
||||
const WAVEFORMATEX *input_fmt, const WAVEFORMATEX *output_fmt,
|
||||
WAVEFORMATEX **supported_fmt)
|
||||
{
|
||||
EQImpl *This = EQImpl_from_IXAPO(iface);
|
||||
TRACE("%p, %p, %p, %p\n", This, input_fmt, output_fmt, supported_fmt);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI EQXAPO_Initialize(IXAPO *iface, const void *data,
|
||||
UINT32 data_len)
|
||||
{
|
||||
EQImpl *This = EQImpl_from_IXAPO(iface);
|
||||
TRACE("%p, %p, %u\n", This, data, data_len);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI EQXAPO_Reset(IXAPO *iface)
|
||||
{
|
||||
EQImpl *This = EQImpl_from_IXAPO(iface);
|
||||
TRACE("%p\n", This);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI EQXAPO_LockForProcess(IXAPO *iface, UINT32 in_params_count,
|
||||
const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS *in_params,
|
||||
UINT32 out_params_count,
|
||||
const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS *out_params)
|
||||
{
|
||||
EQImpl *This = EQImpl_from_IXAPO(iface);
|
||||
TRACE("%p, %u, %p, %u, %p\n", This, in_params_count, in_params,
|
||||
out_params_count, out_params);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static void WINAPI EQXAPO_UnlockForProcess(IXAPO *iface)
|
||||
{
|
||||
EQImpl *This = EQImpl_from_IXAPO(iface);
|
||||
TRACE("%p\n", This);
|
||||
}
|
||||
|
||||
static void WINAPI EQXAPO_Process(IXAPO *iface, UINT32 in_params_count,
|
||||
const XAPO_PROCESS_BUFFER_PARAMETERS *in_params,
|
||||
UINT32 out_params_count,
|
||||
const XAPO_PROCESS_BUFFER_PARAMETERS *out_params, BOOL enabled)
|
||||
{
|
||||
EQImpl *This = EQImpl_from_IXAPO(iface);
|
||||
TRACE("%p, %u, %p, %u, %p, %u\n", This, in_params_count, in_params,
|
||||
out_params_count, out_params, enabled);
|
||||
}
|
||||
|
||||
static UINT32 WINAPI EQXAPO_CalcInputFrames(IXAPO *iface, UINT32 output_frames)
|
||||
{
|
||||
EQImpl *This = EQImpl_from_IXAPO(iface);
|
||||
TRACE("%p, %u\n", This, output_frames);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static UINT32 WINAPI EQXAPO_CalcOutputFrames(IXAPO *iface, UINT32 input_frames)
|
||||
{
|
||||
EQImpl *This = EQImpl_from_IXAPO(iface);
|
||||
TRACE("%p, %u\n", This, input_frames);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const IXAPOVtbl EQXAPO_Vtbl = {
|
||||
EQXAPO_QueryInterface,
|
||||
EQXAPO_AddRef,
|
||||
EQXAPO_Release,
|
||||
EQXAPO_GetRegistrationProperties,
|
||||
EQXAPO_IsInputFormatSupported,
|
||||
EQXAPO_IsOutputFormatSupported,
|
||||
EQXAPO_Initialize,
|
||||
EQXAPO_Reset,
|
||||
EQXAPO_LockForProcess,
|
||||
EQXAPO_UnlockForProcess,
|
||||
EQXAPO_Process,
|
||||
EQXAPO_CalcInputFrames,
|
||||
EQXAPO_CalcOutputFrames
|
||||
};
|
||||
|
||||
static HRESULT WINAPI EQXAPOParams_QueryInterface(IXAPOParameters *iface,
|
||||
REFIID riid, void **ppvObject)
|
||||
{
|
||||
EQImpl *This = EQImpl_from_IXAPOParameters(iface);
|
||||
return EQXAPO_QueryInterface(&This->IXAPO_iface, riid, ppvObject);
|
||||
}
|
||||
|
||||
static ULONG WINAPI EQXAPOParams_AddRef(IXAPOParameters *iface)
|
||||
{
|
||||
EQImpl *This = EQImpl_from_IXAPOParameters(iface);
|
||||
return EQXAPO_AddRef(&This->IXAPO_iface);
|
||||
}
|
||||
|
||||
static ULONG WINAPI EQXAPOParams_Release(IXAPOParameters *iface)
|
||||
{
|
||||
EQImpl *This = EQImpl_from_IXAPOParameters(iface);
|
||||
return EQXAPO_Release(&This->IXAPO_iface);
|
||||
}
|
||||
|
||||
static void WINAPI EQXAPOParams_SetParameters(IXAPOParameters *iface,
|
||||
const void *params, UINT32 params_len)
|
||||
{
|
||||
EQImpl *This = EQImpl_from_IXAPOParameters(iface);
|
||||
TRACE("%p, %p, %u\n", This, params, params_len);
|
||||
}
|
||||
|
||||
static void WINAPI EQXAPOParams_GetParameters(IXAPOParameters *iface, void *params,
|
||||
UINT32 params_len)
|
||||
{
|
||||
EQImpl *This = EQImpl_from_IXAPOParameters(iface);
|
||||
TRACE("%p, %p, %u\n", This, params, params_len);
|
||||
}
|
||||
|
||||
static const IXAPOParametersVtbl EQXAPOParameters_Vtbl = {
|
||||
EQXAPOParams_QueryInterface,
|
||||
EQXAPOParams_AddRef,
|
||||
EQXAPOParams_Release,
|
||||
EQXAPOParams_SetParameters,
|
||||
EQXAPOParams_GetParameters
|
||||
};
|
||||
|
||||
struct xapo_cf {
|
||||
IClassFactory IClassFactory_iface;
|
||||
LONG ref;
|
||||
|
@ -523,6 +726,22 @@ static HRESULT WINAPI xapocf_CreateInstance(IClassFactory *iface, IUnknown *pOut
|
|||
object->IXAPOParameters_iface.lpVtbl = &RVBXAPOParameters_Vtbl;
|
||||
object->version = This->version;
|
||||
|
||||
hr = IXAPO_QueryInterface(&object->IXAPO_iface, riid, ppobj);
|
||||
if(FAILED(hr)){
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
}else if(IsEqualGUID(This->class, &CLSID_FXEQ)){
|
||||
EQImpl *object;
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if(!object)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
object->IXAPO_iface.lpVtbl = &EQXAPO_Vtbl;
|
||||
object->IXAPOParameters_iface.lpVtbl = &EQXAPOParameters_Vtbl;
|
||||
object->version = This->version;
|
||||
|
||||
hr = IXAPO_QueryInterface(&object->IXAPO_iface, riid, ppobj);
|
||||
if(FAILED(hr)){
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
|
|
|
@ -89,3 +89,45 @@ coclass FXReverb15 { interface IXAPO; }
|
|||
uuid(a90bc001-e897-e897-7439-43FF02000208)
|
||||
]
|
||||
coclass FXReverb28 { interface IXAPO; }
|
||||
|
||||
[
|
||||
helpstring("XAPOFX1.1 FXEQ Class (Wine)"),
|
||||
threading(both),
|
||||
uuid(a90bc001-e897-e897-7439-43FF00000101)
|
||||
]
|
||||
coclass FXEQ11 { interface IXAPO; }
|
||||
|
||||
[
|
||||
helpstring("XAPOFX1.2 FXEQ Class (Wine)"),
|
||||
threading(both),
|
||||
uuid(a90bc001-e897-e897-7439-43FF00000102)
|
||||
]
|
||||
coclass FXEQ12 { interface IXAPO; }
|
||||
|
||||
[
|
||||
helpstring("XAPOFX1.3 FXEQ Class (Wine)"),
|
||||
threading(both),
|
||||
uuid(a90bc001-e897-e897-7439-43FF00000103)
|
||||
]
|
||||
coclass FXEQ13 { interface IXAPO; }
|
||||
|
||||
[
|
||||
helpstring("XAPOFX1.4 FXEQ Class (Wine)"),
|
||||
threading(both),
|
||||
uuid(a90bc001-e897-e897-7439-43FF00000104)
|
||||
]
|
||||
coclass FXEQ14 { interface IXAPO; }
|
||||
|
||||
[
|
||||
helpstring("XAPOFX1.5 FXEQ Class (Wine)"),
|
||||
threading(both),
|
||||
uuid(a90bc001-e897-e897-7439-43FF00000105)
|
||||
]
|
||||
coclass FXEQ15 { interface IXAPO; }
|
||||
|
||||
[
|
||||
helpstring("XAudio2.8 FXEQ Class (Wine)"),
|
||||
threading(both),
|
||||
uuid(a90bc001-e897-e897-7439-43FF00000208)
|
||||
]
|
||||
coclass FXEQ28 { interface IXAPO; }
|
||||
|
|
|
@ -2067,6 +2067,22 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void **ppv)
|
|||
|
||||
}else if(IsEqualGUID(rclsid, &CLSID_WINE_FXReverb28)){
|
||||
factory = make_xapo_factory(&CLSID_AudioReverb, 28);
|
||||
|
||||
|
||||
}else if(IsEqualGUID(rclsid, &CLSID_WINE_FXEQ10)){
|
||||
factory = make_xapo_factory(&CLSID_FXEQ, 21);
|
||||
}else if(IsEqualGUID(rclsid, &CLSID_WINE_FXEQ11)){
|
||||
factory = make_xapo_factory(&CLSID_FXEQ, 22);
|
||||
}else if(IsEqualGUID(rclsid, &CLSID_WINE_FXEQ12)){
|
||||
factory = make_xapo_factory(&CLSID_FXEQ, 23);
|
||||
}else if(IsEqualGUID(rclsid, &CLSID_WINE_FXEQ13)){
|
||||
factory = make_xapo_factory(&CLSID_FXEQ, 24);
|
||||
}else if(IsEqualGUID(rclsid, &CLSID_WINE_FXEQ14)){
|
||||
factory = make_xapo_factory(&CLSID_FXEQ, 26);
|
||||
}else if(IsEqualGUID(rclsid, &CLSID_WINE_FXEQ15)){
|
||||
factory = make_xapo_factory(&CLSID_FXEQ, 27);
|
||||
}else if(IsEqualGUID(rclsid, &CLSID_WINE_FXEQ28)){
|
||||
factory = make_xapo_factory(&CLSID_FXEQ, 28);
|
||||
}
|
||||
|
||||
if(!factory) return CLASS_E_CLASSNOTAVAILABLE;
|
||||
|
|
|
@ -103,6 +103,9 @@ HRESULT CDECL CreateFX(REFCLSID clsid, IUnknown **out, void *initdata, UINT32 in
|
|||
if(IsEqualGUID(clsid, &CLSID_FXReverb27) ||
|
||||
IsEqualGUID(clsid, &CLSID_FXReverb))
|
||||
class = &CLSID_WINE_FXReverb28;
|
||||
else if(IsEqualGUID(clsid, &CLSID_FXEQ27) ||
|
||||
IsEqualGUID(clsid, &CLSID_FXEQ))
|
||||
class = &CLSID_WINE_FXEQ28;
|
||||
|
||||
hr = CoCreateInstance(class, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void**)&obj);
|
||||
if(FAILED(hr)){
|
||||
|
|
Loading…
Reference in New Issue