Commit 1f3d99a2 authored by Christian Costa's avatar Christian Costa Committed by Alexandre Julliard

dmsynth: Add stubbed IKsControl interface to DirectMusicSynth object.

parent 42d18a32
......@@ -39,6 +39,7 @@
#include "dmusici.h"
#include "dmusicf.h"
#include "dmusics.h"
#include "dmksctrl.h"
/*****************************************************************************
* Interfaces
......@@ -56,15 +57,16 @@ extern HRESULT WINAPI DMUSIC_CreateDirectMusicSynthSinkImpl (LPCGUID lpcGUID, LP
* IDirectMusicSynth8Impl implementation structure
*/
struct IDirectMusicSynth8Impl {
/* IUnknown fields */
IDirectMusicSynth8 IDirectMusicSynth8_iface;
LONG ref;
/* IDirectMusicSynth8 fields */
DMUS_PORTCAPS pCaps;
BOOL fActive;
IReferenceClock* pLatencyClock;
IDirectMusicSynthSinkImpl* pSynthSink;
/* IUnknown fields */
IDirectMusicSynth8 IDirectMusicSynth8_iface;
IKsControl IKsControl_iface;
LONG ref;
/* IDirectMusicSynth8 fields */
DMUS_PORTCAPS pCaps;
BOOL fActive;
IReferenceClock* pLatencyClock;
IDirectMusicSynthSinkImpl* pSynthSink;
};
/*****************************************************************************
......
/* IDirectMusicSynth8 Implementation
/*
* IDirectMusicSynth8 Implementation
*
* Copyright (C) 2003-2004 Rok Mandeljc
*
......@@ -17,6 +18,12 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define COBJMACROS
#include "objbase.h"
#include "initguid.h"
#include "dmksctrl.h"
#include "dmsynth_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmsynth);
......@@ -40,6 +47,12 @@ static HRESULT WINAPI IDirectMusicSynth8Impl_QueryInterface(LPDIRECTMUSICSYNTH8
*ppobj = This;
return S_OK;
}
else if (IsEqualIID(riid, &IID_IKsControl)) {
IUnknown_AddRef(iface);
*ppobj = &This->IKsControl_iface;
return S_OK;
}
WARN("(%p, %s, %p): not found\n", This, debugstr_dmguid(riid), ppobj);
return E_NOINTERFACE;
}
......@@ -324,6 +337,66 @@ static const IDirectMusicSynth8Vtbl DirectMusicSynth8_Vtbl = {
IDirectMusicSynth8Impl_AssignChannelToBuses
};
static inline IDirectMusicSynth8Impl *impl_from_IKsControl(IKsControl *iface)
{
return CONTAINING_RECORD(iface, IDirectMusicSynth8Impl, IKsControl_iface);
}
static HRESULT WINAPI DMSynthImpl_IKsControl_QueryInterface(IKsControl* iface, REFIID riid, LPVOID *ppobj)
{
IDirectMusicSynth8Impl *This = impl_from_IKsControl(iface);
return IDirectMusicSynth8Impl_QueryInterface(&This->IDirectMusicSynth8_iface, riid, ppobj);
}
static ULONG WINAPI DMSynthImpl_IKsControl_AddRef(IKsControl* iface)
{
IDirectMusicSynth8Impl *This = impl_from_IKsControl(iface);
return IDirectMusicSynth8Impl_AddRef(&This->IDirectMusicSynth8_iface);
}
static ULONG WINAPI DMSynthImpl_IKsControl_Release(IKsControl* iface)
{
IDirectMusicSynth8Impl *This = impl_from_IKsControl(iface);
return IDirectMusicSynth8Impl_Release(&This->IDirectMusicSynth8_iface);
}
static HRESULT WINAPI DMSynthImpl_IKsControl_KsProperty(IKsControl* iface, PKSPROPERTY Property, ULONG PropertyLength, LPVOID PropertyData,
ULONG DataLength, ULONG* BytesReturned)
{
FIXME("(%p)->(%p, %u, %p, %u, %p): stub\n", iface, Property, PropertyLength, PropertyData, DataLength, BytesReturned);
return E_NOTIMPL;
}
static HRESULT WINAPI DMSynthImpl_IKsControl_KsMethod(IKsControl* iface, PKSMETHOD Method, ULONG MethodLength, LPVOID MethodData,
ULONG DataLength, ULONG* BytesReturned)
{
FIXME("(%p)->(%p, %u, %p, %u, %p): stub\n", iface, Method, MethodLength, MethodData, DataLength, BytesReturned);
return E_NOTIMPL;
}
static HRESULT WINAPI DMSynthImpl_IKsControl_KsEvent(IKsControl* iface, PKSEVENT Event, ULONG EventLength, LPVOID EventData,
ULONG DataLength, ULONG* BytesReturned)
{
FIXME("(%p)->(%p, %u, %p, %u, %p): stub\n", iface, Event, EventLength, EventData, DataLength, BytesReturned);
return E_NOTIMPL;
}
static const IKsControlVtbl DMSynthImpl_IKsControl_Vtbl = {
DMSynthImpl_IKsControl_QueryInterface,
DMSynthImpl_IKsControl_AddRef,
DMSynthImpl_IKsControl_Release,
DMSynthImpl_IKsControl_KsProperty,
DMSynthImpl_IKsControl_KsMethod,
DMSynthImpl_IKsControl_KsEvent
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicSynthImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter)
{
......@@ -336,6 +409,7 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicSynthImpl (LPCGUID lpcGUID, LPVOID* ppobj
return E_OUTOFMEMORY;
}
obj->IDirectMusicSynth8_iface.lpVtbl = &DirectMusicSynth8_Vtbl;
obj->IKsControl_iface.lpVtbl = &DMSynthImpl_IKsControl_Vtbl;
obj->ref = 0;
/* fill in caps */
obj->pCaps.dwSize = sizeof(DMUS_PORTCAPS);
......
......@@ -51,7 +51,7 @@ static void test_dmsynth(void)
ok(hr == S_OK, "CoCreateInstance returned: %x\n", hr);
hr = IDirectMusicSynth_QueryInterface(dmsynth, &IID_IKsControl, (LPVOID*)&control_synth);
todo_wine ok(hr == S_OK, "IDirectMusicSynth_QueryInterface returned: %x\n", hr);
ok(hr == S_OK, "IDirectMusicSynth_QueryInterface returned: %x\n", hr);
hr = IDirectMusicSynthSink_QueryInterface(dmsynth_sink, &IID_IKsControl, (LPVOID*)&control_sink);
todo_wine ok(hr == S_OK, "IDirectMusicSynthSink_QueryInterface returned: %x\n", hr);
......
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