Sweden-Number/dlls/dmusic/object.c

128 lines
3.4 KiB
C

/* IDirectMusicObject Implementation
*
* Copyright (C) 2003 Rok Mandeljc
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "winuser.h"
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "mmsystem.h"
#include "winternl.h"
#include "mmddk.h"
#include "wine/windef16.h"
#include "wine/winbase16.h"
#include "wine/debug.h"
#include "dsound.h"
#include "dmusic_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
/* IDirectMusicObject IUnknown parts follow: */
HRESULT WINAPI IDirectMusicObjectImpl_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicObjectImpl,iface);
if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicObject))
{
IDirectMusicObjectImpl_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicObjectImpl_AddRef (LPDIRECTMUSICOBJECT iface)
{
ICOM_THIS(IDirectMusicObjectImpl,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicObjectImpl_Release (LPDIRECTMUSICOBJECT iface)
{
ICOM_THIS(IDirectMusicObjectImpl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0)
{
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicObject Interface follow: */
HRESULT WINAPI IDirectMusicObjectImpl_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicObjectImpl,iface);
TRACE("(%p, %p)\n", This, pDesc);
pDesc = This->pDesc;
return S_OK;
}
HRESULT WINAPI IDirectMusicObjectImpl_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicObjectImpl,iface);
TRACE("(%p, %p)\n", This, pDesc);
This->pDesc = pDesc;
return S_OK;
}
HRESULT WINAPI IDirectMusicObjectImpl_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicObjectImpl,iface);
FIXME("(%p, %p, %p): stub\n", This, pStream, pDesc);
return S_OK;
}
ICOM_VTABLE(IDirectMusicObject) DirectMusicObject_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicObjectImpl_QueryInterface,
IDirectMusicObjectImpl_AddRef,
IDirectMusicObjectImpl_Release,
IDirectMusicObjectImpl_GetDescriptor,
IDirectMusicObjectImpl_SetDescriptor,
IDirectMusicObjectImpl_ParseDescriptor
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicObject (LPCGUID lpcGUID, LPDIRECTMUSICOBJECT* ppDMObj, LPUNKNOWN pUnkOuter)
{
if (IsEqualGUID (lpcGUID, &IID_IDirectMusicObject))
{
FIXME("Not yet\n");
return E_NOINTERFACE;
}
WARN("No interface found\n");
return E_NOINTERFACE;
}