- updated resources to DX9

- completely rewritten headers (DX9 compat.; look much nicer now ;=)
- removed IDirectMusicSong and IDirectMusicMelodyFormulationTrack
  (which are removed from DX9; weren't implemented in DX8 anyway)
- combined/simplified IDirectMusicSomething / IDirectMusicObject /
  IPersistStream for objects that support loading
- implemented IDirectMusicObject on all such objects; via generic
  functions
- combined IDirectMusicTrack(8)/IPersistStream on all tracks
- fully implemented IDirectMusicContainer (at least 90% if there are
  no private interfaces)
- implemented IDirectMusicCollection (99% work & MS compliant
  behaviour; except for instruments)
- tried to implement IDirectMusicInstrument (unfortunately uses some
  dirty private interfaces... :(
- added dswave.dll; DirectMusic Wave
- some changes in style
- many, many more ;)
This commit is contained in:
Rok Mandeljc 2004-01-20 00:21:40 +00:00 committed by Alexandre Julliard
parent 236c8a2452
commit 0382ea1d8a
109 changed files with 15383 additions and 17638 deletions

3
configure vendored

File diff suppressed because one or more lines are too long

View File

@ -1498,6 +1498,7 @@ dlls/dplayx/Makefile
dlls/dpnhpast/Makefile
dlls/dsound/Makefile
dlls/dsound/tests/Makefile
dlls/dswave/Makefile
dlls/gdi/Makefile
dlls/gdi/tests/Makefile
dlls/glu32/Makefile

View File

@ -46,6 +46,7 @@ BASEDIRS = \
dplayx \
dpnhpast \
dsound \
dswave \
gdi \
iccvid \
icmp \
@ -239,6 +240,7 @@ SYMLINKS = \
dplayx.dll$(DLLEXT) \
dpnhpast.dll$(DLLEXT) \
dsound.dll$(DLLEXT) \
dswave.dll$(DLLEXT) \
gdi32.dll$(DLLEXT) \
iccvid.dll$(DLLEXT) \
icmp.dll$(DLLEXT) \
@ -446,6 +448,9 @@ dpnhpast.dll$(DLLEXT): dpnhpast/dpnhpast.dll$(DLLEXT)
dsound.dll$(DLLEXT): dsound/dsound.dll$(DLLEXT)
$(RM) $@ && $(LN_S) dsound/dsound.dll$(DLLEXT) $@
dswave.dll$(DLLEXT): dswave/dswave.dll$(DLLEXT)
$(RM) $@ && $(LN_S) dswave/dswave.dll$(DLLEXT) $@
gdi32.dll$(DLLEXT): gdi/gdi32.dll$(DLLEXT)
$(RM) $@ && $(LN_S) gdi/gdi32.dll$(DLLEXT) $@
@ -840,6 +845,7 @@ IMPORT_LIBS = \
libdplayx \
libdpnhpast \
libdsound \
libdswave \
libgdi32 \
libglu32 \
libglut32 \
@ -1086,6 +1092,11 @@ libdsound.def: dsound/dsound.spec.def
libdsound.a: dsound/dsound.spec.def
$(DLLTOOL) -k -l $@ -d dsound/dsound.spec.def
libdswave.def: dswave/dswave.spec.def
$(RM) $@ && $(LN_S) dswave/dswave.spec.def $@
libdswave.a: dswave/dswave.spec.def
$(DLLTOOL) -k -l $@ -d dswave/dswave.spec.def
libgdi32.def: gdi/gdi32.spec.def
$(RM) $@ && $(LN_S) gdi/gdi32.spec.def $@
libgdi32.a: gdi/gdi32.spec.def
@ -1495,6 +1506,7 @@ dplay/dplay.spec.def: $(WINEBUILD)
dplayx/dplayx.spec.def: $(WINEBUILD)
dpnhpast/dpnhpast.spec.def: $(WINEBUILD)
dsound/dsound.spec.def: $(WINEBUILD)
dswave/dswave.spec.def: $(WINEBUILD)
gdi/gdi32.spec.def: $(WINEBUILD)
glu32/glu32.spec.def: $(WINEBUILD)
glut32/glut32.spec.def: $(WINEBUILD)
@ -1611,6 +1623,7 @@ dplay/dplay.dll$(DLLEXT): dplay
dplayx/dplayx.dll$(DLLEXT): dplayx
dpnhpast/dpnhpast.dll$(DLLEXT): dpnhpast
dsound/dsound.dll$(DLLEXT): dsound
dswave/dswave.dll$(DLLEXT): dswave
gdi/gdi32.dll$(DLLEXT): gdi
glu32/glu32.dll$(DLLEXT): glu32
glut32/glut32.dll$(DLLEXT): glut32

View File

@ -1,6 +1,6 @@
/* IDirectMusicBand Implementation
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -17,47 +17,51 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "dmband_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmband);
WINE_DECLARE_DEBUG_CHANNEL(dmfile);
const GUID IID_IDirectMusicBandPRIVATE = {0xda54db81,0x837d,0x11d1,{0x86,0xbc,0x00,0xc0,0x4f,0xbf,0x8f,0xef}};
/*****************************************************************************
* IDirectMusicBandImpl implementation
*/
/* IDirectMusicBand IUnknown part: */
HRESULT WINAPI IDirectMusicBandImpl_QueryInterface (LPDIRECTMUSICBAND iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicBandImpl,iface);
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IDirectMusicBand)) {
IDirectMusicBandImpl_AddRef(iface);
*ppobj = This;
/* IDirectMusicBandImpl IUnknown part: */
HRESULT WINAPI IDirectMusicBandImpl_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicBandImpl, UnknownVtbl, iface);
TRACE("(%p, %s, %p)\n", This, debugstr_guid(riid), ppobj);
if (IsEqualIID (riid, &IID_IUnknown)) {
*ppobj = (LPVOID)&This->UnknownVtbl;
IDirectMusicBandImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicBand)) {
*ppobj = (LPVOID)&This->BandVtbl;
IDirectMusicBandImpl_IDirectMusicBand_AddRef ((LPDIRECTMUSICBAND)&This->BandVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicObject)) {
*ppobj = (LPVOID)&This->ObjectVtbl;
IDirectMusicBandImpl_IDirectMusicObject_AddRef ((LPDIRECTMUSICOBJECT)&This->ObjectVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IPersistStream)) {
*ppobj = (LPVOID)&This->PersistStreamVtbl;
IDirectMusicBandImpl_IPersistStream_AddRef ((LPPERSISTSTREAM)&This->PersistStreamVtbl);
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicBandImpl_AddRef (LPDIRECTMUSICBAND iface)
{
ICOM_THIS(IDirectMusicBandImpl,iface);
ULONG WINAPI IDirectMusicBandImpl_IUnknown_AddRef (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicBandImpl, UnknownVtbl, iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicBandImpl_Release (LPDIRECTMUSICBAND iface)
{
ICOM_THIS(IDirectMusicBandImpl,iface);
ULONG WINAPI IDirectMusicBandImpl_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicBandImpl, UnknownVtbl, iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
@ -66,611 +70,348 @@ ULONG WINAPI IDirectMusicBandImpl_Release (LPDIRECTMUSICBAND iface)
return ref;
}
/* IDirectMusicBand IDirectMusicBand part: */
HRESULT WINAPI IDirectMusicBandImpl_CreateSegment (LPDIRECTMUSICBAND iface, IDirectMusicSegment** ppSegment)
{
ICOM_THIS(IDirectMusicBandImpl,iface);
ICOM_VTABLE(IUnknown) DirectMusicBand_Unknown_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicBandImpl_IUnknown_QueryInterface,
IDirectMusicBandImpl_IUnknown_AddRef,
IDirectMusicBandImpl_IUnknown_Release
};
/* IDirectMusicBandImpl IDirectMusicBand part: */
HRESULT WINAPI IDirectMusicBandImpl_IDirectMusicBand_QueryInterface (LPDIRECTMUSICBAND iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicBandImpl, BandVtbl, iface);
return IDirectMusicBandImpl_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicBandImpl_IDirectMusicBand_AddRef (LPDIRECTMUSICBAND iface) {
ICOM_THIS_MULTI(IDirectMusicBandImpl, BandVtbl, iface);
return IDirectMusicBandImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicBandImpl_IDirectMusicBand_Release (LPDIRECTMUSICBAND iface) {
ICOM_THIS_MULTI(IDirectMusicBandImpl, BandVtbl, iface);
return IDirectMusicBandImpl_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicBandImpl_IDirectMusicBand_CreateSegment (LPDIRECTMUSICBAND iface, IDirectMusicSegment** ppSegment) {
ICOM_THIS_MULTI(IDirectMusicBandImpl, BandVtbl, iface);
FIXME("(%p, %p): stub\n", This, ppSegment);
return S_OK;
}
HRESULT WINAPI IDirectMusicBandImpl_Download (LPDIRECTMUSICBAND iface, IDirectMusicPerformance* pPerformance)
{
ICOM_THIS(IDirectMusicBandImpl,iface);
HRESULT WINAPI IDirectMusicBandImpl_IDirectMusicBand_Download (LPDIRECTMUSICBAND iface, IDirectMusicPerformance* pPerformance) {
ICOM_THIS_MULTI(IDirectMusicBandImpl, BandVtbl, iface);
FIXME("(%p, %p): stub\n", This, pPerformance);
return S_OK;
}
HRESULT WINAPI IDirectMusicBandImpl_Unload (LPDIRECTMUSICBAND iface, IDirectMusicPerformance* pPerformance)
{
ICOM_THIS(IDirectMusicBandImpl,iface);
HRESULT WINAPI IDirectMusicBandImpl_IDirectMusicBand_Unload (LPDIRECTMUSICBAND iface, IDirectMusicPerformance* pPerformance) {
ICOM_THIS_MULTI(IDirectMusicBandImpl, BandVtbl, iface);
FIXME("(%p, %p): stub\n", This, pPerformance);
return S_OK;
}
ICOM_VTABLE(IDirectMusicBand) DirectMusicBand_Vtbl =
{
ICOM_VTABLE(IDirectMusicBand) DirectMusicBand_Band_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicBandImpl_QueryInterface,
IDirectMusicBandImpl_AddRef,
IDirectMusicBandImpl_Release,
IDirectMusicBandImpl_CreateSegment,
IDirectMusicBandImpl_Download,
IDirectMusicBandImpl_Unload
IDirectMusicBandImpl_IDirectMusicBand_QueryInterface,
IDirectMusicBandImpl_IDirectMusicBand_AddRef,
IDirectMusicBandImpl_IDirectMusicBand_Release,
IDirectMusicBandImpl_IDirectMusicBand_CreateSegment,
IDirectMusicBandImpl_IDirectMusicBand_Download,
IDirectMusicBandImpl_IDirectMusicBand_Unload
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicBand (LPCGUID lpcGUID, LPDIRECTMUSICBAND* ppDMBand, LPUNKNOWN pUnkOuter)
{
IDirectMusicBandImpl* dmband;
if (IsEqualGUID (lpcGUID, &IID_IDirectMusicBand)) {
dmband = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicBandImpl));
if (NULL == dmband) {
*ppDMBand = (LPDIRECTMUSICBAND) NULL;
return E_OUTOFMEMORY;
}
dmband->lpVtbl = &DirectMusicBand_Vtbl;
dmband->ref = 1;
list_init (&dmband->Instruments);
*ppDMBand = (LPDIRECTMUSICBAND) dmband;
return S_OK;
}
WARN("No interface found\n");
return E_NOINTERFACE;
/* IDirectMusicBandImpl IDirectMusicObject part: */
HRESULT WINAPI IDirectMusicBandImpl_IDirectMusicObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicBandImpl, ObjectVtbl, iface);
return IDirectMusicBandImpl_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
/*****************************************************************************
* IDirectMusicBandObject implementation
*/
/* IDirectMusicBandObject IUnknown part: */
HRESULT WINAPI IDirectMusicBandObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicBandObject,iface);
if (IsEqualGUID (riid, &IID_IUnknown)
|| IsEqualGUID(riid, &IID_IDirectMusicObject)) {
IDirectMusicBandObject_AddRef(iface);
*ppobj = This;
return S_OK;
} else if (IsEqualGUID (riid, &IID_IPersistStream)) {
IPersistStream_AddRef ((LPPERSISTSTREAM)This->pStream);
*ppobj = (LPPERSISTSTREAM)This->pStream;
return S_OK;
} else if (IsEqualGUID (riid, &IID_IDirectMusicBand)) {
IDirectMusicBand_AddRef ((LPDIRECTMUSICBAND)This->pBand);
*ppobj = (LPDIRECTMUSICBAND)This->pBand;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
ULONG WINAPI IDirectMusicBandImpl_IDirectMusicObject_AddRef (LPDIRECTMUSICOBJECT iface) {
ICOM_THIS_MULTI(IDirectMusicBandImpl, ObjectVtbl, iface);
return IDirectMusicBandImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicBandObject_AddRef (LPDIRECTMUSICOBJECT iface)
{
ICOM_THIS(IDirectMusicBandObject,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
ULONG WINAPI IDirectMusicBandImpl_IDirectMusicObject_Release (LPDIRECTMUSICOBJECT iface) {
ICOM_THIS_MULTI(IDirectMusicBandImpl, ObjectVtbl, iface);
return IDirectMusicBandImpl_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicBandObject_Release (LPDIRECTMUSICOBJECT iface)
{
ICOM_THIS(IDirectMusicBandObject,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0)
{
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicBandObject IDirectMusicObject part: */
HRESULT WINAPI IDirectMusicBandObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicBandObject,iface);
HRESULT WINAPI IDirectMusicBandImpl_IDirectMusicObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc) {
ICOM_THIS_MULTI(IDirectMusicBandImpl, ObjectVtbl, iface);
TRACE("(%p, %p)\n", This, pDesc);
pDesc = This->pDesc;
/* I think we shouldn't return pointer here since then values can be changed; it'd be a mess */
memcpy (pDesc, This->pDesc, This->pDesc->dwSize);
return S_OK;
}
HRESULT WINAPI IDirectMusicBandObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicBandObject,iface);
TRACE("(%p, %p)\n", This, pDesc);
This->pDesc = pDesc;
HRESULT WINAPI IDirectMusicBandImpl_IDirectMusicObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc) {
ICOM_THIS_MULTI(IDirectMusicBandImpl, ObjectVtbl, iface);
TRACE("(%p, %p): setting descriptor:\n", This, pDesc);
if (TRACE_ON(dmband)) {
DMUSIC_dump_DMUS_OBJECTDESC (pDesc);
}
/* According to MSDN, we should copy only given values, not whole struct */
if (pDesc->dwValidData & DMUS_OBJ_OBJECT)
memcpy (&This->pDesc->guidObject, &pDesc->guidObject, sizeof (pDesc->guidObject));
if (pDesc->dwValidData & DMUS_OBJ_CLASS)
memcpy (&This->pDesc->guidClass, &pDesc->guidClass, sizeof (pDesc->guidClass));
if (pDesc->dwValidData & DMUS_OBJ_NAME)
strncpyW (This->pDesc->wszName, pDesc->wszName, DMUS_MAX_NAME);
if (pDesc->dwValidData & DMUS_OBJ_CATEGORY)
strncpyW (This->pDesc->wszCategory, pDesc->wszCategory, DMUS_MAX_CATEGORY);
if (pDesc->dwValidData & DMUS_OBJ_FILENAME)
strncpyW (This->pDesc->wszFileName, pDesc->wszFileName, DMUS_MAX_FILENAME);
if (pDesc->dwValidData & DMUS_OBJ_VERSION)
memcpy (&This->pDesc->vVersion, &pDesc->vVersion, sizeof (pDesc->vVersion));
if (pDesc->dwValidData & DMUS_OBJ_DATE)
memcpy (&This->pDesc->ftDate, &pDesc->ftDate, sizeof (pDesc->ftDate));
if (pDesc->dwValidData & DMUS_OBJ_MEMORY) {
memcpy (&This->pDesc->llMemLength, &pDesc->llMemLength, sizeof (pDesc->llMemLength));
memcpy (This->pDesc->pbMemData, pDesc->pbMemData, sizeof (pDesc->pbMemData));
}
if (pDesc->dwValidData & DMUS_OBJ_STREAM) {
/* according to MSDN, we copy the stream */
IStream_Clone (pDesc->pStream, &This->pDesc->pStream);
}
/* add new flags */
This->pDesc->dwValidData |= pDesc->dwValidData;
return S_OK;
}
HRESULT WINAPI IDirectMusicBandObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicBandObject,iface);
FIXME("(%p, %p, %p): stub\n", This, pStream, pDesc);
return S_OK;
}
ICOM_VTABLE(IDirectMusicObject) DirectMusicBandObject_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicBandObject_QueryInterface,
IDirectMusicBandObject_AddRef,
IDirectMusicBandObject_Release,
IDirectMusicBandObject_GetDescriptor,
IDirectMusicBandObject_SetDescriptor,
IDirectMusicBandObject_ParseDescriptor
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicBandObject (LPCGUID lpcGUID, LPDIRECTMUSICOBJECT* ppObject, LPUNKNOWN pUnkOuter)
{
IDirectMusicBandObject *obj;
TRACE("(%p,%p,%p)\n", lpcGUID, ppObject, pUnkOuter);
if (IsEqualGUID (lpcGUID, &IID_IDirectMusicObject)) {
obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicBandObject));
if (NULL == obj) {
*ppObject = (LPDIRECTMUSICOBJECT) NULL;
return E_OUTOFMEMORY;
}
obj->lpVtbl = &DirectMusicBandObject_Vtbl;
obj->ref = 1;
/* prepare IPersistStream */
obj->pStream = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(IDirectMusicBandObjectStream));
obj->pStream->lpVtbl = &DirectMusicBandObjectStream_Vtbl;
obj->pStream->ref = 1;
obj->pStream->pParentObject = obj;
/* prepare IDirectMusicBand */
DMUSIC_CreateDirectMusicBand (&IID_IDirectMusicBand, (LPDIRECTMUSICBAND*)&obj->pBand, NULL);
obj->pBand->pObject = obj;
*ppObject = (LPDIRECTMUSICOBJECT) obj;
return S_OK;
}
WARN("No interface found\n");
return E_NOINTERFACE;
}
/*****************************************************************************
* IDirectMusicBandObjectStream implementation
*/
/* IDirectMusicBandObjectStream IUnknown part: */
HRESULT WINAPI IDirectMusicBandObjectStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicBandObjectStream,iface);
if (IsEqualGUID(riid, &IID_IUnknown)
|| IsEqualGUID(riid, &IID_IPersistStream)) {
IDirectMusicBandObjectStream_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicBandObjectStream_AddRef (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicBandObjectStream,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicBandObjectStream_Release (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicBandObjectStream,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicBandObjectStream IPersist part: */
HRESULT WINAPI IDirectMusicBandObjectStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID)
{
return E_NOTIMPL;
}
/* IDirectMusicBandObjectStream IPersistStream part: */
HRESULT WINAPI IDirectMusicBandObjectStream_IsDirty (LPPERSISTSTREAM iface)
{
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicBandObjectStream_Load (LPPERSISTSTREAM iface, IStream* pStm)
{
ICOM_THIS(IDirectMusicBandObjectStream,iface);
FOURCC chunkID;
DWORD chunkSize, StreamSize, StreamCount, ListSize[3], ListCount[3];
HRESULT WINAPI IDirectMusicBandImpl_IDirectMusicObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc) {
DMUS_PRIVATE_CHUNK Chunk;
DWORD StreamSize, StreamCount, ListSize[1], ListCount[1];
LARGE_INTEGER liMove; /* used when skipping chunks */
DMUS_IO_REFERENCE tempReferenceHeader;
DMUS_OBJECTDESC ObjDesc;
IDirectMusicBandImpl* pBand = This->pParentObject->pBand; /* that's where we load data to */
LPDIRECTMUSICLOADER pLoader;
LPDIRECTMUSICGETLOADER pGetLoader;
TRACE("(%p, %p)\n", pStream, pDesc);
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
IStream_Read (pStm, &chunkSize, sizeof(DWORD), NULL);
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (chunkID), chunkSize);
switch (chunkID) {
/* FIXME: should this be determined from stream? */
pDesc->dwValidData |= DMUS_OBJ_CLASS;
memcpy (&pDesc->guidClass, &CLSID_DirectMusicBand, sizeof(CLSID));
IStream_Read (pStream, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
TRACE_(dmfile)(": %s chunk (size = 0x%04lx)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
switch (Chunk.fccID) {
case FOURCC_RIFF: {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
TRACE_(dmfile)(": RIFF chunk of type %s", debugstr_fourcc(chunkID));
StreamSize = chunkSize - sizeof(FOURCC);
IStream_Read (pStream, &Chunk.fccID, sizeof(FOURCC), NULL);
TRACE_(dmfile)(": RIFF chunk of type %s", debugstr_fourcc(Chunk.fccID));
StreamSize = Chunk.dwSize - sizeof(FOURCC);
StreamCount = 0;
switch (chunkID) {
case DMUS_FOURCC_BAND_FORM: {
TRACE_(dmfile)(": band form\n");
do {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
IStream_Read (pStm, &chunkSize, sizeof(FOURCC), NULL);
StreamCount += sizeof(FOURCC) + sizeof(DWORD) + chunkSize;
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (chunkID), chunkSize);
switch (chunkID) {
case DMUS_FOURCC_GUID_CHUNK: {
TRACE_(dmfile)(": GUID chunk\n");
IStream_Read (pStm, pBand->guidID, chunkSize, NULL);
break;
}
case DMUS_FOURCC_VERSION_CHUNK: {
TRACE_(dmfile)(": version chunk\n");
IStream_Read (pStm, pBand->vVersion, chunkSize, NULL);
break;
}
case FOURCC_LIST: {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
TRACE_(dmfile)(": LIST chunk of type %s", debugstr_fourcc(chunkID));
ListSize[0] = chunkSize - sizeof(FOURCC);
ListCount[0] = 0;
switch (chunkID) {
case DMUS_FOURCC_UNFO_LIST: {
TRACE_(dmfile)(": UNFO list\n");
do {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
IStream_Read (pStm, &chunkSize, sizeof(FOURCC), NULL);
ListCount[0] += sizeof(FOURCC) + sizeof(DWORD) + chunkSize;
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (chunkID), chunkSize);
switch (chunkID) {
/* don't ask me why, but M$ puts INFO elements in UNFO list sometimes
(though strings seem to be valid unicode) */
case mmioFOURCC('I','N','A','M'):
case DMUS_FOURCC_UNAM_CHUNK: {
TRACE_(dmfile)(": name chunk\n");
pBand->wzName = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, chunkSize);
IStream_Read (pStm, pBand->wzName, chunkSize, NULL);
break;
}
case mmioFOURCC('I','A','R','T'):
case DMUS_FOURCC_UART_CHUNK: {
TRACE_(dmfile)(": artist chunk\n");
pBand->wzArtist = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, chunkSize);
IStream_Read (pStm, pBand->wzArtist, chunkSize, NULL);
break;
}
case mmioFOURCC('I','C','O','P'):
case DMUS_FOURCC_UCOP_CHUNK: {
TRACE_(dmfile)(": copyright chunk\n");
pBand->wzCopyright = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, chunkSize);
IStream_Read (pStm, pBand->wzCopyright, chunkSize, NULL);
break;
}
case mmioFOURCC('I','S','B','J'):
case DMUS_FOURCC_USBJ_CHUNK: {
TRACE_(dmfile)(": subject chunk\n");
pBand->wzSubject = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, chunkSize);
IStream_Read (pStm, pBand->wzSubject, chunkSize, NULL);
break;
}
case mmioFOURCC('I','C','M','T'):
case DMUS_FOURCC_UCMT_CHUNK: {
TRACE_(dmfile)(": comment chunk\n");
pBand->wzComment = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, chunkSize);
IStream_Read (pStm, pBand->wzComment, chunkSize, NULL);
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (irrevelant & skipping)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
TRACE_(dmfile)(": ListCount[0] = %ld < ListSize[0] = %ld\n", ListCount[0], ListSize[0]);
} while (ListCount[0] < ListSize[0]);
break;
}
case DMUS_FOURCC_INSTRUMENTS_LIST: {
TRACE_(dmfile)(": instruments list\n");
do {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
IStream_Read (pStm, &chunkSize, sizeof(FOURCC), NULL);
ListCount[0] += sizeof(FOURCC) + sizeof(DWORD) + chunkSize;
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (chunkID), chunkSize);
switch (chunkID) {
case FOURCC_LIST: {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
TRACE_(dmfile)(": LIST chunk of type %s", debugstr_fourcc(chunkID));
ListSize[1] = chunkSize - sizeof(FOURCC);
ListCount[1] = 0;
switch (chunkID) {
case DMUS_FOURCC_INSTRUMENT_LIST: {
/* init new instrument list entry */
LPDMUS_PRIVATE_INSTRUMENT pNewInstrument = (LPDMUS_PRIVATE_INSTRUMENT) HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(DMUS_PRIVATE_INSTRUMENT));
TRACE_(dmfile)(": instrument list\n");
do {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
IStream_Read (pStm, &chunkSize, sizeof(FOURCC), NULL);
ListCount[1] += sizeof(FOURCC) + sizeof(DWORD) + chunkSize;
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (chunkID), chunkSize);
switch (chunkID) {
case DMUS_FOURCC_INSTRUMENT_CHUNK: {
TRACE_(dmfile)(": band instrument header\n");
IStream_Read (pStm, &pNewInstrument->pInstrument, chunkSize, NULL);
break;
}
case FOURCC_LIST: {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
TRACE_(dmfile)(": LIST chunk of type %s", debugstr_fourcc(chunkID));
ListSize[2] = chunkSize - sizeof(FOURCC);
ListCount[2] = 0;
switch (chunkID) {
case DMUS_FOURCC_REF_LIST: {
TRACE_(dmfile)(": reference list\n");
ZeroMemory ((LPVOID)&ObjDesc, sizeof(DMUS_OBJECTDESC));
do {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
IStream_Read (pStm, &chunkSize, sizeof(FOURCC), NULL);
ListCount[2] += sizeof(FOURCC) + sizeof(DWORD) + chunkSize;
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (chunkID), chunkSize);
switch (chunkID) {
case DMUS_FOURCC_REF_CHUNK: {
TRACE_(dmfile)(": reference header chunk\n");
IStream_Read (pStm, &tempReferenceHeader, chunkSize, NULL);
/* copy retrieved data to DMUS_OBJECTDESC */
ObjDesc.dwSize = sizeof(DMUS_OBJECTDESC);
ObjDesc.guidClass = tempReferenceHeader.guidClassID;
ObjDesc.dwValidData = tempReferenceHeader.dwValidData;
break;
}
case DMUS_FOURCC_GUID_CHUNK: {
TRACE_(dmfile)(": guid chunk\n");
IStream_Read (pStm, &ObjDesc.guidObject, chunkSize, NULL);
break;
}
case DMUS_FOURCC_DATE_CHUNK: {
TRACE_(dmfile)(": file date chunk\n");
IStream_Read (pStm, &ObjDesc.ftDate, chunkSize, NULL);
break;
}
case DMUS_FOURCC_NAME_CHUNK: {
TRACE_(dmfile)(": name chunk\n");
IStream_Read (pStm, &ObjDesc.wszName, chunkSize, NULL);
break;
}
case DMUS_FOURCC_FILE_CHUNK: {
TRACE_(dmfile)(": file name chunk\n");
IStream_Read (pStm, &ObjDesc.wszFileName, chunkSize, NULL);
break;
}
case DMUS_FOURCC_CATEGORY_CHUNK: {
TRACE_(dmfile)(": category chunk\n");
IStream_Read (pStm, &ObjDesc.wszCategory, chunkSize, NULL);
break;
}
case DMUS_FOURCC_VERSION_CHUNK: {
TRACE_(dmfile)(": version chunk\n");
IStream_Read (pStm, &ObjDesc.vVersion, chunkSize, NULL);
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (skipping)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); /* skip this chunk */
break;
}
}
TRACE_(dmfile)(": ListCount[2] = %ld < ListSize[2] = %ld\n", ListCount[2], ListSize[2]);
} while (ListCount[2] < ListSize[2]);
/* let's see what we have */
TRACE_(dmfile)(": (READ): reference: dwSize = %ld; dwValidData = %ld; guidObject = %s; guidClass = %s; \
vVersion = %08lx,%08lx; wszName = %s; wszCategory = %s; wszFileName = %s\n", ObjDesc.dwSize, ObjDesc.dwValidData, debugstr_guid(&ObjDesc.guidObject), debugstr_guid(&ObjDesc.guidClass),
ObjDesc.vVersion.dwVersionMS, ObjDesc.vVersion.dwVersionLS, debugstr_w(ObjDesc.wszName), debugstr_w(ObjDesc.wszCategory), debugstr_w(ObjDesc.wszFileName));
/* now, let's convience loader to load reference */
if (IStream_QueryInterface (pStm, &IID_IDirectMusicGetLoader, (LPVOID*)&pGetLoader) == S_OK) {
if (IDirectMusicGetLoader_GetLoader (pGetLoader, &pLoader) == S_OK) {
/* load referenced object */
IDirectMusicObject* pObject;
if(FAILED(IDirectMusicLoader_GetObject (pLoader, &ObjDesc, &IID_IDirectMusicObject, (LPVOID*)&pObject)))
/* acquire collection from loaded referenced object */
if(FAILED(IDirectMusicObject_QueryInterface (pObject, &IID_IDirectMusicCollection, (LPVOID*)&pNewInstrument->ppReferenceCollection)))
IDirectMusicLoader_Release (pLoader);
}
IDirectMusicGetLoader_Release (pGetLoader);
} else {
ERR("Could not get IDirectMusicGetLoader... reference will not be loaded :(\n");
/* E_FAIL */
}
break;
}
default: {
TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
return E_FAIL;
}
}
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (skipping)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); /* skip this chunk */
break;
}
}
TRACE_(dmfile)(": ListCount[1] = %ld < ListSize[1] = %ld\n", ListCount[1], ListSize[1]);
} while (ListCount[1] < ListSize[1]);
/* hmm... in dxdiag segment's band there aren't any references, but loader still desperatly
loads default collection... does that mean that if there is no reference, use default?
*/
if (!pNewInstrument->ppReferenceCollection) {
TRACE_(dmfile)(": (READ): loading default collection (as no specific reference was made)\n");
ZeroMemory ((LPVOID)&ObjDesc, sizeof(DMUS_OBJECTDESC));
ObjDesc.dwSize = sizeof(DMUS_OBJECTDESC);
ObjDesc.dwValidData = DMUS_OBJ_CLASS | DMUS_OBJ_OBJECT;
ObjDesc.guidObject = GUID_DefaultGMCollection;
ObjDesc.guidClass = CLSID_DirectMusicCollection;
if (SUCCEEDED(IStream_QueryInterface (pStm, &IID_IDirectMusicGetLoader, (LPVOID*)&pGetLoader))) {
if (SUCCEEDED(IDirectMusicGetLoader_GetLoader (pGetLoader, &pLoader))) {
IDirectMusicObject* pObject;
if (SUCCEEDED(IDirectMusicLoader_GetObject (pLoader, &ObjDesc, &IID_IDirectMusicObject, (LPVOID*)&pObject))) {
IDirectMusicObject_QueryInterface (pObject, &IID_IDirectMusicCollection, (LPVOID*)&pNewInstrument->ppReferenceCollection);
IDirectMusicLoader_Release (pLoader);
}
}
IDirectMusicGetLoader_Release (pGetLoader);
} else {
ERR("Could not get IDirectMusicGetLoader... reference will not be loaded :(\n");
/* E_FAIL */
}
}
list_add_tail (&This->pParentObject->pBand->Instruments, &pNewInstrument->entry);
break;
}
default: {
TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
return E_FAIL;
}
}
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (irrevelant & skipping)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
TRACE_(dmfile)(": ListCount[0] = %ld < ListSize[0] = %ld\n", ListCount[0], ListSize[0]);
} while (ListCount[0] < ListSize[0]);
break;
}
default: {
TRACE_(dmfile)(": unknown (skipping)\n");
liMove.QuadPart = chunkSize - sizeof(FOURCC);
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (irrevelant & skipping)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
if (Chunk.fccID == DMUS_FOURCC_BAND_FORM) {
TRACE_(dmfile)(": band form\n");
do {
IStream_Read (pStream, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
StreamCount += sizeof(FOURCC) + sizeof(DWORD) + Chunk.dwSize;
TRACE_(dmfile)(": %s chunk (size = 0x%04lx)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
switch (Chunk.fccID) {
case DMUS_FOURCC_GUID_CHUNK: {
TRACE_(dmfile)(": GUID chunk\n");
pDesc->dwValidData |= DMUS_OBJ_OBJECT;
IStream_Read (pStream, &pDesc->guidObject, Chunk.dwSize, NULL);
break;
}
TRACE_(dmfile)(": StreamCount[0] = %ld < StreamSize[0] = %ld\n", StreamCount, StreamSize);
} while (StreamCount < StreamSize);
break;
}
default: {
TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
liMove.QuadPart = StreamSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */
return E_FAIL;
}
case DMUS_FOURCC_VERSION_CHUNK: {
TRACE_(dmfile)(": version chunk\n");
pDesc->dwValidData |= DMUS_OBJ_VERSION;
IStream_Read (pStream, &pDesc->vVersion, Chunk.dwSize, NULL);
break;
}
case DMUS_FOURCC_CATEGORY_CHUNK: {
TRACE_(dmfile)(": category chunk\n");
pDesc->dwValidData |= DMUS_OBJ_CATEGORY;
IStream_Read (pStream, pDesc->wszCategory, Chunk.dwSize, NULL);
break;
}
case FOURCC_LIST: {
IStream_Read (pStream, &Chunk.fccID, sizeof(FOURCC), NULL);
TRACE_(dmfile)(": LIST chunk of type %s", debugstr_fourcc(Chunk.fccID));
ListSize[0] = Chunk.dwSize - sizeof(FOURCC);
ListCount[0] = 0;
switch (Chunk.fccID) {
/* evil M$ UNFO list, which can (!?) contain INFO elements */
case DMUS_FOURCC_UNFO_LIST: {
TRACE_(dmfile)(": UNFO list\n");
do {
IStream_Read (pStream, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
ListCount[0] += sizeof(FOURCC) + sizeof(DWORD) + Chunk.dwSize;
TRACE_(dmfile)(": %s chunk (size = 0x%04lx)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
switch (Chunk.fccID) {
/* don't ask me why, but M$ puts INFO elements in UNFO list sometimes
(though strings seem to be valid unicode) */
case mmioFOURCC('I','N','A','M'):
case DMUS_FOURCC_UNAM_CHUNK: {
TRACE_(dmfile)(": name chunk\n");
pDesc->dwValidData |= DMUS_OBJ_NAME;
IStream_Read (pStream, pDesc->wszName, Chunk.dwSize, NULL);
break;
}
case mmioFOURCC('I','A','R','T'):
case DMUS_FOURCC_UART_CHUNK: {
TRACE_(dmfile)(": artist chunk (ignored)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','C','O','P'):
case DMUS_FOURCC_UCOP_CHUNK: {
TRACE_(dmfile)(": copyright chunk (ignored)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','S','B','J'):
case DMUS_FOURCC_USBJ_CHUNK: {
TRACE_(dmfile)(": subject chunk (ignored)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','C','M','T'):
case DMUS_FOURCC_UCMT_CHUNK: {
TRACE_(dmfile)(": comment chunk (ignored)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (irrevelant & skipping)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
TRACE_(dmfile)(": ListCount[0] = %ld < ListSize[0] = %ld\n", ListCount[0], ListSize[0]);
} while (ListCount[0] < ListSize[0]);
break;
}
default: {
TRACE_(dmfile)(": unknown (skipping)\n");
liMove.QuadPart = Chunk.dwSize - sizeof(FOURCC);
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (irrevelant & skipping)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
TRACE_(dmfile)(": StreamCount[0] = %ld < StreamSize[0] = %ld\n", StreamCount, StreamSize);
} while (StreamCount < StreamSize);
break;
} else {
TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
liMove.QuadPart = StreamSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */
return E_FAIL;
}
TRACE_(dmfile)(": reading finished\n");
break;
}
default: {
TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */
return E_FAIL;
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */
return DMUS_E_INVALIDFILE;
}
}
TRACE(": returning descriptor:\n");
if (TRACE_ON(dmband)) {
DMUSIC_dump_DMUS_OBJECTDESC (pDesc);
}
/* DEBUG: dumps whole band object tree: */
if (TRACE_ON(dmband)) {
int r = 0;
DMUS_PRIVATE_INSTRUMENT *tmpEntry;
struct list *listEntry;
TRACE("*** IDirectMusicBand (%p) ***\n", pBand);
if (pBand->guidID)
TRACE(" - GUID = %s\n", debugstr_guid(pBand->guidID));
if (pBand->vVersion)
TRACE(" - Version = %i,%i,%i,%i\n", (pBand->vVersion->dwVersionMS >> 8) && 0x0000FFFF, pBand->vVersion->dwVersionMS && 0x0000FFFF, \
(pBand->vVersion->dwVersionLS >> 8) && 0x0000FFFF, pBand->vVersion->dwVersionLS && 0x0000FFFF);
if (pBand->wzName)
TRACE(" - Name = %s\n", debugstr_w(pBand->wzName));
if (pBand->wzArtist)
TRACE(" - Artist = %s\n", debugstr_w(pBand->wzArtist));
if (pBand->wzCopyright)
TRACE(" - Copyright = %s\n", debugstr_w(pBand->wzCopyright));
if (pBand->wzSubject)
TRACE(" - Subject = %s\n", debugstr_w(pBand->wzSubject));
if (pBand->wzComment)
TRACE(" - Comment = %s\n", debugstr_w(pBand->wzComment));
TRACE(" - Instruments:\n");
LIST_FOR_EACH (listEntry, &This->pParentObject->pBand->Instruments) {
tmpEntry = LIST_ENTRY( listEntry, DMUS_PRIVATE_INSTRUMENT, entry );
TRACE(" - Instrument[%i]:\n", r);
TRACE(" - Instrument header:\n");
TRACE(" - dwPatch = %ld\n", tmpEntry->pInstrument.dwPatch);
TRACE(" - dwAssignPatch = %ld\n", tmpEntry->pInstrument.dwAssignPatch);
TRACE(" - dwNoteRanges[4] = %ln\n", tmpEntry->pInstrument.dwNoteRanges);
TRACE(" - dwPChannel = %ld\n", tmpEntry->pInstrument.dwPChannel);
TRACE(" - dwFlags = %ld\n", tmpEntry->pInstrument.dwFlags);
TRACE(" - bPan = %i\n", tmpEntry->pInstrument.bPan);
TRACE(" - bVolume = %i\n", tmpEntry->pInstrument.bVolume);
TRACE(" - nTranspose = %i\n", tmpEntry->pInstrument.nTranspose);
TRACE(" - dwChannelPriority = %ld\n", tmpEntry->pInstrument.dwChannelPriority);
TRACE(" - nPitchBendRange = %i\n", tmpEntry->pInstrument.nPitchBendRange);
TRACE(" - Reference collection: %p\n", tmpEntry->ppReferenceCollection);
r++;
}
}
return S_OK;
}
HRESULT WINAPI IDirectMusicBandObjectStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty)
{
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicBandObjectStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize)
{
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicBandObjectStream_Vtbl =
{
ICOM_VTABLE(IDirectMusicObject) DirectMusicBand_Object_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicBandObjectStream_QueryInterface,
IDirectMusicBandObjectStream_AddRef,
IDirectMusicBandObjectStream_Release,
IDirectMusicBandObjectStream_GetClassID,
IDirectMusicBandObjectStream_IsDirty,
IDirectMusicBandObjectStream_Load,
IDirectMusicBandObjectStream_Save,
IDirectMusicBandObjectStream_GetSizeMax
IDirectMusicBandImpl_IDirectMusicObject_QueryInterface,
IDirectMusicBandImpl_IDirectMusicObject_AddRef,
IDirectMusicBandImpl_IDirectMusicObject_Release,
IDirectMusicBandImpl_IDirectMusicObject_GetDescriptor,
IDirectMusicBandImpl_IDirectMusicObject_SetDescriptor,
IDirectMusicBandImpl_IDirectMusicObject_ParseDescriptor
};
/* IDirectMusicBandImpl IPersistStream part: */
HRESULT WINAPI IDirectMusicBandImpl_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicBandImpl, PersistStreamVtbl, iface);
return IDirectMusicBandImpl_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicBandImpl_IPersistStream_AddRef (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicBandImpl, PersistStreamVtbl, iface);
return IDirectMusicBandImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicBandImpl_IPersistStream_Release (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicBandImpl, PersistStreamVtbl, iface);
return IDirectMusicBandImpl_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicBandImpl_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicBandImpl_IPersistStream_IsDirty (LPPERSISTSTREAM iface) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicBandImpl_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm) {
ICOM_THIS_MULTI(IDirectMusicBandImpl, PersistStreamVtbl, iface);
FIXME("(%p,%p): loading not implemented yet\n", This, pStm);
return S_OK;
}
HRESULT WINAPI IDirectMusicBandImpl_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicBandImpl_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) {
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicBand_PersistStream_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicBandImpl_IPersistStream_QueryInterface,
IDirectMusicBandImpl_IPersistStream_AddRef,
IDirectMusicBandImpl_IPersistStream_Release,
IDirectMusicBandImpl_IPersistStream_GetClassID,
IDirectMusicBandImpl_IPersistStream_IsDirty,
IDirectMusicBandImpl_IPersistStream_Load,
IDirectMusicBandImpl_IPersistStream_Save,
IDirectMusicBandImpl_IPersistStream_GetSizeMax
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicBandImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) {
IDirectMusicBandImpl* obj;
obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicBandImpl));
if (NULL == obj) {
*ppobj = (LPVOID) NULL;
return E_OUTOFMEMORY;
}
obj->UnknownVtbl = &DirectMusicBand_Unknown_Vtbl;
obj->BandVtbl = &DirectMusicBand_Band_Vtbl;
obj->ObjectVtbl = &DirectMusicBand_Object_Vtbl;
obj->PersistStreamVtbl = &DirectMusicBand_PersistStream_Vtbl;
obj->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC));
DM_STRUCT_INIT(obj->pDesc);
obj->pDesc->dwValidData |= DMUS_OBJ_CLASS;
memcpy (&obj->pDesc->guidClass, &CLSID_DirectMusicBand, sizeof (CLSID));
obj->ref = 0; /* will be inited by QueryInterface */
list_init (&obj->Instruments);
return IDirectMusicBandImpl_IUnknown_QueryInterface ((LPUNKNOWN)&obj->UnknownVtbl, lpcGUID, ppobj);
}

View File

@ -1,6 +1,6 @@
/* IDirectMusicBandTrack Implementation
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -17,53 +17,45 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "dmband_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmband);
WINE_DECLARE_DEBUG_CHANNEL(dmfile);
/*****************************************************************************
* IDirectMusicBandTrack implementation
*/
/* IDirectMusicBandTrack IUnknown part: */
HRESULT WINAPI IDirectMusicBandTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicBandTrack,iface);
HRESULT WINAPI IDirectMusicBandTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicBandTrack, UnknownVtbl, iface);
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IDirectMusicTrack) ||
IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
IDirectMusicBandTrack_AddRef(iface);
*ppobj = This;
if (IsEqualIID (riid, &IID_IUnknown)) {
*ppobj = (LPUNKNOWN)&This->UnknownVtbl;
IDirectMusicBandTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicTrack)
|| IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
*ppobj = (LPDIRECTMUSICTRACK8)&This->TrackVtbl;
IDirectMusicBandTrack_IDirectMusicTrack_AddRef ((LPDIRECTMUSICTRACK8)&This->TrackVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicBandTrackStream_AddRef ((LPPERSISTSTREAM)This->pStream);
*ppobj = This->pStream;
*ppobj = (LPPERSISTSTREAM)&This->PersistStreamVtbl;
IDirectMusicBandTrack_IPersistStream_AddRef ((LPPERSISTSTREAM)&This->PersistStreamVtbl);
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicBandTrack_AddRef (LPDIRECTMUSICTRACK8 iface)
{
ICOM_THIS(IDirectMusicBandTrack,iface);
ULONG WINAPI IDirectMusicBandTrack_IUnknown_AddRef (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicBandTrack, UnknownVtbl, iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicBandTrack_Release (LPDIRECTMUSICTRACK8 iface)
{
ICOM_THIS(IDirectMusicBandTrack,iface);
ULONG WINAPI IDirectMusicBandTrack_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicBandTrack, UnknownVtbl, iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
@ -72,37 +64,49 @@ ULONG WINAPI IDirectMusicBandTrack_Release (LPDIRECTMUSICTRACK8 iface)
return ref;
}
/* IDirectMusicBandTrack IDirectMusicTrack part: */
HRESULT WINAPI IDirectMusicBandTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment)
{
ICOM_THIS(IDirectMusicBandTrack,iface);
ICOM_VTABLE(IUnknown) DirectMusicBandTrack_Unknown_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicBandTrack_IUnknown_QueryInterface,
IDirectMusicBandTrack_IUnknown_AddRef,
IDirectMusicBandTrack_IUnknown_Release
};
/* IDirectMusicBandTrack IDirectMusicTrack8 part: */
HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicBandTrack, TrackVtbl, iface);
return IDirectMusicBandTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicBandTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface) {
ICOM_THIS_MULTI(IDirectMusicBandTrack, TrackVtbl, iface);
return IDirectMusicBandTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicBandTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface) {
ICOM_THIS_MULTI(IDirectMusicBandTrack, TrackVtbl, iface);
return IDirectMusicBandTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment) {
ICOM_THIS_MULTI(IDirectMusicBandTrack, TrackVtbl, iface);
FIXME("(%p, %p): stub\n", This, pSegment);
return S_OK;
}
HRESULT WINAPI IDirectMusicBandTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicBandTrack,iface);
HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicBandTrack, TrackVtbl, iface);
FIXME("(%p, %p, %p, %p, %ld, %ld): stub\n", This, pSegmentState, pPerformance, ppStateData, dwVirtualTrack8ID, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicBandTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData)
{
ICOM_THIS(IDirectMusicBandTrack,iface);
HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData) {
ICOM_THIS_MULTI(IDirectMusicBandTrack, TrackVtbl, iface);
FIXME("(%p, %p): stub\n", This, pStateData);
return S_OK;
}
HRESULT WINAPI IDirectMusicBandTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
{
ICOM_THIS(IDirectMusicBandTrack,iface);
HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID) {
ICOM_THIS_MULTI(IDirectMusicBandTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %ld, %ld, %ld, %p, %p, %ld): semi-stub\n", This, pStateData, mtStart, mtEnd, mtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
/* Sends following pMSG:
@ -111,92 +115,24 @@ HRESULT WINAPI IDirectMusicBandTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pSta
- DMUS_CHANNEL_PRIORITY_PMSG
- DMUS_MIDI_PMSG
*/
#if 0
/* get the graph and segment */
IDirectMusicSegment* pSegment; /* needed for getting track group */
IDirectMusicGraph* pGraph; /* needed for PMsg stamping */
DWORD dwGroup;
if (FAILED(IDirectMusicSegmentState_GetSegment (pSegSt, &pSegment))) {
ERR("failed to get segment\n");
return E_FAIL;
}
/* HINT: M$ lies when saying that we can query segment for graph; one can obtain graph only
by querying segment state or performance */
if (FAILED(IDirectMusicSegmentState_QueryInterface (pSegSt, &IID_IDirectMusicGraph, (LPVOID*)&pGraph))) {
ERR("failed to get graph on segment\n");
return E_FAIL;
}
IDirectMusicSegment_GetTrackGroup (pSegment, (LPDIRECTMUSICTRACK)iface, &dwGroup);
/* iterate through band list to get appropriate band */
DMUS_PRIVATE_BAND *tmpBandEntry;
struct list *listEntry;
IDirectMusicBandImpl* pBand = NULL;
LIST_FOR_EACH (listEntry, &This->Bands) {
tmpBandEntry = LIST_ENTRY (listEntry, DMUS_PRIVATE_BAND, entry);
/* FIXME: time checking is far from perfect: i don't know if times are properly compared and
in case of v.2 header i don't know which time to take; besides, first band with smaller
time will be taken */
if (((tmpBandEntry->pBandHeader.dwVersion = 1) && (tmpBandEntry->pBandHeader.lBandTime < mtStart))
|| ((tmpBandEntry->pBandHeader.dwVersion = 2) && (tmpBandEntry->pBandHeader.lBandTimeLogical < mtStart))) {
pBand = tmpBandEntry->ppBand;
break;
}
}
int r = 0; /* TEST */
/* now iterate through instruments list on selected band and fill and send all messages related to it */
DMUS_PRIVATE_INSTRUMENT *tmpInstrumentEntry;
LIST_FOR_EACH (listEntry, &pBand->Instruments) {
tmpInstrumentEntry = LIST_ENTRY (listEntry, DMUS_PRIVATE_INSTRUMENT, entry);
FIXME("parsing instrument [%i]\n", r);
r++;
/* allocate the msg */
DMUS_CHANNEL_MIDI_PMSG* pMIDI = NULL;
if (FAILED(IDirectMusicPerformance_AllocPMsg (pPerf, sizeof(DMUS_MIDI_PMSG), (DMUS_PMSG**)&pMIDI))) {
ERR("could not allocate PMsg\n");
}
/* HERE THE MESSAGE DATA SHOULD BE PUT IN */
if (FAILED(IDirectMusicGraph_StampPMsg (pGraph, (DMUS_PMSG*)pMIDI))) {
ERR("could not stamp PMsg\n");
}
if (FAILED(IDirectMusicPerformance_SendPMsg (pPerf, (DMUS_PMSG*)pMIDI))) {
ERR("could not send PMsg\n");
}
}
#endif
return S_OK;
}
HRESULT WINAPI IDirectMusicBandTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam)
{
ICOM_THIS(IDirectMusicBandTrack,iface);
HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam) {
ICOM_THIS_MULTI(IDirectMusicBandTrack, TrackVtbl, iface);
FIXME("(%p, %s, %ld, %p, %p): stub\n", This, debugstr_guid(rguidType), mtTime, pmtNext, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicBandTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam)
{
ICOM_THIS(IDirectMusicBandTrack,iface);
HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam) {
ICOM_THIS_MULTI(IDirectMusicBandTrack, TrackVtbl, iface);
FIXME("(%p, %s, %ld, %p): stub\n", This, debugstr_guid(rguidType), mtTime, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicBandTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType)
{
ICOM_THIS(IDirectMusicBandTrack,iface);
HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType) {
ICOM_THIS_MULTI(IDirectMusicBandTrack, TrackVtbl, iface);
TRACE("(%p, %s): ", This, debugstr_guid(rguidType));
if (IsEqualGUID (rguidType, &GUID_BandParam)
@ -218,497 +154,144 @@ HRESULT WINAPI IDirectMusicBandTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface
return DMUS_E_TYPE_UNSUPPORTED;
}
HRESULT WINAPI IDirectMusicBandTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType)
{
ICOM_THIS(IDirectMusicBandTrack,iface);
HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
ICOM_THIS_MULTI(IDirectMusicBandTrack, TrackVtbl, iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
return S_OK;
}
HRESULT WINAPI IDirectMusicBandTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType)
{
ICOM_THIS(IDirectMusicBandTrack,iface);
HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
ICOM_THIS_MULTI(IDirectMusicBandTrack, TrackVtbl, iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
return S_OK;
}
HRESULT WINAPI IDirectMusicBandTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack)
{
ICOM_THIS(IDirectMusicBandTrack,iface);
HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack) {
ICOM_THIS_MULTI(IDirectMusicBandTrack, TrackVtbl, iface);
FIXME("(%p, %ld, %ld, %p): stub\n", This, mtStart, mtEnd, ppTrack);
return S_OK;
}
/* IDirectMusicBandTrack IDirectMusicTrack8 part: */
HRESULT WINAPI IDirectMusicBandTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
{
ICOM_THIS(IDirectMusicBandTrack,iface);
HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID) {
ICOM_THIS_MULTI(IDirectMusicBandTrack, TrackVtbl, iface);
FIXME("(%p, %p, %lli, %lli, %lli, %ld, %p, %p, %ld): stub\n", This, pStateData, rtStart, rtEnd, rtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
return S_OK;
}
HRESULT WINAPI IDirectMusicBandTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicBandTrack,iface);
HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicBandTrack, TrackVtbl, iface);
FIXME("(%p, %s, %lli, %p, %p, %p, %ld): stub\n", This, debugstr_guid(rguidType), rtTime, prtNext, pParam, pStateData, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicBandTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicBandTrack,iface);
HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicBandTrack, TrackVtbl, iface);
FIXME("(%p, %s, %lli, %p, %p, %ld): stub\n", This, debugstr_guid(rguidType), rtTime, pParam, pStateData, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicBandTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack)
{
ICOM_THIS(IDirectMusicBandTrack,iface);
HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
ICOM_THIS_MULTI(IDirectMusicBandTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %p): stub\n", This, pContext, dwTrackGroup, ppResultTrack);
return S_OK;
}
HRESULT WINAPI IDirectMusicBandTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack)
{
ICOM_THIS(IDirectMusicBandTrack,iface);
HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
ICOM_THIS_MULTI(IDirectMusicBandTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %p, %ld, %p): stub\n", This, pNewTrack, mtJoin, pContext, dwTrackGroup, ppResultTrack);
return S_OK;
}
ICOM_VTABLE(IDirectMusicTrack8) DirectMusicBandTrack_Vtbl =
{
ICOM_VTABLE(IDirectMusicTrack8) DirectMusicBandTrack_DirectMusicTrack_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicBandTrack_QueryInterface,
IDirectMusicBandTrack_AddRef,
IDirectMusicBandTrack_Release,
IDirectMusicBandTrack_Init,
IDirectMusicBandTrack_InitPlay,
IDirectMusicBandTrack_EndPlay,
IDirectMusicBandTrack_Play,
IDirectMusicBandTrack_GetParam,
IDirectMusicBandTrack_SetParam,
IDirectMusicBandTrack_IsParamSupported,
IDirectMusicBandTrack_AddNotificationType,
IDirectMusicBandTrack_RemoveNotificationType,
IDirectMusicBandTrack_Clone,
IDirectMusicBandTrack_PlayEx,
IDirectMusicBandTrack_GetParamEx,
IDirectMusicBandTrack_SetParamEx,
IDirectMusicBandTrack_Compose,
IDirectMusicBandTrack_Join
IDirectMusicBandTrack_IDirectMusicTrack_QueryInterface,
IDirectMusicBandTrack_IDirectMusicTrack_AddRef,
IDirectMusicBandTrack_IDirectMusicTrack_Release,
IDirectMusicBandTrack_IDirectMusicTrack_Init,
IDirectMusicBandTrack_IDirectMusicTrack_InitPlay,
IDirectMusicBandTrack_IDirectMusicTrack_EndPlay,
IDirectMusicBandTrack_IDirectMusicTrack_Play,
IDirectMusicBandTrack_IDirectMusicTrack_GetParam,
IDirectMusicBandTrack_IDirectMusicTrack_SetParam,
IDirectMusicBandTrack_IDirectMusicTrack_IsParamSupported,
IDirectMusicBandTrack_IDirectMusicTrack_AddNotificationType,
IDirectMusicBandTrack_IDirectMusicTrack_RemoveNotificationType,
IDirectMusicBandTrack_IDirectMusicTrack_Clone,
IDirectMusicBandTrack_IDirectMusicTrack_PlayEx,
IDirectMusicBandTrack_IDirectMusicTrack_GetParamEx,
IDirectMusicBandTrack_IDirectMusicTrack_SetParamEx,
IDirectMusicBandTrack_IDirectMusicTrack_Compose,
IDirectMusicBandTrack_IDirectMusicTrack_Join
};
/* IDirectMusicBandTrack IPersistStream part: */
HRESULT WINAPI IDirectMusicBandTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicBandTrack, PersistStreamVtbl, iface);
return IDirectMusicBandTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicBandTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicBandTrack, PersistStreamVtbl, iface);
return IDirectMusicBandTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicBandTrack_IPersistStream_Release (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicBandTrack, PersistStreamVtbl, iface);
return IDirectMusicBandTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicBandTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicBandTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicBandTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm) {
ICOM_THIS_MULTI(IDirectMusicBandTrack, PersistStreamVtbl, iface);
FIXME("(%p,%p): loading not implemented yet\n", This, pStm);
return S_OK;
}
HRESULT WINAPI IDirectMusicBandTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicBandTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) {
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicBandTrack_PerststStream_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicBandTrack_IPersistStream_QueryInterface,
IDirectMusicBandTrack_IPersistStream_AddRef,
IDirectMusicBandTrack_IPersistStream_Release,
IDirectMusicBandTrack_IPersistStream_GetClassID,
IDirectMusicBandTrack_IPersistStream_IsDirty,
IDirectMusicBandTrack_IPersistStream_Load,
IDirectMusicBandTrack_IPersistStream_Save,
IDirectMusicBandTrack_IPersistStream_GetSizeMax
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicBandTrack (LPCGUID lpcGUID, LPDIRECTMUSICTRACK8 *ppTrack, LPUNKNOWN pUnkOuter)
{
HRESULT WINAPI DMUSIC_CreateDirectMusicBandTrack (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) {
IDirectMusicBandTrack* track;
if (IsEqualIID (lpcGUID, &IID_IDirectMusicTrack)
|| IsEqualIID (lpcGUID, &IID_IDirectMusicTrack8)) {
track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicBandTrack));
if (NULL == track) {
*ppTrack = (LPDIRECTMUSICTRACK8) NULL;
return E_OUTOFMEMORY;
}
track->lpVtbl = &DirectMusicBandTrack_Vtbl;
track->ref = 1;
list_init (&track->Bands);
track->pStream = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(IDirectMusicBandTrackStream));
track->pStream->lpVtbl = &DirectMusicBandTrackStream_Vtbl;
track->pStream->ref = 1;
track->pStream->pParentTrack = track;
*ppTrack = (LPDIRECTMUSICTRACK8) track;
return S_OK;
track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicBandTrack));
if (NULL == track) {
*ppobj = (LPVOID) NULL;
return E_OUTOFMEMORY;
}
WARN("No interface found\n");
track->UnknownVtbl = &DirectMusicBandTrack_Unknown_Vtbl;
track->TrackVtbl = &DirectMusicBandTrack_DirectMusicTrack_Vtbl;
track->PersistStreamVtbl = &DirectMusicBandTrack_PerststStream_Vtbl;
track->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC));
DM_STRUCT_INIT(track->pDesc);
track->pDesc->dwValidData |= DMUS_OBJ_CLASS;
memcpy (&track->pDesc->guidClass, &CLSID_DirectMusicBandTrack, sizeof (CLSID));
track->ref = 0; /* will be inited by QueryInterface */
list_init (&track->Bands);
return E_NOINTERFACE;
return IDirectMusicBandTrack_IUnknown_QueryInterface ((LPUNKNOWN)&track->UnknownVtbl, lpcGUID, ppobj);
}
/*****************************************************************************
* IDirectMusicBandTrackStream implementation
*/
/* IDirectMusicBandTrackStream IUnknown part: */
HRESULT WINAPI IDirectMusicBandTrackStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicBandTrackStream,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicBandTrackStream_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicBandTrackStream_AddRef (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicBandTrackStream,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicBandTrackStream_Release (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicBandTrackStream,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicBandTrackStream IPersist part: */
HRESULT WINAPI IDirectMusicBandTrackStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID)
{
return E_NOTIMPL;
}
/* IDirectMusicBandTrackStream IPersistStream part: */
HRESULT WINAPI IDirectMusicBandTrackStream_IsDirty (LPPERSISTSTREAM iface)
{
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicBandTrackStream_Load (LPPERSISTSTREAM iface, IStream* pStm)
{
ICOM_THIS(IDirectMusicBandTrackStream,iface);
FOURCC chunkID;
DWORD chunkSize, StreamSize, StreamCount, ListSize[3], ListCount[3];
LARGE_INTEGER liMove; /* used when skipping chunks */
DMUS_OBJECTDESC ObjDesc;
IDirectMusicBandTrack* pTrack = This->pParentTrack; /* that's where we load data to */
DMUS_IO_BAND_ITEM_HEADER tempHeaderV1;
DMUS_IO_BAND_ITEM_HEADER2 tempHeaderV2;
LPDIRECTMUSICLOADER pLoader;
LPDIRECTMUSICGETLOADER pGetLoader;
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
IStream_Read (pStm, &chunkSize, sizeof(DWORD), NULL);
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (chunkID), chunkSize);
switch (chunkID) {
case FOURCC_RIFF: {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
TRACE_(dmfile)(": RIFF chunk of type %s", debugstr_fourcc(chunkID));
StreamSize = chunkSize - sizeof(FOURCC);
StreamCount = 0;
switch (chunkID) {
case DMUS_FOURCC_BANDTRACK_FORM: {
TRACE_(dmfile)(": band track form\n");
do {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
IStream_Read (pStm, &chunkSize, sizeof(FOURCC), NULL);
StreamCount += sizeof(FOURCC) + sizeof(DWORD) + chunkSize;
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (chunkID), chunkSize);
switch (chunkID) {
case DMUS_FOURCC_BANDTRACK_CHUNK: {
TRACE_(dmfile)(": band track header chunk\n");
IStream_Read (pStm, pTrack->btkHeader, chunkSize, NULL);
break;
}
case DMUS_FOURCC_GUID_CHUNK: {
TRACE_(dmfile)(": GUID chunk\n");
IStream_Read (pStm, pTrack->guidID, chunkSize, NULL);
break;
}
case DMUS_FOURCC_VERSION_CHUNK: {
TRACE_(dmfile)(": version chunk\n");
IStream_Read (pStm, pTrack->vVersion, chunkSize, NULL);
break;
}
case FOURCC_LIST: {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
TRACE_(dmfile)(": LIST chunk of type %s", debugstr_fourcc(chunkID));
ListSize[0] = chunkSize - sizeof(FOURCC);
ListCount[0] = 0;
switch (chunkID) {
case DMUS_FOURCC_UNFO_LIST: {
TRACE_(dmfile)(": UNFO list\n");
do {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
IStream_Read (pStm, &chunkSize, sizeof(FOURCC), NULL);
ListCount[0] += sizeof(FOURCC) + sizeof(DWORD) + chunkSize;
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (chunkID), chunkSize);
switch (chunkID) {
/* don't ask me why, but M$ puts INFO elements in UNFO list sometimes
(though strings seem to be valid unicode) */
case mmioFOURCC('I','N','A','M'):
case DMUS_FOURCC_UNAM_CHUNK: {
TRACE_(dmfile)(": name chunk\n");
pTrack->wzName = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, chunkSize);
IStream_Read (pStm, pTrack->wzName, chunkSize, NULL);
break;
}
case mmioFOURCC('I','A','R','T'):
case DMUS_FOURCC_UART_CHUNK: {
TRACE_(dmfile)(": artist chunk\n");
pTrack->wzArtist = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, chunkSize);
IStream_Read (pStm, pTrack->wzArtist, chunkSize, NULL);
break;
}
case mmioFOURCC('I','C','O','P'):
case DMUS_FOURCC_UCOP_CHUNK: {
TRACE_(dmfile)(": copyright chunk\n");
pTrack->wzCopyright = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, chunkSize);
IStream_Read (pStm, pTrack->wzCopyright, chunkSize, NULL);
break;
}
case mmioFOURCC('I','S','B','J'):
case DMUS_FOURCC_USBJ_CHUNK: {
TRACE_(dmfile)(": subject chunk\n");
pTrack->wzSubject = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, chunkSize);
IStream_Read (pStm, pTrack->wzSubject, chunkSize, NULL);
break;
}
case mmioFOURCC('I','C','M','T'):
case DMUS_FOURCC_UCMT_CHUNK: {
TRACE_(dmfile)(": comment chunk\n");
pTrack->wzComment = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, chunkSize);
IStream_Read (pStm, pTrack->wzComment, chunkSize, NULL);
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (irrevelant & skipping)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
TRACE_(dmfile)(": ListCount[0] = %ld < ListSize[0] = %ld\n", ListCount[0], ListSize[0]);
} while (ListCount[0] < ListSize[0]);
break;
}
case DMUS_FOURCC_BANDS_LIST: {
TRACE_(dmfile)(": bands list\n");
do {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
IStream_Read (pStm, &chunkSize, sizeof(FOURCC), NULL);
ListCount[0] += sizeof(FOURCC) + sizeof(DWORD) + chunkSize;
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (chunkID), chunkSize);
switch (chunkID) {
case FOURCC_LIST: {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
TRACE_(dmfile)(": LIST chunk of type %s", debugstr_fourcc(chunkID));
ListSize[1] = chunkSize - sizeof(FOURCC);
ListCount[1] = 0;
switch (chunkID) {
case DMUS_FOURCC_BAND_LIST: {
/* init new band list entry */
LPDMUS_PRIVATE_BAND pNewBand = (LPDMUS_PRIVATE_BAND) HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(DMUS_PRIVATE_BAND));
TRACE_(dmfile)(": band list\n");
do {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
IStream_Read (pStm, &chunkSize, sizeof(FOURCC), NULL);
ListCount[1] += sizeof(FOURCC) + sizeof(DWORD) + chunkSize;
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (chunkID), chunkSize);
switch (chunkID) {
case DMUS_FOURCC_BANDITEM_CHUNK: {
TRACE_(dmfile)(": band item header (v.1) chunk\n");
IStream_Read (pStm, &tempHeaderV1, chunkSize, NULL);
/* now transfer data to universal header */
pNewBand->pBandHeader.dwVersion = 1;
pNewBand->pBandHeader.lBandTime = tempHeaderV1.lBandTime;
break;
}
case DMUS_FOURCC_BANDITEM_CHUNK2: {
TRACE_(dmfile)(": band item header (v.2) chunk\n");
IStream_Read (pStm, &tempHeaderV2, chunkSize, NULL);
/* now transfer data to universal header */
pNewBand->pBandHeader.dwVersion = 2;
pNewBand->pBandHeader.lBandTimeLogical = tempHeaderV2.lBandTimeLogical;
pNewBand->pBandHeader.lBandTimePhysical = tempHeaderV2.lBandTimePhysical;
break;
}
case FOURCC_RIFF: {
TRACE_(dmfile)(": RIFF chunk (probably band form)\n");
liMove.QuadPart = 0;
liMove.QuadPart -= (sizeof(FOURCC) + sizeof(DWORD)); /* goto the beginning of chunk */
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
/* perform sacrificial ritual so that loader will load band */
ZeroMemory ((LPVOID)&ObjDesc, sizeof(DMUS_OBJECTDESC));
ObjDesc.dwSize = sizeof(DMUS_OBJECTDESC);
ObjDesc.dwValidData = DMUS_OBJ_CLASS | DMUS_OBJ_STREAM;
ObjDesc.guidClass = CLSID_DirectMusicBand;
ObjDesc.pStream = pStm;
/* now pray... */
if (SUCCEEDED(IStream_QueryInterface (pStm, &IID_IDirectMusicGetLoader, (LPVOID*)&pGetLoader))) {
if (SUCCEEDED(IDirectMusicGetLoader_GetLoader (pGetLoader, &pLoader))) {
IDirectMusicObject* pObject;
if (SUCCEEDED(IDirectMusicLoader_GetObject (pLoader, &ObjDesc, &IID_IDirectMusicObject, (LPVOID*)&pObject))) {
/* acquire band from loaded object */
IDirectMusicObject_QueryInterface (pObject, &IID_IDirectMusicBand, (LPVOID*)&pNewBand->ppBand);
/*IDirectMusicLoader_Release (pLoader);*/
} else FIXME(": couldn't get band\n");
}
IDirectMusicGetLoader_Release (pGetLoader);
} else {
ERR("Could not get IDirectMusicGetLoader... reference will not be loaded :(\n");
/* E_FAIL */
}
/* MSDN states that loader returns stream pointer to it's before-reading position,
which means that we must skip whole (loaded) chunk */
liMove.QuadPart = sizeof(FOURCC) + sizeof(DWORD) + chunkID;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (irrevelant & skipping)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
TRACE_(dmfile)(": ListCount[1] = %ld < ListSize[1] = %ld\n", ListCount[1], ListSize[1]);
} while (ListCount[1] < ListSize[1]);
list_add_tail (&pTrack->Bands, &pNewBand->entry);
break;
}
default: {
TRACE_(dmfile)(": unknown (skipping)\n");
liMove.QuadPart = chunkSize - sizeof(FOURCC);
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (irrevelant & skipping)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
TRACE_(dmfile)(": ListCount[0] = %ld < ListSize[0] = %ld\n", ListCount[0], ListSize[0]);
} while (ListCount[0] < ListSize[0]);
break;
}
default: {
TRACE_(dmfile)(": unknown (skipping)\n");
liMove.QuadPart = chunkSize - sizeof(FOURCC);
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (skipping)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); /* skip this chunk */
break;
}
}
TRACE_(dmfile)(": StreamCount[0] = %ld < StreamSize[0] = %ld\n", StreamCount, StreamSize);
} while (StreamCount < StreamSize);
break;
}
default: {
TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
liMove.QuadPart = StreamSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */
return E_FAIL;
}
}
TRACE_(dmfile)(": reading finished\n");
break;
}
default: {
TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */
return E_FAIL;
}
}
/* DEBUG: dumps whole band track object tree: */
if (TRACE_ON(dmband)) {
int r = 0;
DMUS_PRIVATE_BAND *tmpEntry;
struct list *listEntry;
TRACE("*** IDirectMusicBandTrack (%p) ***\n", pTrack);
if (pTrack->btkHeader) {
TRACE(" - Band track header:\n");
TRACE(" - bAutoDownload: %i\n", pTrack->btkHeader->bAutoDownload);
}
if (pTrack->guidID)
TRACE(" - GUID = %s\n", debugstr_guid(pTrack->guidID));
if (pTrack->vVersion)
TRACE(" - Version = %i,%i,%i,%i\n", (pTrack->vVersion->dwVersionMS >> 8) && 0x0000FFFF, pTrack->vVersion->dwVersionMS && 0x0000FFFF, \
(pTrack->vVersion->dwVersionLS >> 8) && 0x0000FFFF, pTrack->vVersion->dwVersionLS && 0x0000FFFF);
if (pTrack->wzName)
TRACE(" - Name = %s\n", debugstr_w(pTrack->wzName));
if (pTrack->wzArtist)
TRACE(" - Artist = %s\n", debugstr_w(pTrack->wzArtist));
if (pTrack->wzCopyright)
TRACE(" - Copyright = %s\n", debugstr_w(pTrack->wzCopyright));
if (pTrack->wzSubject)
TRACE(" - Subject = %s\n", debugstr_w(pTrack->wzSubject));
if (pTrack->wzComment)
TRACE(" - Comment = %s\n", debugstr_w(pTrack->wzComment));
TRACE(" - Bands:\n");
LIST_FOR_EACH (listEntry, &pTrack->Bands) {
tmpEntry = LIST_ENTRY( listEntry, DMUS_PRIVATE_BAND, entry );
TRACE(" - Band[%i]:\n", r);
TRACE(" - Band header:\n");
TRACE(" - version = %ld\n", tmpEntry->pBandHeader.dwVersion);
if (tmpEntry->pBandHeader.dwVersion == 1) {
TRACE(" - lBandTime = %li\n", tmpEntry->pBandHeader.lBandTime);
} else if (tmpEntry->pBandHeader.dwVersion == 2) {
TRACE(" - lBandTimeLogical = %li\n", tmpEntry->pBandHeader.lBandTimeLogical);
TRACE(" - lBandTimePhysical = %li\n", tmpEntry->pBandHeader.lBandTimePhysical);
}
TRACE(" - Band: %p\n", tmpEntry->ppBand);
r++;
}
}
return S_OK;
}
HRESULT WINAPI IDirectMusicBandTrackStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty)
{
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicBandTrackStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize)
{
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicBandTrackStream_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicBandTrackStream_QueryInterface,
IDirectMusicBandTrackStream_AddRef,
IDirectMusicBandTrackStream_Release,
IDirectMusicBandTrackStream_GetClassID,
IDirectMusicBandTrackStream_IsDirty,
IDirectMusicBandTrackStream_Load,
IDirectMusicBandTrackStream_Save,
IDirectMusicBandTrackStream_GetSizeMax
};

View File

@ -1,6 +1,6 @@
/* DirectMusicBand Main
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -21,8 +21,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(dmband);
typedef struct
{
typedef struct {
/* IUnknown fields */
ICOM_VFIELD(IClassFactory);
DWORD ref;
@ -32,44 +31,31 @@ typedef struct
* DirectMusicBand ClassFactory
*/
static HRESULT WINAPI BandCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI BandCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI BandCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI BandCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI BandCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI BandCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI BandCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI BandCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualIID (riid, &IID_IDirectMusicBand)) {
return DMUSIC_CreateDirectMusicBand (riid, (LPDIRECTMUSICBAND*) ppobj, pOuter);
} else if (IsEqualIID (riid, &IID_IDirectMusicObject)) {
return DMUSIC_CreateDirectMusicBandObject (riid, (LPDIRECTMUSICOBJECT*) ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
return DMUSIC_CreateDirectMusicBandImpl (riid, ppobj, pOuter);
}
static HRESULT WINAPI BandCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI BandCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -91,43 +77,31 @@ static IClassFactoryImpl Band_CF = {&BandCF_Vtbl, 1 };
* DirectMusicBandTrack ClassFactory
*/
static HRESULT WINAPI BandTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI BandTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI BandTrackCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI BandTrackCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI BandTrackCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI BandTrackCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI BandTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI BandTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualIID (riid, &IID_IDirectMusicTrack)
|| IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
return DMUSIC_CreateDirectMusicBandTrack (riid, (LPDIRECTMUSICTRACK8*) ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
return DMUSIC_CreateDirectMusicBandTrack (riid, ppobj, pOuter);
}
static HRESULT WINAPI BandTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI BandTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -149,15 +123,11 @@ static IClassFactoryImpl BandTrack_CF = {&BandTrackCF_Vtbl, 1 };
*
*
*/
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
if (fdwReason == DLL_PROCESS_ATTACH)
{
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
if (fdwReason == DLL_PROCESS_ATTACH) {
DisableThreadLibraryCalls(hinstDLL);
/* FIXME: Initialisation */
}
else if (fdwReason == DLL_PROCESS_DETACH)
{
} else if (fdwReason == DLL_PROCESS_DETACH) {
/* FIXME: Cleanup */
}
@ -170,10 +140,8 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
*
*
*/
HRESULT WINAPI DMBAND_DllCanUnloadNow(void)
{
HRESULT WINAPI DMBAND_DllCanUnloadNow(void) {
FIXME("(void): stub\n");
return S_FALSE;
}
@ -183,8 +151,7 @@ HRESULT WINAPI DMBAND_DllCanUnloadNow(void)
*
*
*/
HRESULT WINAPI DMBAND_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
{
HRESULT WINAPI DMBAND_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) {
TRACE("(%p,%p,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
if (IsEqualCLSID (rclsid, &CLSID_DirectMusicBand) && IsEqualIID (riid, &IID_IClassFactory)) {

View File

@ -1,6 +1,6 @@
/* DirectMusicBand Private Include
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -23,51 +23,45 @@
#include <stdarg.h>
#include "windef.h"
#include "wine/debug.h"
#include "winbase.h"
#include "winnt.h"
#include "wingdi.h"
#include "dmusicc.h"
#include "dmusici.h"
#include "dmusics.h"
#include "dmplugin.h"
#include "dmusicf.h"
#include "dsound.h"
#include "wine/list.h"
#include "winuser.h"
#include "wine/debug.h"
#include "wine/list.h"
#include "wine/unicode.h"
#include "winreg.h"
#include "dmusici.h"
#include "dmusicf.h"
#include "dmusics.h"
/*****************************************************************************
* Interfaces
*/
typedef struct IDirectMusicBandImpl IDirectMusicBandImpl;
typedef struct IDirectMusicBandObject IDirectMusicBandObject;
typedef struct IDirectMusicBandObjectStream IDirectMusicBandObjectStream;
typedef struct IDirectMusicBandTrack IDirectMusicBandTrack;
typedef struct IDirectMusicBandTrackStream IDirectMusicBandTrackStream;
/*****************************************************************************
* Predeclare the interface implementation structures
*/
extern ICOM_VTABLE(IDirectMusicBand) DirectMusicBand_Vtbl;
extern ICOM_VTABLE(IUnknown) DirectMusicBand_Uknown_Vtbl;
extern ICOM_VTABLE(IDirectMusicBand) DirectMusicBand_Band_Vtbl;
extern ICOM_VTABLE(IDirectMusicObject) DirectMusicBand_Object_Vtbl;
extern ICOM_VTABLE(IPersistStream) DirectMusicBand_PeristStream_Vtbl;
extern ICOM_VTABLE(IDirectMusicObject) DirectMusicBandObject_Vtbl;
extern ICOM_VTABLE(IPersistStream) DirectMusicBandObjectStream_Vtbl;
extern ICOM_VTABLE(IDirectMusicTrack8) DirectMusicBandTrack_Vtbl;
extern ICOM_VTABLE(IPersistStream) DirectMusicBandTrackStream_Vtbl;
extern ICOM_VTABLE(IUnknown) DirectMusicBandTrack_Unknown_Vtbl;
extern ICOM_VTABLE(IDirectMusicTrack8) DirectMusicBandTrack_DirectMusicTrack_Vtbl;
extern ICOM_VTABLE(IPersistStream) DirectMusicBandTrack_PersistStream_Vtbl;
/*****************************************************************************
* ClassFactory
* can support IID_IDirectMusicBand
* return always an IDirectMusicBandImpl
*/
extern HRESULT WINAPI DMUSIC_CreateDirectMusicBand (LPCGUID lpcGUID, LPDIRECTMUSICBAND* ppDMBand, LPUNKNOWN pUnkOuter);
extern HRESULT WINAPI DMUSIC_CreateDirectMusicBandImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter);
extern HRESULT WINAPI DMUSIC_CreateDirectMusicBandObject (LPCGUID lpcGUID, LPDIRECTMUSICOBJECT* ppObject, LPUNKNOWN pUnkOuter);
extern HRESULT WINAPI DMUSIC_CreateDirectMusicBandTrack (LPCGUID lpcGUID, LPDIRECTMUSICTRACK8* ppTrack, LPUNKNOWN pUnkOuter);
extern HRESULT WINAPI DMUSIC_CreateDirectMusicBandTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter);
/*****************************************************************************
@ -99,165 +93,197 @@ typedef struct _DMUS_PRIVATE_BAND {
/*****************************************************************************
* IDirectMusicBandImpl implementation structure
*/
struct IDirectMusicBandImpl
{
struct IDirectMusicBandImpl {
/* IUnknown fields */
ICOM_VFIELD(IDirectMusicBand);
ICOM_VTABLE(IUnknown) *UnknownVtbl;
ICOM_VTABLE(IDirectMusicBand) *BandVtbl;
ICOM_VTABLE(IDirectMusicObject) *ObjectVtbl;
ICOM_VTABLE(IPersistStream) *PersistStreamVtbl;
DWORD ref;
/* IDirectMusicBandImpl fields */
IDirectMusicBandObject* pObject;
GUID* guidID; /* unique id */
DMUS_IO_VERSION* vVersion; /* version */
/* info from UNFO list */
WCHAR* wzName;
WCHAR* wzArtist;
WCHAR* wzCopyright;
WCHAR* wzSubject;
WCHAR* wzComment;
LPDMUS_OBJECTDESC pDesc;
/* data */
struct list Instruments;
};
/* IUnknown: */
extern HRESULT WINAPI IDirectMusicBandImpl_QueryInterface (LPDIRECTMUSICBAND iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicBandImpl_AddRef (LPDIRECTMUSICBAND iface);
extern ULONG WINAPI IDirectMusicBandImpl_Release (LPDIRECTMUSICBAND iface);
extern HRESULT WINAPI IDirectMusicBandImpl_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicBandImpl_IUnknown_AddRef (LPUNKNOWN iface);
extern ULONG WINAPI IDirectMusicBandImpl_IUnknown_Release (LPUNKNOWN iface);
/* IDirectMusicBand: */
extern HRESULT WINAPI IDirectMusicBandImpl_CreateSegment (LPDIRECTMUSICBAND iface, IDirectMusicSegment** ppSegment);
extern HRESULT WINAPI IDirectMusicBandImpl_Download (LPDIRECTMUSICBAND iface, IDirectMusicPerformance* pPerformance);
extern HRESULT WINAPI IDirectMusicBandImpl_Unload (LPDIRECTMUSICBAND iface, IDirectMusicPerformance* pPerformance);
/*****************************************************************************
* IDirectMusicBandObject implementation structure
*/
struct IDirectMusicBandObject
{
/* IUnknown fields */
ICOM_VFIELD(IDirectMusicObject);
DWORD ref;
/* IDirectMusicObjectImpl fields */
LPDMUS_OBJECTDESC pDesc;
IDirectMusicBandObjectStream* pStream;
IDirectMusicBandImpl* pBand;
};
/* IUnknown: */
extern HRESULT WINAPI IDirectMusicBandObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicBandObject_AddRef (LPDIRECTMUSICOBJECT iface);
extern ULONG WINAPI IDirectMusicBandObject_Release (LPDIRECTMUSICOBJECT iface);
extern HRESULT WINAPI IDirectMusicBandImpl_IDirectMusicBand_QueryInterface (LPDIRECTMUSICBAND iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicBandImpl_IDirectMusicBand_AddRef (LPDIRECTMUSICBAND iface);
extern ULONG WINAPI IDirectMusicBandImpl_IDirectMusicBand_Release (LPDIRECTMUSICBAND iface);
extern HRESULT WINAPI IDirectMusicBandImpl_IDirectMusicBand_CreateSegment (LPDIRECTMUSICBAND iface, IDirectMusicSegment** ppSegment);
extern HRESULT WINAPI IDirectMusicBandImpl_IDirectMusicBand_Download (LPDIRECTMUSICBAND iface, IDirectMusicPerformance* pPerformance);
extern HRESULT WINAPI IDirectMusicBandImpl_IDirectMusicBand_Unload (LPDIRECTMUSICBAND iface, IDirectMusicPerformance* pPerformance);
/* IDirectMusicObject: */
extern HRESULT WINAPI IDirectMusicBandObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc);
extern HRESULT WINAPI IDirectMusicBandObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc);
extern HRESULT WINAPI IDirectMusicBandObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc);
/*****************************************************************************
* IDirectMusicBandObjectStream implementation structure
*/
struct IDirectMusicBandObjectStream
{
/* IUnknown fields */
ICOM_VFIELD (IPersistStream);
DWORD ref;
/* IPersistStreamImpl fields */
IDirectMusicBandObject* pParentObject;
};
/* IUnknown: */
extern HRESULT WINAPI IDirectMusicBandObjectStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject);
extern ULONG WINAPI IDirectMusicBandObjectStream_AddRef (LPPERSISTSTREAM iface);
extern ULONG WINAPI IDirectMusicBandObjectStream_Release (LPPERSISTSTREAM iface);
/* IPersist: */
extern HRESULT WINAPI IDirectMusicBandObjectStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID);
extern HRESULT WINAPI IDirectMusicBandImpl_IDirectMusicObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicBandImpl_IDirectMusicObject_AddRef (LPDIRECTMUSICOBJECT iface);
extern ULONG WINAPI IDirectMusicBandImpl_IDirectMusicObject_Release (LPDIRECTMUSICOBJECT iface);
extern HRESULT WINAPI IDirectMusicBandImpl_IDirectMusicObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc);
extern HRESULT WINAPI IDirectMusicBandImpl_IDirectMusicObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc);
extern HRESULT WINAPI IDirectMusicBandImpl_IDirectMusicObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc);
/* IPersistStream: */
extern HRESULT WINAPI IDirectMusicBandObjectStream_IsDirty (LPPERSISTSTREAM iface);
extern HRESULT WINAPI IDirectMusicBandObjectStream_Load (LPPERSISTSTREAM iface, IStream* pStm);
extern HRESULT WINAPI IDirectMusicBandObjectStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty);
extern HRESULT WINAPI IDirectMusicBandObjectStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize);
extern HRESULT WINAPI IDirectMusicBandImpl_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject);
extern ULONG WINAPI IDirectMusicBandImpl_IPersistStream_AddRef (LPPERSISTSTREAM iface);
extern ULONG WINAPI IDirectMusicBandImpl_IPersistStream_Release (LPPERSISTSTREAM iface);
extern HRESULT WINAPI IDirectMusicBandImpl_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID);
extern HRESULT WINAPI IDirectMusicBandImpl_IPersistStream_IsDirty (LPPERSISTSTREAM iface);
extern HRESULT WINAPI IDirectMusicBandImpl_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm);
extern HRESULT WINAPI IDirectMusicBandImpl_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty);
extern HRESULT WINAPI IDirectMusicBandImpl_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize);
/*****************************************************************************
* IDirectMusicBandTrack implementation structure
*/
struct IDirectMusicBandTrack
{
struct IDirectMusicBandTrack {
/* IUnknown fields */
ICOM_VFIELD(IDirectMusicTrack8);
ICOM_VTABLE(IUnknown) *UnknownVtbl;
ICOM_VTABLE(IDirectMusicTrack8) *TrackVtbl;
ICOM_VTABLE(IPersistStream) *PersistStreamVtbl;
DWORD ref;
/* IDirectMusicBandTrack fields */
IDirectMusicBandTrackStream* pStream;
DMUS_IO_BAND_TRACK_HEADER* btkHeader; /* header */
GUID* guidID; /* unique id */
DMUS_IO_VERSION* vVersion; /* version */
/* info from UNFO list */
WCHAR* wzName;
WCHAR* wzArtist;
WCHAR* wzCopyright;
WCHAR* wzSubject;
WCHAR* wzComment;
LPDMUS_OBJECTDESC pDesc;
DMUS_IO_BAND_TRACK_HEADER* pHeader;
/* data */
struct list Bands;
};
/* IUnknown: */
extern HRESULT WINAPI IDirectMusicBandTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicBandTrack_AddRef (LPDIRECTMUSICTRACK8 iface);
extern ULONG WINAPI IDirectMusicBandTrack_Release (LPDIRECTMUSICTRACK8 iface);
/* IDirectMusicTrack: */
extern HRESULT WINAPI IDirectMusicBandTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment);
extern HRESULT WINAPI IDirectMusicBandTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags);
extern HRESULT WINAPI IDirectMusicBandTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData);
extern HRESULT WINAPI IDirectMusicBandTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID);
extern HRESULT WINAPI IDirectMusicBandTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam);
extern HRESULT WINAPI IDirectMusicBandTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam);
extern HRESULT WINAPI IDirectMusicBandTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType);
extern HRESULT WINAPI IDirectMusicBandTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType);
extern HRESULT WINAPI IDirectMusicBandTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType);
extern HRESULT WINAPI IDirectMusicBandTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack);
/* IDirectMusicTrack8: */
extern HRESULT WINAPI IDirectMusicBandTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID);
extern HRESULT WINAPI IDirectMusicBandTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags);
extern HRESULT WINAPI IDirectMusicBandTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags);
extern HRESULT WINAPI IDirectMusicBandTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack);
extern HRESULT WINAPI IDirectMusicBandTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack);
extern HRESULT WINAPI IDirectMusicBandTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicBandTrack_IUnknown_AddRef (LPUNKNOWN iface);
extern ULONG WINAPI IDirectMusicBandTrack_IUnknown_Release (LPUNKNOWN iface);
/* IDirectMusicTrack(8): */
extern HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicBandTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface);
extern ULONG WINAPI IDirectMusicBandTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface);
extern HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment);
extern HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags);
extern HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData);
extern HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID);
extern HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam);
extern HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam);
extern HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType);
extern HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType);
extern HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType);
extern HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack);
extern HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID);
extern HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags);
extern HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags);
extern HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack);
extern HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack);
/* IPersistStream: */
extern HRESULT WINAPI IDirectMusicBandTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject);
extern ULONG WINAPI IDirectMusicBandTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface);
extern ULONG WINAPI IDirectMusicBandTrack_IPersistStream_Release (LPPERSISTSTREAM iface);
extern HRESULT WINAPI IDirectMusicBandTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID);
extern HRESULT WINAPI IDirectMusicBandTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface);
extern HRESULT WINAPI IDirectMusicBandTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm);
extern HRESULT WINAPI IDirectMusicBandTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty);
extern HRESULT WINAPI IDirectMusicBandTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize);
/*****************************************************************************
* IDirectMusicBandTrackStream implementation structure
* Misc.
*/
struct IDirectMusicBandTrackStream
{
/* IUnknown fields */
ICOM_VFIELD (IPersistStream);
DWORD ref;
/* for simpler reading */
typedef struct _DMUS_PRIVATE_CHUNK {
FOURCC fccID; /* FOURCC ID of the chunk */
DWORD dwSize; /* size of the chunk */
} DMUS_PRIVATE_CHUNK, *LPDMUS_PRIVATE_CHUNK;
/* IPersistStreamImpl fields */
IDirectMusicBandTrack* pParentTrack;
};
/* IUnknown: */
extern HRESULT WINAPI IDirectMusicBandTrackStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject);
extern ULONG WINAPI IDirectMusicBandTrackStream_AddRef (LPPERSISTSTREAM iface);
extern ULONG WINAPI IDirectMusicBandTrackStream_Release (LPPERSISTSTREAM iface);
/* IPersist: */
extern HRESULT WINAPI IDirectMusicBandTrackStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID);
/* IPersistStream: */
extern HRESULT WINAPI IDirectMusicBandTrackStream_IsDirty (LPPERSISTSTREAM iface);
extern HRESULT WINAPI IDirectMusicBandTrackStream_Load (LPPERSISTSTREAM iface, IStream* pStm);
extern HRESULT WINAPI IDirectMusicBandTrackStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty);
extern HRESULT WINAPI IDirectMusicBandTrackStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize);
/* check whether the given DWORD is even (return 0) or odd (return 1) */
static inline int even_or_odd (DWORD number) {
return (number & 0x1); /* basically, check if bit 0 is set ;) */
}
/* FOURCC to string conversion for debug messages */
static inline const char *debugstr_fourcc (DWORD fourcc) {
if (!fourcc) return "'null'";
return wine_dbg_sprintf ("\'%c%c%c%c\'",
(char)(fourcc), (char)(fourcc >> 8),
(char)(fourcc >> 16), (char)(fourcc >> 24));
(char)(fourcc >> 16), (char)(fourcc >> 24));
}
/* DMUS_VERSION struct to string conversion for debug messages */
static inline const char *debugstr_dmversion (LPDMUS_VERSION version) {
if (!version) return "'null'";
return wine_dbg_sprintf ("\'%i,%i,%i,%i\'",
(int)((version->dwVersionMS && 0xFFFF0000) >> 8), (int)(version->dwVersionMS && 0x0000FFFF),
(int)((version->dwVersionLS && 0xFFFF0000) >> 8), (int)(version->dwVersionLS && 0x0000FFFF));
}
/* used for initialising structs (primarily for DMUS_OBJECTDESC) */
#define DM_STRUCT_INIT(x) \
do { \
memset((x), 0, sizeof(*(x))); \
(x)->dwSize = sizeof(*x); \
} while (0)
/* used for generic dumping (copied from ddraw) */
typedef struct {
DWORD val;
const char* name;
} flag_info;
/* generic dump function */
static inline void DMUSIC_dump_flags_ (DWORD flags, const flag_info* names, size_t num_names, int newline) {
unsigned int i;
for (i=0; i < num_names; i++) {
if ((flags & names[i].val) || /* standard flag value */
((!flags) && (!names[i].val))) /* zero value only */
DPRINTF("%s ", names[i].name);
}
if (newline) DPRINTF("\n");
}
#define FE(x) { x, #x }
#define DMUSIC_dump_flags(flags,names,num_names) DMUSIC_dump_flags_(flags, names, num_names, 1)
static inline void DMUSIC_dump_DMUS_OBJ_FLAGS (DWORD flagmask) {
static const flag_info flags[] = {
FE(DMUS_OBJ_OBJECT),
FE(DMUS_OBJ_CLASS),
FE(DMUS_OBJ_NAME),
FE(DMUS_OBJ_CATEGORY),
FE(DMUS_OBJ_FILENAME),
FE(DMUS_OBJ_FULLPATH),
FE(DMUS_OBJ_URL),
FE(DMUS_OBJ_VERSION),
FE(DMUS_OBJ_DATE),
FE(DMUS_OBJ_LOADED),
FE(DMUS_OBJ_MEMORY),
FE(DMUS_OBJ_STREAM)
};
DMUSIC_dump_flags(flagmask, flags, sizeof(flags)/sizeof(flags[0]));
}
static inline void DMUSIC_dump_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) {
if (pDesc) {
DPRINTF("DMUS_OBJECTDESC (%p)\n", pDesc);
DPRINTF(" - dwSize = %ld\n", pDesc->dwSize);
DPRINTF(" - dwValidData = ");
DMUSIC_dump_DMUS_OBJ_FLAGS (pDesc->dwValidData);
if (pDesc->dwValidData & DMUS_OBJ_CLASS) DPRINTF(" - guidClass = %s\n", debugstr_guid(&pDesc->guidClass));
if (pDesc->dwValidData & DMUS_OBJ_OBJECT) DPRINTF(" - guidObject = %s\n", debugstr_guid(&pDesc->guidObject));
if (pDesc->dwValidData & DMUS_OBJ_DATE) DPRINTF(" - ftDate = FIXME\n");
if (pDesc->dwValidData & DMUS_OBJ_VERSION) DPRINTF(" - vVersion = %s\n", debugstr_dmversion(&pDesc->vVersion));
if (pDesc->dwValidData & DMUS_OBJ_NAME) DPRINTF(" - wszName = %s\n", debugstr_w(pDesc->wszName));
if (pDesc->dwValidData & DMUS_OBJ_CATEGORY) DPRINTF(" - wszCategory = %s\n", debugstr_w(pDesc->wszCategory));
if (pDesc->dwValidData & DMUS_OBJ_FILENAME) DPRINTF(" - wszFileName = %s\n", debugstr_w(pDesc->wszFileName));
if (pDesc->dwValidData & DMUS_OBJ_MEMORY) DPRINTF(" - llMemLength = %lli\n - pbMemData = %p\n", pDesc->llMemLength, pDesc->pbMemData);
if (pDesc->dwValidData & DMUS_OBJ_STREAM) DPRINTF(" - pStream = %p\n", pDesc->pStream);
} else {
DPRINTF("(NULL)\n");
}
}
#endif /* __WINE_DMBAND_PRIVATE_H */

View File

@ -18,21 +18,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdarg.h>
#include <string.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winreg.h"
#include "winerror.h"
#include "dmusics.h"
#include "dmusici.h"
#include "dmplugin.h"
#include "wine/debug.h"
#include "dmband_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmband);
@ -44,8 +30,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(dmband);
/***********************************************************************
* interface for self-registering
*/
struct regsvr_interface
{
struct regsvr_interface {
IID const *iid; /* NULL for end of list */
LPCSTR name; /* can be NULL to omit */
IID const *base_iid; /* can be NULL to omit */
@ -57,8 +42,7 @@ struct regsvr_interface
static HRESULT register_interfaces(struct regsvr_interface const *list);
static HRESULT unregister_interfaces(struct regsvr_interface const *list);
struct regsvr_coclass
{
struct regsvr_coclass {
CLSID const *clsid; /* NULL for end of list */
LPCSTR name; /* can be NULL to omit */
LPCSTR ips; /* can be NULL to omit */
@ -124,8 +108,7 @@ static LONG recursive_delete_keyW(HKEY base, WCHAR const *name);
/***********************************************************************
* register_interfaces
*/
static HRESULT register_interfaces(struct regsvr_interface const *list)
{
static HRESULT register_interfaces(struct regsvr_interface const *list) {
LONG res = ERROR_SUCCESS;
HKEY interface_key;
@ -194,8 +177,7 @@ error_return:
/***********************************************************************
* unregister_interfaces
*/
static HRESULT unregister_interfaces(struct regsvr_interface const *list)
{
static HRESULT unregister_interfaces(struct regsvr_interface const *list) {
LONG res = ERROR_SUCCESS;
HKEY interface_key;
@ -219,8 +201,7 @@ error_return:
/***********************************************************************
* register_coclasses
*/
static HRESULT register_coclasses(struct regsvr_coclass const *list)
{
static HRESULT register_coclasses(struct regsvr_coclass const *list) {
LONG res = ERROR_SUCCESS;
HKEY coclass_key;
@ -301,8 +282,7 @@ error_return:
/***********************************************************************
* unregister_coclasses
*/
static HRESULT unregister_coclasses(struct regsvr_coclass const *list)
{
static HRESULT unregister_coclasses(struct regsvr_coclass const *list) {
LONG res = ERROR_SUCCESS;
HKEY coclass_key;
@ -338,8 +318,7 @@ error_return:
/***********************************************************************
* regsvr_key_guid
*/
static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid)
{
static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid) {
WCHAR buf[39];
StringFromGUID2(guid, buf, 39);
@ -352,8 +331,7 @@ static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid)
static LONG register_key_defvalueW(
HKEY base,
WCHAR const *name,
WCHAR const *value)
{
WCHAR const *value) {
LONG res;
HKEY key;
@ -372,8 +350,7 @@ static LONG register_key_defvalueW(
static LONG register_key_defvalueA(
HKEY base,
WCHAR const *name,
char const *value)
{
char const *value) {
LONG res;
HKEY key;
@ -394,8 +371,7 @@ static LONG register_progid(
char const *progid,
char const *curver_progid,
char const *name,
char const *extra)
{
char const *extra) {
LONG res;
HKEY progid_key;
@ -439,8 +415,7 @@ error_close_progid_key:
/***********************************************************************
* recursive_delete_key
*/
static LONG recursive_delete_key(HKEY key)
{
static LONG recursive_delete_key(HKEY key) {
LONG res;
WCHAR subkey_name[MAX_PATH];
DWORD cName;
@ -471,8 +446,7 @@ static LONG recursive_delete_key(HKEY key)
/***********************************************************************
* recursive_delete_keyA
*/
static LONG recursive_delete_keyA(HKEY base, char const *name)
{
static LONG recursive_delete_keyA(HKEY base, char const *name) {
LONG res;
HKEY key;
@ -487,8 +461,7 @@ static LONG recursive_delete_keyA(HKEY base, char const *name)
/***********************************************************************
* recursive_delete_keyW
*/
static LONG recursive_delete_keyW(HKEY base, WCHAR const *name)
{
static LONG recursive_delete_keyW(HKEY base, WCHAR const *name) {
LONG res;
HKEY key;
@ -534,8 +507,7 @@ static struct regsvr_interface const interface_list[] = {
/***********************************************************************
* DllRegisterServer (DMBAND.3)
*/
HRESULT WINAPI DMBAND_DllRegisterServer(void)
{
HRESULT WINAPI DMBAND_DllRegisterServer(void) {
HRESULT hr;
TRACE("\n");
@ -549,8 +521,7 @@ HRESULT WINAPI DMBAND_DllRegisterServer(void)
/***********************************************************************
* DllUnregisterServer (DMBAND.4)
*/
HRESULT WINAPI DMBAND_DllUnregisterServer(void)
{
HRESULT WINAPI DMBAND_DllUnregisterServer(void) {
HRESULT hr;
TRACE("\n");

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 Rok Mandeljc <rok.mandeljc@gimb.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -18,10 +18,10 @@
#define WINE_FILEDESCRIPTION_STR "Wine DirectMusic Band"
#define WINE_FILENAME_STR "dmband.dll"
#define WINE_FILEVERSION 4,8,1,881
#define WINE_FILEVERSION_STR "4.8.1.881"
#define WINE_PRODUCTVERSION 4,8,1,881
#define WINE_PRODUCTVERSION_STR "4.8"
#define WINE_FILEVERSION 4,9,0,900
#define WINE_FILEVERSION_STR "4.9.0.900"
#define WINE_PRODUCTVERSION 4,9,0,900
#define WINE_PRODUCTVERSION_STR "4.9"
#define WINE_PRODUCTNAME_STR "DirectX"
#include "wine/wine_common_ver.rc"

View File

@ -1,6 +1,6 @@
/* IDirectMusicChordMap Implementation
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -17,27 +17,33 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "dmcompos_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmcompos);
WINE_DECLARE_DEBUG_CHANNEL(dmfile);
/* IDirectMusicChordMap IUnknown parts follow: */
HRESULT WINAPI IDirectMusicChordMapImpl_QueryInterface (LPDIRECTMUSICCHORDMAP iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicChordMapImpl,iface);
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IDirectMusicChordMap)) {
IDirectMusicChordMapImpl_AddRef(iface);
*ppobj = This;
/*****************************************************************************
* IDirectMusicChordMapImpl implementation
*/
/* IDirectMusicChordMapImpl IUnknown part: */
HRESULT WINAPI IDirectMusicChordMapImpl_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicChordMapImpl, UnknownVtbl, iface);
if (IsEqualIID (riid, &IID_IUnknown)) {
*ppobj = (LPVOID)&This->UnknownVtbl;
IDirectMusicChordMapImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicChordMap)) {
*ppobj = (LPVOID)&This->ChordMapVtbl;
IDirectMusicChordMapImpl_IDirectMusicChordMap_AddRef ((LPDIRECTMUSICCHORDMAP)&This->ChordMapVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicObject)) {
*ppobj = (LPVOID)&This->ObjectVtbl;
IDirectMusicChordMapImpl_IDirectMusicObject_AddRef ((LPDIRECTMUSICOBJECT)&This->ObjectVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IPersistStream)) {
*ppobj = (LPVOID)&This->PersistStreamVtbl;
IDirectMusicChordMapImpl_IPersistStream_AddRef ((LPPERSISTSTREAM)&This->PersistStreamVtbl);
return S_OK;
}
@ -45,16 +51,14 @@ HRESULT WINAPI IDirectMusicChordMapImpl_QueryInterface (LPDIRECTMUSICCHORDMAP if
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicChordMapImpl_AddRef (LPDIRECTMUSICCHORDMAP iface)
{
ICOM_THIS(IDirectMusicChordMapImpl,iface);
ULONG WINAPI IDirectMusicChordMapImpl_IUnknown_AddRef (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicChordMapImpl, UnknownVtbl, iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicChordMapImpl_Release (LPDIRECTMUSICCHORDMAP iface)
{
ICOM_THIS(IDirectMusicChordMapImpl,iface);
ULONG WINAPI IDirectMusicChordMapImpl_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicChordMapImpl, UnknownVtbl, iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
@ -63,235 +67,475 @@ ULONG WINAPI IDirectMusicChordMapImpl_Release (LPDIRECTMUSICCHORDMAP iface)
return ref;
}
/* IDirectMusicChordMap Interface follow: */
HRESULT WINAPI IDirectMusicChordMapImpl_GetScale (LPDIRECTMUSICCHORDMAP iface, DWORD* pdwScale)
{
ICOM_THIS(IDirectMusicChordMapImpl,iface);
ICOM_VTABLE(IUnknown) DirectMusicChordMap_Unknown_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicChordMapImpl_IUnknown_QueryInterface,
IDirectMusicChordMapImpl_IUnknown_AddRef,
IDirectMusicChordMapImpl_IUnknown_Release
};
TRACE("(%p, %p)\n", This, pdwScale);
*pdwScale = This->dwScale;
/* IDirectMusicChordMapImpl IDirectMusicChordMap part: */
HRESULT WINAPI IDirectMusicChordMapImpl_IDirectMusicChordMap_QueryInterface (LPDIRECTMUSICCHORDMAP iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicChordMapImpl, ChordMapVtbl, iface);
return IDirectMusicChordMapImpl_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicChordMapImpl_IDirectMusicChordMap_AddRef (LPDIRECTMUSICCHORDMAP iface) {
ICOM_THIS_MULTI(IDirectMusicChordMapImpl, ChordMapVtbl, iface);
return IDirectMusicChordMapImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicChordMapImpl_IDirectMusicChordMap_Release (LPDIRECTMUSICCHORDMAP iface) {
ICOM_THIS_MULTI(IDirectMusicChordMapImpl, ChordMapVtbl, iface);
return IDirectMusicChordMapImpl_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicChordMapImpl_IDirectMusicChordMap_GetScale (LPDIRECTMUSICCHORDMAP iface, DWORD* pdwScale) {
ICOM_THIS_MULTI(IDirectMusicChordMapImpl, ChordMapVtbl, iface);
FIXME("(%p, %p): stub\n", This, pdwScale);
return S_OK;
}
ICOM_VTABLE(IDirectMusicChordMap) DirectMusicChordMap_ChordMap_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicChordMapImpl_IDirectMusicChordMap_QueryInterface,
IDirectMusicChordMapImpl_IDirectMusicChordMap_AddRef,
IDirectMusicChordMapImpl_IDirectMusicChordMap_Release,
IDirectMusicChordMapImpl_IDirectMusicChordMap_GetScale
};
/* IDirectMusicChordMapImpl IDirectMusicObject part: */
HRESULT WINAPI IDirectMusicChordMapImpl_IDirectMusicObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicChordMapImpl, ObjectVtbl, iface);
return IDirectMusicChordMapImpl_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicChordMapImpl_IDirectMusicObject_AddRef (LPDIRECTMUSICOBJECT iface) {
ICOM_THIS_MULTI(IDirectMusicChordMapImpl, ObjectVtbl, iface);
return IDirectMusicChordMapImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicChordMapImpl_IDirectMusicObject_Release (LPDIRECTMUSICOBJECT iface) {
ICOM_THIS_MULTI(IDirectMusicChordMapImpl, ObjectVtbl, iface);
return IDirectMusicChordMapImpl_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicChordMapImpl_IDirectMusicObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc) {
ICOM_THIS_MULTI(IDirectMusicChordMapImpl, ObjectVtbl, iface);
TRACE("(%p, %p)\n", This, pDesc);
/* I think we shouldn't return pointer here since then values can be changed; it'd be a mess */
memcpy (pDesc, This->pDesc, This->pDesc->dwSize);
return S_OK;
}
HRESULT WINAPI IDirectMusicChordMapImpl_IDirectMusicObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc) {
ICOM_THIS_MULTI(IDirectMusicChordMapImpl, ObjectVtbl, iface);
TRACE("(%p, %p): setting descriptor:\n", This, pDesc);
if (TRACE_ON(dmcompos)) {
DMUSIC_dump_DMUS_OBJECTDESC (pDesc);
}
/* According to MSDN, we should copy only given values, not whole struct */
if (pDesc->dwValidData & DMUS_OBJ_OBJECT)
memcpy (&This->pDesc->guidObject, &pDesc->guidObject, sizeof (pDesc->guidObject));
if (pDesc->dwValidData & DMUS_OBJ_CLASS)
memcpy (&This->pDesc->guidClass, &pDesc->guidClass, sizeof (pDesc->guidClass));
if (pDesc->dwValidData & DMUS_OBJ_NAME)
strncpyW (This->pDesc->wszName, pDesc->wszName, DMUS_MAX_NAME);
if (pDesc->dwValidData & DMUS_OBJ_CATEGORY)
strncpyW (This->pDesc->wszCategory, pDesc->wszCategory, DMUS_MAX_CATEGORY);
if (pDesc->dwValidData & DMUS_OBJ_FILENAME)
strncpyW (This->pDesc->wszFileName, pDesc->wszFileName, DMUS_MAX_FILENAME);
if (pDesc->dwValidData & DMUS_OBJ_VERSION)
memcpy (&This->pDesc->vVersion, &pDesc->vVersion, sizeof (pDesc->vVersion));
if (pDesc->dwValidData & DMUS_OBJ_DATE)
memcpy (&This->pDesc->ftDate, &pDesc->ftDate, sizeof (pDesc->ftDate));
if (pDesc->dwValidData & DMUS_OBJ_MEMORY) {
memcpy (&This->pDesc->llMemLength, &pDesc->llMemLength, sizeof (pDesc->llMemLength));
memcpy (This->pDesc->pbMemData, pDesc->pbMemData, sizeof (pDesc->pbMemData));
}
if (pDesc->dwValidData & DMUS_OBJ_STREAM) {
/* according to MSDN, we copy the stream */
IStream_Clone (pDesc->pStream, &This->pDesc->pStream);
}
/* add new flags */
This->pDesc->dwValidData |= pDesc->dwValidData;
return S_OK;
}
ICOM_VTABLE(IDirectMusicChordMap) DirectMusicChordMap_Vtbl =
{
HRESULT WINAPI IDirectMusicChordMapImpl_IDirectMusicObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc) {
DMUS_PRIVATE_CHUNK Chunk;
DWORD StreamSize, StreamCount, ListSize[1], ListCount[1];
LARGE_INTEGER liMove; /* used when skipping chunks */
TRACE("(%p, %p)\n", pStream, pDesc);
/* FIXME: should this be determined from stream? */
pDesc->dwValidData |= DMUS_OBJ_CLASS;
memcpy (&pDesc->guidClass, &CLSID_DirectMusicChordMap, sizeof(CLSID));
IStream_Read (pStream, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
TRACE_(dmfile)(": %s chunk (size = 0x%04lx)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
switch (Chunk.fccID) {
case FOURCC_RIFF: {
IStream_Read (pStream, &Chunk.fccID, sizeof(FOURCC), NULL);
TRACE_(dmfile)(": RIFF chunk of type %s", debugstr_fourcc(Chunk.fccID));
StreamSize = Chunk.dwSize - sizeof(FOURCC);
StreamCount = 0;
if (Chunk.fccID == DMUS_FOURCC_CHORDMAP_FORM) {
TRACE_(dmfile)(": chord map form\n");
do {
IStream_Read (pStream, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
StreamCount += sizeof(FOURCC) + sizeof(DWORD) + Chunk.dwSize;
TRACE_(dmfile)(": %s chunk (size = 0x%04lx)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
switch (Chunk.fccID) {
case DMUS_FOURCC_GUID_CHUNK: {
TRACE_(dmfile)(": GUID chunk\n");
pDesc->dwValidData |= DMUS_OBJ_OBJECT;
IStream_Read (pStream, &pDesc->guidObject, Chunk.dwSize, NULL);
break;
}
case DMUS_FOURCC_VERSION_CHUNK: {
TRACE_(dmfile)(": version chunk\n");
pDesc->dwValidData |= DMUS_OBJ_VERSION;
IStream_Read (pStream, &pDesc->vVersion, Chunk.dwSize, NULL);
break;
}
case DMUS_FOURCC_CATEGORY_CHUNK: {
TRACE_(dmfile)(": category chunk\n");
pDesc->dwValidData |= DMUS_OBJ_CATEGORY;
IStream_Read (pStream, pDesc->wszCategory, Chunk.dwSize, NULL);
break;
}
case FOURCC_LIST: {
IStream_Read (pStream, &Chunk.fccID, sizeof(FOURCC), NULL);
TRACE_(dmfile)(": LIST chunk of type %s", debugstr_fourcc(Chunk.fccID));
ListSize[0] = Chunk.dwSize - sizeof(FOURCC);
ListCount[0] = 0;
switch (Chunk.fccID) {
/* evil M$ UNFO list, which can (!?) contain INFO elements */
case DMUS_FOURCC_UNFO_LIST: {
TRACE_(dmfile)(": UNFO list\n");
do {
IStream_Read (pStream, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
ListCount[0] += sizeof(FOURCC) + sizeof(DWORD) + Chunk.dwSize;
TRACE_(dmfile)(": %s chunk (size = 0x%04lx)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
switch (Chunk.fccID) {
/* don't ask me why, but M$ puts INFO elements in UNFO list sometimes
(though strings seem to be valid unicode) */
case mmioFOURCC('I','N','A','M'):
case DMUS_FOURCC_UNAM_CHUNK: {
TRACE_(dmfile)(": name chunk\n");
pDesc->dwValidData |= DMUS_OBJ_NAME;
IStream_Read (pStream, pDesc->wszName, Chunk.dwSize, NULL);
break;
}
case mmioFOURCC('I','A','R','T'):
case DMUS_FOURCC_UART_CHUNK: {
TRACE_(dmfile)(": artist chunk (ignored)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','C','O','P'):
case DMUS_FOURCC_UCOP_CHUNK: {
TRACE_(dmfile)(": copyright chunk (ignored)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','S','B','J'):
case DMUS_FOURCC_USBJ_CHUNK: {
TRACE_(dmfile)(": subject chunk (ignored)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','C','M','T'):
case DMUS_FOURCC_UCMT_CHUNK: {
TRACE_(dmfile)(": comment chunk (ignored)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (irrevelant & skipping)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
TRACE_(dmfile)(": ListCount[0] = %ld < ListSize[0] = %ld\n", ListCount[0], ListSize[0]);
} while (ListCount[0] < ListSize[0]);
break;
}
default: {
TRACE_(dmfile)(": unknown (skipping)\n");
liMove.QuadPart = Chunk.dwSize - sizeof(FOURCC);
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (irrevelant & skipping)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
TRACE_(dmfile)(": StreamCount[0] = %ld < StreamSize[0] = %ld\n", StreamCount, StreamSize);
} while (StreamCount < StreamSize);
break;
} else {
TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
liMove.QuadPart = StreamSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */
return E_FAIL;
}
TRACE_(dmfile)(": reading finished\n");
break;
}
default: {
TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */
return DMUS_E_INVALIDFILE;
}
}
TRACE(": returning descriptor:\n");
if (TRACE_ON(dmcompos)) {
DMUSIC_dump_DMUS_OBJECTDESC (pDesc);
}
return S_OK;
}
ICOM_VTABLE(IDirectMusicObject) DirectMusicChordMap_Object_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicChordMapImpl_QueryInterface,
IDirectMusicChordMapImpl_AddRef,
IDirectMusicChordMapImpl_Release,
IDirectMusicChordMapImpl_GetScale
IDirectMusicChordMapImpl_IDirectMusicObject_QueryInterface,
IDirectMusicChordMapImpl_IDirectMusicObject_AddRef,
IDirectMusicChordMapImpl_IDirectMusicObject_Release,
IDirectMusicChordMapImpl_IDirectMusicObject_GetDescriptor,
IDirectMusicChordMapImpl_IDirectMusicObject_SetDescriptor,
IDirectMusicChordMapImpl_IDirectMusicObject_ParseDescriptor
};
/* IDirectMusicChordMapImpl IPersistStream part: */
HRESULT WINAPI IDirectMusicChordMapImpl_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicChordMapImpl, PersistStreamVtbl, iface);
return IDirectMusicChordMapImpl_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicChordMapImpl_IPersistStream_AddRef (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicChordMapImpl, PersistStreamVtbl, iface);
return IDirectMusicChordMapImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicChordMapImpl_IPersistStream_Release (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicChordMapImpl, PersistStreamVtbl, iface);
return IDirectMusicChordMapImpl_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicChordMapImpl_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicChordMapImpl_IPersistStream_IsDirty (LPPERSISTSTREAM iface) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicChordMapImpl_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm) {
ICOM_THIS_MULTI(IDirectMusicChordMapImpl, PersistStreamVtbl, iface);
FOURCC chunkID;
DWORD chunkSize, StreamSize, StreamCount, ListSize[3], ListCount[3];
LARGE_INTEGER liMove; /* used when skipping chunks */
FIXME("(%p, %p): Loading not implemented yet\n", This, pStm);
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
IStream_Read (pStm, &chunkSize, sizeof(DWORD), NULL);
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (chunkID), chunkSize);
switch (chunkID) {
case FOURCC_RIFF: {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
TRACE_(dmfile)(": RIFF chunk of type %s", debugstr_fourcc(chunkID));
StreamSize = chunkSize - sizeof(FOURCC);
StreamCount = 0;
switch (chunkID) {
case DMUS_FOURCC_CHORDMAP_FORM: {
TRACE_(dmfile)(": chordmap form\n");
do {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
IStream_Read (pStm, &chunkSize, sizeof(FOURCC), NULL);
StreamCount += sizeof(FOURCC) + sizeof(DWORD) + chunkSize;
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (chunkID), chunkSize);
switch (chunkID) {
case DMUS_FOURCC_GUID_CHUNK: {
TRACE_(dmfile)(": GUID chunk\n");
This->pDesc->dwValidData |= DMUS_OBJ_OBJECT;
IStream_Read (pStm, &This->pDesc->guidObject, chunkSize, NULL);
break;
}
case DMUS_FOURCC_VERSION_CHUNK: {
TRACE_(dmfile)(": version chunk\n");
This->pDesc->dwValidData |= DMUS_OBJ_VERSION;
IStream_Read (pStm, &This->pDesc->vVersion, chunkSize, NULL);
break;
}
case DMUS_FOURCC_CATEGORY_CHUNK: {
TRACE_(dmfile)(": category chunk\n");
This->pDesc->dwValidData |= DMUS_OBJ_CATEGORY;
IStream_Read (pStm, This->pDesc->wszCategory, chunkSize, NULL);
break;
}
case FOURCC_LIST: {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
TRACE_(dmfile)(": LIST chunk of type %s", debugstr_fourcc(chunkID));
ListSize[0] = chunkSize - sizeof(FOURCC);
ListCount[0] = 0;
switch (chunkID) {
case DMUS_FOURCC_UNFO_LIST: {
TRACE_(dmfile)(": UNFO list\n");
do {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
IStream_Read (pStm, &chunkSize, sizeof(FOURCC), NULL);
ListCount[0] += sizeof(FOURCC) + sizeof(DWORD) + chunkSize;
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (chunkID), chunkSize);
switch (chunkID) {
/* don't ask me why, but M$ puts INFO elements in UNFO list sometimes
(though strings seem to be valid unicode) */
case mmioFOURCC('I','N','A','M'):
case DMUS_FOURCC_UNAM_CHUNK: {
TRACE_(dmfile)(": name chunk\n");
This->pDesc->dwValidData |= DMUS_OBJ_NAME;
IStream_Read (pStm, This->pDesc->wszName, chunkSize, NULL);
break;
}
case mmioFOURCC('I','A','R','T'):
case DMUS_FOURCC_UART_CHUNK: {
TRACE_(dmfile)(": artist chunk (ignored)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','C','O','P'):
case DMUS_FOURCC_UCOP_CHUNK: {
TRACE_(dmfile)(": copyright chunk (ignored)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','S','B','J'):
case DMUS_FOURCC_USBJ_CHUNK: {
TRACE_(dmfile)(": subject chunk (ignored)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','C','M','T'):
case DMUS_FOURCC_UCMT_CHUNK: {
TRACE_(dmfile)(": comment chunk (ignored)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (irrevelant & skipping)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
TRACE_(dmfile)(": ListCount[0] = %ld < ListSize[0] = %ld\n", ListCount[0], ListSize[0]);
} while (ListCount[0] < ListSize[0]);
break;
}
default: {
TRACE_(dmfile)(": unknown (skipping)\n");
liMove.QuadPart = chunkSize - sizeof(FOURCC);
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (irrevelant & skipping)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
TRACE_(dmfile)(": StreamCount[0] = %ld < StreamSize[0] = %ld\n", StreamCount, StreamSize);
} while (StreamCount < StreamSize);
break;
}
default: {
TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
liMove.QuadPart = StreamSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */
return E_FAIL;
}
}
TRACE_(dmfile)(": reading finished\n");
break;
}
default: {
TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */
return E_FAIL;
}
}
return S_OK;
}
HRESULT WINAPI IDirectMusicChordMapImpl_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicChordMapImpl_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) {
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicChordMap_PersistStream_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicChordMapImpl_IPersistStream_QueryInterface,
IDirectMusicChordMapImpl_IPersistStream_AddRef,
IDirectMusicChordMapImpl_IPersistStream_Release,
IDirectMusicChordMapImpl_IPersistStream_GetClassID,
IDirectMusicChordMapImpl_IPersistStream_IsDirty,
IDirectMusicChordMapImpl_IPersistStream_Load,
IDirectMusicChordMapImpl_IPersistStream_Save,
IDirectMusicChordMapImpl_IPersistStream_GetSizeMax
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicChordMap (LPCGUID lpcGUID, LPDIRECTMUSICCHORDMAP* ppDMCM, LPUNKNOWN pUnkOuter)
{
IDirectMusicChordMapImpl* dmchordmap;
HRESULT WINAPI DMUSIC_CreateDirectMusicChordMapImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) {
IDirectMusicChordMapImpl* obj;
if (IsEqualIID (lpcGUID, &IID_IDirectMusicChordMap)) {
dmchordmap = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicChordMapImpl));
if (NULL == dmchordmap) {
*ppDMCM = (LPDIRECTMUSICCHORDMAP) NULL;
return E_OUTOFMEMORY;
}
dmchordmap->lpVtbl = &DirectMusicChordMap_Vtbl;
dmchordmap->ref = 1;
*ppDMCM = (LPDIRECTMUSICCHORDMAP) dmchordmap;
return S_OK;
obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicChordMapImpl));
if (NULL == obj) {
*ppobj = (LPVOID) NULL;
return E_OUTOFMEMORY;
}
WARN("No interface found\n");
obj->UnknownVtbl = &DirectMusicChordMap_Unknown_Vtbl;
obj->ChordMapVtbl = &DirectMusicChordMap_ChordMap_Vtbl;
obj->ObjectVtbl = &DirectMusicChordMap_Object_Vtbl;
obj->PersistStreamVtbl = &DirectMusicChordMap_PersistStream_Vtbl;
obj->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC));
DM_STRUCT_INIT(obj->pDesc);
obj->pDesc->dwValidData |= DMUS_OBJ_CLASS;
memcpy (&obj->pDesc->guidClass, &CLSID_DirectMusicChordMap, sizeof (CLSID));
obj->ref = 0; /* will be inited by QueryInterface */
return E_NOINTERFACE;
return IDirectMusicChordMapImpl_IUnknown_QueryInterface ((LPUNKNOWN)&obj->UnknownVtbl, lpcGUID, ppobj);
}
/*****************************************************************************
* IDirectMusicChordMapObject implementation
*/
/* IDirectMusicChordMapObject IUnknown part: */
HRESULT WINAPI IDirectMusicChordMapObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicChordMapObject,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IDirectMusicObject)) {
IDirectMusicChordMapObject_AddRef(iface);
*ppobj = This;
return S_OK;
} else if (IsEqualIID (riid, &IID_IPersistStream)) {
IPersistStream_AddRef ((LPPERSISTSTREAM)This->pStream);
*ppobj = (LPPERSISTSTREAM)This->pStream;
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicChordMap)) {
IDirectMusicChordMap_AddRef ((LPDIRECTMUSICCHORDMAP)This->pChordMap);
*ppobj = (LPDIRECTMUSICCHORDMAP)This->pChordMap;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicChordMapObject_AddRef (LPDIRECTMUSICOBJECT iface)
{
ICOM_THIS(IDirectMusicChordMapObject,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicChordMapObject_Release (LPDIRECTMUSICOBJECT iface)
{
ICOM_THIS(IDirectMusicChordMapObject,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicChordMapObject IDirectMusicObject part: */
HRESULT WINAPI IDirectMusicChordMapObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicChordMapObject,iface);
TRACE("(%p, %p)\n", This, pDesc);
pDesc = This->pDesc;
return S_OK;
}
HRESULT WINAPI IDirectMusicChordMapObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicChordMapObject,iface);
TRACE("(%p, %p)\n", This, pDesc);
This->pDesc = pDesc;
return S_OK;
}
HRESULT WINAPI IDirectMusicChordMapObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicChordMapObject,iface);
FIXME("(%p, %p, %p): stub\n", This, pStream, pDesc);
return S_OK;
}
ICOM_VTABLE(IDirectMusicObject) DirectMusicChordMapObject_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicChordMapObject_QueryInterface,
IDirectMusicChordMapObject_AddRef,
IDirectMusicChordMapObject_Release,
IDirectMusicChordMapObject_GetDescriptor,
IDirectMusicChordMapObject_SetDescriptor,
IDirectMusicChordMapObject_ParseDescriptor
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicChordMapObject (LPCGUID lpcGUID, LPDIRECTMUSICOBJECT* ppObject, LPUNKNOWN pUnkOuter)
{
IDirectMusicChordMapObject *obj;
TRACE("(%p,%p,%p)\n", lpcGUID, ppObject, pUnkOuter);
if (IsEqualIID (lpcGUID, &IID_IDirectMusicObject)) {
obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicChordMapObject));
if (NULL == obj) {
*ppObject = (LPDIRECTMUSICOBJECT) NULL;
return E_OUTOFMEMORY;
}
obj->lpVtbl = &DirectMusicChordMapObject_Vtbl;
obj->ref = 1;
/* prepare IPersistStream */
obj->pStream = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(IDirectMusicChordMapObjectStream));
obj->pStream->lpVtbl = &DirectMusicChordMapObjectStream_Vtbl;
obj->pStream->ref = 1;
obj->pStream->pParentObject = obj;
/* prepare IDirectMusiChordMap */
DMUSIC_CreateDirectMusicChordMap (&IID_IDirectMusicChordMap, (LPDIRECTMUSICCHORDMAP*)&obj->pChordMap, NULL);
obj->pChordMap->pObject = obj;
*ppObject = (LPDIRECTMUSICOBJECT) obj;
return S_OK;
}
WARN("No interface found\n");
return E_NOINTERFACE;
}
/*****************************************************************************
* IDirectMusicChordMapObjectStream implementation
*/
/* IDirectMusicChordMapObjectStream IUnknown part: */
HRESULT WINAPI IDirectMusicChordMapObjectStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicChordMapObjectStream,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicChordMapObjectStream_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicChordMapObjectStream_AddRef (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicChordMapObjectStream,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicChordMapObjectStream_Release (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicChordMapObjectStream,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicChordMapObjectStream IPersist part: */
HRESULT WINAPI IDirectMusicChordMapObjectStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID)
{
return E_NOTIMPL;
}
/* IDirectMusicChordMapObjectStream IPersistStream part: */
HRESULT WINAPI IDirectMusicChordMapObjectStream_IsDirty (LPPERSISTSTREAM iface)
{
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicChordMapObjectStream_Load (LPPERSISTSTREAM iface, IStream* pStm)
{
FIXME(": Loading not implemented yet\n");
return S_OK;
}
HRESULT WINAPI IDirectMusicChordMapObjectStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty)
{
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicChordMapObjectStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize)
{
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicChordMapObjectStream_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicChordMapObjectStream_QueryInterface,
IDirectMusicChordMapObjectStream_AddRef,
IDirectMusicChordMapObjectStream_Release,
IDirectMusicChordMapObjectStream_GetClassID,
IDirectMusicChordMapObjectStream_IsDirty,
IDirectMusicChordMapObjectStream_Load,
IDirectMusicChordMapObjectStream_Save,
IDirectMusicChordMapObjectStream_GetSizeMax
};

View File

@ -1,6 +1,6 @@
/* IDirectMusicChordMapTrack Implementation
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -17,14 +17,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "dmcompos_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmcompos);
@ -34,35 +26,36 @@ WINE_DECLARE_DEBUG_CHANNEL(dmfile);
* IDirectMusicChordMapTrack implementation
*/
/* IDirectMusicChordMapTrack IUnknown part: */
HRESULT WINAPI IDirectMusicChordMapTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicChordMapTrack,iface);
HRESULT WINAPI IDirectMusicChordMapTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicChordMapTrack, UnknownVtbl, iface);
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IDirectMusicTrack) ||
IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
IDirectMusicChordMapTrack_AddRef(iface);
*ppobj = This;
if (IsEqualIID (riid, &IID_IUnknown)) {
*ppobj = (LPUNKNOWN)&This->UnknownVtbl;
IDirectMusicChordMapTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicTrack)
|| IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
*ppobj = (LPDIRECTMUSICTRACK8)&This->TrackVtbl;
IDirectMusicChordMapTrack_IDirectMusicTrack_AddRef ((LPDIRECTMUSICTRACK8)&This->TrackVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicChordMapTrackStream_AddRef ((LPPERSISTSTREAM)This->pStream);
*ppobj = This->pStream;
*ppobj = (LPPERSISTSTREAM)&This->PersistStreamVtbl;
IDirectMusicChordMapTrack_IPersistStream_AddRef ((LPPERSISTSTREAM)&This->PersistStreamVtbl);
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicChordMapTrack_AddRef (LPDIRECTMUSICTRACK8 iface)
{
ICOM_THIS(IDirectMusicChordMapTrack,iface);
ULONG WINAPI IDirectMusicChordMapTrack_IUnknown_AddRef (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicChordMapTrack, UnknownVtbl, iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicChordMapTrack_Release (LPDIRECTMUSICTRACK8 iface)
{
ICOM_THIS(IDirectMusicChordMapTrack,iface);
ULONG WINAPI IDirectMusicChordMapTrack_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicChordMapTrack, UnknownVtbl, iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
@ -71,271 +64,213 @@ ULONG WINAPI IDirectMusicChordMapTrack_Release (LPDIRECTMUSICTRACK8 iface)
return ref;
}
/* IDirectMusicChordMapTrack IDirectMusicTrack part: */
HRESULT WINAPI IDirectMusicChordMapTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment)
{
ICOM_THIS(IDirectMusicChordMapTrack,iface);
ICOM_VTABLE(IUnknown) DirectMusicChordMapTrack_Unknown_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicChordMapTrack_IUnknown_QueryInterface,
IDirectMusicChordMapTrack_IUnknown_AddRef,
IDirectMusicChordMapTrack_IUnknown_Release
};
/* IDirectMusicChordMapTrack IDirectMusicTrack8 part: */
HRESULT WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicChordMapTrack, TrackVtbl, iface);
return IDirectMusicChordMapTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface) {
ICOM_THIS_MULTI(IDirectMusicChordMapTrack, TrackVtbl, iface);
return IDirectMusicChordMapTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface) {
ICOM_THIS_MULTI(IDirectMusicChordMapTrack, TrackVtbl, iface);
return IDirectMusicChordMapTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment) {
ICOM_THIS_MULTI(IDirectMusicChordMapTrack, TrackVtbl, iface);
FIXME("(%p, %p): stub\n", This, pSegment);
return S_OK;
}
HRESULT WINAPI IDirectMusicChordMapTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicChordMapTrack,iface);
HRESULT WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicChordMapTrack, TrackVtbl, iface);
FIXME("(%p, %p, %p, %p, %ld, %ld): stub\n", This, pSegmentState, pPerformance, ppStateData, dwVirtualTrack8ID, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicChordMapTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData)
{
ICOM_THIS(IDirectMusicChordMapTrack,iface);
HRESULT WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData) {
ICOM_THIS_MULTI(IDirectMusicChordMapTrack, TrackVtbl, iface);
FIXME("(%p, %p): stub\n", This, pStateData);
return S_OK;
}
HRESULT WINAPI IDirectMusicChordMapTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
{
ICOM_THIS(IDirectMusicChordMapTrack,iface);
HRESULT WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID) {
ICOM_THIS_MULTI(IDirectMusicChordMapTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %ld, %ld, %ld, %p, %p, %ld): stub\n", This, pStateData, mtStart, mtEnd, mtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
return S_OK;
}
HRESULT WINAPI IDirectMusicChordMapTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam)
{
ICOM_THIS(IDirectMusicChordMapTrack,iface);
HRESULT WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam) {
ICOM_THIS_MULTI(IDirectMusicChordMapTrack, TrackVtbl, iface);
FIXME("(%p, %s, %ld, %p, %p): stub\n", This, debugstr_guid(rguidType), mtTime, pmtNext, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicChordMapTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam)
{
ICOM_THIS(IDirectMusicChordMapTrack,iface);
HRESULT WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam) {
ICOM_THIS_MULTI(IDirectMusicChordMapTrack, TrackVtbl, iface);
FIXME("(%p, %s, %ld, %p): stub\n", This, debugstr_guid(rguidType), mtTime, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicChordMapTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType)
{
ICOM_THIS(IDirectMusicChordMapTrack,iface);
HRESULT WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType) {
ICOM_THIS_MULTI(IDirectMusicChordMapTrack, TrackVtbl, iface);
TRACE("(%p, %s): ", This, debugstr_guid(rguidType));
if (IsEqualGUID (rguidType, &GUID_IDirectMusicChordMap)) {
TRACE("param supported\n");
return S_OK;
}
}
TRACE("param unsupported\n");
return DMUS_E_TYPE_UNSUPPORTED;
}
HRESULT WINAPI IDirectMusicChordMapTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType)
{
ICOM_THIS(IDirectMusicChordMapTrack,iface);
HRESULT WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
ICOM_THIS_MULTI(IDirectMusicChordMapTrack, TrackVtbl, iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
return S_OK;
}
HRESULT WINAPI IDirectMusicChordMapTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType)
{
ICOM_THIS(IDirectMusicChordMapTrack,iface);
HRESULT WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
ICOM_THIS_MULTI(IDirectMusicChordMapTrack, TrackVtbl, iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
return S_OK;
}
HRESULT WINAPI IDirectMusicChordMapTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack)
{
ICOM_THIS(IDirectMusicChordMapTrack,iface);
HRESULT WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack) {
ICOM_THIS_MULTI(IDirectMusicChordMapTrack, TrackVtbl, iface);
FIXME("(%p, %ld, %ld, %p): stub\n", This, mtStart, mtEnd, ppTrack);
return S_OK;
}
/* IDirectMusicChordMapTrack IDirectMusicTrack8 part: */
HRESULT WINAPI IDirectMusicChordMapTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
{
ICOM_THIS(IDirectMusicChordMapTrack,iface);
HRESULT WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID) {
ICOM_THIS_MULTI(IDirectMusicChordMapTrack, TrackVtbl, iface);
FIXME("(%p, %p, %lli, %lli, %lli, %ld, %p, %p, %ld): stub\n", This, pStateData, rtStart, rtEnd, rtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
return S_OK;
}
HRESULT WINAPI IDirectMusicChordMapTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicChordMapTrack,iface);
HRESULT WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicChordMapTrack, TrackVtbl, iface);
FIXME("(%p, %s, %lli, %p, %p, %p, %ld): stub\n", This, debugstr_guid(rguidType), rtTime, prtNext, pParam, pStateData, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicChordMapTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicChordMapTrack,iface);
HRESULT WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicChordMapTrack, TrackVtbl, iface);
FIXME("(%p, %s, %lli, %p, %p, %ld): stub\n", This, debugstr_guid(rguidType), rtTime, pParam, pStateData, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicChordMapTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack)
{
ICOM_THIS(IDirectMusicChordMapTrack,iface);
HRESULT WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
ICOM_THIS_MULTI(IDirectMusicChordMapTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %p): stub\n", This, pContext, dwTrackGroup, ppResultTrack);
return S_OK;
}
HRESULT WINAPI IDirectMusicChordMapTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack)
{
ICOM_THIS(IDirectMusicChordMapTrack,iface);
HRESULT WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
ICOM_THIS_MULTI(IDirectMusicChordMapTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %p, %ld, %p): stub\n", This, pNewTrack, mtJoin, pContext, dwTrackGroup, ppResultTrack);
return S_OK;
}
ICOM_VTABLE(IDirectMusicTrack8) DirectMusicChordMapTrack_Vtbl =
{
ICOM_VTABLE(IDirectMusicTrack8) DirectMusicChordMapTrack_Track_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicChordMapTrack_QueryInterface,
IDirectMusicChordMapTrack_AddRef,
IDirectMusicChordMapTrack_Release,
IDirectMusicChordMapTrack_Init,
IDirectMusicChordMapTrack_InitPlay,
IDirectMusicChordMapTrack_EndPlay,
IDirectMusicChordMapTrack_Play,
IDirectMusicChordMapTrack_GetParam,
IDirectMusicChordMapTrack_SetParam,
IDirectMusicChordMapTrack_IsParamSupported,
IDirectMusicChordMapTrack_AddNotificationType,
IDirectMusicChordMapTrack_RemoveNotificationType,
IDirectMusicChordMapTrack_Clone,
IDirectMusicChordMapTrack_PlayEx,
IDirectMusicChordMapTrack_GetParamEx,
IDirectMusicChordMapTrack_SetParamEx,
IDirectMusicChordMapTrack_Compose,
IDirectMusicChordMapTrack_Join
IDirectMusicChordMapTrack_IDirectMusicTrack_QueryInterface,
IDirectMusicChordMapTrack_IDirectMusicTrack_AddRef,
IDirectMusicChordMapTrack_IDirectMusicTrack_Release,
IDirectMusicChordMapTrack_IDirectMusicTrack_Init,
IDirectMusicChordMapTrack_IDirectMusicTrack_InitPlay,
IDirectMusicChordMapTrack_IDirectMusicTrack_EndPlay,
IDirectMusicChordMapTrack_IDirectMusicTrack_Play,
IDirectMusicChordMapTrack_IDirectMusicTrack_GetParam,
IDirectMusicChordMapTrack_IDirectMusicTrack_SetParam,
IDirectMusicChordMapTrack_IDirectMusicTrack_IsParamSupported,
IDirectMusicChordMapTrack_IDirectMusicTrack_AddNotificationType,
IDirectMusicChordMapTrack_IDirectMusicTrack_RemoveNotificationType,
IDirectMusicChordMapTrack_IDirectMusicTrack_Clone,
IDirectMusicChordMapTrack_IDirectMusicTrack_PlayEx,
IDirectMusicChordMapTrack_IDirectMusicTrack_GetParamEx,
IDirectMusicChordMapTrack_IDirectMusicTrack_SetParamEx,
IDirectMusicChordMapTrack_IDirectMusicTrack_Compose,
IDirectMusicChordMapTrack_IDirectMusicTrack_Join
};
/* IDirectMusicChordMapTrack IPersistStream part: */
HRESULT WINAPI IDirectMusicChordMapTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicChordMapTrack, PersistStreamVtbl, iface);
return IDirectMusicChordMapTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicChordMapTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicChordMapTrack, PersistStreamVtbl, iface);
return IDirectMusicChordMapTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicChordMapTrack_IPersistStream_Release (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicChordMapTrack, PersistStreamVtbl, iface);
return IDirectMusicChordMapTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicChordMapTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicChordMapTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicChordMapTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm) {
ICOM_THIS_MULTI(IDirectMusicChordMapTrack, PersistStreamVtbl, iface);
FIXME("(%p, %p): Loading not implemented yet\n", This, pStm);
return S_OK;
}
HRESULT WINAPI IDirectMusicChordMapTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicChordMapTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) {
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicChordMapTrack_PersistStream_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicChordMapTrack_IPersistStream_QueryInterface,
IDirectMusicChordMapTrack_IPersistStream_AddRef,
IDirectMusicChordMapTrack_IPersistStream_Release,
IDirectMusicChordMapTrack_IPersistStream_GetClassID,
IDirectMusicChordMapTrack_IPersistStream_IsDirty,
IDirectMusicChordMapTrack_IPersistStream_Load,
IDirectMusicChordMapTrack_IPersistStream_Save,
IDirectMusicChordMapTrack_IPersistStream_GetSizeMax
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicChordMapTrack (LPCGUID lpcGUID, LPDIRECTMUSICTRACK8 *ppTrack, LPUNKNOWN pUnkOuter)
{
HRESULT WINAPI DMUSIC_CreateDirectMusicChordMapTrack (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) {
IDirectMusicChordMapTrack* track;
if (IsEqualIID (lpcGUID, &IID_IDirectMusicTrack)
|| IsEqualIID (lpcGUID, &IID_IDirectMusicTrack8)) {
track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicChordMapTrack));
if (NULL == track) {
*ppTrack = (LPDIRECTMUSICTRACK8) NULL;
return E_OUTOFMEMORY;
}
track->lpVtbl = &DirectMusicChordMapTrack_Vtbl;
track->ref = 1;
track->pStream = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(IDirectMusicChordMapTrackStream));
track->pStream->lpVtbl = &DirectMusicChordMapTrackStream_Vtbl;
track->pStream->ref = 1;
track->pStream->pParentTrack = track;
*ppTrack = (LPDIRECTMUSICTRACK8) track;
return S_OK;
track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicChordMapTrack));
if (NULL == track) {
*ppobj = (LPVOID) NULL;
return E_OUTOFMEMORY;
}
WARN("No interface found\n");
track->UnknownVtbl = &DirectMusicChordMapTrack_Unknown_Vtbl;
track->TrackVtbl = &DirectMusicChordMapTrack_Track_Vtbl;
track->PersistStreamVtbl = &DirectMusicChordMapTrack_PersistStream_Vtbl;
track->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC));
DM_STRUCT_INIT(track->pDesc);
track->pDesc->dwValidData |= DMUS_OBJ_CLASS;
memcpy (&track->pDesc->guidClass, &CLSID_DirectMusicChordMapTrack, sizeof (CLSID));
track->ref = 0; /* will be inited by QueryInterface */
return E_NOINTERFACE;
return IDirectMusicChordMapTrack_IUnknown_QueryInterface ((LPUNKNOWN)&track->UnknownVtbl, lpcGUID, ppobj);
}
/*****************************************************************************
* IDirectMusicChordMapTrackStream implementation
*/
/* IDirectMusicChordMapTrackStream IUnknown part follow: */
HRESULT WINAPI IDirectMusicChordMapTrackStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicChordMapTrackStream,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicChordMapTrackStream_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicChordMapTrackStream_AddRef (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicChordMapTrackStream,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicChordMapTrackStream_Release (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicChordMapTrackStream,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicChordMapTrackStream IPersist part: */
HRESULT WINAPI IDirectMusicChordMapTrackStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID)
{
return E_NOTIMPL;
}
/* IDirectMusicChordMapTrackStream IPersistStream part: */
HRESULT WINAPI IDirectMusicChordMapTrackStream_IsDirty (LPPERSISTSTREAM iface)
{
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicChordMapTrackStream_Load (LPPERSISTSTREAM iface, IStream* pStm)
{
FIXME(": Loading not implemented yet\n");
return S_OK;
}
HRESULT WINAPI IDirectMusicChordMapTrackStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty)
{
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicChordMapTrackStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize)
{
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicChordMapTrackStream_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicChordMapTrackStream_QueryInterface,
IDirectMusicChordMapTrackStream_AddRef,
IDirectMusicChordMapTrackStream_Release,
IDirectMusicChordMapTrackStream_GetClassID,
IDirectMusicChordMapTrackStream_IsDirty,
IDirectMusicChordMapTrackStream_Load,
IDirectMusicChordMapTrackStream_Save,
IDirectMusicChordMapTrackStream_GetSizeMax
};

View File

@ -1,6 +1,6 @@
/* IDirectMusicComposer
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -17,21 +17,12 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "dmcompos_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmcompos);
/* IDirectMusicComposer IUnknown parts follow: */
HRESULT WINAPI IDirectMusicComposerImpl_QueryInterface (LPDIRECTMUSICCOMPOSER iface, REFIID riid, LPVOID *ppobj)
{
/* IDirectMusicComposerImpl IUnknown part: */
HRESULT WINAPI IDirectMusicComposerImpl_QueryInterface (LPDIRECTMUSICCOMPOSER iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IDirectMusicComposerImpl,iface);
if (IsEqualIID (riid, &IID_IUnknown) ||
@ -44,15 +35,13 @@ HRESULT WINAPI IDirectMusicComposerImpl_QueryInterface (LPDIRECTMUSICCOMPOSER if
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicComposerImpl_AddRef (LPDIRECTMUSICCOMPOSER iface)
{
ULONG WINAPI IDirectMusicComposerImpl_AddRef (LPDIRECTMUSICCOMPOSER iface) {
ICOM_THIS(IDirectMusicComposerImpl,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicComposerImpl_Release (LPDIRECTMUSICCOMPOSER iface)
{
ULONG WINAPI IDirectMusicComposerImpl_Release (LPDIRECTMUSICCOMPOSER iface) {
ICOM_THIS(IDirectMusicComposerImpl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
@ -62,63 +51,44 @@ ULONG WINAPI IDirectMusicComposerImpl_Release (LPDIRECTMUSICCOMPOSER iface)
return ref;
}
/* IDirectMusicComposer Interface follow: */
HRESULT WINAPI IDirectMusicComposerImpl_ComposeSegmentFromTemplate (LPDIRECTMUSICCOMPOSER iface, IDirectMusicStyle* pStyle, IDirectMusicSegment* pTemplate, WORD wActivity, IDirectMusicChordMap* pChordMap, IDirectMusicSegment** ppSegment)
{
/* IDirectMusicComposerImpl IDirectMusicComposer part: */
HRESULT WINAPI IDirectMusicComposerImpl_ComposeSegmentFromTemplate (LPDIRECTMUSICCOMPOSER iface, IDirectMusicStyle* pStyle, IDirectMusicSegment* pTemplate, WORD wActivity, IDirectMusicChordMap* pChordMap, IDirectMusicSegment** ppSegment) {
ICOM_THIS(IDirectMusicComposerImpl,iface);
FIXME("(%p, %p, %p, %d, %p, %p): stub\n", This, pStyle, pTemplate, wActivity, pChordMap, ppSegment);
return S_OK;
}
HRESULT WINAPI IDirectMusicComposerImpl_ComposeSegmentFromShape (LPDIRECTMUSICCOMPOSER iface, IDirectMusicStyle* pStyle, WORD wNumMeasures, WORD wShape, WORD wActivity, BOOL fIntro, BOOL fEnd, IDirectMusicChordMap* pChordMap, IDirectMusicSegment** ppSegment)
{
HRESULT WINAPI IDirectMusicComposerImpl_ComposeSegmentFromShape (LPDIRECTMUSICCOMPOSER iface, IDirectMusicStyle* pStyle, WORD wNumMeasures, WORD wShape, WORD wActivity, BOOL fIntro, BOOL fEnd, IDirectMusicChordMap* pChordMap, IDirectMusicSegment** ppSegment) {
ICOM_THIS(IDirectMusicComposerImpl,iface);
FIXME("(%p, %p, %d, %d, %d, %d, %d, %p, %p): stub\n", This, pStyle, wNumMeasures, wShape, wActivity, fIntro, fEnd, pChordMap, ppSegment);
return S_OK;
}
HRESULT WINAPI IDirectMusicComposerImpl_ComposeTransition (LPDIRECTMUSICCOMPOSER iface, IDirectMusicSegment* pFromSeg, IDirectMusicSegment* pToSeg, MUSIC_TIME mtTime, WORD wCommand, DWORD dwFlags, IDirectMusicChordMap* pChordMap, IDirectMusicSegment** ppTransSeg)
{
HRESULT WINAPI IDirectMusicComposerImpl_ComposeTransition (LPDIRECTMUSICCOMPOSER iface, IDirectMusicSegment* pFromSeg, IDirectMusicSegment* pToSeg, MUSIC_TIME mtTime, WORD wCommand, DWORD dwFlags, IDirectMusicChordMap* pChordMap, IDirectMusicSegment** ppTransSeg) {
ICOM_THIS(IDirectMusicComposerImpl,iface);
FIXME("(%p, %p, %p, %ld, %d, %ld, %p, %p): stub\n", This, pFromSeg, pToSeg, mtTime, wCommand, dwFlags, pChordMap, ppTransSeg);
return S_OK;
}
HRESULT WINAPI IDirectMusicComposerImpl_AutoTransition (LPDIRECTMUSICCOMPOSER iface, IDirectMusicPerformance* pPerformance, IDirectMusicSegment* pToSeg, WORD wCommand, DWORD dwFlags, IDirectMusicChordMap* pChordMap, IDirectMusicSegment** ppTransSeg, IDirectMusicSegmentState** ppToSegState, IDirectMusicSegmentState** ppTransSegState)
{
HRESULT WINAPI IDirectMusicComposerImpl_AutoTransition (LPDIRECTMUSICCOMPOSER iface, IDirectMusicPerformance* pPerformance, IDirectMusicSegment* pToSeg, WORD wCommand, DWORD dwFlags, IDirectMusicChordMap* pChordMap, IDirectMusicSegment** ppTransSeg, IDirectMusicSegmentState** ppToSegState, IDirectMusicSegmentState** ppTransSegState) {
ICOM_THIS(IDirectMusicComposerImpl,iface);
FIXME("(%p, %p, %d, %ld, %p, %p, %p, %p): stub\n", This, pPerformance, wCommand, dwFlags, pChordMap, ppTransSeg, ppToSegState, ppTransSegState);
return S_OK;
}
HRESULT WINAPI IDirectMusicComposerImpl_ComposeTemplateFromShape (LPDIRECTMUSICCOMPOSER iface, WORD wNumMeasures, WORD wShape, BOOL fIntro, BOOL fEnd, WORD wEndLength, IDirectMusicSegment** ppTemplate)
{
HRESULT WINAPI IDirectMusicComposerImpl_ComposeTemplateFromShape (LPDIRECTMUSICCOMPOSER iface, WORD wNumMeasures, WORD wShape, BOOL fIntro, BOOL fEnd, WORD wEndLength, IDirectMusicSegment** ppTemplate) {
ICOM_THIS(IDirectMusicComposerImpl,iface);
FIXME("(%p, %d, %d, %d, %d, %d, %p): stub\n", This, wNumMeasures, wShape, fIntro, fEnd, wEndLength, ppTemplate);
return S_OK;
}
HRESULT WINAPI IDirectMusicComposerImpl_ChangeChordMap (LPDIRECTMUSICCOMPOSER iface, IDirectMusicSegment* pSegment, BOOL fTrackScale, IDirectMusicChordMap* pChordMap)
{
HRESULT WINAPI IDirectMusicComposerImpl_ChangeChordMap (LPDIRECTMUSICCOMPOSER iface, IDirectMusicSegment* pSegment, BOOL fTrackScale, IDirectMusicChordMap* pChordMap) {
ICOM_THIS(IDirectMusicComposerImpl,iface);
FIXME("(%p, %p, %d, %p): stub\n", This, pSegment, fTrackScale, pChordMap);
return S_OK;
}
ICOM_VTABLE(IDirectMusicComposer) DirectMusicComposer_Vtbl =
{
ICOM_VTABLE(IDirectMusicComposer) DirectMusicComposer_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicComposerImpl_QueryInterface,
IDirectMusicComposerImpl_AddRef,
@ -132,22 +102,16 @@ ICOM_VTABLE(IDirectMusicComposer) DirectMusicComposer_Vtbl =
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicComposer (LPCGUID lpcGUID, LPDIRECTMUSICCOMPOSER* ppDMCP, LPUNKNOWN pUnkOuter)
{
IDirectMusicComposerImpl* dmcompos;
HRESULT WINAPI DMUSIC_CreateDirectMusicComposerImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) {
IDirectMusicComposerImpl* obj;
if (IsEqualIID (lpcGUID, &IID_IDirectMusicComposer)) {
dmcompos = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicComposerImpl));
if (NULL == dmcompos) {
*ppDMCP = (LPDIRECTMUSICCOMPOSER) NULL;
return E_OUTOFMEMORY;
}
dmcompos->lpVtbl = &DirectMusicComposer_Vtbl;
dmcompos->ref = 1;
*ppDMCP = (LPDIRECTMUSICCOMPOSER) dmcompos;
return S_OK;
obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicComposerImpl));
if (NULL == obj) {
*ppobj = (LPDIRECTMUSICCOMPOSER) NULL;
return E_OUTOFMEMORY;
}
WARN("No interface found\n");
obj->lpVtbl = &DirectMusicComposer_Vtbl;
obj->ref = 0; /* will be inited by QueryInterface */
return E_NOINTERFACE;
return IDirectMusicComposerImpl_QueryInterface ((LPDIRECTMUSICCOMPOSER)obj, lpcGUID, ppobj);
}

View File

@ -1,6 +1,6 @@
/* DirectMusicComposer Main
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -21,8 +21,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(dmcompos);
typedef struct
{
typedef struct {
/* IUnknown fields */
ICOM_VFIELD(IClassFactory);
DWORD ref;
@ -31,44 +30,30 @@ typedef struct
/******************************************************************
* DirectMusicChordMap ClassFactory
*/
static HRESULT WINAPI ChordMapCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI ChordMapCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI ChordMapCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI ChordMapCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI ChordMapCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI ChordMapCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI ChordMapCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI ChordMapCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualIID (riid, &IID_IDirectMusicChordMap)) {
return DMUSIC_CreateDirectMusicChordMap (riid, (LPDIRECTMUSICCHORDMAP*)ppobj, pOuter);
} else if (IsEqualIID (riid, &IID_IDirectMusicObject)) {
return DMUSIC_CreateDirectMusicChordMapObject (riid, (LPDIRECTMUSICOBJECT*) ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
return DMUSIC_CreateDirectMusicChordMapImpl (riid, ppobj, pOuter);
}
static HRESULT WINAPI ChordMapCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI ChordMapCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -88,42 +73,30 @@ static IClassFactoryImpl ChordMap_CF = {&ChordMapCF_Vtbl, 1 };
/******************************************************************
* DirectMusicComposer ClassFactory
*/
static HRESULT WINAPI ComposerCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI ComposerCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI ComposerCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI ComposerCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI ComposerCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI ComposerCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI ComposerCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI ComposerCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualIID (riid, &IID_IDirectMusicComposer)) {
return DMUSIC_CreateDirectMusicComposer (riid, (LPDIRECTMUSICCOMPOSER*)ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
return DMUSIC_CreateDirectMusicComposerImpl (riid, ppobj, pOuter);
}
static HRESULT WINAPI ComposerCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI ComposerCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -143,43 +116,30 @@ static IClassFactoryImpl Composer_CF = {&ComposerCF_Vtbl, 1 };
/******************************************************************
* DirectMusicChordMapTrack ClassFactory
*/
static HRESULT WINAPI ChordMapTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI ChordMapTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI ChordMapTrackCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI ChordMapTrackCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI ChordMapTrackCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI ChordMapTrackCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI ChordMapTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI ChordMapTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualIID (riid, &IID_IDirectMusicTrack)
|| IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
return DMUSIC_CreateDirectMusicChordMapTrack (riid, (LPDIRECTMUSICTRACK8*) ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
return DMUSIC_CreateDirectMusicChordMapTrack (riid, ppobj, pOuter);
}
static HRESULT WINAPI ChordMapTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI ChordMapTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -199,41 +159,32 @@ static IClassFactoryImpl ChordMapTrack_CF = {&ChordMapTrackCF_Vtbl, 1 };
/******************************************************************
* DirectMusicTemplate ClassFactory
*/
static HRESULT WINAPI TemplateCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI TemplateCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI TemplateCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI TemplateCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI TemplateCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI TemplateCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI TemplateCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI TemplateCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
/* nothing yet */
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
static HRESULT WINAPI TemplateCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI TemplateCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -253,43 +204,30 @@ static IClassFactoryImpl Template_CF = {&TemplateCF_Vtbl, 1 };
/******************************************************************
* DirectMusicSignPostTrack ClassFactory
*/
static HRESULT WINAPI SignPostTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI SignPostTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI SignPostTrackCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI SignPostTrackCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI SignPostTrackCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI SignPostTrackCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI SignPostTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI SignPostTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualIID (riid, &IID_IDirectMusicTrack)
|| IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
return DMUSIC_CreateDirectMusicSignPostTrack (riid, (LPDIRECTMUSICTRACK8*) ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
return DMUSIC_CreateDirectMusicSignPostTrack (riid, ppobj, pOuter);
}
static HRESULT WINAPI SignPostTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI SignPostTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -311,15 +249,12 @@ static IClassFactoryImpl SignPostTrack_CF = {&SignPostTrackCF_Vtbl, 1 };
*
*
*/
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
if (fdwReason == DLL_PROCESS_ATTACH)
{
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
if (fdwReason == DLL_PROCESS_ATTACH) {
DisableThreadLibraryCalls(hinstDLL);
/* FIXME: Initialisation */
}
else if (fdwReason == DLL_PROCESS_DETACH)
{
else if (fdwReason == DLL_PROCESS_DETACH) {
/* FIXME: Cleanup */
}
@ -332,10 +267,8 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
*
*
*/
HRESULT WINAPI DMCOMPOS_DllCanUnloadNow(void)
{
HRESULT WINAPI DMCOMPOS_DllCanUnloadNow(void) {
FIXME("(void): stub\n");
return S_FALSE;
}
@ -345,8 +278,7 @@ HRESULT WINAPI DMCOMPOS_DllCanUnloadNow(void)
*
*
*/
HRESULT WINAPI DMCOMPOS_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
{
HRESULT WINAPI DMCOMPOS_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) {
TRACE("(%p,%p,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
if (IsEqualCLSID (rclsid, &CLSID_DirectMusicChordMap) && IsEqualIID (riid, &IID_IClassFactory)) {
*ppv = (LPVOID) &ChordMap_CF;

View File

@ -1,6 +1,6 @@
/* DirectMusicComposer Private Include
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -23,89 +23,100 @@
#include <stdarg.h>
#include "windef.h"
#include "wine/debug.h"
#include "winbase.h"
#include "winnt.h"
#include "wingdi.h"
#include "dmusicc.h"
#include "winuser.h"
#include "wine/debug.h"
#include "wine/list.h"
#include "wine/unicode.h"
#include "winreg.h"
#include "dmusici.h"
#include "dmusics.h"
#include "dmplugin.h"
#include "dmusicf.h"
#include "dsound.h"
#include "dmusics.h"
/*****************************************************************************
* Interfaces
*/
typedef struct IDirectMusicChordMapImpl IDirectMusicChordMapImpl;
typedef struct IDirectMusicComposerImpl IDirectMusicComposerImpl;
typedef struct IDirectMusicChordMapObject IDirectMusicChordMapObject;
typedef struct IDirectMusicChordMapObjectStream IDirectMusicChordMapObjectStream;
typedef struct IDirectMusicChordMapTrack IDirectMusicChordMapTrack;
typedef struct IDirectMusicChordMapTrackStream IDirectMusicChordMapTrackStream;
typedef struct IDirectMusicSignPostTrack IDirectMusicSignPostTrack;
typedef struct IDirectMusicSignPostTrackStream IDirectMusicSignPostTrackStream;
/*****************************************************************************
* Predeclare the interface implementation structures
*/
extern ICOM_VTABLE(IDirectMusicChordMap) DirectMusicChordMap_Vtbl;
extern ICOM_VTABLE(IUnknown) DirectMusicChordMap_Unknown_Vtbl;
extern ICOM_VTABLE(IDirectMusicChordMap) DirectMusicChordMap_ChordMap_Vtbl;
extern ICOM_VTABLE(IDirectMusicObject) DirectMusicChordMap_Object_Vtbl;
extern ICOM_VTABLE(IPersistStream) DirectMusicChordMap_PersistStream_Vtbl;
extern ICOM_VTABLE(IDirectMusicComposer) DirectMusicComposer_Vtbl;
extern ICOM_VTABLE(IDirectMusicObject) DirectMusicChordMapObject_Vtbl;
extern ICOM_VTABLE(IPersistStream) DirectMusicChordMapObjectStream_Vtbl;
extern ICOM_VTABLE(IUnknown) DirectMusicChordMapTrack_Unknown_Vtbl;
extern ICOM_VTABLE(IDirectMusicTrack8) DirectMusicChordMapTrack_Track_Vtbl;
extern ICOM_VTABLE(IPersistStream) DirectMusicChordMapTrack_PersistStream_Vtbl;
extern ICOM_VTABLE(IDirectMusicTrack8) DirectMusicChordMapTrack_Vtbl;
extern ICOM_VTABLE(IPersistStream) DirectMusicChordMapTrackStream_Vtbl;
extern ICOM_VTABLE(IDirectMusicTrack8) DirectMusicSignPostTrack_Vtbl;
extern ICOM_VTABLE(IPersistStream) DirectMusicSignPostTrackStream_Vtbl;
extern ICOM_VTABLE(IUnknown) DirectMusicSignPostTrack_Unknown_Vtbl;
extern ICOM_VTABLE(IDirectMusicTrack8) DirectMusicSignPostTrack_Track_Vtbl;
extern ICOM_VTABLE(IPersistStream) DirectMusicSignPostTrack_PersistStream_Vtbl;
/*****************************************************************************
* ClassFactory
*/
/* can support IID_IDirectMusicChordMap
* return always an IDirectMusicChordMapImpl
*/
extern HRESULT WINAPI DMUSIC_CreateDirectMusicChordMap (LPCGUID lpcGUID, LPDIRECTMUSICCHORDMAP* ppDMCM, LPUNKNOWN pUnkOuter);
/* can support IID_IDirectMusicComposer
* return always an IDirectMusicComposerImpl
*/
extern HRESULT WINAPI DMUSIC_CreateDirectMusicComposer (LPCGUID lpcGUID, LPDIRECTMUSICCOMPOSER* ppDMCP, LPUNKNOWN pUnkOuter);
extern HRESULT WINAPI DMUSIC_CreateDirectMusicChordMapObject (LPCGUID lpcGUID, LPDIRECTMUSICOBJECT* ppObject, LPUNKNOWN pUnkOuter);
extern HRESULT WINAPI DMUSIC_CreateDirectMusicChordMapTrack (LPCGUID lpcGUID, LPDIRECTMUSICTRACK8* ppTrack, LPUNKNOWN pUnkOuter);
extern HRESULT WINAPI DMUSIC_CreateDirectMusicSignPostTrack (LPCGUID lpcGUID, LPDIRECTMUSICTRACK8* ppTrack, LPUNKNOWN pUnkOuter);
extern HRESULT WINAPI DMUSIC_CreateDirectMusicChordMapImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter);
extern HRESULT WINAPI DMUSIC_CreateDirectMusicComposerImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter);
extern HRESULT WINAPI DMUSIC_CreateDirectMusicChordMapTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter);
extern HRESULT WINAPI DMUSIC_CreateDirectMusicSignPostTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter);
/*****************************************************************************
* IDirectMusicChordMapImpl implementation structure
*/
struct IDirectMusicChordMapImpl
{
struct IDirectMusicChordMapImpl {
/* IUnknown fields */
ICOM_VFIELD(IDirectMusicChordMap);
ICOM_VTABLE(IUnknown) *UnknownVtbl;
ICOM_VTABLE(IDirectMusicChordMap) *ChordMapVtbl;
ICOM_VTABLE(IDirectMusicObject) *ObjectVtbl;
ICOM_VTABLE(IPersistStream) *PersistStreamVtbl;
DWORD ref;
/* IDirectMusicChordMapImpl fields */
IDirectMusicChordMapObject* pObject;
DWORD dwScale;
LPDMUS_OBJECTDESC pDesc;
};
/* IUnknown: */
extern HRESULT WINAPI IDirectMusicChordMapImpl_QueryInterface (LPDIRECTMUSICCHORDMAP iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicChordMapImpl_AddRef (LPDIRECTMUSICCHORDMAP iface);
extern ULONG WINAPI IDirectMusicChordMapImpl_Release (LPDIRECTMUSICCHORDMAP iface);
extern HRESULT WINAPI IDirectMusicChordMapImpl_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicChordMapImpl_IUnknown_AddRef (LPUNKNOWN iface);
extern ULONG WINAPI IDirectMusicChordMapImpl_IUnknown_Release (LPUNKNOWN iface);
/* IDirectMusicChordMap: */
extern HRESULT WINAPI IDirectMusicChordMapImpl_GetScale (LPDIRECTMUSICCHORDMAP iface, DWORD* pdwScale);
extern HRESULT WINAPI IDirectMusicChordMapImpl_IDirectMusicChordMap_QueryInterface (LPDIRECTMUSICCHORDMAP iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicChordMapImpl_IDirectMusicChordMap_AddRef (LPDIRECTMUSICCHORDMAP iface);
extern ULONG WINAPI IDirectMusicChordMapImpl_IDirectMusicChordMap_Release (LPDIRECTMUSICCHORDMAP iface);
extern HRESULT WINAPI IDirectMusicChordMapImpl_IDirectMusicChordMap_GetScale (LPDIRECTMUSICCHORDMAP iface, DWORD* pdwScale);
/* IDirectMusicObject: */
extern HRESULT WINAPI IDirectMusicChordMapImpl_IDirectMusicObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicChordMapImpl_IDirectMusicObject_AddRef (LPDIRECTMUSICOBJECT iface);
extern ULONG WINAPI IDirectMusicChordMapImpl_IDirectMusicObject_Release (LPDIRECTMUSICOBJECT iface);
extern HRESULT WINAPI IDirectMusicChordMapImpl_IDirectMusicObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc);
extern HRESULT WINAPI IDirectMusicChordMapImpl_IDirectMusicObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc);
extern HRESULT WINAPI IDirectMusicChordMapImpl_IDirectMusicObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc);
/* IPersistStream: */
extern HRESULT WINAPI IDirectMusicChordMapImpl_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject);
extern ULONG WINAPI IDirectMusicChordMapImpl_IPersistStream_AddRef (LPPERSISTSTREAM iface);
extern ULONG WINAPI IDirectMusicChordMapImpl_IPersistStream_Release (LPPERSISTSTREAM iface);
extern HRESULT WINAPI IDirectMusicChordMapImpl_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID);
extern HRESULT WINAPI IDirectMusicChordMapImpl_IPersistStream_IsDirty (LPPERSISTSTREAM iface);
extern HRESULT WINAPI IDirectMusicChordMapImpl_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm);
extern HRESULT WINAPI IDirectMusicChordMapImpl_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty);
extern HRESULT WINAPI IDirectMusicChordMapImpl_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize);
/*****************************************************************************
* IDirectMusicComposerImpl implementation structure
*/
struct IDirectMusicComposerImpl
{
struct IDirectMusicComposerImpl {
/* IUnknown fields */
ICOM_VFIELD(IDirectMusicComposer);
DWORD ref;
@ -126,175 +137,198 @@ extern HRESULT WINAPI IDirectMusicComposerImpl_ComposeTemplateFromShape (LPDIREC
extern HRESULT WINAPI IDirectMusicComposerImpl_ChangeChordMap (LPDIRECTMUSICCOMPOSER iface, IDirectMusicSegment* pSegment, BOOL fTrackScale, IDirectMusicChordMap* pChordMap);
/*****************************************************************************
* IDirectMusicChordMapObject implementation structure
*/
struct IDirectMusicChordMapObject
{
/* IUnknown fields */
ICOM_VFIELD(IDirectMusicObject);
DWORD ref;
/* IDirectMusicObjectImpl fields */
LPDMUS_OBJECTDESC pDesc;
IDirectMusicChordMapObjectStream* pStream;
IDirectMusicChordMapImpl* pChordMap;
};
/* IUnknown: */
extern HRESULT WINAPI IDirectMusicChordMapObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicChordMapObject_AddRef (LPDIRECTMUSICOBJECT iface);
extern ULONG WINAPI IDirectMusicChordMapObject_Release (LPDIRECTMUSICOBJECT iface);
/* IDirectMusicObject: */
extern HRESULT WINAPI IDirectMusicChordMapObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc);
extern HRESULT WINAPI IDirectMusicChordMapObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc);
extern HRESULT WINAPI IDirectMusicChordMapObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc);
/*****************************************************************************
* IDirectMusicChordMapObjectStream implementation structure
*/
struct IDirectMusicChordMapObjectStream
{
/* IUnknown fields */
ICOM_VFIELD (IPersistStream);
DWORD ref;
/* IPersistStreamImpl fields */
IDirectMusicChordMapObject* pParentObject;
};
/* IUnknown: */
extern HRESULT WINAPI IDirectMusicChordMapObjectStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject);
extern ULONG WINAPI IDirectMusicChordMapObjectStream_AddRef (LPPERSISTSTREAM iface);
extern ULONG WINAPI IDirectMusicChordMapObjectStream_Release (LPPERSISTSTREAM iface);
/* IPersist: */
extern HRESULT WINAPI IDirectMusicChordMapObjectStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID);
/* IPersistStream: */
extern HRESULT WINAPI IDirectMusicChordMapObjectStream_IsDirty (LPPERSISTSTREAM iface);
extern HRESULT WINAPI IDirectMusicChordMapObjectStream_Load (LPPERSISTSTREAM iface, IStream* pStm);
extern HRESULT WINAPI IDirectMusicChordMapObjectStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty);
extern HRESULT WINAPI IDirectMusicChordMapObjectStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize);
/*****************************************************************************
* IDirectMusicChordMapTrack implementation structure
*/
struct IDirectMusicChordMapTrack
{
struct IDirectMusicChordMapTrack {
/* IUnknown fields */
ICOM_VFIELD(IDirectMusicTrack8);
ICOM_VTABLE(IUnknown) *UnknownVtbl;
ICOM_VTABLE(IDirectMusicTrack8) *TrackVtbl;
ICOM_VTABLE(IPersistStream) *PersistStreamVtbl;
DWORD ref;
/* IDirectMusicChordMapTrack fields */
IDirectMusicChordMapTrackStream* pStream;
LPDMUS_OBJECTDESC pDesc;
};
/* IUnknown: */
extern HRESULT WINAPI IDirectMusicChordMapTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicChordMapTrack_AddRef (LPDIRECTMUSICTRACK8 iface);
extern ULONG WINAPI IDirectMusicChordMapTrack_Release (LPDIRECTMUSICTRACK8 iface);
/* IDirectMusicTrack: */
extern HRESULT WINAPI IDirectMusicChordMapTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment);
extern HRESULT WINAPI IDirectMusicChordMapTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags);
extern HRESULT WINAPI IDirectMusicChordMapTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData);
extern HRESULT WINAPI IDirectMusicChordMapTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID);
extern HRESULT WINAPI IDirectMusicChordMapTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam);
extern HRESULT WINAPI IDirectMusicChordMapTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam);
extern HRESULT WINAPI IDirectMusicChordMapTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType);
extern HRESULT WINAPI IDirectMusicChordMapTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType);
extern HRESULT WINAPI IDirectMusicChordMapTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType);
extern HRESULT WINAPI IDirectMusicChordMapTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack);
/* IDirectMusicTrack8: */
extern HRESULT WINAPI IDirectMusicChordMapTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID);
extern HRESULT WINAPI IDirectMusicChordMapTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags);
extern HRESULT WINAPI IDirectMusicChordMapTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags);
extern HRESULT WINAPI IDirectMusicChordMapTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack);
extern HRESULT WINAPI IDirectMusicChordMapTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack);
/*****************************************************************************
* IDirectMusicChordMapTrackStream implementation structure
*/
struct IDirectMusicChordMapTrackStream
{
/* IUnknown fields */
ICOM_VFIELD (IPersistStream);
DWORD ref;
/* IPersistStreamImpl fields */
IDirectMusicChordMapTrack* pParentTrack;
};
/* IUnknown: */
extern HRESULT WINAPI IDirectMusicChordMapTrackStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject);
extern ULONG WINAPI IDirectMusicChordMapTrackStream_AddRef (LPPERSISTSTREAM iface);
extern ULONG WINAPI IDirectMusicChordMapTrackStream_Release (LPPERSISTSTREAM iface);
/* IPersist: */
extern HRESULT WINAPI IDirectMusicChordMapTrackStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID);
extern HRESULT WINAPI IDirectMusicChordMapTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicChordMapTrack_IUnknown_AddRef (LPUNKNOWN iface);
extern ULONG WINAPI IDirectMusicChordMapTrack_IUnknown_Release (LPUNKNOWN iface);
/* IDirectMusicTrack(8): */
extern HRESULT WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface);
extern ULONG WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface);
extern HRESULT WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment);
extern HRESULT WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags);
extern HRESULT WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData);
extern HRESULT WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID);
extern HRESULT WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam);
extern HRESULT WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam);
extern HRESULT WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType);
extern HRESULT WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType);
extern HRESULT WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType);
extern HRESULT WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack);
extern HRESULT WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID);
extern HRESULT WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags);
extern HRESULT WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags);
extern HRESULT WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack);
extern HRESULT WINAPI IDirectMusicChordMapTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack);
/* IPersistStream: */
extern HRESULT WINAPI IDirectMusicChordMapTrackStream_IsDirty (LPPERSISTSTREAM iface);
extern HRESULT WINAPI IDirectMusicChordMapTrackStream_Load (LPPERSISTSTREAM iface, IStream* pStm);
extern HRESULT WINAPI IDirectMusicChordMapTrackStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty);
extern HRESULT WINAPI IDirectMusicChordMapTrackStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize);
extern HRESULT WINAPI IDirectMusicChordMapTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject);
extern ULONG WINAPI IDirectMusicChordMapTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface);
extern ULONG WINAPI IDirectMusicChordMapTrack_IPersistStream_Release (LPPERSISTSTREAM iface);
extern HRESULT WINAPI IDirectMusicChordMapTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID);
extern HRESULT WINAPI IDirectMusicChordMapTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface);
extern HRESULT WINAPI IDirectMusicChordMapTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm);
extern HRESULT WINAPI IDirectMusicChordMapTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty);
extern HRESULT WINAPI IDirectMusicChordMapTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize);
/*****************************************************************************
* IDirectMusicSignPostTrack implementation structure
*/
struct IDirectMusicSignPostTrack
{
struct IDirectMusicSignPostTrack {
/* IUnknown fields */
ICOM_VFIELD(IDirectMusicTrack8);
ICOM_VTABLE(IUnknown) *UnknownVtbl;
ICOM_VTABLE(IDirectMusicTrack8) *TrackVtbl;
ICOM_VTABLE(IPersistStream) *PersistStreamVtbl;
DWORD ref;
/* IDirectMusicSignPostTrack fields */
IDirectMusicSignPostTrackStream* pStream;
LPDMUS_OBJECTDESC pDesc;
};
/* IUnknown: */
extern HRESULT WINAPI IDirectMusicSignPostTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicSignPostTrack_AddRef (LPDIRECTMUSICTRACK8 iface);
extern ULONG WINAPI IDirectMusicSignPostTrack_Release (LPDIRECTMUSICTRACK8 iface);
/* IDirectMusicTrack: */
extern HRESULT WINAPI IDirectMusicSignPostTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment);
extern HRESULT WINAPI IDirectMusicSignPostTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags);
extern HRESULT WINAPI IDirectMusicSignPostTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData);
extern HRESULT WINAPI IDirectMusicSignPostTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID);
extern HRESULT WINAPI IDirectMusicSignPostTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam);
extern HRESULT WINAPI IDirectMusicSignPostTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam);
extern HRESULT WINAPI IDirectMusicSignPostTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType);
extern HRESULT WINAPI IDirectMusicSignPostTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType);
extern HRESULT WINAPI IDirectMusicSignPostTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType);
extern HRESULT WINAPI IDirectMusicSignPostTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack);
/* IDirectMusicTrack8: */
extern HRESULT WINAPI IDirectMusicSignPostTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID);
extern HRESULT WINAPI IDirectMusicSignPostTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags);
extern HRESULT WINAPI IDirectMusicSignPostTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags);
extern HRESULT WINAPI IDirectMusicSignPostTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack);
extern HRESULT WINAPI IDirectMusicSignPostTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack);
extern HRESULT WINAPI IDirectMusicSignPostTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicSignPostTrack_IUnknown_AddRef (LPUNKNOWN iface);
extern ULONG WINAPI IDirectMusicSignPostTrack_IUnknown_Release (LPUNKNOWN iface);
/* IDirectMusicTrack(8): */
extern HRESULT WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface);
extern ULONG WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface);
extern HRESULT WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment);
extern HRESULT WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags);
extern HRESULT WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData);
extern HRESULT WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID);
extern HRESULT WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam);
extern HRESULT WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam);
extern HRESULT WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType);
extern HRESULT WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType);
extern HRESULT WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType);
extern HRESULT WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack);
extern HRESULT WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID);
extern HRESULT WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags);
extern HRESULT WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags);
extern HRESULT WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack);
extern HRESULT WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack);
/* IPersistStream: */
extern HRESULT WINAPI IDirectMusicSignPostTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject);
extern ULONG WINAPI IDirectMusicSignPostTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface);
extern ULONG WINAPI IDirectMusicSignPostTrack_IPersistStream_Release (LPPERSISTSTREAM iface);
extern HRESULT WINAPI IDirectMusicSignPostTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID);
extern HRESULT WINAPI IDirectMusicSignPostTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface);
extern HRESULT WINAPI IDirectMusicSignPostTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm);
extern HRESULT WINAPI IDirectMusicSignPostTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty);
extern HRESULT WINAPI IDirectMusicSignPostTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize);
/*****************************************************************************
* IDirectMusicSignPostTrackStream implementation structure
* Misc.
*/
struct IDirectMusicSignPostTrackStream
{
/* IUnknown fields */
ICOM_VFIELD (IPersistStream);
DWORD ref;
/* for simpler reading */
typedef struct _DMUS_PRIVATE_CHUNK {
FOURCC fccID; /* FOURCC ID of the chunk */
DWORD dwSize; /* size of the chunk */
} DMUS_PRIVATE_CHUNK, *LPDMUS_PRIVATE_CHUNK;
/* IPersistStreamImpl fields */
IDirectMusicSignPostTrack* pParentTrack;
};
/* check whether the given DWORD is even (return 0) or odd (return 1) */
static inline int even_or_odd (DWORD number) {
return (number & 0x1); /* basically, check if bit 0 is set ;) */
}
/* IUnknown: */
extern HRESULT WINAPI IDirectMusicSignPostTrackStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject);
extern ULONG WINAPI IDirectMusicSignPostTrackStream_AddRef (LPPERSISTSTREAM iface);
extern ULONG WINAPI IDirectMusicSignPostTrackStream_Release (LPPERSISTSTREAM iface);
/* IPersist: */
extern HRESULT WINAPI IDirectMusicSignPostTrackStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID);
/* IPersistStream: */
extern HRESULT WINAPI IDirectMusicSignPostTrackStream_IsDirty (LPPERSISTSTREAM iface);
extern HRESULT WINAPI IDirectMusicSignPostTrackStream_Load (LPPERSISTSTREAM iface, IStream* pStm);
extern HRESULT WINAPI IDirectMusicSignPostTrackStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty);
extern HRESULT WINAPI IDirectMusicSignPostTrackStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize);
/* FOURCC to string conversion for debug messages */
static inline const char *debugstr_fourcc (DWORD fourcc) {
if (!fourcc) return "'null'";
return wine_dbg_sprintf ("\'%c%c%c%c\'",
(char)(fourcc), (char)(fourcc >> 8),
(char)(fourcc >> 16), (char)(fourcc >> 24));
}
/* DMUS_VERSION struct to string conversion for debug messages */
static inline const char *debugstr_dmversion (LPDMUS_VERSION version) {
if (!version) return "'null'";
return wine_dbg_sprintf ("\'%i,%i,%i,%i\'",
(int)((version->dwVersionMS && 0xFFFF0000) >> 8), (int)(version->dwVersionMS && 0x0000FFFF),
(int)((version->dwVersionLS && 0xFFFF0000) >> 8), (int)(version->dwVersionLS && 0x0000FFFF));
}
/* used for initialising structs (primarily for DMUS_OBJECTDESC) */
#define DM_STRUCT_INIT(x) \
do { \
memset((x), 0, sizeof(*(x))); \
(x)->dwSize = sizeof(*x); \
} while (0)
/* used for generic dumping (copied from ddraw) */
typedef struct {
DWORD val;
const char* name;
} flag_info;
/* generic dump function */
static inline void DMUSIC_dump_flags_ (DWORD flags, const flag_info* names, size_t num_names, int newline) {
unsigned int i;
for (i=0; i < num_names; i++) {
if ((flags & names[i].val) || /* standard flag value */
((!flags) && (!names[i].val))) /* zero value only */
DPRINTF("%s ", names[i].name);
}
if (newline) DPRINTF("\n");
}
#define FE(x) { x, #x }
#define DMUSIC_dump_flags(flags,names,num_names) DMUSIC_dump_flags_(flags, names, num_names, 1)
static inline void DMUSIC_dump_DMUS_OBJ_FLAGS (DWORD flagmask) {
static const flag_info flags[] = {
FE(DMUS_OBJ_OBJECT),
FE(DMUS_OBJ_CLASS),
FE(DMUS_OBJ_NAME),
FE(DMUS_OBJ_CATEGORY),
FE(DMUS_OBJ_FILENAME),
FE(DMUS_OBJ_FULLPATH),
FE(DMUS_OBJ_URL),
FE(DMUS_OBJ_VERSION),
FE(DMUS_OBJ_DATE),
FE(DMUS_OBJ_LOADED),
FE(DMUS_OBJ_MEMORY),
FE(DMUS_OBJ_STREAM)
};
DMUSIC_dump_flags(flagmask, flags, sizeof(flags)/sizeof(flags[0]));
}
static inline void DMUSIC_dump_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) {
if (pDesc) {
DPRINTF("DMUS_OBJECTDESC (%p)\n", pDesc);
DPRINTF(" - dwSize = %ld\n", pDesc->dwSize);
DPRINTF(" - dwValidData = ");
DMUSIC_dump_DMUS_OBJ_FLAGS (pDesc->dwValidData);
if (pDesc->dwValidData & DMUS_OBJ_CLASS) DPRINTF(" - guidClass = %s\n", debugstr_guid(&pDesc->guidClass));
if (pDesc->dwValidData & DMUS_OBJ_OBJECT) DPRINTF(" - guidObject = %s\n", debugstr_guid(&pDesc->guidObject));
if (pDesc->dwValidData & DMUS_OBJ_DATE) DPRINTF(" - ftDate = FIXME\n");
if (pDesc->dwValidData & DMUS_OBJ_VERSION) DPRINTF(" - vVersion = %s\n", debugstr_dmversion(&pDesc->vVersion));
if (pDesc->dwValidData & DMUS_OBJ_NAME) DPRINTF(" - wszName = %s\n", debugstr_w(pDesc->wszName));
if (pDesc->dwValidData & DMUS_OBJ_CATEGORY) DPRINTF(" - wszCategory = %s\n", debugstr_w(pDesc->wszCategory));
if (pDesc->dwValidData & DMUS_OBJ_FILENAME) DPRINTF(" - wszFileName = %s\n", debugstr_w(pDesc->wszFileName));
if (pDesc->dwValidData & DMUS_OBJ_MEMORY) DPRINTF(" - llMemLength = %lli\n - pbMemData = %p\n", pDesc->llMemLength, pDesc->pbMemData);
if (pDesc->dwValidData & DMUS_OBJ_STREAM) DPRINTF(" - pStream = %p\n", pDesc->pStream);
} else {
DPRINTF("(NULL)\n");
}
}
#endif /* __WINE_DMCOMPOS_PRIVATE_H */

View File

@ -18,21 +18,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdarg.h>
#include <string.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winreg.h"
#include "winerror.h"
#include "dmusics.h"
#include "dmusici.h"
#include "dmplugin.h"
#include "wine/debug.h"
#include "dmcompos_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmcompos);
@ -44,8 +30,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(dmcompos);
/***********************************************************************
* interface for self-registering
*/
struct regsvr_interface
{
struct regsvr_interface {
IID const *iid; /* NULL for end of list */
LPCSTR name; /* can be NULL to omit */
IID const *base_iid; /* can be NULL to omit */
@ -57,8 +42,7 @@ struct regsvr_interface
static HRESULT register_interfaces(struct regsvr_interface const *list);
static HRESULT unregister_interfaces(struct regsvr_interface const *list);
struct regsvr_coclass
{
struct regsvr_coclass {
CLSID const *clsid; /* NULL for end of list */
LPCSTR name; /* can be NULL to omit */
LPCSTR ips; /* can be NULL to omit */
@ -124,8 +108,7 @@ static LONG recursive_delete_keyW(HKEY base, WCHAR const *name);
/***********************************************************************
* register_interfaces
*/
static HRESULT register_interfaces(struct regsvr_interface const *list)
{
static HRESULT register_interfaces(struct regsvr_interface const *list) {
LONG res = ERROR_SUCCESS;
HKEY interface_key;
@ -194,8 +177,7 @@ error_return:
/***********************************************************************
* unregister_interfaces
*/
static HRESULT unregister_interfaces(struct regsvr_interface const *list)
{
static HRESULT unregister_interfaces(struct regsvr_interface const *list) {
LONG res = ERROR_SUCCESS;
HKEY interface_key;
@ -219,8 +201,7 @@ error_return:
/***********************************************************************
* register_coclasses
*/
static HRESULT register_coclasses(struct regsvr_coclass const *list)
{
static HRESULT register_coclasses(struct regsvr_coclass const *list) {
LONG res = ERROR_SUCCESS;
HKEY coclass_key;
@ -301,8 +282,7 @@ error_return:
/***********************************************************************
* unregister_coclasses
*/
static HRESULT unregister_coclasses(struct regsvr_coclass const *list)
{
static HRESULT unregister_coclasses(struct regsvr_coclass const *list) {
LONG res = ERROR_SUCCESS;
HKEY coclass_key;
@ -338,8 +318,7 @@ error_return:
/***********************************************************************
* regsvr_key_guid
*/
static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid)
{
static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid) {
WCHAR buf[39];
StringFromGUID2(guid, buf, 39);
@ -352,8 +331,7 @@ static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid)
static LONG register_key_defvalueW(
HKEY base,
WCHAR const *name,
WCHAR const *value)
{
WCHAR const *value) {
LONG res;
HKEY key;
@ -372,8 +350,7 @@ static LONG register_key_defvalueW(
static LONG register_key_defvalueA(
HKEY base,
WCHAR const *name,
char const *value)
{
char const *value) {
LONG res;
HKEY key;
@ -394,8 +371,7 @@ static LONG register_progid(
char const *progid,
char const *curver_progid,
char const *name,
char const *extra)
{
char const *extra) {
LONG res;
HKEY progid_key;
@ -439,8 +415,7 @@ error_close_progid_key:
/***********************************************************************
* recursive_delete_key
*/
static LONG recursive_delete_key(HKEY key)
{
static LONG recursive_delete_key(HKEY key) {
LONG res;
WCHAR subkey_name[MAX_PATH];
DWORD cName;
@ -471,8 +446,7 @@ static LONG recursive_delete_key(HKEY key)
/***********************************************************************
* recursive_delete_keyA
*/
static LONG recursive_delete_keyA(HKEY base, char const *name)
{
static LONG recursive_delete_keyA(HKEY base, char const *name) {
LONG res;
HKEY key;
@ -487,8 +461,7 @@ static LONG recursive_delete_keyA(HKEY base, char const *name)
/***********************************************************************
* recursive_delete_keyW
*/
static LONG recursive_delete_keyW(HKEY base, WCHAR const *name)
{
static LONG recursive_delete_keyW(HKEY base, WCHAR const *name) {
LONG res;
HKEY key;
@ -558,8 +531,7 @@ static struct regsvr_interface const interface_list[] = {
/***********************************************************************
* DllRegisterServer (DMCOMPOS.3)
*/
HRESULT WINAPI DMCOMPOS_DllRegisterServer(void)
{
HRESULT WINAPI DMCOMPOS_DllRegisterServer(void) {
HRESULT hr;
TRACE("\n");
@ -573,8 +545,7 @@ HRESULT WINAPI DMCOMPOS_DllRegisterServer(void)
/***********************************************************************
* DllUnregisterServer (DMCOMPOS.4)
*/
HRESULT WINAPI DMCOMPOS_DllUnregisterServer(void)
{
HRESULT WINAPI DMCOMPOS_DllUnregisterServer(void) {
HRESULT hr;
TRACE("\n");

View File

@ -1,6 +1,6 @@
/* IDirectMusicSignPostTrack Implementation
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -17,14 +17,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "dmcompos_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmcompos);
@ -34,19 +26,21 @@ WINE_DECLARE_DEBUG_CHANNEL(dmfile);
* IDirectMusicSignPostTrack implementation
*/
/* IDirectMusicSignPostTrack IUnknown part: */
HRESULT WINAPI IDirectMusicSignPostTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicSignPostTrack,iface);
HRESULT WINAPI IDirectMusicSignPostTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicSignPostTrack, UnknownVtbl, iface);
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IDirectMusicTrack) ||
IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
IDirectMusicSignPostTrack_AddRef(iface);
*ppobj = This;
if (IsEqualIID (riid, &IID_IUnknown)) {
*ppobj = (LPUNKNOWN)&This->UnknownVtbl;
IDirectMusicSignPostTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicTrack)
|| IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
*ppobj = (LPDIRECTMUSICTRACK8)&This->TrackVtbl;
IDirectMusicSignPostTrack_IDirectMusicTrack_AddRef ((LPDIRECTMUSICTRACK8)&This->TrackVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicSignPostTrackStream_AddRef ((LPPERSISTSTREAM)This->pStream);
*ppobj = This->pStream;
*ppobj = (LPPERSISTSTREAM)&This->PersistStreamVtbl;
IDirectMusicSignPostTrack_IPersistStream_AddRef ((LPPERSISTSTREAM)&This->PersistStreamVtbl);
return S_OK;
}
@ -54,16 +48,14 @@ HRESULT WINAPI IDirectMusicSignPostTrack_QueryInterface (LPDIRECTMUSICTRACK8 ifa
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicSignPostTrack_AddRef (LPDIRECTMUSICTRACK8 iface)
{
ICOM_THIS(IDirectMusicSignPostTrack,iface);
ULONG WINAPI IDirectMusicSignPostTrack_IUnknown_AddRef (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicSignPostTrack, UnknownVtbl, iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicSignPostTrack_Release (LPDIRECTMUSICTRACK8 iface)
{
ICOM_THIS(IDirectMusicSignPostTrack,iface);
ULONG WINAPI IDirectMusicSignPostTrack_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicSignPostTrack, UnknownVtbl, iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
@ -72,269 +64,211 @@ ULONG WINAPI IDirectMusicSignPostTrack_Release (LPDIRECTMUSICTRACK8 iface)
return ref;
}
/* IDirectMusicSignPostTrack IDirectMusicTrack part: */
HRESULT WINAPI IDirectMusicSignPostTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment)
{
ICOM_THIS(IDirectMusicSignPostTrack,iface);
ICOM_VTABLE(IUnknown) DirectMusicSignPostTrack_Unknown_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicSignPostTrack_IUnknown_QueryInterface,
IDirectMusicSignPostTrack_IUnknown_AddRef,
IDirectMusicSignPostTrack_IUnknown_Release
};
/* IDirectMusicSignPostTrack IDirectMusicTrack8 part: */
HRESULT WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicSignPostTrack, TrackVtbl, iface);
return IDirectMusicSignPostTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface) {
ICOM_THIS_MULTI(IDirectMusicSignPostTrack, TrackVtbl, iface);
return IDirectMusicSignPostTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface) {
ICOM_THIS_MULTI(IDirectMusicSignPostTrack, TrackVtbl, iface);
return IDirectMusicSignPostTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment) {
ICOM_THIS_MULTI(IDirectMusicSignPostTrack, TrackVtbl, iface);
FIXME("(%p, %p): stub\n", This, pSegment);
return S_OK;
}
HRESULT WINAPI IDirectMusicSignPostTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicSignPostTrack,iface);
HRESULT WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicSignPostTrack, TrackVtbl, iface);
FIXME("(%p, %p, %p, %p, %ld, %ld): stub\n", This, pSegmentState, pPerformance, ppStateData, dwVirtualTrack8ID, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicSignPostTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData)
{
ICOM_THIS(IDirectMusicSignPostTrack,iface);
HRESULT WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData) {
ICOM_THIS_MULTI(IDirectMusicSignPostTrack, TrackVtbl, iface);
FIXME("(%p, %p): stub\n", This, pStateData);
return S_OK;
}
HRESULT WINAPI IDirectMusicSignPostTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
{
HRESULT WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID) {
ICOM_THIS(IDirectMusicSignPostTrack,iface);
FIXME("(%p, %p, %ld, %ld, %ld, %ld, %p, %p, %ld): stub\n", This, pStateData, mtStart, mtEnd, mtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
return S_OK;
}
HRESULT WINAPI IDirectMusicSignPostTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam)
{
ICOM_THIS(IDirectMusicSignPostTrack,iface);
HRESULT WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam) {
ICOM_THIS_MULTI(IDirectMusicSignPostTrack, TrackVtbl, iface);
FIXME("(%p, %s, %ld, %p, %p): stub\n", This, debugstr_guid(rguidType), mtTime, pmtNext, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicSignPostTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam)
{
ICOM_THIS(IDirectMusicSignPostTrack,iface);
HRESULT WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam) {
ICOM_THIS_MULTI(IDirectMusicSignPostTrack, TrackVtbl, iface);
FIXME("(%p, %s, %ld, %p): stub\n", This, debugstr_guid(rguidType), mtTime, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicSignPostTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType)
{
ICOM_THIS(IDirectMusicSignPostTrack,iface);
HRESULT WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType) {
ICOM_THIS_MULTI(IDirectMusicSignPostTrack, TrackVtbl, iface);
TRACE("(%p, %s): ", This, debugstr_guid(rguidType));
/* didn't find any params */
TRACE("param unsupported\n");
return DMUS_E_TYPE_UNSUPPORTED;
}
HRESULT WINAPI IDirectMusicSignPostTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType)
{
ICOM_THIS(IDirectMusicSignPostTrack,iface);
HRESULT WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
ICOM_THIS_MULTI(IDirectMusicSignPostTrack, TrackVtbl, iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
return S_OK;
}
HRESULT WINAPI IDirectMusicSignPostTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType)
{
ICOM_THIS(IDirectMusicSignPostTrack,iface);
HRESULT WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
ICOM_THIS_MULTI(IDirectMusicSignPostTrack, TrackVtbl, iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
return S_OK;
}
HRESULT WINAPI IDirectMusicSignPostTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack)
{
ICOM_THIS(IDirectMusicSignPostTrack,iface);
HRESULT WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack) {
ICOM_THIS_MULTI(IDirectMusicSignPostTrack, TrackVtbl, iface);
FIXME("(%p, %ld, %ld, %p): stub\n", This, mtStart, mtEnd, ppTrack);
return S_OK;
}
/* IDirectMusicSignPostTrack IDirectMusicTrack8 part: */
HRESULT WINAPI IDirectMusicSignPostTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
{
ICOM_THIS(IDirectMusicSignPostTrack,iface);
HRESULT WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID) {
ICOM_THIS_MULTI(IDirectMusicSignPostTrack, TrackVtbl, iface);
FIXME("(%p, %p, %lli, %lli, %lli, %ld, %p, %p, %ld): stub\n", This, pStateData, rtStart, rtEnd, rtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
return S_OK;
}
HRESULT WINAPI IDirectMusicSignPostTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicSignPostTrack,iface);
HRESULT WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicSignPostTrack, TrackVtbl, iface);
FIXME("(%p, %s, %lli, %p, %p, %p, %ld): stub\n", This, debugstr_guid(rguidType), rtTime, prtNext, pParam, pStateData, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicSignPostTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicSignPostTrack,iface);
HRESULT WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicSignPostTrack, TrackVtbl, iface);
FIXME("(%p, %s, %lli, %p, %p, %ld): stub\n", This, debugstr_guid(rguidType), rtTime, pParam, pStateData, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicSignPostTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack)
{
HRESULT WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
ICOM_THIS(IDirectMusicSignPostTrack,iface);
FIXME("(%p, %p, %ld, %p): stub\n", This, pContext, dwTrackGroup, ppResultTrack);
return S_OK;
}
HRESULT WINAPI IDirectMusicSignPostTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack)
{
ICOM_THIS(IDirectMusicSignPostTrack,iface);
HRESULT WINAPI IDirectMusicSignPostTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
ICOM_THIS_MULTI(IDirectMusicSignPostTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %p, %ld, %p): stub\n", This, pNewTrack, mtJoin, pContext, dwTrackGroup, ppResultTrack);
return S_OK;
}
ICOM_VTABLE(IDirectMusicTrack8) DirectMusicSignPostTrack_Vtbl =
ICOM_VTABLE(IDirectMusicTrack8) DirectMusicSignPostTrack_Track_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicSignPostTrack_IDirectMusicTrack_QueryInterface,
IDirectMusicSignPostTrack_IDirectMusicTrack_AddRef,
IDirectMusicSignPostTrack_IDirectMusicTrack_Release,
IDirectMusicSignPostTrack_IDirectMusicTrack_Init,
IDirectMusicSignPostTrack_IDirectMusicTrack_InitPlay,
IDirectMusicSignPostTrack_IDirectMusicTrack_EndPlay,
IDirectMusicSignPostTrack_IDirectMusicTrack_Play,
IDirectMusicSignPostTrack_IDirectMusicTrack_GetParam,
IDirectMusicSignPostTrack_IDirectMusicTrack_SetParam,
IDirectMusicSignPostTrack_IDirectMusicTrack_IsParamSupported,
IDirectMusicSignPostTrack_IDirectMusicTrack_AddNotificationType,
IDirectMusicSignPostTrack_IDirectMusicTrack_RemoveNotificationType,
IDirectMusicSignPostTrack_IDirectMusicTrack_Clone,
IDirectMusicSignPostTrack_IDirectMusicTrack_PlayEx,
IDirectMusicSignPostTrack_IDirectMusicTrack_GetParamEx,
IDirectMusicSignPostTrack_IDirectMusicTrack_SetParamEx,
IDirectMusicSignPostTrack_IDirectMusicTrack_Compose,
IDirectMusicSignPostTrack_IDirectMusicTrack_Join
};
/* IDirectMusicSignPostTrack IPersistStream part: */
HRESULT WINAPI IDirectMusicSignPostTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicSignPostTrack, PersistStreamVtbl, iface);
return IDirectMusicSignPostTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicSignPostTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicSignPostTrack, PersistStreamVtbl, iface);
return IDirectMusicSignPostTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicSignPostTrack_IPersistStream_Release (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicSignPostTrack, PersistStreamVtbl, iface);
return IDirectMusicSignPostTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicSignPostTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicSignPostTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicSignPostTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm) {
ICOM_THIS_MULTI(IDirectMusicSignPostTrack, PersistStreamVtbl, iface);
FIXME("(%p, %p): Loading not implemented yet\n", This, pStm);
return S_OK;
}
HRESULT WINAPI IDirectMusicSignPostTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicSignPostTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) {
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicSignPostTrack_PersistStream_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicSignPostTrack_QueryInterface,
IDirectMusicSignPostTrack_AddRef,
IDirectMusicSignPostTrack_Release,
IDirectMusicSignPostTrack_Init,
IDirectMusicSignPostTrack_InitPlay,
IDirectMusicSignPostTrack_EndPlay,
IDirectMusicSignPostTrack_Play,
IDirectMusicSignPostTrack_GetParam,
IDirectMusicSignPostTrack_SetParam,
IDirectMusicSignPostTrack_IsParamSupported,
IDirectMusicSignPostTrack_AddNotificationType,
IDirectMusicSignPostTrack_RemoveNotificationType,
IDirectMusicSignPostTrack_Clone,
IDirectMusicSignPostTrack_PlayEx,
IDirectMusicSignPostTrack_GetParamEx,
IDirectMusicSignPostTrack_SetParamEx,
IDirectMusicSignPostTrack_Compose,
IDirectMusicSignPostTrack_Join
IDirectMusicSignPostTrack_IPersistStream_QueryInterface,
IDirectMusicSignPostTrack_IPersistStream_AddRef,
IDirectMusicSignPostTrack_IPersistStream_Release,
IDirectMusicSignPostTrack_IPersistStream_GetClassID,
IDirectMusicSignPostTrack_IPersistStream_IsDirty,
IDirectMusicSignPostTrack_IPersistStream_Load,
IDirectMusicSignPostTrack_IPersistStream_Save,
IDirectMusicSignPostTrack_IPersistStream_GetSizeMax
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicSignPostTrack (LPCGUID lpcGUID, LPDIRECTMUSICTRACK8 *ppTrack, LPUNKNOWN pUnkOuter)
{
HRESULT WINAPI DMUSIC_CreateDirectMusicSignPostTrack (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) {
IDirectMusicSignPostTrack* track;
if (IsEqualIID (lpcGUID, &IID_IDirectMusicTrack)
|| IsEqualIID (lpcGUID, &IID_IDirectMusicTrack8)) {
track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicSignPostTrack));
if (NULL == track) {
*ppTrack = (LPDIRECTMUSICTRACK8) NULL;
return E_OUTOFMEMORY;
}
track->lpVtbl = &DirectMusicSignPostTrack_Vtbl;
track->ref = 1;
track->pStream = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(IDirectMusicSignPostTrackStream));
track->pStream->lpVtbl = &DirectMusicSignPostTrackStream_Vtbl;
track->pStream->ref = 1;
track->pStream->pParentTrack = track;
*ppTrack = (LPDIRECTMUSICTRACK8) track;
return S_OK;
track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicSignPostTrack));
if (NULL == track) {
*ppobj = (LPVOID) NULL;
return E_OUTOFMEMORY;
}
track->UnknownVtbl = &DirectMusicSignPostTrack_Unknown_Vtbl;
track->TrackVtbl = &DirectMusicSignPostTrack_Track_Vtbl;
track->PersistStreamVtbl = &DirectMusicSignPostTrack_PersistStream_Vtbl;
track->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC));
DM_STRUCT_INIT(track->pDesc);
track->pDesc->dwValidData |= DMUS_OBJ_CLASS;
memcpy (&track->pDesc->guidClass, &CLSID_DirectMusicSignPostTrack, sizeof (CLSID));
track->ref = 0; /* will be inited by QueryInterface */
WARN("No interface found\n");
return E_NOINTERFACE;
return IDirectMusicSignPostTrack_IUnknown_QueryInterface ((LPUNKNOWN)&track->UnknownVtbl, lpcGUID, ppobj);
}
/*****************************************************************************
* IDirectMusicSignPostTrackStream implementation
*/
/* IDirectMusicSignPostTrackStream IUnknown part follow: */
HRESULT WINAPI IDirectMusicSignPostTrackStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicSignPostTrackStream,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicSignPostTrackStream_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicSignPostTrackStream_AddRef (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicSignPostTrackStream,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicSignPostTrackStream_Release (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicSignPostTrackStream,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicSignPostTrackStream IPersist part: */
HRESULT WINAPI IDirectMusicSignPostTrackStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID)
{
return E_NOTIMPL;
}
/* IDirectMusicSignPostTrackStream IPersistStream part: */
HRESULT WINAPI IDirectMusicSignPostTrackStream_IsDirty (LPPERSISTSTREAM iface)
{
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicSignPostTrackStream_Load (LPPERSISTSTREAM iface, IStream* pStm)
{
FIXME(": Loading not implemented yet\n");
return S_OK;
}
HRESULT WINAPI IDirectMusicSignPostTrackStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty)
{
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicSignPostTrackStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize)
{
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicSignPostTrackStream_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicSignPostTrackStream_QueryInterface,
IDirectMusicSignPostTrackStream_AddRef,
IDirectMusicSignPostTrackStream_Release,
IDirectMusicSignPostTrackStream_GetClassID,
IDirectMusicSignPostTrackStream_IsDirty,
IDirectMusicSignPostTrackStream_Load,
IDirectMusicSignPostTrackStream_Save,
IDirectMusicSignPostTrackStream_GetSizeMax
};

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 Rok Mandeljc <rok.mandeljc@gimb.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -18,10 +18,10 @@
#define WINE_FILEDESCRIPTION_STR "Wine DirectMusic Composer"
#define WINE_FILENAME_STR "dmcompos.dll"
#define WINE_FILEVERSION 4,8,1,881
#define WINE_FILEVERSION_STR "4.8.1.881"
#define WINE_PRODUCTVERSION 4,8,1,881
#define WINE_PRODUCTVERSION_STR "4.8"
#define WINE_FILEVERSION 4,9,0,900
#define WINE_FILEVERSION_STR "4.9.0.900"
#define WINE_PRODUCTVERSION 4,9,0,900
#define WINE_PRODUCTVERSION_STR "4.9"
#define WINE_PRODUCTNAME_STR "DirectX"
#include "wine/wine_common_ver.rc"

View File

@ -20,7 +20,6 @@ C_SRCS = \
segmentstate.c \
segtriggertrack.c \
seqtrack.c \
song.c \
sysextrack.c \
tempotrack.c \
timesigtrack.c \

View File

@ -1,6 +1,6 @@
/* IDirectMusicAudioPath Implementation
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -17,27 +17,33 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "dmime_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmime);
WINE_DECLARE_DEBUG_CHANNEL(dmfile);
/*****************************************************************************
* IDirectMusicAudioPathImpl implementation
*/
/* IDirectMusicAudioPath IUnknown part: */
HRESULT WINAPI IDirectMusicAudioPathImpl_QueryInterface (LPDIRECTMUSICAUDIOPATH iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicAudioPathImpl,iface);
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IDirectMusicAudioPath)) {
IDirectMusicAudioPathImpl_AddRef(iface);
*ppobj = This;
HRESULT WINAPI IDirectMusicAudioPathImpl_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicAudioPathImpl, UnknownVtbl, iface);
if (IsEqualIID (riid, &IID_IUnknown)) {
*ppobj = (LPVOID)&This->UnknownVtbl;
IDirectMusicAudioPathImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicAudioPath)) {
*ppobj = (LPVOID)&This->AudioPathVtbl;
IDirectMusicAudioPathImpl_IDirectMusicAudioPath_AddRef ((LPDIRECTMUSICAUDIOPATH)&This->AudioPathVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicObject)) {
*ppobj = (LPVOID)&This->ObjectVtbl;
IDirectMusicAudioPathImpl_IDirectMusicObject_AddRef ((LPDIRECTMUSICOBJECT)&This->ObjectVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IPersistStream)) {
*ppobj = (LPVOID)&This->PersistStreamVtbl;
IDirectMusicAudioPathImpl_IPersistStream_AddRef ((LPPERSISTSTREAM)&This->PersistStreamVtbl);
return S_OK;
}
@ -45,16 +51,14 @@ HRESULT WINAPI IDirectMusicAudioPathImpl_QueryInterface (LPDIRECTMUSICAUDIOPATH
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicAudioPathImpl_AddRef (LPDIRECTMUSICAUDIOPATH iface)
{
ICOM_THIS(IDirectMusicAudioPathImpl,iface);
ULONG WINAPI IDirectMusicAudioPathImpl_IUnknown_AddRef (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicAudioPathImpl, UnknownVtbl, iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicAudioPathImpl_Release (LPDIRECTMUSICAUDIOPATH iface)
{
ICOM_THIS(IDirectMusicAudioPathImpl,iface);
ULONG WINAPI IDirectMusicAudioPathImpl_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicAudioPathImpl, UnknownVtbl, iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
@ -63,10 +67,31 @@ ULONG WINAPI IDirectMusicAudioPathImpl_Release (LPDIRECTMUSICAUDIOPATH iface)
return ref;
}
/* IDirectMusicAudioPath IDirectMusicAudioPath part: */
HRESULT WINAPI IDirectMusicAudioPathImpl_GetObjectInPath (LPDIRECTMUSICAUDIOPATH iface, DWORD dwPChannel, DWORD dwStage, DWORD dwBuffer, REFGUID guidObject, WORD dwIndex, REFGUID iidInterface, void** ppObject)
{
ICOM_THIS(IDirectMusicAudioPathImpl,iface);
ICOM_VTABLE(IUnknown) DirectMusicAudioPath_Unknown_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicAudioPathImpl_IUnknown_QueryInterface,
IDirectMusicAudioPathImpl_IUnknown_AddRef,
IDirectMusicAudioPathImpl_IUnknown_Release
};
/* IDirectMusicAudioPathImpl IDirectMusicAudioPath part: */
HRESULT WINAPI IDirectMusicAudioPathImpl_IDirectMusicAudioPath_QueryInterface (LPDIRECTMUSICAUDIOPATH iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicAudioPathImpl, AudioPathVtbl, iface);
return IDirectMusicAudioPathImpl_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicAudioPathImpl_IDirectMusicAudioPath_AddRef (LPDIRECTMUSICAUDIOPATH iface) {
ICOM_THIS_MULTI(IDirectMusicAudioPathImpl, AudioPathVtbl, iface);
return IDirectMusicAudioPathImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicAudioPathImpl_IDirectMusicAudioPath_Release (LPDIRECTMUSICAUDIOPATH iface) {
ICOM_THIS_MULTI(IDirectMusicAudioPathImpl, AudioPathVtbl, iface);
return IDirectMusicAudioPathImpl_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicAudioPathImpl_IDirectMusicAudioPath_GetObjectInPath (LPDIRECTMUSICAUDIOPATH iface, DWORD dwPChannel, DWORD dwStage, DWORD dwBuffer, REFGUID guidObject, WORD dwIndex, REFGUID iidInterface, void** ppObject) {
ICOM_THIS_MULTI(IDirectMusicAudioPathImpl, AudioPathVtbl, iface);
FIXME("(%p, %ld, %ld, %ld, %s, %d, %s, %p): stub\n", This, dwPChannel, dwStage, dwBuffer, debugstr_guid(guidObject), dwIndex, debugstr_guid(iidInterface), ppObject);
@ -102,13 +127,11 @@ HRESULT WINAPI IDirectMusicAudioPathImpl_GetObjectInPath (LPDIRECTMUSICAUDIOPATH
if (IsEqualIID (iidInterface, &IID_IDirectMusicGraph)) {
if (NULL == This->pToolGraph) {
IDirectMusicGraphImpl* pGraph;
pGraph = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicGraphImpl));
pGraph->lpVtbl = &DirectMusicGraph_Vtbl;
pGraph->ref = 1;
DMUSIC_CreateDirectMusicGraphImpl (&IID_IDirectMusicGraph, (LPVOID*)&pGraph, NULL);
This->pToolGraph = (IDirectMusicGraph*) pGraph;
}
*ppObject = (LPDIRECTMUSICGRAPH) This->pToolGraph;
IDirectMusicGraphImpl_AddRef((LPDIRECTMUSICGRAPH) *ppObject);
IDirectMusicGraph_AddRef((LPDIRECTMUSICGRAPH) *ppObject);
return S_OK;
}
}
@ -135,12 +158,10 @@ HRESULT WINAPI IDirectMusicAudioPathImpl_GetObjectInPath (LPDIRECTMUSICAUDIOPATH
IDirectMusicPerformance8Impl_GetGraph((LPDIRECTMUSICPERFORMANCE8) This->pPerf, &pPerfoGraph);
if (NULL == pPerfoGraph) {
IDirectMusicGraphImpl* pGraph = NULL;
pGraph = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicGraphImpl));
pGraph->lpVtbl = &DirectMusicGraph_Vtbl;
pGraph->ref = 1;
DMUSIC_CreateDirectMusicGraphImpl (&IID_IDirectMusicGraph, (LPVOID*)&pGraph, NULL);
IDirectMusicPerformance8Impl_SetGraph((LPDIRECTMUSICPERFORMANCE8) This->pPerf, (IDirectMusicGraph*) pGraph);
/* we need release as SetGraph do an AddRef */
IDirectMusicGraphImpl_Release((LPDIRECTMUSICGRAPH) pGraph);
IDirectMusicGraph_Release((LPDIRECTMUSICGRAPH) pGraph);
pPerfoGraph = (LPDIRECTMUSICGRAPH) pGraph;
}
*ppObject = (LPDIRECTMUSICGRAPH) pPerfoGraph;
@ -157,256 +178,467 @@ HRESULT WINAPI IDirectMusicAudioPathImpl_GetObjectInPath (LPDIRECTMUSICAUDIOPATH
return E_INVALIDARG;
}
HRESULT WINAPI IDirectMusicAudioPathImpl_Activate (LPDIRECTMUSICAUDIOPATH iface, BOOL fActivate)
{
ICOM_THIS(IDirectMusicAudioPathImpl,iface);
HRESULT WINAPI IDirectMusicAudioPathImpl_IDirectMusicAudioPath_Activate (LPDIRECTMUSICAUDIOPATH iface, BOOL fActivate) {
ICOM_THIS_MULTI(IDirectMusicAudioPathImpl, AudioPathVtbl, iface);
FIXME("(%p, %d): stub\n", This, fActivate);
return S_OK;
}
HRESULT WINAPI IDirectMusicAudioPathImpl_SetVolume (LPDIRECTMUSICAUDIOPATH iface, long lVolume, DWORD dwDuration)
{
ICOM_THIS(IDirectMusicAudioPathImpl,iface);
HRESULT WINAPI IDirectMusicAudioPathImpl_IDirectMusicAudioPath_SetVolume (LPDIRECTMUSICAUDIOPATH iface, long lVolume, DWORD dwDuration) {
ICOM_THIS_MULTI(IDirectMusicAudioPathImpl, AudioPathVtbl, iface);
FIXME("(%p, %li, %ld): stub\n", This, lVolume, dwDuration);
return S_OK;
}
HRESULT WINAPI IDirectMusicAudioPathImpl_ConvertPChannel (LPDIRECTMUSICAUDIOPATH iface, DWORD dwPChannelIn, DWORD* pdwPChannelOut)
{
ICOM_THIS(IDirectMusicAudioPathImpl,iface);
HRESULT WINAPI IDirectMusicAudioPathImpl_IDirectMusicAudioPath_ConvertPChannel (LPDIRECTMUSICAUDIOPATH iface, DWORD dwPChannelIn, DWORD* pdwPChannelOut) {
ICOM_THIS_MULTI(IDirectMusicAudioPathImpl, AudioPathVtbl, iface);
FIXME("(%p, %ld, %p): stub\n", This, dwPChannelIn, pdwPChannelOut);
return S_OK;
}
ICOM_VTABLE(IDirectMusicAudioPath) DirectMusicAudioPath_AudioPath_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicAudioPathImpl_IDirectMusicAudioPath_QueryInterface,
IDirectMusicAudioPathImpl_IDirectMusicAudioPath_AddRef,
IDirectMusicAudioPathImpl_IDirectMusicAudioPath_Release,
IDirectMusicAudioPathImpl_IDirectMusicAudioPath_GetObjectInPath,
IDirectMusicAudioPathImpl_IDirectMusicAudioPath_Activate,
IDirectMusicAudioPathImpl_IDirectMusicAudioPath_SetVolume,
IDirectMusicAudioPathImpl_IDirectMusicAudioPath_ConvertPChannel
};
/* IDirectMusicAudioPathImpl IDirectMusicObject part: */
HRESULT WINAPI IDirectMusicAudioPathImpl_IDirectMusicObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicAudioPathImpl, ObjectVtbl, iface);
return IDirectMusicAudioPathImpl_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicAudioPathImpl_IDirectMusicObject_AddRef (LPDIRECTMUSICOBJECT iface) {
ICOM_THIS_MULTI(IDirectMusicAudioPathImpl, ObjectVtbl, iface);
return IDirectMusicAudioPathImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicAudioPathImpl_IDirectMusicObject_Release (LPDIRECTMUSICOBJECT iface) {
ICOM_THIS_MULTI(IDirectMusicAudioPathImpl, ObjectVtbl, iface);
return IDirectMusicAudioPathImpl_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicAudioPathImpl_IDirectMusicObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc) {
ICOM_THIS_MULTI(IDirectMusicAudioPathImpl, ObjectVtbl, iface);
TRACE("(%p, %p)\n", This, pDesc);
/* I think we shouldn't return pointer here since then values can be changed; it'd be a mess */
memcpy (pDesc, This->pDesc, This->pDesc->dwSize);
return S_OK;
}
HRESULT WINAPI IDirectMusicAudioPathImpl_IDirectMusicObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc) {
ICOM_THIS_MULTI(IDirectMusicAudioPathImpl, ObjectVtbl, iface);
TRACE("(%p, %p): setting descriptor:\n", This, pDesc);
if (TRACE_ON(dmime)) {
DMUSIC_dump_DMUS_OBJECTDESC (pDesc);
}
/* According to MSDN, we should copy only given values, not whole struct */
if (pDesc->dwValidData & DMUS_OBJ_OBJECT)
memcpy (&This->pDesc->guidObject, &pDesc->guidObject, sizeof (pDesc->guidObject));
if (pDesc->dwValidData & DMUS_OBJ_CLASS)
memcpy (&This->pDesc->guidClass, &pDesc->guidClass, sizeof (pDesc->guidClass));
if (pDesc->dwValidData & DMUS_OBJ_NAME)
strncpyW (This->pDesc->wszName, pDesc->wszName, DMUS_MAX_NAME);
if (pDesc->dwValidData & DMUS_OBJ_CATEGORY)
strncpyW (This->pDesc->wszCategory, pDesc->wszCategory, DMUS_MAX_CATEGORY);
if (pDesc->dwValidData & DMUS_OBJ_FILENAME)
strncpyW (This->pDesc->wszFileName, pDesc->wszFileName, DMUS_MAX_FILENAME);
if (pDesc->dwValidData & DMUS_OBJ_VERSION)
memcpy (&This->pDesc->vVersion, &pDesc->vVersion, sizeof (pDesc->vVersion));
if (pDesc->dwValidData & DMUS_OBJ_DATE)
memcpy (&This->pDesc->ftDate, &pDesc->ftDate, sizeof (pDesc->ftDate));
if (pDesc->dwValidData & DMUS_OBJ_MEMORY) {
memcpy (&This->pDesc->llMemLength, &pDesc->llMemLength, sizeof (pDesc->llMemLength));
memcpy (This->pDesc->pbMemData, pDesc->pbMemData, sizeof (pDesc->pbMemData));
}
if (pDesc->dwValidData & DMUS_OBJ_STREAM) {
/* according to MSDN, we copy the stream */
IStream_Clone (pDesc->pStream, &This->pDesc->pStream);
}
/* add new flags */
This->pDesc->dwValidData |= pDesc->dwValidData;
return S_OK;
}
ICOM_VTABLE(IDirectMusicAudioPath) DirectMusicAudioPath_Vtbl =
{
HRESULT WINAPI IDirectMusicAudioPathImpl_IDirectMusicObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc) {
ICOM_THIS_MULTI(IDirectMusicAudioPathImpl, ObjectVtbl, iface);
DMUS_PRIVATE_CHUNK Chunk;
DWORD StreamSize, StreamCount, ListSize[1], ListCount[1];
LARGE_INTEGER liMove; /* used when skipping chunks */
TRACE("(%p, %p, %p)\n", This, pStream, pDesc);
/* FIXME: should this be determined from stream? */
pDesc->dwValidData |= DMUS_OBJ_CLASS;
memcpy (&pDesc->guidClass, &CLSID_DirectMusicAudioPath, sizeof(CLSID));
IStream_Read (pStream, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
TRACE_(dmfile)(": %s chunk (size = 0x%04lx)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
switch (Chunk.fccID) {
case FOURCC_RIFF: {
IStream_Read (pStream, &Chunk.fccID, sizeof(FOURCC), NULL);
TRACE_(dmfile)(": RIFF chunk of type %s", debugstr_fourcc(Chunk.fccID));
StreamSize = Chunk.dwSize - sizeof(FOURCC);
StreamCount = 0;
if (Chunk.fccID == DMUS_FOURCC_AUDIOPATH_FORM) {
TRACE_(dmfile)(": audio path form\n");
do {
IStream_Read (pStream, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
StreamCount += sizeof(FOURCC) + sizeof(DWORD) + Chunk.dwSize;
TRACE_(dmfile)(": %s chunk (size = 0x%04lx)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
switch (Chunk.fccID) {
case DMUS_FOURCC_GUID_CHUNK: {
TRACE_(dmfile)(": GUID chunk\n");
pDesc->dwValidData |= DMUS_OBJ_OBJECT;
IStream_Read (pStream, &pDesc->guidObject, Chunk.dwSize, NULL);
break;
}
case DMUS_FOURCC_VERSION_CHUNK: {
TRACE_(dmfile)(": version chunk\n");
pDesc->dwValidData |= DMUS_OBJ_VERSION;
IStream_Read (pStream, &pDesc->vVersion, Chunk.dwSize, NULL);
break;
}
case DMUS_FOURCC_CATEGORY_CHUNK: {
TRACE_(dmfile)(": category chunk\n");
pDesc->dwValidData |= DMUS_OBJ_CATEGORY;
IStream_Read (pStream, pDesc->wszCategory, Chunk.dwSize, NULL);
break;
}
case FOURCC_LIST: {
IStream_Read (pStream, &Chunk.fccID, sizeof(FOURCC), NULL);
TRACE_(dmfile)(": LIST chunk of type %s", debugstr_fourcc(Chunk.fccID));
ListSize[0] = Chunk.dwSize - sizeof(FOURCC);
ListCount[0] = 0;
switch (Chunk.fccID) {
/* evil M$ UNFO list, which can (!?) contain INFO elements */
case DMUS_FOURCC_UNFO_LIST: {
TRACE_(dmfile)(": UNFO list\n");
do {
IStream_Read (pStream, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
ListCount[0] += sizeof(FOURCC) + sizeof(DWORD) + Chunk.dwSize;
TRACE_(dmfile)(": %s chunk (size = 0x%04lx)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
switch (Chunk.fccID) {
/* don't ask me why, but M$ puts INFO elements in UNFO list sometimes
(though strings seem to be valid unicode) */
case mmioFOURCC('I','N','A','M'):
case DMUS_FOURCC_UNAM_CHUNK: {
TRACE_(dmfile)(": name chunk\n");
pDesc->dwValidData |= DMUS_OBJ_NAME;
IStream_Read (pStream, pDesc->wszName, Chunk.dwSize, NULL);
break;
}
case mmioFOURCC('I','A','R','T'):
case DMUS_FOURCC_UART_CHUNK: {
TRACE_(dmfile)(": artist chunk (ignored)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','C','O','P'):
case DMUS_FOURCC_UCOP_CHUNK: {
TRACE_(dmfile)(": copyright chunk (ignored)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','S','B','J'):
case DMUS_FOURCC_USBJ_CHUNK: {
TRACE_(dmfile)(": subject chunk (ignored)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','C','M','T'):
case DMUS_FOURCC_UCMT_CHUNK: {
TRACE_(dmfile)(": comment chunk (ignored)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (irrevelant & skipping)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
TRACE_(dmfile)(": ListCount[0] = %ld < ListSize[0] = %ld\n", ListCount[0], ListSize[0]);
} while (ListCount[0] < ListSize[0]);
break;
}
default: {
TRACE_(dmfile)(": unknown (skipping)\n");
liMove.QuadPart = Chunk.dwSize - sizeof(FOURCC);
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (irrevelant & skipping)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
TRACE_(dmfile)(": StreamCount[0] = %ld < StreamSize[0] = %ld\n", StreamCount, StreamSize);
} while (StreamCount < StreamSize);
break;
} else {
TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
liMove.QuadPart = StreamSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */
return E_FAIL;
}
TRACE_(dmfile)(": reading finished\n");
break;
}
default: {
TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */
return DMUS_E_INVALIDFILE;
}
}
TRACE(": returning descriptor:\n");
if (TRACE_ON(dmime)) {
DMUSIC_dump_DMUS_OBJECTDESC (pDesc);
}
return S_OK;
}
ICOM_VTABLE(IDirectMusicObject) DirectMusicAudioPath_Object_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicAudioPathImpl_QueryInterface,
IDirectMusicAudioPathImpl_AddRef,
IDirectMusicAudioPathImpl_Release,
IDirectMusicAudioPathImpl_GetObjectInPath,
IDirectMusicAudioPathImpl_Activate,
IDirectMusicAudioPathImpl_SetVolume,
IDirectMusicAudioPathImpl_ConvertPChannel
IDirectMusicAudioPathImpl_IDirectMusicObject_QueryInterface,
IDirectMusicAudioPathImpl_IDirectMusicObject_AddRef,
IDirectMusicAudioPathImpl_IDirectMusicObject_Release,
IDirectMusicAudioPathImpl_IDirectMusicObject_GetDescriptor,
IDirectMusicAudioPathImpl_IDirectMusicObject_SetDescriptor,
IDirectMusicAudioPathImpl_IDirectMusicObject_ParseDescriptor
};
/* IDirectMusicAudioPathImpl IPersistStream part: */
HRESULT WINAPI IDirectMusicAudioPathImpl_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicAudioPathImpl, PersistStreamVtbl, iface);
return IDirectMusicAudioPathImpl_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicAudioPathImpl_IPersistStream_AddRef (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicAudioPathImpl, PersistStreamVtbl, iface);
return IDirectMusicAudioPathImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicAudioPathImpl_IPersistStream_Release (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicAudioPathImpl, PersistStreamVtbl, iface);
return IDirectMusicAudioPathImpl_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicAudioPathImpl_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicAudioPathImpl_IPersistStream_IsDirty (LPPERSISTSTREAM iface) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicAudioPathImpl_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm) {
ICOM_THIS_MULTI(IDirectMusicAudioPathImpl, PersistStreamVtbl, iface);
FOURCC chunkID;
DWORD chunkSize, StreamSize, StreamCount, ListSize[3], ListCount[3];
LARGE_INTEGER liMove; /* used when skipping chunks */
FIXME("(%p, %p): Loading not implemented yet\n", This, pStm);
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
IStream_Read (pStm, &chunkSize, sizeof(DWORD), NULL);
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (chunkID), chunkSize);
switch (chunkID) {
case FOURCC_RIFF: {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
TRACE_(dmfile)(": RIFF chunk of type %s", debugstr_fourcc(chunkID));
StreamSize = chunkSize - sizeof(FOURCC);
StreamCount = 0;
switch (chunkID) {
case DMUS_FOURCC_AUDIOPATH_FORM: {
TRACE_(dmfile)(": audio path form\n");
do {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
IStream_Read (pStm, &chunkSize, sizeof(FOURCC), NULL);
StreamCount += sizeof(FOURCC) + sizeof(DWORD) + chunkSize;
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (chunkID), chunkSize);
switch (chunkID) {
case DMUS_FOURCC_GUID_CHUNK: {
TRACE_(dmfile)(": GUID chunk\n");
This->pDesc->dwValidData |= DMUS_OBJ_OBJECT;
IStream_Read (pStm, &This->pDesc->guidObject, chunkSize, NULL);
break;
}
case DMUS_FOURCC_VERSION_CHUNK: {
TRACE_(dmfile)(": version chunk\n");
This->pDesc->dwValidData |= DMUS_OBJ_VERSION;
IStream_Read (pStm, &This->pDesc->vVersion, chunkSize, NULL);
break;
}
case DMUS_FOURCC_CATEGORY_CHUNK: {
TRACE_(dmfile)(": category chunk\n");
This->pDesc->dwValidData |= DMUS_OBJ_CATEGORY;
IStream_Read (pStm, This->pDesc->wszCategory, chunkSize, NULL);
break;
}
case FOURCC_LIST: {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
TRACE_(dmfile)(": LIST chunk of type %s", debugstr_fourcc(chunkID));
ListSize[0] = chunkSize - sizeof(FOURCC);
ListCount[0] = 0;
switch (chunkID) {
case DMUS_FOURCC_UNFO_LIST: {
TRACE_(dmfile)(": UNFO list\n");
do {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
IStream_Read (pStm, &chunkSize, sizeof(FOURCC), NULL);
ListCount[0] += sizeof(FOURCC) + sizeof(DWORD) + chunkSize;
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (chunkID), chunkSize);
switch (chunkID) {
/* don't ask me why, but M$ puts INFO elements in UNFO list sometimes
(though strings seem to be valid unicode) */
case mmioFOURCC('I','N','A','M'):
case DMUS_FOURCC_UNAM_CHUNK: {
TRACE_(dmfile)(": name chunk\n");
This->pDesc->dwValidData |= DMUS_OBJ_NAME;
IStream_Read (pStm, This->pDesc->wszName, chunkSize, NULL);
break;
}
case mmioFOURCC('I','A','R','T'):
case DMUS_FOURCC_UART_CHUNK: {
TRACE_(dmfile)(": artist chunk (ignored)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','C','O','P'):
case DMUS_FOURCC_UCOP_CHUNK: {
TRACE_(dmfile)(": copyright chunk (ignored)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','S','B','J'):
case DMUS_FOURCC_USBJ_CHUNK: {
TRACE_(dmfile)(": subject chunk (ignored)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','C','M','T'):
case DMUS_FOURCC_UCMT_CHUNK: {
TRACE_(dmfile)(": comment chunk (ignored)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (irrevelant & skipping)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
TRACE_(dmfile)(": ListCount[0] = %ld < ListSize[0] = %ld\n", ListCount[0], ListSize[0]);
} while (ListCount[0] < ListSize[0]);
break;
}
default: {
TRACE_(dmfile)(": unknown (skipping)\n");
liMove.QuadPart = chunkSize - sizeof(FOURCC);
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (irrevelant & skipping)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
TRACE_(dmfile)(": StreamCount[0] = %ld < StreamSize[0] = %ld\n", StreamCount, StreamSize);
} while (StreamCount < StreamSize);
break;
}
default: {
TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
liMove.QuadPart = StreamSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */
return E_FAIL;
}
}
TRACE_(dmfile)(": reading finished\n");
break;
}
default: {
TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */
return E_FAIL;
}
}
return S_OK;
}
HRESULT WINAPI IDirectMusicAudioPathImpl_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicAudioPathImpl_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) {
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicAudioPath_PersistStream_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicAudioPathImpl_IPersistStream_QueryInterface,
IDirectMusicAudioPathImpl_IPersistStream_AddRef,
IDirectMusicAudioPathImpl_IPersistStream_Release,
IDirectMusicAudioPathImpl_IPersistStream_GetClassID,
IDirectMusicAudioPathImpl_IPersistStream_IsDirty,
IDirectMusicAudioPathImpl_IPersistStream_Load,
IDirectMusicAudioPathImpl_IPersistStream_Save,
IDirectMusicAudioPathImpl_IPersistStream_GetSizeMax
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicAudioPath (LPCGUID lpcGUID, LPDIRECTMUSICAUDIOPATH* ppDMCAPath, LPUNKNOWN pUnkOuter)
{
IDirectMusicAudioPathImpl* path;
HRESULT WINAPI DMUSIC_CreateDirectMusicAudioPathImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) {
IDirectMusicAudioPathImpl* obj;
if (IsEqualIID (lpcGUID, &IID_IDirectMusicAudioPath)) {
path = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicAudioPathImpl));
if (NULL == path) {
*ppDMCAPath = (LPDIRECTMUSICAUDIOPATH) NULL;
return E_OUTOFMEMORY;
}
path->lpVtbl = &DirectMusicAudioPath_Vtbl;
path->ref = 1;
*ppDMCAPath = (LPDIRECTMUSICAUDIOPATH) path;
return S_OK;
obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicAudioPathImpl));
if (NULL == obj) {
*ppobj = (LPVOID) NULL;
return E_OUTOFMEMORY;
}
obj->UnknownVtbl = &DirectMusicAudioPath_Unknown_Vtbl;
obj->AudioPathVtbl = &DirectMusicAudioPath_AudioPath_Vtbl;
obj->ObjectVtbl = &DirectMusicAudioPath_Object_Vtbl;
obj->PersistStreamVtbl = &DirectMusicAudioPath_PersistStream_Vtbl;
obj->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC));
DM_STRUCT_INIT(obj->pDesc);
obj->pDesc->dwValidData |= DMUS_OBJ_CLASS;
memcpy (&obj->pDesc->guidClass, &CLSID_DirectMusicAudioPath, sizeof (CLSID));
obj->ref = 0; /* will be inited by QueryInterface */
WARN("No interface found\n");
return E_NOINTERFACE;
return IDirectMusicAudioPathImpl_IUnknown_QueryInterface ((LPUNKNOWN)&obj->UnknownVtbl, lpcGUID, ppobj);
}
/*****************************************************************************
* IDirectMusicAudioPathObject implementation
*/
/* IDirectMusicAudioPathObject IUnknown part: */
HRESULT WINAPI IDirectMusicAudioPathObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicAudioPathObject,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IDirectMusicObject)) {
IDirectMusicAudioPathObject_AddRef(iface);
*ppobj = This;
return S_OK;
} else if (IsEqualIID (riid, &IID_IPersistStream)) {
IPersistStream_AddRef ((LPPERSISTSTREAM)This->pStream);
*ppobj = (LPPERSISTSTREAM)This->pStream;
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicAudioPath)) {
IDirectMusicAudioPath_AddRef ((LPDIRECTMUSICAUDIOPATH)This->pAudioPath);
*ppobj = (LPDIRECTMUSICAUDIOPATH)This->pAudioPath;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicAudioPathObject_AddRef (LPDIRECTMUSICOBJECT iface)
{
ICOM_THIS(IDirectMusicAudioPathObject,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicAudioPathObject_Release (LPDIRECTMUSICOBJECT iface)
{
ICOM_THIS(IDirectMusicAudioPathObject,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicAudioPathObject IDirectMusicObject part: */
HRESULT WINAPI IDirectMusicAudioPathObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicAudioPathObject,iface);
TRACE("(%p, %p)\n", This, pDesc);
pDesc = This->pDesc;
return S_OK;
}
HRESULT WINAPI IDirectMusicAudioPathObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicAudioPathObject,iface);
TRACE("(%p, %p)\n", This, pDesc);
This->pDesc = pDesc;
return S_OK;
}
HRESULT WINAPI IDirectMusicAudioPathObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicAudioPathObject,iface);
FIXME("(%p, %p, %p): stub\n", This, pStream, pDesc);
return S_OK;
}
ICOM_VTABLE(IDirectMusicObject) DirectMusicAudioPathObject_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicAudioPathObject_QueryInterface,
IDirectMusicAudioPathObject_AddRef,
IDirectMusicAudioPathObject_Release,
IDirectMusicAudioPathObject_GetDescriptor,
IDirectMusicAudioPathObject_SetDescriptor,
IDirectMusicAudioPathObject_ParseDescriptor
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicAudioPathObject (LPCGUID lpcGUID, LPDIRECTMUSICOBJECT* ppObject, LPUNKNOWN pUnkOuter)
{
IDirectMusicAudioPathObject *obj;
TRACE("(%p,%p,%p)\n", lpcGUID, ppObject, pUnkOuter);
if (IsEqualIID (lpcGUID, &IID_IDirectMusicObject)) {
obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicAudioPathObject));
if (NULL == obj) {
*ppObject = (LPDIRECTMUSICOBJECT) NULL;
return E_OUTOFMEMORY;
}
obj->lpVtbl = &DirectMusicAudioPathObject_Vtbl;
obj->ref = 1;
/* prepare IPersistStream */
obj->pStream = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(IDirectMusicAudioPathObjectStream));
obj->pStream->lpVtbl = &DirectMusicAudioPathObjectStream_Vtbl;
obj->pStream->ref = 1;
obj->pStream->pParentObject = obj;
/* prepare IDirectMusicAudioPath */
DMUSIC_CreateDirectMusicAudioPath (&IID_IDirectMusicAudioPath, (LPDIRECTMUSICAUDIOPATH*)&obj->pAudioPath, NULL);
obj->pAudioPath->pObject = obj;
*ppObject = (LPDIRECTMUSICOBJECT) obj;
return S_OK;
}
WARN("No interface found\n");
return E_NOINTERFACE;
}
/*****************************************************************************
* IDirectMusicAudioPathObjectStream implementation
*/
/* IDirectMusicAudioPathObjectStream IUnknown part: */
HRESULT WINAPI IDirectMusicAudioPathObjectStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicAudioPathObjectStream,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicAudioPathObjectStream_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicAudioPathObjectStream_AddRef (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicAudioPathObjectStream,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicAudioPathObjectStream_Release (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicAudioPathObjectStream,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicAudioPathObjectStream IPersist part: */
HRESULT WINAPI IDirectMusicAudioPathObjectStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID)
{
return E_NOTIMPL;
}
/* IDirectMusicAudioPathObjectStream IPersistStream part: */
HRESULT WINAPI IDirectMusicAudioPathObjectStream_IsDirty (LPPERSISTSTREAM iface)
{
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicAudioPathObjectStream_Load (LPPERSISTSTREAM iface, IStream* pStm)
{
FIXME(": Loading not implemented yet\n");
return S_OK;
}
HRESULT WINAPI IDirectMusicAudioPathObjectStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty)
{
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicAudioPathObjectStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize)
{
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicAudioPathObjectStream_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicAudioPathObjectStream_QueryInterface,
IDirectMusicAudioPathObjectStream_AddRef,
IDirectMusicAudioPathObjectStream_Release,
IDirectMusicAudioPathObjectStream_GetClassID,
IDirectMusicAudioPathObjectStream_IsDirty,
IDirectMusicAudioPathObjectStream_Load,
IDirectMusicAudioPathObjectStream_Save,
IDirectMusicAudioPathObjectStream_GetSizeMax
};

View File

@ -1,6 +1,6 @@
/* DirectMusicInteractiveEngine Main
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -21,8 +21,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(dmime);
typedef struct
{
typedef struct {
/* IUnknown fields */
ICOM_VFIELD(IClassFactory);
DWORD ref;
@ -31,43 +30,30 @@ typedef struct
/******************************************************************
* DirectMusicPerformance ClassFactory
*/
static HRESULT WINAPI PerformanceCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI PerformanceCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI PerformanceCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI PerformanceCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI PerformanceCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI PerformanceCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI PerformanceCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI PerformanceCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualIID (riid, &IID_IDirectMusicPerformance) ||
IsEqualIID (riid, &IID_IDirectMusicPerformance8)) {
return DMUSIC_CreateDirectMusicPerformance (riid, (LPDIRECTMUSICPERFORMANCE8*) ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
return DMUSIC_CreateDirectMusicPerformanceImpl (riid, ppobj, pOuter);
}
static HRESULT WINAPI PerformanceCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI PerformanceCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -87,45 +73,30 @@ static IClassFactoryImpl Performance_CF = {&PerformanceCF_Vtbl, 1 };
/******************************************************************
* DirectMusicSegment ClassFactory
*/
static HRESULT WINAPI SegmentCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI SegmentCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI SegmentCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI SegmentCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI SegmentCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI SegmentCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI SegmentCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI SegmentCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualIID (riid, &IID_IDirectMusicSegment) ||
IsEqualIID (riid, &IID_IDirectMusicSegment8)) {
return DMUSIC_CreateDirectMusicSegment (riid, (LPDIRECTMUSICSEGMENT8*) ppobj, pOuter);
} else if (IsEqualIID (riid, &IID_IDirectMusicObject)) {
return DMUSIC_CreateDirectMusicSegmentObject (riid, (LPDIRECTMUSICOBJECT*) ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
return DMUSIC_CreateDirectMusicSegmentImpl (riid, ppobj, pOuter);
}
static HRESULT WINAPI SegmentCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI SegmentCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -145,43 +116,30 @@ static IClassFactoryImpl Segment_CF = {&SegmentCF_Vtbl, 1 };
/******************************************************************
* DirectMusicSegmentState ClassFactory
*/
static HRESULT WINAPI SegmentStateCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI SegmentStateCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI SegmentStateCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI SegmentStateCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI SegmentStateCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI SegmentStateCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI SegmentStateCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI SegmentStateCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualIID (riid, &IID_IDirectMusicSegmentState) ||
IsEqualIID (riid, &IID_IDirectMusicSegmentState8)) {
return DMUSIC_CreateDirectMusicSegmentState (riid, (LPDIRECTMUSICSEGMENTSTATE8*) ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
return DMUSIC_CreateDirectMusicSegmentStateImpl (riid, ppobj, pOuter);
}
static HRESULT WINAPI SegmentStateCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI SegmentStateCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -201,44 +159,30 @@ static IClassFactoryImpl SegmentState_CF = {&SegmentStateCF_Vtbl, 1 };
/******************************************************************
* DirectMusicGraph ClassFactory
*/
static HRESULT WINAPI GraphCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI GraphCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI GraphCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI GraphCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI GraphCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI GraphCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI GraphCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI GraphCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualIID (riid, &IID_IDirectMusicGraph)) {
return DMUSIC_CreateDirectMusicGraph (riid, (LPDIRECTMUSICGRAPH*) ppobj, pOuter);
} else if (IsEqualIID (riid, &IID_IDirectMusicObject)) {
return DMUSIC_CreateDirectMusicGraphObject (riid, (LPDIRECTMUSICOBJECT*) ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
return DMUSIC_CreateDirectMusicGraphImpl (riid, ppobj, pOuter);
}
static HRESULT WINAPI GraphCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI GraphCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -258,43 +202,30 @@ static IClassFactoryImpl Graph_CF = {&GraphCF_Vtbl, 1 };
/******************************************************************
* DirectMusicTempoTrack ClassFactory
*/
static HRESULT WINAPI TempoTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI TempoTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI TempoTrackCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI TempoTrackCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI TempoTrackCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI TempoTrackCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI TempoTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI TempoTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualIID (riid, &IID_IDirectMusicTrack) ||
IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
return DMUSIC_CreateDirectMusicTempoTrack (riid, (LPDIRECTMUSICTRACK8*) ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
return DMUSIC_CreateDirectMusicTempoTrack (riid, ppobj, pOuter);
}
static HRESULT WINAPI TempoTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI TempoTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -314,43 +245,30 @@ static IClassFactoryImpl TempoTrack_CF = {&TempoTrackCF_Vtbl, 1 };
/******************************************************************
* DirectMusicSeqTrack ClassFactory
*/
static HRESULT WINAPI SeqTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI SeqTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI SeqTrackCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI SeqTrackCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI SeqTrackCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI SeqTrackCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI SeqTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI SeqTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualIID (riid, &IID_IDirectMusicTrack) ||
IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
return DMUSIC_CreateDirectMusicSeqTrack (riid, (LPDIRECTMUSICTRACK8*) ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
return DMUSIC_CreateDirectMusicSeqTrack (riid, ppobj, pOuter);
}
static HRESULT WINAPI SeqTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI SeqTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -370,43 +288,30 @@ static IClassFactoryImpl SeqTrack_CF = {&SeqTrackCF_Vtbl, 1 };
/******************************************************************
* DirectMusicSysExTrack ClassFactory
*/
static HRESULT WINAPI SysExTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI SysExTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI SysExTrackCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI SysExTrackCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI SysExTrackCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI SysExTrackCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI SysExTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI SysExTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualIID (riid, &IID_IDirectMusicTrack) ||
IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
return DMUSIC_CreateDirectMusicSysExTrack (riid, (LPDIRECTMUSICTRACK8*) ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
return DMUSIC_CreateDirectMusicSysExTrack (riid, ppobj, pOuter);
}
static HRESULT WINAPI SysExTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI SysExTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -426,43 +331,30 @@ static IClassFactoryImpl SysExTrack_CF = {&SysExTrackCF_Vtbl, 1 };
/******************************************************************
* DirectMusicTimeSigTrack ClassFactory
*/
static HRESULT WINAPI TimeSigTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI TimeSigTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI TimeSigTrackCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI TimeSigTrackCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI TimeSigTrackCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI TimeSigTrackCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI TimeSigTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI TimeSigTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualIID (riid, &IID_IDirectMusicTrack) ||
IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
return DMUSIC_CreateDirectMusicTimeSigTrack (riid, (LPDIRECTMUSICTRACK8*) ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
return DMUSIC_CreateDirectMusicTimeSigTrack (riid, ppobj, pOuter);
}
static HRESULT WINAPI TimeSigTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI TimeSigTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -482,43 +374,30 @@ static IClassFactoryImpl TimeSigTrack_CF = {&TimeSigTrackCF_Vtbl, 1 };
/******************************************************************
* DirectMusicParamControlTrack ClassFactory
*/
static HRESULT WINAPI ParamControlTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI ParamControlTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI ParamControlTrackCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI ParamControlTrackCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI ParamControlTrackCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI ParamControlTrackCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI ParamControlTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI ParamControlTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualIID (riid, &IID_IDirectMusicTrack) ||
IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
return DMUSIC_CreateDirectMusicParamControlTrack (riid, (LPDIRECTMUSICTRACK8*) ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
return DMUSIC_CreateDirectMusicParamControlTrack (riid, ppobj, pOuter);
}
static HRESULT WINAPI ParamControlTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI ParamControlTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -538,43 +417,30 @@ static IClassFactoryImpl ParamControlTrack_CF = {&ParamControlTrackCF_Vtbl, 1 };
/******************************************************************
* DirectMusicMarkerTrack ClassFactory
*/
static HRESULT WINAPI MarkerTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI MarkerTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI MarkerTrackCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI MarkerTrackCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI MarkerTrackCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI MarkerTrackCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI MarkerTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI MarkerTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualIID (riid, &IID_IDirectMusicTrack) ||
IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
return DMUSIC_CreateDirectMusicMarkerTrack (riid, (LPDIRECTMUSICTRACK8*) ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
return DMUSIC_CreateDirectMusicMarkerTrack (riid, ppobj, pOuter);
}
static HRESULT WINAPI MarkerTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI MarkerTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -594,43 +460,30 @@ static IClassFactoryImpl MarkerTrack_CF = {&MarkerTrackCF_Vtbl, 1 };
/******************************************************************
* DirectMusicLyricsTrack ClassFactory
*/
static HRESULT WINAPI LyricsTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI LyricsTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI LyricsTrackCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI LyricsTrackCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI LyricsTrackCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI LyricsTrackCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI LyricsTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI LyricsTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualIID (riid, &IID_IDirectMusicTrack) ||
IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
return DMUSIC_CreateDirectMusicLyricsTrack (riid, (LPDIRECTMUSICTRACK8*) ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
return DMUSIC_CreateDirectMusicLyricsTrack (riid, ppobj, pOuter);
}
static HRESULT WINAPI LyricsTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI LyricsTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -647,103 +500,34 @@ static ICOM_VTABLE(IClassFactory) LyricsTrackCF_Vtbl = {
static IClassFactoryImpl LyricsTrack_CF = {&LyricsTrackCF_Vtbl, 1 };
/******************************************************************
* DirectMusicSong ClassFactory
*/
static HRESULT WINAPI SongCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI SongCF_AddRef(LPCLASSFACTORY iface)
{
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI SongCF_Release(LPCLASSFACTORY iface)
{
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI SongCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualIID (riid, &IID_IDirectMusicSong)) {
return DMUSIC_CreateDirectMusicPerformance (riid, (LPDIRECTMUSICPERFORMANCE8*) ppobj, pOuter);
} else if (IsEqualIID (riid, &IID_IDirectMusicObject)) {
return DMUSIC_CreateDirectMusicSongObject (riid, (LPDIRECTMUSICOBJECT*) ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
static HRESULT WINAPI SongCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
}
static ICOM_VTABLE(IClassFactory) SongCF_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
SongCF_QueryInterface,
SongCF_AddRef,
SongCF_Release,
SongCF_CreateInstance,
SongCF_LockServer
};
static IClassFactoryImpl Song_CF = {&SongCF_Vtbl, 1 };
/******************************************************************
* DirectMusicSegTriggerTrack ClassFactory
*/
static HRESULT WINAPI SegTriggerTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI SegTriggerTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI SegTriggerTrackCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI SegTriggerTrackCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI SegTriggerTrackCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI SegTriggerTrackCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI SegTriggerTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI SegTriggerTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualIID (riid, &IID_IDirectMusicTrack) ||
IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
return DMUSIC_CreateDirectMusicSegTriggerTrack (riid, (LPDIRECTMUSICTRACK8*) ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
return DMUSIC_CreateDirectMusicSegTriggerTrack (riid, ppobj, pOuter);
}
static HRESULT WINAPI SegTriggerTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI SegTriggerTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -760,50 +544,33 @@ static ICOM_VTABLE(IClassFactory) SegTriggerTrackCF_Vtbl = {
static IClassFactoryImpl SegTriggerTrack_CF = {&SegTriggerTrackCF_Vtbl, 1 };
/******************************************************************
* DirectMusicAudioPath ClassFactory
*/
static HRESULT WINAPI AudioPathCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI AudioPathCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI AudioPathCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI AudioPathCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI AudioPathCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI AudioPathCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI AudioPathCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI AudioPathCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualIID (riid, &IID_IDirectMusicAudioPath)) {
return DMUSIC_CreateDirectMusicAudioPath (riid, (LPDIRECTMUSICAUDIOPATH*) ppobj, pOuter);
} else if (IsEqualIID (riid, &IID_IDirectMusicObject)) {
return DMUSIC_CreateDirectMusicAudioPathObject (riid, (LPDIRECTMUSICOBJECT*) ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
return DMUSIC_CreateDirectMusicAudioPathImpl (riid, ppobj, pOuter);
}
static HRESULT WINAPI AudioPathCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI AudioPathCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -823,43 +590,30 @@ static IClassFactoryImpl AudioPath_CF = {&AudioPathCF_Vtbl, 1 };
/******************************************************************
* DirectMusicWaveTrack ClassFactory
*/
static HRESULT WINAPI WaveTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI WaveTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI WaveTrackCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI WaveTrackCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI WaveTrackCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI WaveTrackCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI WaveTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI WaveTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualIID (riid, &IID_IDirectMusicTrack) ||
IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
return DMUSIC_CreateDirectMusicWaveTrack (riid, (LPDIRECTMUSICTRACK8*) ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
return DMUSIC_CreateDirectMusicWaveTrack (riid, ppobj, pOuter);
}
static HRESULT WINAPI WaveTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI WaveTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -881,15 +635,12 @@ static IClassFactoryImpl WaveTrack_CF = {&WaveTrackCF_Vtbl, 1 };
*
*
*/
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
if (fdwReason == DLL_PROCESS_ATTACH)
{
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
if (fdwReason == DLL_PROCESS_ATTACH) {
DisableThreadLibraryCalls(hinstDLL);
/* FIXME: Initialisation */
}
else if (fdwReason == DLL_PROCESS_DETACH)
{
else if (fdwReason == DLL_PROCESS_DETACH) {
/* FIXME: Cleanup */
}
@ -902,10 +653,8 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
*
*
*/
HRESULT WINAPI DMIME_DllCanUnloadNow(void)
{
HRESULT WINAPI DMIME_DllCanUnloadNow(void) {
FIXME("(void): stub\n");
return S_FALSE;
}
@ -962,10 +711,6 @@ HRESULT WINAPI DMIME_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv
*ppv = (LPVOID) &LyricsTrack_CF;
IClassFactory_AddRef((IClassFactory*)*ppv);
return S_OK;
} else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicSong) && IsEqualIID (riid, &IID_IClassFactory)) {
*ppv = (LPVOID) &Song_CF;
IClassFactory_AddRef((IClassFactory*)*ppv);
return S_OK;
} else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicSegTriggerTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
*ppv = (LPVOID) &SegTriggerTrack_CF;
IClassFactory_AddRef((IClassFactory*)*ppv);

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
/* IDirectMusicGraph
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -17,44 +17,48 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "dmime_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmime);
WINE_DECLARE_DEBUG_CHANNEL(dmfile);
/* IDirectMusicGraph IUnknown part: */
HRESULT WINAPI IDirectMusicGraphImpl_QueryInterface (LPDIRECTMUSICGRAPH iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicGraphImpl,iface);
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IDirectMusicGraph)) {
IDirectMusicGraphImpl_AddRef(iface);
*ppobj = This;
/*****************************************************************************
* IDirectMusicGraphImpl implementation
*/
/* IDirectMusicGraphImpl IUnknown part: */
HRESULT WINAPI IDirectMusicGraphImpl_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicGraphImpl, UnknownVtbl, iface);
if (IsEqualIID (riid, &IID_IUnknown)) {
*ppobj = (LPVOID)&This->UnknownVtbl;
IDirectMusicGraphImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicGraph)) {
*ppobj = (LPVOID)&This->GraphVtbl;
IDirectMusicGraphImpl_IDirectMusicGraph_AddRef ((LPDIRECTMUSICGRAPH)&This->GraphVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicObject)) {
*ppobj = (LPVOID)&This->ObjectVtbl;
IDirectMusicGraphImpl_IDirectMusicObject_AddRef ((LPDIRECTMUSICOBJECT)&This->ObjectVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IPersistStream)) {
*ppobj = (LPVOID)&This->PersistStreamVtbl;
IDirectMusicGraphImpl_IPersistStream_AddRef ((LPPERSISTSTREAM)&This->PersistStreamVtbl);
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicGraphImpl_AddRef (LPDIRECTMUSICGRAPH iface)
{
ICOM_THIS(IDirectMusicGraphImpl,iface);
ULONG WINAPI IDirectMusicGraphImpl_IUnknown_AddRef (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicGraphImpl, UnknownVtbl, iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicGraphImpl_Release (LPDIRECTMUSICGRAPH iface)
{
ICOM_THIS(IDirectMusicGraphImpl,iface);
ULONG WINAPI IDirectMusicGraphImpl_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicGraphImpl, UnknownVtbl, iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
@ -63,22 +67,40 @@ ULONG WINAPI IDirectMusicGraphImpl_Release (LPDIRECTMUSICGRAPH iface)
return ref;
}
/* IDirectMusicGraph IDirectMusicGraph part: */
HRESULT WINAPI IDirectMusicGraphImpl_StampPMsg (LPDIRECTMUSICGRAPH iface, DMUS_PMSG* pPMSG)
{
ICOM_THIS(IDirectMusicGraphImpl,iface);
ICOM_VTABLE(IUnknown) DirectMusicGraph_Unknown_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicGraphImpl_IUnknown_QueryInterface,
IDirectMusicGraphImpl_IUnknown_AddRef,
IDirectMusicGraphImpl_IUnknown_Release
};
/* IDirectMusicGraphImpl IDirectMusicGraph part: */
HRESULT WINAPI IDirectMusicGraphImpl_IDirectMusicGraph_QueryInterface (LPDIRECTMUSICGRAPH iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicGraphImpl, GraphVtbl, iface);
return IDirectMusicGraphImpl_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicGraphImpl_IDirectMusicGraph_AddRef (LPDIRECTMUSICGRAPH iface) {
ICOM_THIS_MULTI(IDirectMusicGraphImpl, GraphVtbl, iface);
return IDirectMusicGraphImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicGraphImpl_IDirectMusicGraph_Release (LPDIRECTMUSICGRAPH iface) {
ICOM_THIS_MULTI(IDirectMusicGraphImpl, GraphVtbl, iface);
return IDirectMusicGraphImpl_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicGraphImpl_IDirectMusicGraph_StampPMsg (LPDIRECTMUSICGRAPH iface, DMUS_PMSG* pPMSG) {
ICOM_THIS_MULTI(IDirectMusicGraphImpl, GraphVtbl, iface);
FIXME("(%p, %p): stub\n", This, pPMSG);
return S_OK;
}
HRESULT WINAPI IDirectMusicGraphImpl_InsertTool (LPDIRECTMUSICGRAPH iface, IDirectMusicTool* pTool, DWORD* pdwPChannels, DWORD cPChannels, LONG lIndex)
{
HRESULT WINAPI IDirectMusicGraphImpl_IDirectMusicGraph_InsertTool (LPDIRECTMUSICGRAPH iface, IDirectMusicTool* pTool, DWORD* pdwPChannels, DWORD cPChannels, LONG lIndex) {
int i;
IDirectMusicTool8Impl* p;
IDirectMusicTool8Impl* toAdd = (IDirectMusicTool8Impl*) pTool;
ICOM_THIS(IDirectMusicGraphImpl,iface);
ICOM_THIS_MULTI(IDirectMusicGraphImpl, GraphVtbl, iface);
FIXME("(%p, %p, %p, %ld, %li): use of pdwPChannels\n", This, pTool, pdwPChannels, cPChannels, lIndex);
@ -118,11 +140,10 @@ HRESULT WINAPI IDirectMusicGraphImpl_InsertTool (LPDIRECTMUSICGRAPH iface, IDire
return DS_OK;
}
HRESULT WINAPI IDirectMusicGraphImpl_GetTool (LPDIRECTMUSICGRAPH iface, DWORD dwIndex, IDirectMusicTool** ppTool)
{
HRESULT WINAPI IDirectMusicGraphImpl_IDirectMusicGraph_GetTool (LPDIRECTMUSICGRAPH iface, DWORD dwIndex, IDirectMusicTool** ppTool) {
int i;
IDirectMusicTool8Impl* p = NULL;
ICOM_THIS(IDirectMusicGraphImpl,iface);
ICOM_THIS_MULTI(IDirectMusicGraphImpl, GraphVtbl, iface);
FIXME("(%p, %ld, %p): stub\n", This, dwIndex, ppTool);
@ -134,241 +155,458 @@ HRESULT WINAPI IDirectMusicGraphImpl_GetTool (LPDIRECTMUSICGRAPH iface, DWORD dw
if (NULL != *ppTool) {
IDirectMusicTool8Impl_AddRef((LPDIRECTMUSICTOOL8) *ppTool);
}
return DS_OK;
return S_OK;
}
HRESULT WINAPI IDirectMusicGraphImpl_RemoveTool (LPDIRECTMUSICGRAPH iface, IDirectMusicTool* pTool)
{
ICOM_THIS(IDirectMusicGraphImpl,iface);
HRESULT WINAPI IDirectMusicGraphImpl_IDirectMusicGraph_RemoveTool (LPDIRECTMUSICGRAPH iface, IDirectMusicTool* pTool) {
ICOM_THIS_MULTI(IDirectMusicGraphImpl, GraphVtbl, iface);
FIXME("(%p, %p): stub\n", This, pTool);
return S_OK;
}
ICOM_VTABLE(IDirectMusicGraph) DirectMusicGraph_Graph_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicGraphImpl_IDirectMusicGraph_QueryInterface,
IDirectMusicGraphImpl_IDirectMusicGraph_AddRef,
IDirectMusicGraphImpl_IDirectMusicGraph_Release,
IDirectMusicGraphImpl_IDirectMusicGraph_StampPMsg,
IDirectMusicGraphImpl_IDirectMusicGraph_InsertTool,
IDirectMusicGraphImpl_IDirectMusicGraph_GetTool,
IDirectMusicGraphImpl_IDirectMusicGraph_RemoveTool
};
/* IDirectMusicGraphImpl IDirectMusicObject part: */
HRESULT WINAPI IDirectMusicGraphImpl_IDirectMusicObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicGraphImpl, ObjectVtbl, iface);
return IDirectMusicGraphImpl_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicGraphImpl_IDirectMusicObject_AddRef (LPDIRECTMUSICOBJECT iface) {
ICOM_THIS_MULTI(IDirectMusicGraphImpl, ObjectVtbl, iface);
return IDirectMusicGraphImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicGraphImpl_IDirectMusicObject_Release (LPDIRECTMUSICOBJECT iface) {
ICOM_THIS_MULTI(IDirectMusicGraphImpl, ObjectVtbl, iface);
return IDirectMusicGraphImpl_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicGraphImpl_IDirectMusicObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc) {
ICOM_THIS_MULTI(IDirectMusicGraphImpl, ObjectVtbl, iface);
TRACE("(%p, %p)\n", This, pDesc);
/* I think we shouldn't return pointer here since then values can be changed; it'd be a mess */
memcpy (pDesc, This->pDesc, This->pDesc->dwSize);
return S_OK;
}
HRESULT WINAPI IDirectMusicGraphImpl_IDirectMusicObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc) {
ICOM_THIS_MULTI(IDirectMusicGraphImpl, ObjectVtbl, iface);
TRACE("(%p, %p): setting descriptor:\n", This, pDesc);
if (TRACE_ON(dmime)) {
DMUSIC_dump_DMUS_OBJECTDESC (pDesc);
}
/* According to MSDN, we should copy only given values, not whole struct */
if (pDesc->dwValidData & DMUS_OBJ_OBJECT)
memcpy (&This->pDesc->guidObject, &pDesc->guidObject, sizeof (pDesc->guidObject));
if (pDesc->dwValidData & DMUS_OBJ_CLASS)
memcpy (&This->pDesc->guidClass, &pDesc->guidClass, sizeof (pDesc->guidClass));
if (pDesc->dwValidData & DMUS_OBJ_NAME)
strncpyW (This->pDesc->wszName, pDesc->wszName, DMUS_MAX_NAME);
if (pDesc->dwValidData & DMUS_OBJ_CATEGORY)
strncpyW (This->pDesc->wszCategory, pDesc->wszCategory, DMUS_MAX_CATEGORY);
if (pDesc->dwValidData & DMUS_OBJ_FILENAME)
strncpyW (This->pDesc->wszFileName, pDesc->wszFileName, DMUS_MAX_FILENAME);
if (pDesc->dwValidData & DMUS_OBJ_VERSION)
memcpy (&This->pDesc->vVersion, &pDesc->vVersion, sizeof (pDesc->vVersion));
if (pDesc->dwValidData & DMUS_OBJ_DATE)
memcpy (&This->pDesc->ftDate, &pDesc->ftDate, sizeof (pDesc->ftDate));
if (pDesc->dwValidData & DMUS_OBJ_MEMORY) {
memcpy (&This->pDesc->llMemLength, &pDesc->llMemLength, sizeof (pDesc->llMemLength));
memcpy (This->pDesc->pbMemData, pDesc->pbMemData, sizeof (pDesc->pbMemData));
}
if (pDesc->dwValidData & DMUS_OBJ_STREAM) {
/* according to MSDN, we copy the stream */
IStream_Clone (pDesc->pStream, &This->pDesc->pStream);
}
/* add new flags */
This->pDesc->dwValidData |= pDesc->dwValidData;
return S_OK;
}
ICOM_VTABLE(IDirectMusicGraph) DirectMusicGraph_Vtbl =
{
HRESULT WINAPI IDirectMusicGraphImpl_IDirectMusicObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc) {
ICOM_THIS_MULTI(IDirectMusicGraphImpl, ObjectVtbl, iface);
DMUS_PRIVATE_CHUNK Chunk;
DWORD StreamSize, StreamCount, ListSize[1], ListCount[1];
LARGE_INTEGER liMove; /* used when skipping chunks */
TRACE("(%p, %p, %p)\n", This, pStream, pDesc);
/* FIXME: should this be determined from stream? */
pDesc->dwValidData |= DMUS_OBJ_CLASS;
memcpy (&pDesc->guidClass, &CLSID_DirectMusicGraph, sizeof(CLSID));
IStream_Read (pStream, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
TRACE_(dmfile)(": %s chunk (size = 0x%04lx)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
switch (Chunk.fccID) {
case FOURCC_RIFF: {
IStream_Read (pStream, &Chunk.fccID, sizeof(FOURCC), NULL);
TRACE_(dmfile)(": RIFF chunk of type %s", debugstr_fourcc(Chunk.fccID));
StreamSize = Chunk.dwSize - sizeof(FOURCC);
StreamCount = 0;
if (Chunk.fccID == DMUS_FOURCC_TOOLGRAPH_FORM) {
TRACE_(dmfile)(": graph form\n");
do {
IStream_Read (pStream, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
StreamCount += sizeof(FOURCC) + sizeof(DWORD) + Chunk.dwSize;
TRACE_(dmfile)(": %s chunk (size = 0x%04lx)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
switch (Chunk.fccID) {
case DMUS_FOURCC_GUID_CHUNK: {
TRACE_(dmfile)(": GUID chunk\n");
pDesc->dwValidData |= DMUS_OBJ_OBJECT;
IStream_Read (pStream, &pDesc->guidObject, Chunk.dwSize, NULL);
break;
}
case DMUS_FOURCC_VERSION_CHUNK: {
TRACE_(dmfile)(": version chunk\n");
pDesc->dwValidData |= DMUS_OBJ_VERSION;
IStream_Read (pStream, &pDesc->vVersion, Chunk.dwSize, NULL);
break;
}
case DMUS_FOURCC_CATEGORY_CHUNK: {
TRACE_(dmfile)(": category chunk\n");
pDesc->dwValidData |= DMUS_OBJ_CATEGORY;
IStream_Read (pStream, pDesc->wszCategory, Chunk.dwSize, NULL);
break;
}
case FOURCC_LIST: {
IStream_Read (pStream, &Chunk.fccID, sizeof(FOURCC), NULL);
TRACE_(dmfile)(": LIST chunk of type %s", debugstr_fourcc(Chunk.fccID));
ListSize[0] = Chunk.dwSize - sizeof(FOURCC);
ListCount[0] = 0;
switch (Chunk.fccID) {
/* evil M$ UNFO list, which can (!?) contain INFO elements */
case DMUS_FOURCC_UNFO_LIST: {
TRACE_(dmfile)(": UNFO list\n");
do {
IStream_Read (pStream, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
ListCount[0] += sizeof(FOURCC) + sizeof(DWORD) + Chunk.dwSize;
TRACE_(dmfile)(": %s chunk (size = 0x%04lx)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
switch (Chunk.fccID) {
/* don't ask me why, but M$ puts INFO elements in UNFO list sometimes
(though strings seem to be valid unicode) */
case mmioFOURCC('I','N','A','M'):
case DMUS_FOURCC_UNAM_CHUNK: {
TRACE_(dmfile)(": name chunk\n");
pDesc->dwValidData |= DMUS_OBJ_NAME;
IStream_Read (pStream, pDesc->wszName, Chunk.dwSize, NULL);
break;
}
case mmioFOURCC('I','A','R','T'):
case DMUS_FOURCC_UART_CHUNK: {
TRACE_(dmfile)(": artist chunk (ignored)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','C','O','P'):
case DMUS_FOURCC_UCOP_CHUNK: {
TRACE_(dmfile)(": copyright chunk (ignored)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','S','B','J'):
case DMUS_FOURCC_USBJ_CHUNK: {
TRACE_(dmfile)(": subject chunk (ignored)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','C','M','T'):
case DMUS_FOURCC_UCMT_CHUNK: {
TRACE_(dmfile)(": comment chunk (ignored)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (irrevelant & skipping)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
TRACE_(dmfile)(": ListCount[0] = %ld < ListSize[0] = %ld\n", ListCount[0], ListSize[0]);
} while (ListCount[0] < ListSize[0]);
break;
}
default: {
TRACE_(dmfile)(": unknown (skipping)\n");
liMove.QuadPart = Chunk.dwSize - sizeof(FOURCC);
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (irrevelant & skipping)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
TRACE_(dmfile)(": StreamCount[0] = %ld < StreamSize[0] = %ld\n", StreamCount, StreamSize);
} while (StreamCount < StreamSize);
break;
} else {
TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
liMove.QuadPart = StreamSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */
return E_FAIL;
}
TRACE_(dmfile)(": reading finished\n");
break;
}
default: {
TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */
return DMUS_E_INVALIDFILE;
}
}
TRACE(": returning descriptor:\n");
if (TRACE_ON(dmime)) {
DMUSIC_dump_DMUS_OBJECTDESC (pDesc);
}
return S_OK;
}
ICOM_VTABLE(IDirectMusicObject) DirectMusicGraph_Object_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicGraphImpl_QueryInterface,
IDirectMusicGraphImpl_AddRef,
IDirectMusicGraphImpl_Release,
IDirectMusicGraphImpl_StampPMsg,
IDirectMusicGraphImpl_InsertTool,
IDirectMusicGraphImpl_GetTool,
IDirectMusicGraphImpl_RemoveTool
IDirectMusicGraphImpl_IDirectMusicObject_QueryInterface,
IDirectMusicGraphImpl_IDirectMusicObject_AddRef,
IDirectMusicGraphImpl_IDirectMusicObject_Release,
IDirectMusicGraphImpl_IDirectMusicObject_GetDescriptor,
IDirectMusicGraphImpl_IDirectMusicObject_SetDescriptor,
IDirectMusicGraphImpl_IDirectMusicObject_ParseDescriptor
};
/* IDirectMusicGraphImpl IPersistStream part: */
HRESULT WINAPI IDirectMusicGraphImpl_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicGraphImpl, PersistStreamVtbl, iface);
return IDirectMusicGraphImpl_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicGraphImpl_IPersistStream_AddRef (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicGraphImpl, PersistStreamVtbl, iface);
return IDirectMusicGraphImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicGraphImpl_IPersistStream_Release (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicGraphImpl, PersistStreamVtbl, iface);
return IDirectMusicGraphImpl_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicGraphImpl_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicGraphImpl_IPersistStream_IsDirty (LPPERSISTSTREAM iface) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicGraphImpl_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm) {
ICOM_THIS_MULTI(IDirectMusicGraphImpl, PersistStreamVtbl, iface);
FOURCC chunkID;
DWORD chunkSize, StreamSize, StreamCount, ListSize[3], ListCount[3];
LARGE_INTEGER liMove; /* used when skipping chunks */
FIXME("(%p, %p): Loading not implemented yet\n", This, pStm);
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
IStream_Read (pStm, &chunkSize, sizeof(DWORD), NULL);
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (chunkID), chunkSize);
switch (chunkID) {
case FOURCC_RIFF: {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
TRACE_(dmfile)(": RIFF chunk of type %s", debugstr_fourcc(chunkID));
StreamSize = chunkSize - sizeof(FOURCC);
StreamCount = 0;
switch (chunkID) {
case DMUS_FOURCC_TOOLGRAPH_FORM: {
TRACE_(dmfile)(": graph form\n");
do {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
IStream_Read (pStm, &chunkSize, sizeof(FOURCC), NULL);
StreamCount += sizeof(FOURCC) + sizeof(DWORD) + chunkSize;
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (chunkID), chunkSize);
switch (chunkID) {
case DMUS_FOURCC_GUID_CHUNK: {
TRACE_(dmfile)(": GUID chunk\n");
This->pDesc->dwValidData |= DMUS_OBJ_OBJECT;
IStream_Read (pStm, &This->pDesc->guidObject, chunkSize, NULL);
break;
}
case DMUS_FOURCC_VERSION_CHUNK: {
TRACE_(dmfile)(": version chunk\n");
This->pDesc->dwValidData |= DMUS_OBJ_VERSION;
IStream_Read (pStm, &This->pDesc->vVersion, chunkSize, NULL);
break;
}
case DMUS_FOURCC_CATEGORY_CHUNK: {
TRACE_(dmfile)(": category chunk\n");
This->pDesc->dwValidData |= DMUS_OBJ_CATEGORY;
IStream_Read (pStm, This->pDesc->wszCategory, chunkSize, NULL);
break;
}
case FOURCC_LIST: {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
TRACE_(dmfile)(": LIST chunk of type %s", debugstr_fourcc(chunkID));
ListSize[0] = chunkSize - sizeof(FOURCC);
ListCount[0] = 0;
switch (chunkID) {
case DMUS_FOURCC_UNFO_LIST: {
TRACE_(dmfile)(": UNFO list\n");
do {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
IStream_Read (pStm, &chunkSize, sizeof(FOURCC), NULL);
ListCount[0] += sizeof(FOURCC) + sizeof(DWORD) + chunkSize;
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (chunkID), chunkSize);
switch (chunkID) {
/* don't ask me why, but M$ puts INFO elements in UNFO list sometimes
(though strings seem to be valid unicode) */
case mmioFOURCC('I','N','A','M'):
case DMUS_FOURCC_UNAM_CHUNK: {
TRACE_(dmfile)(": name chunk\n");
This->pDesc->dwValidData |= DMUS_OBJ_NAME;
IStream_Read (pStm, This->pDesc->wszName, chunkSize, NULL);
break;
}
case mmioFOURCC('I','A','R','T'):
case DMUS_FOURCC_UART_CHUNK: {
TRACE_(dmfile)(": artist chunk (ignored)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','C','O','P'):
case DMUS_FOURCC_UCOP_CHUNK: {
TRACE_(dmfile)(": copyright chunk (ignored)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','S','B','J'):
case DMUS_FOURCC_USBJ_CHUNK: {
TRACE_(dmfile)(": subject chunk (ignored)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','C','M','T'):
case DMUS_FOURCC_UCMT_CHUNK: {
TRACE_(dmfile)(": comment chunk (ignored)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (irrevelant & skipping)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
TRACE_(dmfile)(": ListCount[0] = %ld < ListSize[0] = %ld\n", ListCount[0], ListSize[0]);
} while (ListCount[0] < ListSize[0]);
break;
}
default: {
TRACE_(dmfile)(": unknown (skipping)\n");
liMove.QuadPart = chunkSize - sizeof(FOURCC);
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (irrevelant & skipping)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
TRACE_(dmfile)(": StreamCount[0] = %ld < StreamSize[0] = %ld\n", StreamCount, StreamSize);
} while (StreamCount < StreamSize);
break;
}
default: {
TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
liMove.QuadPart = StreamSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */
return E_FAIL;
}
}
TRACE_(dmfile)(": reading finished\n");
break;
}
default: {
TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */
return E_FAIL;
}
}
return S_OK;
}
HRESULT WINAPI IDirectMusicGraphImpl_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicGraphImpl_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) {
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicGraph_PersistStream_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicGraphImpl_IPersistStream_QueryInterface,
IDirectMusicGraphImpl_IPersistStream_AddRef,
IDirectMusicGraphImpl_IPersistStream_Release,
IDirectMusicGraphImpl_IPersistStream_GetClassID,
IDirectMusicGraphImpl_IPersistStream_IsDirty,
IDirectMusicGraphImpl_IPersistStream_Load,
IDirectMusicGraphImpl_IPersistStream_Save,
IDirectMusicGraphImpl_IPersistStream_GetSizeMax
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicGraph (LPCGUID lpcGUID, LPDIRECTMUSICGRAPH *ppDMGrph, LPUNKNOWN pUnkOuter)
{
IDirectMusicGraphImpl* dmgraph;
HRESULT WINAPI DMUSIC_CreateDirectMusicGraphImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) {
IDirectMusicGraphImpl* obj;
if (IsEqualIID (lpcGUID, &IID_IDirectMusicGraph)) {
dmgraph = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicGraphImpl));
if (NULL == dmgraph) {
*ppDMGrph = (LPDIRECTMUSICGRAPH) NULL;
return E_OUTOFMEMORY;
}
dmgraph->lpVtbl = &DirectMusicGraph_Vtbl;
dmgraph->ref = 1;
*ppDMGrph = (LPDIRECTMUSICGRAPH) dmgraph;
return S_OK;
obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicGraphImpl));
if (NULL == obj) {
*ppobj = (LPVOID) NULL;
return E_OUTOFMEMORY;
}
WARN("No interface found\n");
obj->UnknownVtbl = &DirectMusicGraph_Unknown_Vtbl;
obj->GraphVtbl = &DirectMusicGraph_Graph_Vtbl;
obj->ObjectVtbl = &DirectMusicGraph_Object_Vtbl;
obj->PersistStreamVtbl = &DirectMusicGraph_PersistStream_Vtbl;
obj->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC));
DM_STRUCT_INIT(obj->pDesc);
obj->pDesc->dwValidData |= DMUS_OBJ_CLASS;
memcpy (&obj->pDesc->guidClass, &CLSID_DirectMusicGraph, sizeof (CLSID));
obj->ref = 0; /* will be inited by QueryInterface */
return E_NOINTERFACE;
return IDirectMusicGraphImpl_IUnknown_QueryInterface ((LPUNKNOWN)&obj->UnknownVtbl, lpcGUID, ppobj);
}
/*****************************************************************************
* IDirectMusicGraphObject implementation
*/
/* IDirectMusicGraphObject IUnknown part: */
HRESULT WINAPI IDirectMusicGraphObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicGraphObject,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IDirectMusicObject)) {
IDirectMusicGraphObject_AddRef(iface);
*ppobj = This;
return S_OK;
} else if (IsEqualIID (riid, &IID_IPersistStream)) {
IPersistStream_AddRef ((LPPERSISTSTREAM)This->pStream);
*ppobj = (LPPERSISTSTREAM)This->pStream;
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicGraph)) {
IDirectMusicGraph_AddRef ((LPDIRECTMUSICGRAPH)This->pGraph);
*ppobj = (LPDIRECTMUSICGRAPH)This->pGraph;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicGraphObject_AddRef (LPDIRECTMUSICOBJECT iface)
{
ICOM_THIS(IDirectMusicGraphObject,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicGraphObject_Release (LPDIRECTMUSICOBJECT iface)
{
ICOM_THIS(IDirectMusicGraphObject,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicGraphObject IDirectMusicObject part: */
HRESULT WINAPI IDirectMusicGraphObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicGraphObject,iface);
TRACE("(%p, %p)\n", This, pDesc);
pDesc = This->pDesc;
return S_OK;
}
HRESULT WINAPI IDirectMusicGraphObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicGraphObject,iface);
TRACE("(%p, %p)\n", This, pDesc);
This->pDesc = pDesc;
return S_OK;
}
HRESULT WINAPI IDirectMusicGraphObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicGraphObject,iface);
FIXME("(%p, %p, %p): stub\n", This, pStream, pDesc);
return S_OK;
}
ICOM_VTABLE(IDirectMusicObject) DirectMusicGraphObject_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicGraphObject_QueryInterface,
IDirectMusicGraphObject_AddRef,
IDirectMusicGraphObject_Release,
IDirectMusicGraphObject_GetDescriptor,
IDirectMusicGraphObject_SetDescriptor,
IDirectMusicGraphObject_ParseDescriptor
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicGraphObject (LPCGUID lpcGUID, LPDIRECTMUSICOBJECT* ppObject, LPUNKNOWN pUnkOuter)
{
IDirectMusicGraphObject *obj;
TRACE("(%p,%p,%p)\n", lpcGUID, ppObject, pUnkOuter);
if (IsEqualIID (lpcGUID, &IID_IDirectMusicObject)) {
obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicGraphObject));
if (NULL == obj) {
*ppObject = (LPDIRECTMUSICOBJECT) NULL;
return E_OUTOFMEMORY;
}
obj->lpVtbl = &DirectMusicGraphObject_Vtbl;
obj->ref = 1;
/* prepare IPersistStream */
obj->pStream = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(IDirectMusicGraphObjectStream));
obj->pStream->lpVtbl = &DirectMusicGraphObjectStream_Vtbl;
obj->pStream->ref = 1;
obj->pStream->pParentObject = obj;
/* prepare IDirectMusicGraph */
DMUSIC_CreateDirectMusicGraph (&IID_IDirectMusicGraph, (LPDIRECTMUSICGRAPH*)&obj->pGraph, NULL);
obj->pGraph->pObject = obj;
*ppObject = (LPDIRECTMUSICOBJECT) obj;
return S_OK;
}
WARN("No interface found\n");
return E_NOINTERFACE;
}
/*****************************************************************************
* IDirectMusicGraphObjectStream implementation
*/
/* IDirectMusicGraphObjectStream IUnknown part: */
HRESULT WINAPI IDirectMusicGraphObjectStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicGraphObjectStream,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicGraphObjectStream_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicGraphObjectStream_AddRef (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicGraphObjectStream,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicGraphObjectStream_Release (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicGraphObjectStream,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicGraphObjectStream IPersist part: */
HRESULT WINAPI IDirectMusicGraphObjectStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID)
{
return E_NOTIMPL;
}
/* IDirectMusicGraphObjectStream IPersistStream part: */
HRESULT WINAPI IDirectMusicGraphObjectStream_IsDirty (LPPERSISTSTREAM iface)
{
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicGraphObjectStream_Load (LPPERSISTSTREAM iface, IStream* pStm)
{
FIXME(": Loading not implemented yet\n");
return S_OK;
}
HRESULT WINAPI IDirectMusicGraphObjectStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty)
{
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicGraphObjectStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize)
{
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicGraphObjectStream_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicGraphObjectStream_QueryInterface,
IDirectMusicGraphObjectStream_AddRef,
IDirectMusicGraphObjectStream_Release,
IDirectMusicGraphObjectStream_GetClassID,
IDirectMusicGraphObjectStream_IsDirty,
IDirectMusicGraphObjectStream_Load,
IDirectMusicGraphObjectStream_Save,
IDirectMusicGraphObjectStream_GetSizeMax
};

View File

@ -1,6 +1,6 @@
/* IDirectMusicLyricsTrack Implementation
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -17,14 +17,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "dmime_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmime);
@ -34,35 +26,36 @@ WINE_DECLARE_DEBUG_CHANNEL(dmfile);
* IDirectMusicLyricsTrack implementation
*/
/* IDirectMusicLyricsTrack IUnknown part: */
HRESULT WINAPI IDirectMusicLyricsTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicLyricsTrack,iface);
HRESULT WINAPI IDirectMusicLyricsTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicLyricsTrack, UnknownVtbl, iface);
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IDirectMusicTrack) ||
IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
IDirectMusicLyricsTrack_AddRef(iface);
*ppobj = This;
if (IsEqualIID (riid, &IID_IUnknown)) {
*ppobj = (LPUNKNOWN)&This->UnknownVtbl;
IDirectMusicLyricsTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicTrack)
|| IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
*ppobj = (LPDIRECTMUSICTRACK8)&This->TrackVtbl;
IDirectMusicLyricsTrack_IDirectMusicTrack_AddRef ((LPDIRECTMUSICTRACK8)&This->TrackVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicLyricsTrackStream_AddRef ((LPPERSISTSTREAM)This->pStream);
*ppobj = This->pStream;
*ppobj = (LPPERSISTSTREAM)&This->PersistStreamVtbl;
IDirectMusicLyricsTrack_IPersistStream_AddRef ((LPPERSISTSTREAM)&This->PersistStreamVtbl);
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicLyricsTrack_AddRef (LPDIRECTMUSICTRACK8 iface)
{
ICOM_THIS(IDirectMusicLyricsTrack,iface);
ULONG WINAPI IDirectMusicLyricsTrack_IUnknown_AddRef (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicLyricsTrack, UnknownVtbl, iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicLyricsTrack_Release (LPDIRECTMUSICTRACK8 iface)
{
ICOM_THIS(IDirectMusicLyricsTrack,iface);
ULONG WINAPI IDirectMusicLyricsTrack_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicLyricsTrack, UnknownVtbl, iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
@ -71,269 +64,214 @@ ULONG WINAPI IDirectMusicLyricsTrack_Release (LPDIRECTMUSICTRACK8 iface)
return ref;
}
/* IDirectMusicLyricsTrack IDirectMusicTrack part: */
HRESULT WINAPI IDirectMusicLyricsTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment)
{
ICOM_THIS(IDirectMusicLyricsTrack,iface);
ICOM_VTABLE(IUnknown) DirectMusicLyricsTrack_Unknown_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicLyricsTrack_IUnknown_QueryInterface,
IDirectMusicLyricsTrack_IUnknown_AddRef,
IDirectMusicLyricsTrack_IUnknown_Release
};
/* IDirectMusicLyricsTrack IDirectMusicTrack8 part: */
HRESULT WINAPI IDirectMusicLyricsTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicLyricsTrack, TrackVtbl, iface);
return IDirectMusicLyricsTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicLyricsTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface) {
ICOM_THIS_MULTI(IDirectMusicLyricsTrack, TrackVtbl, iface);
return IDirectMusicLyricsTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicLyricsTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface) {
ICOM_THIS_MULTI(IDirectMusicLyricsTrack, TrackVtbl, iface);
return IDirectMusicLyricsTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicLyricsTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment)
{
ICOM_THIS_MULTI(IDirectMusicLyricsTrack, TrackVtbl, iface);
FIXME("(%p, %p): stub\n", This, pSegment);
return S_OK;
}
HRESULT WINAPI IDirectMusicLyricsTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags)
HRESULT WINAPI IDirectMusicLyricsTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicLyricsTrack,iface);
ICOM_THIS_MULTI(IDirectMusicLyricsTrack, TrackVtbl, iface);
FIXME("(%p, %p, %p, %p, %ld, %ld): stub\n", This, pSegmentState, pPerformance, ppStateData, dwVirtualTrack8ID, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicLyricsTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData)
HRESULT WINAPI IDirectMusicLyricsTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData)
{
ICOM_THIS(IDirectMusicLyricsTrack,iface);
ICOM_THIS_MULTI(IDirectMusicLyricsTrack, TrackVtbl, iface);
FIXME("(%p, %p): stub\n", This, pStateData);
return S_OK;
}
HRESULT WINAPI IDirectMusicLyricsTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
HRESULT WINAPI IDirectMusicLyricsTrack_IDirectMusicTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
{
ICOM_THIS(IDirectMusicLyricsTrack,iface);
ICOM_THIS_MULTI(IDirectMusicLyricsTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %ld, %ld, %ld, %p, %p, %ld): stub\n", This, pStateData, mtStart, mtEnd, mtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
return S_OK;
}
HRESULT WINAPI IDirectMusicLyricsTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam)
{
ICOM_THIS(IDirectMusicLyricsTrack,iface);
HRESULT WINAPI IDirectMusicLyricsTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam) {
ICOM_THIS_MULTI(IDirectMusicLyricsTrack, TrackVtbl, iface);
FIXME("(%p, %s, %ld, %p, %p): stub\n", This, debugstr_guid(rguidType), mtTime, pmtNext, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicLyricsTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam)
{
ICOM_THIS(IDirectMusicLyricsTrack,iface);
HRESULT WINAPI IDirectMusicLyricsTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam) {
ICOM_THIS_MULTI(IDirectMusicLyricsTrack, TrackVtbl, iface);
FIXME("(%p, %s, %ld, %p): stub\n", This, debugstr_guid(rguidType), mtTime, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicLyricsTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType)
{
ICOM_THIS(IDirectMusicLyricsTrack,iface);
HRESULT WINAPI IDirectMusicLyricsTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType) {
ICOM_THIS_MULTI(IDirectMusicLyricsTrack, TrackVtbl, iface);
TRACE("(%p, %s): ", This, debugstr_guid(rguidType));
/* didn't find any params */
TRACE("param unsupported\n");
return DMUS_E_TYPE_UNSUPPORTED;
}
HRESULT WINAPI IDirectMusicLyricsTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType)
{
ICOM_THIS(IDirectMusicLyricsTrack,iface);
HRESULT WINAPI IDirectMusicLyricsTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
ICOM_THIS_MULTI(IDirectMusicLyricsTrack, TrackVtbl, iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
return S_OK;
}
HRESULT WINAPI IDirectMusicLyricsTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType)
{
ICOM_THIS(IDirectMusicLyricsTrack,iface);
HRESULT WINAPI IDirectMusicLyricsTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
ICOM_THIS_MULTI(IDirectMusicLyricsTrack, TrackVtbl, iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
return S_OK;
}
HRESULT WINAPI IDirectMusicLyricsTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack)
{
ICOM_THIS(IDirectMusicLyricsTrack,iface);
HRESULT WINAPI IDirectMusicLyricsTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack) {
ICOM_THIS_MULTI(IDirectMusicLyricsTrack, TrackVtbl, iface);
FIXME("(%p, %ld, %ld, %p): stub\n", This, mtStart, mtEnd, ppTrack);
return S_OK;
}
/* IDirectMusicLyricsTrack IDirectMusicTrack8 part: */
HRESULT WINAPI IDirectMusicLyricsTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
{
ICOM_THIS(IDirectMusicLyricsTrack,iface);
HRESULT WINAPI IDirectMusicLyricsTrack_IDirectMusicTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID) {
ICOM_THIS_MULTI(IDirectMusicLyricsTrack, TrackVtbl, iface);
FIXME("(%p, %p, %lli, %lli, %lli, %ld, %p, %p, %ld): stub\n", This, pStateData, rtStart, rtEnd, rtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
return S_OK;
}
HRESULT WINAPI IDirectMusicLyricsTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicLyricsTrack,iface);
HRESULT WINAPI IDirectMusicLyricsTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicLyricsTrack, TrackVtbl, iface);
FIXME("(%p, %s, %lli, %p, %p, %p, %ld): stub\n", This, debugstr_guid(rguidType), rtTime, prtNext, pParam, pStateData, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicLyricsTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicLyricsTrack,iface);
HRESULT WINAPI IDirectMusicLyricsTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicLyricsTrack, TrackVtbl, iface);
FIXME("(%p, %s, %lli, %p, %p, %ld): stub\n", This, debugstr_guid(rguidType), rtTime, pParam, pStateData, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicLyricsTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack)
{
ICOM_THIS(IDirectMusicLyricsTrack,iface);
HRESULT WINAPI IDirectMusicLyricsTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
ICOM_THIS_MULTI(IDirectMusicLyricsTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %p): stub\n", This, pContext, dwTrackGroup, ppResultTrack);
return S_OK;
}
HRESULT WINAPI IDirectMusicLyricsTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack)
{
ICOM_THIS(IDirectMusicLyricsTrack,iface);
HRESULT WINAPI IDirectMusicLyricsTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
ICOM_THIS_MULTI(IDirectMusicLyricsTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %p, %ld, %p): stub\n", This, pNewTrack, mtJoin, pContext, dwTrackGroup, ppResultTrack);
return S_OK;
}
ICOM_VTABLE(IDirectMusicTrack8) DirectMusicLyricsTrack_Vtbl =
{
ICOM_VTABLE(IDirectMusicTrack8) DirectMusicLyricsTrack_Track_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicLyricsTrack_QueryInterface,
IDirectMusicLyricsTrack_AddRef,
IDirectMusicLyricsTrack_Release,
IDirectMusicLyricsTrack_Init,
IDirectMusicLyricsTrack_InitPlay,
IDirectMusicLyricsTrack_EndPlay,
IDirectMusicLyricsTrack_Play,
IDirectMusicLyricsTrack_GetParam,
IDirectMusicLyricsTrack_SetParam,
IDirectMusicLyricsTrack_IsParamSupported,
IDirectMusicLyricsTrack_AddNotificationType,
IDirectMusicLyricsTrack_RemoveNotificationType,
IDirectMusicLyricsTrack_Clone,
IDirectMusicLyricsTrack_PlayEx,
IDirectMusicLyricsTrack_GetParamEx,
IDirectMusicLyricsTrack_SetParamEx,
IDirectMusicLyricsTrack_Compose,
IDirectMusicLyricsTrack_Join
IDirectMusicLyricsTrack_IDirectMusicTrack_QueryInterface,
IDirectMusicLyricsTrack_IDirectMusicTrack_AddRef,
IDirectMusicLyricsTrack_IDirectMusicTrack_Release,
IDirectMusicLyricsTrack_IDirectMusicTrack_Init,
IDirectMusicLyricsTrack_IDirectMusicTrack_InitPlay,
IDirectMusicLyricsTrack_IDirectMusicTrack_EndPlay,
IDirectMusicLyricsTrack_IDirectMusicTrack_Play,
IDirectMusicLyricsTrack_IDirectMusicTrack_GetParam,
IDirectMusicLyricsTrack_IDirectMusicTrack_SetParam,
IDirectMusicLyricsTrack_IDirectMusicTrack_IsParamSupported,
IDirectMusicLyricsTrack_IDirectMusicTrack_AddNotificationType,
IDirectMusicLyricsTrack_IDirectMusicTrack_RemoveNotificationType,
IDirectMusicLyricsTrack_IDirectMusicTrack_Clone,
IDirectMusicLyricsTrack_IDirectMusicTrack_PlayEx,
IDirectMusicLyricsTrack_IDirectMusicTrack_GetParamEx,
IDirectMusicLyricsTrack_IDirectMusicTrack_SetParamEx,
IDirectMusicLyricsTrack_IDirectMusicTrack_Compose,
IDirectMusicLyricsTrack_IDirectMusicTrack_Join
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicLyricsTrack (LPCGUID lpcGUID, LPDIRECTMUSICTRACK8 *ppTrack, LPUNKNOWN pUnkOuter)
{
IDirectMusicLyricsTrack* track;
if (IsEqualIID (lpcGUID, &IID_IDirectMusicTrack)
|| IsEqualIID (lpcGUID, &IID_IDirectMusicTrack8)) {
track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicLyricsTrack));
if (NULL == track) {
*ppTrack = (LPDIRECTMUSICTRACK8) NULL;
return E_OUTOFMEMORY;
}
track->lpVtbl = &DirectMusicLyricsTrack_Vtbl;
track->ref = 1;
track->pStream = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(IDirectMusicLyricsTrackStream));
track->pStream->lpVtbl = &DirectMusicLyricsTrackStream_Vtbl;
track->pStream->ref = 1;
track->pStream->pParentTrack = track;
*ppTrack = (LPDIRECTMUSICTRACK8) track;
return S_OK;
}
WARN("No interface found\n");
return E_NOINTERFACE;
/* IDirectMusicLyricsTrack IPersistStream part: */
HRESULT WINAPI IDirectMusicLyricsTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicLyricsTrack, PersistStreamVtbl, iface);
return IDirectMusicLyricsTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
/*****************************************************************************
* IDirectMusicLyricsTrackStream implementation
*/
/* IDirectMusicLyricsTrackStream IUnknown part follow: */
HRESULT WINAPI IDirectMusicLyricsTrackStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicLyricsTrackStream,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicLyricsTrackStream_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
ULONG WINAPI IDirectMusicLyricsTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicLyricsTrack, PersistStreamVtbl, iface);
return IDirectMusicLyricsTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicLyricsTrackStream_AddRef (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicLyricsTrackStream,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
ULONG WINAPI IDirectMusicLyricsTrack_IPersistStream_Release (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicLyricsTrack, PersistStreamVtbl, iface);
return IDirectMusicLyricsTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicLyricsTrackStream_Release (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicLyricsTrackStream,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicLyricsTrackStream IPersist part: */
HRESULT WINAPI IDirectMusicLyricsTrackStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID)
{
HRESULT WINAPI IDirectMusicLyricsTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) {
return E_NOTIMPL;
}
/* IDirectMusicLyricsTrackStream IPersistStream part: */
HRESULT WINAPI IDirectMusicLyricsTrackStream_IsDirty (LPPERSISTSTREAM iface)
{
HRESULT WINAPI IDirectMusicLyricsTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicLyricsTrackStream_Load (LPPERSISTSTREAM iface, IStream* pStm)
{
HRESULT WINAPI IDirectMusicLyricsTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm) {
FIXME(": Loading not implemented yet\n");
return S_OK;
}
HRESULT WINAPI IDirectMusicLyricsTrackStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty)
{
HRESULT WINAPI IDirectMusicLyricsTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicLyricsTrackStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize)
{
HRESULT WINAPI IDirectMusicLyricsTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) {
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicLyricsTrackStream_Vtbl =
{
ICOM_VTABLE(IPersistStream) DirectMusicLyricsTrack_PersistStream_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicLyricsTrackStream_QueryInterface,
IDirectMusicLyricsTrackStream_AddRef,
IDirectMusicLyricsTrackStream_Release,
IDirectMusicLyricsTrackStream_GetClassID,
IDirectMusicLyricsTrackStream_IsDirty,
IDirectMusicLyricsTrackStream_Load,
IDirectMusicLyricsTrackStream_Save,
IDirectMusicLyricsTrackStream_GetSizeMax
IDirectMusicLyricsTrack_IPersistStream_QueryInterface,
IDirectMusicLyricsTrack_IPersistStream_AddRef,
IDirectMusicLyricsTrack_IPersistStream_Release,
IDirectMusicLyricsTrack_IPersistStream_GetClassID,
IDirectMusicLyricsTrack_IPersistStream_IsDirty,
IDirectMusicLyricsTrack_IPersistStream_Load,
IDirectMusicLyricsTrack_IPersistStream_Save,
IDirectMusicLyricsTrack_IPersistStream_GetSizeMax
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicLyricsTrack (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) {
IDirectMusicLyricsTrack* track;
track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicLyricsTrack));
if (NULL == track) {
*ppobj = (LPVOID) NULL;
return E_OUTOFMEMORY;
}
track->UnknownVtbl = &DirectMusicLyricsTrack_Unknown_Vtbl;
track->TrackVtbl = &DirectMusicLyricsTrack_Track_Vtbl;
track->PersistStreamVtbl = &DirectMusicLyricsTrack_PersistStream_Vtbl;
track->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC));
DM_STRUCT_INIT(track->pDesc);
track->pDesc->dwValidData |= DMUS_OBJ_CLASS;
memcpy (&track->pDesc->guidClass, &CLSID_DirectMusicLyricsTrack, sizeof (CLSID));
track->ref = 0; /* will be inited by QueryInterface */
return IDirectMusicLyricsTrack_IUnknown_QueryInterface ((LPUNKNOWN)&track->UnknownVtbl, lpcGUID, ppobj);
}

View File

@ -1,6 +1,6 @@
/* IDirectMusicMarkerTrack Implementation
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -17,14 +17,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "dmime_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmime);
@ -34,19 +26,21 @@ WINE_DECLARE_DEBUG_CHANNEL(dmfile);
* IDirectMusicMarkerTrack implementation
*/
/* IDirectMusicMarkerTrack IUnknown part: */
HRESULT WINAPI IDirectMusicMarkerTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicMarkerTrack,iface);
HRESULT WINAPI IDirectMusicMarkerTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicMarkerTrack, UnknownVtbl, iface);
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IDirectMusicTrack) ||
IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
IDirectMusicMarkerTrack_AddRef(iface);
*ppobj = This;
if (IsEqualIID (riid, &IID_IUnknown)) {
*ppobj = (LPUNKNOWN)&This->UnknownVtbl;
IDirectMusicMarkerTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicTrack)
|| IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
*ppobj = (LPDIRECTMUSICTRACK8)&This->TrackVtbl;
IDirectMusicMarkerTrack_IDirectMusicTrack_AddRef ((LPDIRECTMUSICTRACK8)&This->TrackVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicMarkerTrackStream_AddRef ((LPPERSISTSTREAM)This->pStream);
*ppobj = This->pStream;
*ppobj = (LPPERSISTSTREAM)&This->PersistStreamVtbl;
IDirectMusicMarkerTrack_IPersistStream_AddRef ((LPPERSISTSTREAM)&This->PersistStreamVtbl);
return S_OK;
}
@ -54,16 +48,14 @@ HRESULT WINAPI IDirectMusicMarkerTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicMarkerTrack_AddRef (LPDIRECTMUSICTRACK8 iface)
{
ICOM_THIS(IDirectMusicMarkerTrack,iface);
ULONG WINAPI IDirectMusicMarkerTrack_IUnknown_AddRef (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicMarkerTrack, UnknownVtbl, iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicMarkerTrack_Release (LPDIRECTMUSICTRACK8 iface)
{
ICOM_THIS(IDirectMusicMarkerTrack,iface);
ULONG WINAPI IDirectMusicMarkerTrack_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicMarkerTrack, UnknownVtbl, iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
@ -72,273 +64,214 @@ ULONG WINAPI IDirectMusicMarkerTrack_Release (LPDIRECTMUSICTRACK8 iface)
return ref;
}
/* IDirectMusicMarkerTrack IDirectMusicTrack part: */
HRESULT WINAPI IDirectMusicMarkerTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment)
{
ICOM_THIS(IDirectMusicMarkerTrack,iface);
ICOM_VTABLE(IUnknown) DirectMusicMarkerTrack_Unknown_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicMarkerTrack_IUnknown_QueryInterface,
IDirectMusicMarkerTrack_IUnknown_AddRef,
IDirectMusicMarkerTrack_IUnknown_Release
};
/* IDirectMusicMarkerTrack IDirectMusicTrack8 part: */
HRESULT WINAPI IDirectMusicMarkerTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicMarkerTrack, TrackVtbl, iface);
return IDirectMusicMarkerTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicMarkerTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface) {
ICOM_THIS_MULTI(IDirectMusicMarkerTrack, TrackVtbl, iface);
return IDirectMusicMarkerTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicMarkerTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface) {
ICOM_THIS_MULTI(IDirectMusicMarkerTrack, TrackVtbl, iface);
return IDirectMusicMarkerTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicMarkerTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment) {
ICOM_THIS_MULTI(IDirectMusicMarkerTrack, TrackVtbl, iface);
FIXME("(%p, %p): stub\n", This, pSegment);
return S_OK;
}
HRESULT WINAPI IDirectMusicMarkerTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicMarkerTrack,iface);
HRESULT WINAPI IDirectMusicMarkerTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicMarkerTrack, TrackVtbl, iface);
FIXME("(%p, %p, %p, %p, %ld, %ld): stub\n", This, pSegmentState, pPerformance, ppStateData, dwVirtualTrack8ID, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicMarkerTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData)
{
ICOM_THIS(IDirectMusicMarkerTrack,iface);
HRESULT WINAPI IDirectMusicMarkerTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData) {
ICOM_THIS_MULTI(IDirectMusicMarkerTrack, TrackVtbl, iface);
FIXME("(%p, %p): stub\n", This, pStateData);
return S_OK;
}
HRESULT WINAPI IDirectMusicMarkerTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
{
ICOM_THIS(IDirectMusicMarkerTrack,iface);
HRESULT WINAPI IDirectMusicMarkerTrack_IDirectMusicTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID) {
ICOM_THIS_MULTI(IDirectMusicMarkerTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %ld, %ld, %ld, %p, %p, %ld): stub\n", This, pStateData, mtStart, mtEnd, mtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
return S_OK;
}
HRESULT WINAPI IDirectMusicMarkerTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam)
{
ICOM_THIS(IDirectMusicMarkerTrack,iface);
HRESULT WINAPI IDirectMusicMarkerTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam) {
ICOM_THIS_MULTI(IDirectMusicMarkerTrack, TrackVtbl, iface);
FIXME("(%p, %s, %ld, %p, %p): stub\n", This, debugstr_guid(rguidType), mtTime, pmtNext, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicMarkerTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam)
{
ICOM_THIS(IDirectMusicMarkerTrack,iface);
HRESULT WINAPI IDirectMusicMarkerTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam) {
ICOM_THIS_MULTI(IDirectMusicMarkerTrack, TrackVtbl, iface);
FIXME("(%p, %s, %ld, %p): stub\n", This, debugstr_guid(rguidType), mtTime, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicMarkerTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType)
{
ICOM_THIS(IDirectMusicMarkerTrack,iface);
HRESULT WINAPI IDirectMusicMarkerTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType) {
ICOM_THIS_MULTI(IDirectMusicMarkerTrack, TrackVtbl, iface);
TRACE("(%p, %s): ", This, debugstr_guid(rguidType));
if (IsEqualGUID (rguidType, &GUID_Play_Marker)
|| IsEqualGUID (rguidType, &GUID_Valid_Start_Time)) {
TRACE("param supported\n");
return S_OK;
}
}
TRACE("param unsupported\n");
return DMUS_E_TYPE_UNSUPPORTED;
}
HRESULT WINAPI IDirectMusicMarkerTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType)
{
ICOM_THIS(IDirectMusicMarkerTrack,iface);
HRESULT WINAPI IDirectMusicMarkerTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
ICOM_THIS_MULTI(IDirectMusicMarkerTrack, TrackVtbl, iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
return S_OK;
}
HRESULT WINAPI IDirectMusicMarkerTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType)
{
ICOM_THIS(IDirectMusicMarkerTrack,iface);
HRESULT WINAPI IDirectMusicMarkerTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
ICOM_THIS_MULTI(IDirectMusicMarkerTrack, TrackVtbl, iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
return S_OK;
}
HRESULT WINAPI IDirectMusicMarkerTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack)
{
ICOM_THIS(IDirectMusicMarkerTrack,iface);
HRESULT WINAPI IDirectMusicMarkerTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack) {
ICOM_THIS_MULTI(IDirectMusicMarkerTrack, TrackVtbl, iface);
FIXME("(%p, %ld, %ld, %p): stub\n", This, mtStart, mtEnd, ppTrack);
return S_OK;
}
/* IDirectMusicMarkerTrack IDirectMusicTrack8 part: */
HRESULT WINAPI IDirectMusicMarkerTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
{
ICOM_THIS(IDirectMusicMarkerTrack,iface);
HRESULT WINAPI IDirectMusicMarkerTrack_IDirectMusicTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID) {
ICOM_THIS_MULTI(IDirectMusicMarkerTrack, TrackVtbl, iface);
FIXME("(%p, %p, %lli, %lli, %lli, %ld, %p, %p, %ld): stub\n", This, pStateData, rtStart, rtEnd, rtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
return S_OK;
}
HRESULT WINAPI IDirectMusicMarkerTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicMarkerTrack,iface);
HRESULT WINAPI IDirectMusicMarkerTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicMarkerTrack, TrackVtbl, iface);
FIXME("(%p, %s, %lli, %p, %p, %p, %ld): stub\n", This, debugstr_guid(rguidType), rtTime, prtNext, pParam, pStateData, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicMarkerTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicMarkerTrack,iface);
HRESULT WINAPI IDirectMusicMarkerTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicMarkerTrack, TrackVtbl, iface);
FIXME("(%p, %s, %lli, %p, %p, %ld): stub\n", This, debugstr_guid(rguidType), rtTime, pParam, pStateData, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicMarkerTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack)
{
ICOM_THIS(IDirectMusicMarkerTrack,iface);
HRESULT WINAPI IDirectMusicMarkerTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
ICOM_THIS_MULTI(IDirectMusicMarkerTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %p): stub\n", This, pContext, dwTrackGroup, ppResultTrack);
return S_OK;
}
HRESULT WINAPI IDirectMusicMarkerTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack)
{
ICOM_THIS(IDirectMusicMarkerTrack,iface);
HRESULT WINAPI IDirectMusicMarkerTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
ICOM_THIS_MULTI(IDirectMusicMarkerTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %p, %ld, %p): stub\n", This, pNewTrack, mtJoin, pContext, dwTrackGroup, ppResultTrack);
return S_OK;
}
ICOM_VTABLE(IDirectMusicTrack8) DirectMusicMarkerTrack_Vtbl =
{
ICOM_VTABLE(IDirectMusicTrack8) DirectMusicMarkerTrack_Track_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicMarkerTrack_QueryInterface,
IDirectMusicMarkerTrack_AddRef,
IDirectMusicMarkerTrack_Release,
IDirectMusicMarkerTrack_Init,
IDirectMusicMarkerTrack_InitPlay,
IDirectMusicMarkerTrack_EndPlay,
IDirectMusicMarkerTrack_Play,
IDirectMusicMarkerTrack_GetParam,
IDirectMusicMarkerTrack_SetParam,
IDirectMusicMarkerTrack_IsParamSupported,
IDirectMusicMarkerTrack_AddNotificationType,
IDirectMusicMarkerTrack_RemoveNotificationType,
IDirectMusicMarkerTrack_Clone,
IDirectMusicMarkerTrack_PlayEx,
IDirectMusicMarkerTrack_GetParamEx,
IDirectMusicMarkerTrack_SetParamEx,
IDirectMusicMarkerTrack_Compose,
IDirectMusicMarkerTrack_Join
IDirectMusicMarkerTrack_IDirectMusicTrack_QueryInterface,
IDirectMusicMarkerTrack_IDirectMusicTrack_AddRef,
IDirectMusicMarkerTrack_IDirectMusicTrack_Release,
IDirectMusicMarkerTrack_IDirectMusicTrack_Init,
IDirectMusicMarkerTrack_IDirectMusicTrack_InitPlay,
IDirectMusicMarkerTrack_IDirectMusicTrack_EndPlay,
IDirectMusicMarkerTrack_IDirectMusicTrack_Play,
IDirectMusicMarkerTrack_IDirectMusicTrack_GetParam,
IDirectMusicMarkerTrack_IDirectMusicTrack_SetParam,
IDirectMusicMarkerTrack_IDirectMusicTrack_IsParamSupported,
IDirectMusicMarkerTrack_IDirectMusicTrack_AddNotificationType,
IDirectMusicMarkerTrack_IDirectMusicTrack_RemoveNotificationType,
IDirectMusicMarkerTrack_IDirectMusicTrack_Clone,
IDirectMusicMarkerTrack_IDirectMusicTrack_PlayEx,
IDirectMusicMarkerTrack_IDirectMusicTrack_GetParamEx,
IDirectMusicMarkerTrack_IDirectMusicTrack_SetParamEx,
IDirectMusicMarkerTrack_IDirectMusicTrack_Compose,
IDirectMusicMarkerTrack_IDirectMusicTrack_Join
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicMarkerTrack (LPCGUID lpcGUID, LPDIRECTMUSICTRACK8 *ppTrack, LPUNKNOWN pUnkOuter)
{
IDirectMusicMarkerTrack* track;
if (IsEqualIID (lpcGUID, &IID_IDirectMusicTrack)
|| IsEqualIID (lpcGUID, &IID_IDirectMusicTrack8)) {
track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicMarkerTrack));
if (NULL == track) {
*ppTrack = (LPDIRECTMUSICTRACK8) NULL;
return E_OUTOFMEMORY;
}
track->lpVtbl = &DirectMusicMarkerTrack_Vtbl;
track->ref = 1;
track->pStream = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(IDirectMusicMarkerTrackStream));
track->pStream->lpVtbl = &DirectMusicMarkerTrackStream_Vtbl;
track->pStream->ref = 1;
track->pStream->pParentTrack = track;
*ppTrack = (LPDIRECTMUSICTRACK8) track;
return S_OK;
}
WARN("No interface found\n");
return E_NOINTERFACE;
/* IDirectMusicMarkerTrack IPersistStream part: */
HRESULT WINAPI IDirectMusicMarkerTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicMarkerTrack, PersistStreamVtbl, iface);
return IDirectMusicMarkerTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
/*****************************************************************************
* IDirectMusicMarkerTrackStream implementation
*/
/* IDirectMusicMarkerTrackStream IUnknown part follow: */
HRESULT WINAPI IDirectMusicMarkerTrackStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicMarkerTrackStream,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicMarkerTrackStream_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
ULONG WINAPI IDirectMusicMarkerTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicMarkerTrack, PersistStreamVtbl, iface);
return IDirectMusicMarkerTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicMarkerTrackStream_AddRef (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicMarkerTrackStream,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
ULONG WINAPI IDirectMusicMarkerTrack_IPersistStream_Release (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicMarkerTrack, PersistStreamVtbl, iface);
return IDirectMusicMarkerTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicMarkerTrackStream_Release (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicMarkerTrackStream,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicMarkerTrackStream IPersist part: */
HRESULT WINAPI IDirectMusicMarkerTrackStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID)
{
HRESULT WINAPI IDirectMusicMarkerTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) {
return E_NOTIMPL;
}
/* IDirectMusicMarkerTrackStream IPersistStream part: */
HRESULT WINAPI IDirectMusicMarkerTrackStream_IsDirty (LPPERSISTSTREAM iface)
{
HRESULT WINAPI IDirectMusicMarkerTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicMarkerTrackStream_Load (LPPERSISTSTREAM iface, IStream* pStm)
{
HRESULT WINAPI IDirectMusicMarkerTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm) {
FIXME(": Loading not implemented yet\n");
return S_OK;
}
HRESULT WINAPI IDirectMusicMarkerTrackStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty)
{
HRESULT WINAPI IDirectMusicMarkerTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicMarkerTrackStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize)
{
HRESULT WINAPI IDirectMusicMarkerTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) {
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicMarkerTrackStream_Vtbl =
{
ICOM_VTABLE(IPersistStream) DirectMusicMarkerTrack_PersistStream_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicMarkerTrackStream_QueryInterface,
IDirectMusicMarkerTrackStream_AddRef,
IDirectMusicMarkerTrackStream_Release,
IDirectMusicMarkerTrackStream_GetClassID,
IDirectMusicMarkerTrackStream_IsDirty,
IDirectMusicMarkerTrackStream_Load,
IDirectMusicMarkerTrackStream_Save,
IDirectMusicMarkerTrackStream_GetSizeMax
IDirectMusicMarkerTrack_IPersistStream_QueryInterface,
IDirectMusicMarkerTrack_IPersistStream_AddRef,
IDirectMusicMarkerTrack_IPersistStream_Release,
IDirectMusicMarkerTrack_IPersistStream_GetClassID,
IDirectMusicMarkerTrack_IPersistStream_IsDirty,
IDirectMusicMarkerTrack_IPersistStream_Load,
IDirectMusicMarkerTrack_IPersistStream_Save,
IDirectMusicMarkerTrack_IPersistStream_GetSizeMax
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicMarkerTrack (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) {
IDirectMusicMarkerTrack* track;
track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicMarkerTrack));
if (NULL == track) {
*ppobj = (LPVOID) NULL;
return E_OUTOFMEMORY;
}
track->UnknownVtbl = &DirectMusicMarkerTrack_Unknown_Vtbl;
track->TrackVtbl = &DirectMusicMarkerTrack_Track_Vtbl;
track->PersistStreamVtbl = &DirectMusicMarkerTrack_PersistStream_Vtbl;
track->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC));
DM_STRUCT_INIT(track->pDesc);
track->pDesc->dwValidData |= DMUS_OBJ_CLASS;
memcpy (&track->pDesc->guidClass, &CLSID_DirectMusicMarkerTrack, sizeof (CLSID));
track->ref = 0; /* will be inited by QueryInterface */
return IDirectMusicMarkerTrack_IUnknown_QueryInterface ((LPUNKNOWN)&track->UnknownVtbl, lpcGUID, ppobj);
}

View File

@ -1,6 +1,6 @@
/* IDirectMusicParamControlTrack Implementation
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -17,14 +17,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "dmime_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmime);
@ -34,35 +26,36 @@ WINE_DECLARE_DEBUG_CHANNEL(dmfile);
* IDirectMusicParamControlTrack implementation
*/
/* IDirectMusicParamControlTrack IUnknown part: */
HRESULT WINAPI IDirectMusicParamControlTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicParamControlTrack,iface);
HRESULT WINAPI IDirectMusicParamControlTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicParamControlTrack, UnknownVtbl, iface);
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IDirectMusicTrack) ||
IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
IDirectMusicParamControlTrack_AddRef(iface);
*ppobj = This;
if (IsEqualIID (riid, &IID_IUnknown)) {
*ppobj = (LPUNKNOWN)&This->UnknownVtbl;
IDirectMusicParamControlTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicTrack)
|| IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
*ppobj = (LPDIRECTMUSICTRACK8)&This->TrackVtbl;
IDirectMusicParamControlTrack_IDirectMusicTrack_AddRef ((LPDIRECTMUSICTRACK8)&This->TrackVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicParamControlTrackStream_AddRef ((LPPERSISTSTREAM)This->pStream);
*ppobj = This->pStream;
*ppobj = (LPPERSISTSTREAM)&This->PersistStreamVtbl;
IDirectMusicParamControlTrack_IPersistStream_AddRef ((LPPERSISTSTREAM)&This->PersistStreamVtbl);
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicParamControlTrack_AddRef (LPDIRECTMUSICTRACK8 iface)
{
ICOM_THIS(IDirectMusicParamControlTrack,iface);
ULONG WINAPI IDirectMusicParamControlTrack_IUnknown_AddRef (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicParamControlTrack, UnknownVtbl, iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicParamControlTrack_Release (LPDIRECTMUSICTRACK8 iface)
{
ICOM_THIS(IDirectMusicParamControlTrack,iface);
ULONG WINAPI IDirectMusicParamControlTrack_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicParamControlTrack, UnknownVtbl, iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
@ -71,268 +64,214 @@ ULONG WINAPI IDirectMusicParamControlTrack_Release (LPDIRECTMUSICTRACK8 iface)
return ref;
}
/* IDirectMusicParamControlTrack IDirectMusicTrack part: */
HRESULT WINAPI IDirectMusicParamControlTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment)
{
ICOM_THIS(IDirectMusicParamControlTrack,iface);
ICOM_VTABLE(IUnknown) DirectMusicParamControlTrack_Unknown_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicParamControlTrack_IUnknown_QueryInterface,
IDirectMusicParamControlTrack_IUnknown_AddRef,
IDirectMusicParamControlTrack_IUnknown_Release
};
/* IDirectMusicParamControlTrack IDirectMusicTrack8 part: */
HRESULT WINAPI IDirectMusicParamControlTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicParamControlTrack, TrackVtbl, iface);
return IDirectMusicParamControlTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicParamControlTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface) {
ICOM_THIS_MULTI(IDirectMusicParamControlTrack, TrackVtbl, iface);
return IDirectMusicParamControlTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicParamControlTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface) {
ICOM_THIS_MULTI(IDirectMusicParamControlTrack, TrackVtbl, iface);
return IDirectMusicParamControlTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicParamControlTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment)
{
ICOM_THIS_MULTI(IDirectMusicParamControlTrack, TrackVtbl, iface);
FIXME("(%p, %p): stub\n", This, pSegment);
return S_OK;
}
HRESULT WINAPI IDirectMusicParamControlTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags)
HRESULT WINAPI IDirectMusicParamControlTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicParamControlTrack,iface);
ICOM_THIS_MULTI(IDirectMusicParamControlTrack, TrackVtbl, iface);
FIXME("(%p, %p, %p, %p, %ld, %ld): stub\n", This, pSegmentState, pPerformance, ppStateData, dwVirtualTrack8ID, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicParamControlTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData)
HRESULT WINAPI IDirectMusicParamControlTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData)
{
ICOM_THIS(IDirectMusicParamControlTrack,iface);
ICOM_THIS_MULTI(IDirectMusicParamControlTrack, TrackVtbl, iface);
FIXME("(%p, %p): stub\n", This, pStateData);
return S_OK;
}
HRESULT WINAPI IDirectMusicParamControlTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
HRESULT WINAPI IDirectMusicParamControlTrack_IDirectMusicTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
{
ICOM_THIS(IDirectMusicParamControlTrack,iface);
ICOM_THIS_MULTI(IDirectMusicParamControlTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %ld, %ld, %ld, %p, %p, %ld): stub\n", This, pStateData, mtStart, mtEnd, mtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
return S_OK;
}
HRESULT WINAPI IDirectMusicParamControlTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam)
{
ICOM_THIS(IDirectMusicParamControlTrack,iface);
HRESULT WINAPI IDirectMusicParamControlTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam) {
ICOM_THIS_MULTI(IDirectMusicParamControlTrack, TrackVtbl, iface);
FIXME("(%p, %s, %ld, %p, %p): stub\n", This, debugstr_guid(rguidType), mtTime, pmtNext, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicParamControlTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam)
{
ICOM_THIS(IDirectMusicParamControlTrack,iface);
HRESULT WINAPI IDirectMusicParamControlTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam) {
ICOM_THIS_MULTI(IDirectMusicParamControlTrack, TrackVtbl, iface);
FIXME("(%p, %s, %ld, %p): stub\n", This, debugstr_guid(rguidType), mtTime, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicParamControlTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType)
{
ICOM_THIS(IDirectMusicParamControlTrack,iface);
HRESULT WINAPI IDirectMusicParamControlTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType) {
ICOM_THIS_MULTI(IDirectMusicParamControlTrack, TrackVtbl, iface);
TRACE("(%p, %s): ", This, debugstr_guid(rguidType));
/* didn't find any params */
TRACE("param unsupported\n");
return DMUS_E_TYPE_UNSUPPORTED;
}
HRESULT WINAPI IDirectMusicParamControlTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType)
{
ICOM_THIS(IDirectMusicParamControlTrack,iface);
HRESULT WINAPI IDirectMusicParamControlTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
ICOM_THIS_MULTI(IDirectMusicParamControlTrack, TrackVtbl, iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
return S_OK;
}
HRESULT WINAPI IDirectMusicParamControlTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType)
{
ICOM_THIS(IDirectMusicParamControlTrack,iface);
HRESULT WINAPI IDirectMusicParamControlTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
ICOM_THIS_MULTI(IDirectMusicParamControlTrack, TrackVtbl, iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
return S_OK;
}
HRESULT WINAPI IDirectMusicParamControlTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack)
{
ICOM_THIS(IDirectMusicParamControlTrack,iface);
HRESULT WINAPI IDirectMusicParamControlTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack) {
ICOM_THIS_MULTI(IDirectMusicParamControlTrack, TrackVtbl, iface);
FIXME("(%p, %ld, %ld, %p): stub\n", This, mtStart, mtEnd, ppTrack);
return S_OK;
}
/* IDirectMusicParamControlTrack IDirectMusicTrack8 part: */
HRESULT WINAPI IDirectMusicParamControlTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
{
ICOM_THIS(IDirectMusicParamControlTrack,iface);
HRESULT WINAPI IDirectMusicParamControlTrack_IDirectMusicTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID) {
ICOM_THIS_MULTI(IDirectMusicParamControlTrack, TrackVtbl, iface);
FIXME("(%p, %p, %lli, %lli, %lli, %ld, %p, %p, %ld): stub\n", This, pStateData, rtStart, rtEnd, rtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
return S_OK;
}
HRESULT WINAPI IDirectMusicParamControlTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicParamControlTrack,iface);
HRESULT WINAPI IDirectMusicParamControlTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicParamControlTrack, TrackVtbl, iface);
FIXME("(%p, %s, %lli, %p, %p, %p, %ld): stub\n", This, debugstr_guid(rguidType), rtTime, prtNext, pParam, pStateData, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicParamControlTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicParamControlTrack,iface);
HRESULT WINAPI IDirectMusicParamControlTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicParamControlTrack, TrackVtbl, iface);
FIXME("(%p, %s, %lli, %p, %p, %ld): stub\n", This, debugstr_guid(rguidType), rtTime, pParam, pStateData, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicParamControlTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack)
{
ICOM_THIS(IDirectMusicParamControlTrack,iface);
HRESULT WINAPI IDirectMusicParamControlTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
ICOM_THIS_MULTI(IDirectMusicParamControlTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %p): stub\n", This, pContext, dwTrackGroup, ppResultTrack);
return S_OK;
}
HRESULT WINAPI IDirectMusicParamControlTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack)
{
ICOM_THIS(IDirectMusicParamControlTrack,iface);
HRESULT WINAPI IDirectMusicParamControlTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
ICOM_THIS_MULTI(IDirectMusicParamControlTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %p, %ld, %p): stub\n", This, pNewTrack, mtJoin, pContext, dwTrackGroup, ppResultTrack);
return S_OK;
}
ICOM_VTABLE(IDirectMusicTrack8) DirectMusicParamControlTrack_Vtbl =
{
ICOM_VTABLE(IDirectMusicTrack8) DirectMusicParamControlTrack_Track_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicParamControlTrack_QueryInterface,
IDirectMusicParamControlTrack_AddRef,
IDirectMusicParamControlTrack_Release,
IDirectMusicParamControlTrack_Init,
IDirectMusicParamControlTrack_InitPlay,
IDirectMusicParamControlTrack_EndPlay,
IDirectMusicParamControlTrack_Play,
IDirectMusicParamControlTrack_GetParam,
IDirectMusicParamControlTrack_SetParam,
IDirectMusicParamControlTrack_IsParamSupported,
IDirectMusicParamControlTrack_AddNotificationType,
IDirectMusicParamControlTrack_RemoveNotificationType,
IDirectMusicParamControlTrack_Clone,
IDirectMusicParamControlTrack_PlayEx,
IDirectMusicParamControlTrack_GetParamEx,
IDirectMusicParamControlTrack_SetParamEx,
IDirectMusicParamControlTrack_Compose,
IDirectMusicParamControlTrack_Join
IDirectMusicParamControlTrack_IDirectMusicTrack_QueryInterface,
IDirectMusicParamControlTrack_IDirectMusicTrack_AddRef,
IDirectMusicParamControlTrack_IDirectMusicTrack_Release,
IDirectMusicParamControlTrack_IDirectMusicTrack_Init,
IDirectMusicParamControlTrack_IDirectMusicTrack_InitPlay,
IDirectMusicParamControlTrack_IDirectMusicTrack_EndPlay,
IDirectMusicParamControlTrack_IDirectMusicTrack_Play,
IDirectMusicParamControlTrack_IDirectMusicTrack_GetParam,
IDirectMusicParamControlTrack_IDirectMusicTrack_SetParam,
IDirectMusicParamControlTrack_IDirectMusicTrack_IsParamSupported,
IDirectMusicParamControlTrack_IDirectMusicTrack_AddNotificationType,
IDirectMusicParamControlTrack_IDirectMusicTrack_RemoveNotificationType,
IDirectMusicParamControlTrack_IDirectMusicTrack_Clone,
IDirectMusicParamControlTrack_IDirectMusicTrack_PlayEx,
IDirectMusicParamControlTrack_IDirectMusicTrack_GetParamEx,
IDirectMusicParamControlTrack_IDirectMusicTrack_SetParamEx,
IDirectMusicParamControlTrack_IDirectMusicTrack_Compose,
IDirectMusicParamControlTrack_IDirectMusicTrack_Join
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicParamControlTrack (LPCGUID lpcGUID, LPDIRECTMUSICTRACK8 *ppTrack, LPUNKNOWN pUnkOuter)
{
IDirectMusicParamControlTrack* track;
if (IsEqualIID (lpcGUID, &IID_IDirectMusicTrack)
|| IsEqualIID (lpcGUID, &IID_IDirectMusicTrack8)) {
track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicParamControlTrack));
if (NULL == track) {
*ppTrack = (LPDIRECTMUSICTRACK8) NULL;
return E_OUTOFMEMORY;
}
track->lpVtbl = &DirectMusicParamControlTrack_Vtbl;
track->ref = 1;
track->pStream = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(IDirectMusicParamControlTrackStream));
track->pStream->lpVtbl = &DirectMusicParamControlTrackStream_Vtbl;
track->pStream->ref = 1;
track->pStream->pParentTrack = track;
*ppTrack = (LPDIRECTMUSICTRACK8) track;
return S_OK;
}
WARN("No interface found\n");
return E_NOINTERFACE;
/* IDirectMusicParamControlTrack IPersistStream part: */
HRESULT WINAPI IDirectMusicParamControlTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicParamControlTrack, PersistStreamVtbl, iface);
return IDirectMusicParamControlTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
/*****************************************************************************
* IDirectMusicParamControlTrackStream implementation
*/
/* IDirectMusicParamControlTrackStream IUnknown part follow: */
HRESULT WINAPI IDirectMusicParamControlTrackStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicParamControlTrackStream,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicParamControlTrackStream_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
ULONG WINAPI IDirectMusicParamControlTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicParamControlTrack, PersistStreamVtbl, iface);
return IDirectMusicParamControlTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicParamControlTrackStream_AddRef (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicParamControlTrackStream,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
ULONG WINAPI IDirectMusicParamControlTrack_IPersistStream_Release (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicParamControlTrack, PersistStreamVtbl, iface);
return IDirectMusicParamControlTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicParamControlTrackStream_Release (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicParamControlTrackStream,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicParamControlTrackStream IPersist part: */
HRESULT WINAPI IDirectMusicParamControlTrackStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID)
{
HRESULT WINAPI IDirectMusicParamControlTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) {
return E_NOTIMPL;
}
/* IDirectMusicParamControlTrackStream IPersistStream part: */
HRESULT WINAPI IDirectMusicParamControlTrackStream_IsDirty (LPPERSISTSTREAM iface)
{
HRESULT WINAPI IDirectMusicParamControlTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicParamControlTrackStream_Load (LPPERSISTSTREAM iface, IStream* pStm)
{
HRESULT WINAPI IDirectMusicParamControlTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm) {
FIXME(": Loading not implemented yet\n");
return S_OK;
}
HRESULT WINAPI IDirectMusicParamControlTrackStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty)
{
HRESULT WINAPI IDirectMusicParamControlTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicParamControlTrackStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize)
{
HRESULT WINAPI IDirectMusicParamControlTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) {
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicParamControlTrackStream_Vtbl =
{
ICOM_VTABLE(IPersistStream) DirectMusicParamControlTrack_PersistStream_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicParamControlTrackStream_QueryInterface,
IDirectMusicParamControlTrackStream_AddRef,
IDirectMusicParamControlTrackStream_Release,
IDirectMusicParamControlTrackStream_GetClassID,
IDirectMusicParamControlTrackStream_IsDirty,
IDirectMusicParamControlTrackStream_Load,
IDirectMusicParamControlTrackStream_Save,
IDirectMusicParamControlTrackStream_GetSizeMax
IDirectMusicParamControlTrack_IPersistStream_QueryInterface,
IDirectMusicParamControlTrack_IPersistStream_AddRef,
IDirectMusicParamControlTrack_IPersistStream_Release,
IDirectMusicParamControlTrack_IPersistStream_GetClassID,
IDirectMusicParamControlTrack_IPersistStream_IsDirty,
IDirectMusicParamControlTrack_IPersistStream_Load,
IDirectMusicParamControlTrack_IPersistStream_Save,
IDirectMusicParamControlTrack_IPersistStream_GetSizeMax
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicParamControlTrack (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) {
IDirectMusicParamControlTrack* track;
track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicParamControlTrack));
if (NULL == track) {
*ppobj = (LPVOID) NULL;
return E_OUTOFMEMORY;
}
track->UnknownVtbl = &DirectMusicParamControlTrack_Unknown_Vtbl;
track->TrackVtbl = &DirectMusicParamControlTrack_Track_Vtbl;
track->PersistStreamVtbl = &DirectMusicParamControlTrack_PersistStream_Vtbl;
track->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC));
DM_STRUCT_INIT(track->pDesc);
track->pDesc->dwValidData |= DMUS_OBJ_CLASS;
memcpy (&track->pDesc->guidClass, &CLSID_DirectMusicParamControlTrack, sizeof (CLSID));
track->ref = 0; /* will be inited by QueryInterface */
return IDirectMusicParamControlTrack_IUnknown_QueryInterface ((LPUNKNOWN)&track->UnknownVtbl, lpcGUID, ppobj);
}

View File

@ -1,6 +1,6 @@
/* IDirectMusicPatternTrack Implementation
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -17,21 +17,12 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "dmime_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmime);
/* IDirectMusicPatternTrack IUnknown parts follow: */
HRESULT WINAPI IDirectMusicPatternTrackImpl_QueryInterface (LPDIRECTMUSICPATTERNTRACK iface, REFIID riid, LPVOID *ppobj)
{
HRESULT WINAPI IDirectMusicPatternTrackImpl_QueryInterface (LPDIRECTMUSICPATTERNTRACK iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IDirectMusicPatternTrackImpl,iface);
if (IsEqualIID (riid, &IID_IUnknown) ||
@ -45,15 +36,13 @@ HRESULT WINAPI IDirectMusicPatternTrackImpl_QueryInterface (LPDIRECTMUSICPATTERN
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicPatternTrackImpl_AddRef (LPDIRECTMUSICPATTERNTRACK iface)
{
ULONG WINAPI IDirectMusicPatternTrackImpl_AddRef (LPDIRECTMUSICPATTERNTRACK iface) {
ICOM_THIS(IDirectMusicPatternTrackImpl,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicPatternTrackImpl_Release (LPDIRECTMUSICPATTERNTRACK iface)
{
ULONG WINAPI IDirectMusicPatternTrackImpl_Release (LPDIRECTMUSICPATTERNTRACK iface) {
ICOM_THIS(IDirectMusicPatternTrackImpl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
@ -64,35 +53,25 @@ ULONG WINAPI IDirectMusicPatternTrackImpl_Release (LPDIRECTMUSICPATTERNTRACK ifa
}
/* IDirectMusicPatternTrack Interface follow: */
HRESULT WINAPI IDirectMusicPatternTrackImpl_CreateSegment (LPDIRECTMUSICPATTERNTRACK iface, IDirectMusicStyle* pStyle, IDirectMusicSegment** ppSegment)
{
HRESULT WINAPI IDirectMusicPatternTrackImpl_CreateSegment (LPDIRECTMUSICPATTERNTRACK iface, IDirectMusicStyle* pStyle, IDirectMusicSegment** ppSegment) {
ICOM_THIS(IDirectMusicPatternTrackImpl,iface);
FIXME("(%p, %p, %p): stub\n", This, pStyle, ppSegment);
return S_OK;
}
HRESULT WINAPI IDirectMusicPatternTrackImpl_SetVariation (LPDIRECTMUSICPATTERNTRACK iface, IDirectMusicSegmentState* pSegState, DWORD dwVariationFlags, DWORD dwPart)
{
HRESULT WINAPI IDirectMusicPatternTrackImpl_SetVariation (LPDIRECTMUSICPATTERNTRACK iface, IDirectMusicSegmentState* pSegState, DWORD dwVariationFlags, DWORD dwPart) {
ICOM_THIS(IDirectMusicPatternTrackImpl,iface);
FIXME("(%p, %p, %ld, %ld): stub\n", This, pSegState, dwVariationFlags, dwPart);
return S_OK;
}
HRESULT WINAPI IDirectMusicPatternTrackImpl_SetPatternByName (LPDIRECTMUSICPATTERNTRACK iface, IDirectMusicSegmentState* pSegState, WCHAR* wszName, IDirectMusicStyle* pStyle, DWORD dwPatternType, DWORD* pdwLength)
{
HRESULT WINAPI IDirectMusicPatternTrackImpl_SetPatternByName (LPDIRECTMUSICPATTERNTRACK iface, IDirectMusicSegmentState* pSegState, WCHAR* wszName, IDirectMusicStyle* pStyle, DWORD dwPatternType, DWORD* pdwLength) {
ICOM_THIS(IDirectMusicPatternTrackImpl,iface);
FIXME("(%p, %p, %p, %p, %ld, %p): stub\n", This, pSegState, wszName, pStyle, dwPatternType, pdwLength);
return S_OK;
}
ICOM_VTABLE(IDirectMusicPatternTrack) DirectMusicPatternTrack_Vtbl =
{
ICOM_VTABLE(IDirectMusicPatternTrack) DirectMusicPatternTrack_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicPatternTrackImpl_QueryInterface,
IDirectMusicPatternTrackImpl_AddRef,
@ -103,14 +82,16 @@ ICOM_VTABLE(IDirectMusicPatternTrack) DirectMusicPatternTrack_Vtbl =
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicPatternTrack (LPCGUID lpcGUID, LPDIRECTMUSICPATTERNTRACK *ppDMPtrnTrack, LPUNKNOWN pUnkOuter)
{
if (IsEqualIID (lpcGUID, &IID_IDirectMusicComposer))
{
FIXME("Not yet\n");
return E_NOINTERFACE;
}
HRESULT WINAPI DMUSIC_CreateDirectMusicPatternTrackImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) {
IDirectMusicPatternTrackImpl* track;
WARN("No interface found\n");
return E_NOINTERFACE;
track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicPatternTrackImpl));
if (NULL == track) {
*ppobj = (LPVOID) NULL;
return E_OUTOFMEMORY;
}
track->lpVtbl = &DirectMusicPatternTrack_Vtbl;
track->ref = 0; /* will be inited by QueryInterface */
return IDirectMusicPatternTrackImpl_QueryInterface ((LPDIRECTMUSICPATTERNTRACK)track, lpcGUID, ppobj);
}

View File

@ -1,6 +1,6 @@
/* IDirectMusicPerformance Implementation
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -17,21 +17,12 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "dmime_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmime);
/* IDirectMusicPerformance8 IUnknown part: */
HRESULT WINAPI IDirectMusicPerformance8Impl_QueryInterface (LPDIRECTMUSICPERFORMANCE8 iface, REFIID riid, LPVOID *ppobj)
{
HRESULT WINAPI IDirectMusicPerformance8Impl_QueryInterface (LPDIRECTMUSICPERFORMANCE8 iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
if (IsEqualIID (riid, &IID_IUnknown) ||
@ -46,15 +37,13 @@ HRESULT WINAPI IDirectMusicPerformance8Impl_QueryInterface (LPDIRECTMUSICPERFORM
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicPerformance8Impl_AddRef (LPDIRECTMUSICPERFORMANCE8 iface)
{
ULONG WINAPI IDirectMusicPerformance8Impl_AddRef (LPDIRECTMUSICPERFORMANCE8 iface) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicPerformance8Impl_Release (LPDIRECTMUSICPERFORMANCE8 iface)
{
ULONG WINAPI IDirectMusicPerformance8Impl_Release (LPDIRECTMUSICPERFORMANCE8 iface) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
@ -64,9 +53,8 @@ ULONG WINAPI IDirectMusicPerformance8Impl_Release (LPDIRECTMUSICPERFORMANCE8 ifa
return ref;
}
/* IDirectMusicPerformance8 IDirectMusicPerformance Interface part: */
HRESULT WINAPI IDirectMusicPerformance8Impl_Init (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusic** ppDirectMusic, LPDIRECTSOUND pDirectSound, HWND hWnd)
{
/* IDirectMusicPerformanceImpl IDirectMusicPerformance Interface part: */
HRESULT WINAPI IDirectMusicPerformance8Impl_Init (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusic** ppDirectMusic, LPDIRECTSOUND pDirectSound, HWND hWnd) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(iface = %p, dmusic = %p, dsound = %p, hwnd = %p)\n", This, ppDirectMusic, pDirectSound, hWnd);
@ -109,220 +97,155 @@ HRESULT WINAPI IDirectMusicPerformance8Impl_Init (LPDIRECTMUSICPERFORMANCE8 ifac
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8Impl_PlaySegment (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicSegment* pSegment, DWORD dwFlags, __int64 i64StartTime, IDirectMusicSegmentState** ppSegmentState)
{
HRESULT WINAPI IDirectMusicPerformance8Impl_PlaySegment (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicSegment* pSegment, DWORD dwFlags, __int64 i64StartTime, IDirectMusicSegmentState** ppSegmentState) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %p, %ld, %lli, %p): stub\n", This, pSegment, dwFlags, i64StartTime, ppSegmentState);
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8Impl_Stop (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicSegment* pSegment, IDirectMusicSegmentState* pSegmentState, MUSIC_TIME mtTime, DWORD dwFlags)
{
HRESULT WINAPI IDirectMusicPerformance8Impl_Stop (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicSegment* pSegment, IDirectMusicSegmentState* pSegmentState, MUSIC_TIME mtTime, DWORD dwFlags) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %p, %p, %ld, %ld): stub\n", This, pSegment, pSegmentState, mtTime, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8Impl_GetSegmentState (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicSegmentState** ppSegmentState, MUSIC_TIME mtTime)
{
HRESULT WINAPI IDirectMusicPerformance8Impl_GetSegmentState (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicSegmentState** ppSegmentState, MUSIC_TIME mtTime) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p,%p, %ld): stub\n", This, ppSegmentState, mtTime);
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8Impl_SetPrepareTime (LPDIRECTMUSICPERFORMANCE8 iface, DWORD dwMilliSeconds)
{
HRESULT WINAPI IDirectMusicPerformance8Impl_SetPrepareTime (LPDIRECTMUSICPERFORMANCE8 iface, DWORD dwMilliSeconds) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %ld): stub\n", This, dwMilliSeconds);
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8Impl_GetPrepareTime (LPDIRECTMUSICPERFORMANCE8 iface, DWORD* pdwMilliSeconds)
{
HRESULT WINAPI IDirectMusicPerformance8Impl_GetPrepareTime (LPDIRECTMUSICPERFORMANCE8 iface, DWORD* pdwMilliSeconds) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %p): stub\n", This, pdwMilliSeconds);
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8Impl_SetBumperLength (LPDIRECTMUSICPERFORMANCE8 iface, DWORD dwMilliSeconds)
{
HRESULT WINAPI IDirectMusicPerformance8Impl_SetBumperLength (LPDIRECTMUSICPERFORMANCE8 iface, DWORD dwMilliSeconds) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %ld): stub\n", This, dwMilliSeconds);
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8Impl_GetBumperLength (LPDIRECTMUSICPERFORMANCE8 iface, DWORD* pdwMilliSeconds)
{
HRESULT WINAPI IDirectMusicPerformance8Impl_GetBumperLength (LPDIRECTMUSICPERFORMANCE8 iface, DWORD* pdwMilliSeconds) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %p): stub\n", This, pdwMilliSeconds);
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8Impl_SendPMsg (LPDIRECTMUSICPERFORMANCE8 iface, DMUS_PMSG* pPMSG)
{
HRESULT WINAPI IDirectMusicPerformance8Impl_SendPMsg (LPDIRECTMUSICPERFORMANCE8 iface, DMUS_PMSG* pPMSG) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %p): stub\n", This, pPMSG);
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8Impl_MusicToReferenceTime (LPDIRECTMUSICPERFORMANCE8 iface, MUSIC_TIME mtTime, REFERENCE_TIME* prtTime)
{
HRESULT WINAPI IDirectMusicPerformance8Impl_MusicToReferenceTime (LPDIRECTMUSICPERFORMANCE8 iface, MUSIC_TIME mtTime, REFERENCE_TIME* prtTime) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %ld, %p): stub\n", This, mtTime, prtTime);
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8Impl_ReferenceToMusicTime (LPDIRECTMUSICPERFORMANCE8 iface, REFERENCE_TIME rtTime, MUSIC_TIME* pmtTime)
{
HRESULT WINAPI IDirectMusicPerformance8Impl_ReferenceToMusicTime (LPDIRECTMUSICPERFORMANCE8 iface, REFERENCE_TIME rtTime, MUSIC_TIME* pmtTime) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %lli, %p): stub\n", This, rtTime, pmtTime);
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8Impl_IsPlaying (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicSegment* pSegment, IDirectMusicSegmentState* pSegState)
{
HRESULT WINAPI IDirectMusicPerformance8Impl_IsPlaying (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicSegment* pSegment, IDirectMusicSegmentState* pSegState) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %p, %p): stub\n", This, pSegment, pSegState);
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8Impl_GetTime (LPDIRECTMUSICPERFORMANCE8 iface, REFERENCE_TIME* prtNow, MUSIC_TIME* pmtNow)
{
HRESULT WINAPI IDirectMusicPerformance8Impl_GetTime (LPDIRECTMUSICPERFORMANCE8 iface, REFERENCE_TIME* prtNow, MUSIC_TIME* pmtNow) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %p, %p): stub\n", This, prtNow, pmtNow);
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8Impl_AllocPMsg (LPDIRECTMUSICPERFORMANCE8 iface, ULONG cb, DMUS_PMSG** ppPMSG)
{
HRESULT WINAPI IDirectMusicPerformance8Impl_AllocPMsg (LPDIRECTMUSICPERFORMANCE8 iface, ULONG cb, DMUS_PMSG** ppPMSG) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %ld, %p): stub\n", This, cb, ppPMSG);
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8Impl_FreePMsg (LPDIRECTMUSICPERFORMANCE8 iface, DMUS_PMSG* pPMSG)
{
HRESULT WINAPI IDirectMusicPerformance8Impl_FreePMsg (LPDIRECTMUSICPERFORMANCE8 iface, DMUS_PMSG* pPMSG) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %p): stub\n", This, pPMSG);
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8Impl_GetGraph (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicGraph** ppGraph)
{
HRESULT WINAPI IDirectMusicPerformance8Impl_GetGraph (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicGraph** ppGraph) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %p): to check\n", This, ppGraph);
if (NULL != This->pToolGraph) {
*ppGraph = (LPDIRECTMUSICGRAPH) This->pToolGraph;
IDirectMusicGraphImpl_AddRef((LPDIRECTMUSICGRAPH) *ppGraph);
IDirectMusicGraph_AddRef((LPDIRECTMUSICGRAPH) *ppGraph);
}
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8Impl_SetGraph (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicGraph* pGraph)
{
HRESULT WINAPI IDirectMusicPerformance8Impl_SetGraph (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicGraph* pGraph) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %p): to check\n", This, pGraph);
if (NULL != This->pToolGraph) {
/* Todo clean buffers and tools before */
IDirectMusicGraphImpl_Release((LPDIRECTMUSICGRAPH) This->pToolGraph);
IDirectMusicGraph_Release((LPDIRECTMUSICGRAPH) This->pToolGraph);
}
This->pToolGraph = pGraph;
if (NULL != This->pToolGraph) {
IDirectMusicGraphImpl_AddRef((LPDIRECTMUSICGRAPH) This->pToolGraph);
IDirectMusicGraph_AddRef((LPDIRECTMUSICGRAPH) This->pToolGraph);
}
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8Impl_SetNotificationHandle (LPDIRECTMUSICPERFORMANCE8 iface, HANDLE hNotification, REFERENCE_TIME rtMinimum)
{
HRESULT WINAPI IDirectMusicPerformance8Impl_SetNotificationHandle (LPDIRECTMUSICPERFORMANCE8 iface, HANDLE hNotification, REFERENCE_TIME rtMinimum) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %p, %lli): stub\n", This, hNotification, rtMinimum);
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8Impl_GetNotificationPMsg (LPDIRECTMUSICPERFORMANCE8 iface, DMUS_NOTIFICATION_PMSG** ppNotificationPMsg)
{
HRESULT WINAPI IDirectMusicPerformance8Impl_GetNotificationPMsg (LPDIRECTMUSICPERFORMANCE8 iface, DMUS_NOTIFICATION_PMSG** ppNotificationPMsg) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %p): stub\n", This, ppNotificationPMsg);
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8Impl_AddNotificationType (LPDIRECTMUSICPERFORMANCE8 iface, REFGUID rguidNotificationType)
{
HRESULT WINAPI IDirectMusicPerformance8Impl_AddNotificationType (LPDIRECTMUSICPERFORMANCE8 iface, REFGUID rguidNotificationType) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8Impl_RemoveNotificationType (LPDIRECTMUSICPERFORMANCE8 iface, REFGUID rguidNotificationType)
{
HRESULT WINAPI IDirectMusicPerformance8Impl_RemoveNotificationType (LPDIRECTMUSICPERFORMANCE8 iface, REFGUID rguidNotificationType) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8Impl_AddPort (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicPort* pPort)
{
HRESULT WINAPI IDirectMusicPerformance8Impl_AddPort (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicPort* pPort) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %p): stub\n", This, pPort);
IDirectMusicPort_AddRef (pPort);
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8Impl_RemovePort (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicPort* pPort)
{
HRESULT WINAPI IDirectMusicPerformance8Impl_RemovePort (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicPort* pPort) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %p): stub\n", This, pPort);
IDirectMusicPort_Release (pPort);
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8Impl_AssignPChannelBlock (LPDIRECTMUSICPERFORMANCE8 iface, DWORD dwBlockNum, IDirectMusicPort* pPort, DWORD dwGroup)
{
HRESULT WINAPI IDirectMusicPerformance8Impl_AssignPChannelBlock (LPDIRECTMUSICPERFORMANCE8 iface, DWORD dwBlockNum, IDirectMusicPort* pPort, DWORD dwGroup) {
int i, j, range /* min value in range */;
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
@ -341,8 +264,7 @@ HRESULT WINAPI IDirectMusicPerformance8Impl_AssignPChannelBlock (LPDIRECTMUSICPE
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8Impl_AssignPChannel (LPDIRECTMUSICPERFORMANCE8 iface, DWORD dwPChannel, IDirectMusicPort* pPort, DWORD dwGroup, DWORD dwMChannel)
{
HRESULT WINAPI IDirectMusicPerformance8Impl_AssignPChannel (LPDIRECTMUSICPERFORMANCE8 iface, DWORD dwPChannel, IDirectMusicPort* pPort, DWORD dwGroup, DWORD dwMChannel) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
TRACE("(%p, %ld, %p, %ld, %ld)\n", This, dwPChannel, pPort, dwGroup, dwMChannel);
@ -353,53 +275,37 @@ HRESULT WINAPI IDirectMusicPerformance8Impl_AssignPChannel (LPDIRECTMUSICPERFORM
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8Impl_PChannelInfo (LPDIRECTMUSICPERFORMANCE8 iface, DWORD dwPChannel, IDirectMusicPort** ppPort, DWORD* pdwGroup, DWORD* pdwMChannel)
{
HRESULT WINAPI IDirectMusicPerformance8Impl_PChannelInfo (LPDIRECTMUSICPERFORMANCE8 iface, DWORD dwPChannel, IDirectMusicPort** ppPort, DWORD* pdwGroup, DWORD* pdwMChannel) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %ld, %p, %p, %p): stub\n", This, dwPChannel, ppPort, pdwGroup, pdwMChannel);
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8Impl_DownloadInstrument (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicInstrument* pInst, DWORD dwPChannel, IDirectMusicDownloadedInstrument** ppDownInst, DMUS_NOTERANGE* pNoteRanges, DWORD dwNumNoteRanges, IDirectMusicPort** ppPort, DWORD* pdwGroup, DWORD* pdwMChannel)
{
HRESULT WINAPI IDirectMusicPerformance8Impl_DownloadInstrument (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicInstrument* pInst, DWORD dwPChannel, IDirectMusicDownloadedInstrument** ppDownInst, DMUS_NOTERANGE* pNoteRanges, DWORD dwNumNoteRanges, IDirectMusicPort** ppPort, DWORD* pdwGroup, DWORD* pdwMChannel) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %p, %ld, %p, %p, %ld, %p, %p, %p): stub\n", This, pInst, dwPChannel, ppDownInst, pNoteRanges, dwNumNoteRanges, ppPort, pdwGroup, pdwMChannel);
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8Impl_Invalidate (LPDIRECTMUSICPERFORMANCE8 iface, MUSIC_TIME mtTime, DWORD dwFlags)
{
HRESULT WINAPI IDirectMusicPerformance8Impl_Invalidate (LPDIRECTMUSICPERFORMANCE8 iface, MUSIC_TIME mtTime, DWORD dwFlags) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %ld, %ld): stub\n", This, mtTime, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8Impl_GetParam (LPDIRECTMUSICPERFORMANCE8 iface, REFGUID rguidType, DWORD dwGroupBits, DWORD dwIndex, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam)
{
HRESULT WINAPI IDirectMusicPerformance8Impl_GetParam (LPDIRECTMUSICPERFORMANCE8 iface, REFGUID rguidType, DWORD dwGroupBits, DWORD dwIndex, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %s, %ld, %ld, %ld, %p, %p): stub\n", This, debugstr_guid(rguidType), dwGroupBits, dwIndex, mtTime, pmtNext, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8Impl_SetParam (LPDIRECTMUSICPERFORMANCE8 iface, REFGUID rguidType, DWORD dwGroupBits, DWORD dwIndex, MUSIC_TIME mtTime, void* pParam)
{
HRESULT WINAPI IDirectMusicPerformance8Impl_SetParam (LPDIRECTMUSICPERFORMANCE8 iface, REFGUID rguidType, DWORD dwGroupBits, DWORD dwIndex, MUSIC_TIME mtTime, void* pParam) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %s, %ld, %ld, %ld, %p): stub\n", This, debugstr_guid(rguidType), dwGroupBits, dwIndex, mtTime, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8Impl_GetGlobalParam (LPDIRECTMUSICPERFORMANCE8 iface, REFGUID rguidType, void* pParam, DWORD dwSize)
{
HRESULT WINAPI IDirectMusicPerformance8Impl_GetGlobalParam (LPDIRECTMUSICPERFORMANCE8 iface, REFGUID rguidType, void* pParam, DWORD dwSize) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
TRACE("(%p, %s, %p, %ld): stub\n", This, debugstr_guid(rguidType), pParam, dwSize);
@ -416,8 +322,7 @@ HRESULT WINAPI IDirectMusicPerformance8Impl_GetGlobalParam (LPDIRECTMUSICPERFORM
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8Impl_SetGlobalParam (LPDIRECTMUSICPERFORMANCE8 iface, REFGUID rguidType, void* pParam, DWORD dwSize)
{
HRESULT WINAPI IDirectMusicPerformance8Impl_SetGlobalParam (LPDIRECTMUSICPERFORMANCE8 iface, REFGUID rguidType, void* pParam, DWORD dwSize) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
TRACE("(%p, %s, %p, %ld)\n", This, debugstr_guid(rguidType), pParam, dwSize);
@ -442,84 +347,57 @@ HRESULT WINAPI IDirectMusicPerformance8Impl_SetGlobalParam (LPDIRECTMUSICPERFORM
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8Impl_GetLatencyTime (LPDIRECTMUSICPERFORMANCE8 iface, REFERENCE_TIME* prtTime)
{
HRESULT WINAPI IDirectMusicPerformance8Impl_GetLatencyTime (LPDIRECTMUSICPERFORMANCE8 iface, REFERENCE_TIME* prtTime) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %p): stub\n", This, prtTime);
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8Impl_GetQueueTime (LPDIRECTMUSICPERFORMANCE8 iface, REFERENCE_TIME* prtTime)
{
HRESULT WINAPI IDirectMusicPerformance8Impl_GetQueueTime (LPDIRECTMUSICPERFORMANCE8 iface, REFERENCE_TIME* prtTime) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %p): stub\n", This, prtTime);
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8Impl_AdjustTime (LPDIRECTMUSICPERFORMANCE8 iface, REFERENCE_TIME rtAmount)
{
HRESULT WINAPI IDirectMusicPerformance8Impl_AdjustTime (LPDIRECTMUSICPERFORMANCE8 iface, REFERENCE_TIME rtAmount) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %lli): stub\n", This, rtAmount);
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8Impl_CloseDown (LPDIRECTMUSICPERFORMANCE8 iface)
{
HRESULT WINAPI IDirectMusicPerformance8Impl_CloseDown (LPDIRECTMUSICPERFORMANCE8 iface) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p): stub\n", This);
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8Impl_GetResolvedTime (LPDIRECTMUSICPERFORMANCE8 iface, REFERENCE_TIME rtTime, REFERENCE_TIME* prtResolved, DWORD dwTimeResolveFlags)
{
HRESULT WINAPI IDirectMusicPerformance8Impl_GetResolvedTime (LPDIRECTMUSICPERFORMANCE8 iface, REFERENCE_TIME rtTime, REFERENCE_TIME* prtResolved, DWORD dwTimeResolveFlags) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %lli, %p, %ld): stub\n", This, rtTime, prtResolved, dwTimeResolveFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8Impl_MIDIToMusic (LPDIRECTMUSICPERFORMANCE8 iface, BYTE bMIDIValue, DMUS_CHORD_KEY* pChord, BYTE bPlayMode, BYTE bChordLevel, WORD* pwMusicValue)
{
HRESULT WINAPI IDirectMusicPerformance8Impl_MIDIToMusic (LPDIRECTMUSICPERFORMANCE8 iface, BYTE bMIDIValue, DMUS_CHORD_KEY* pChord, BYTE bPlayMode, BYTE bChordLevel, WORD* pwMusicValue) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %d, %p, %d, %d, %p): stub\n", This, bMIDIValue, pChord, bPlayMode, bChordLevel, pwMusicValue);
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8Impl_MusicToMIDI (LPDIRECTMUSICPERFORMANCE8 iface, WORD wMusicValue, DMUS_CHORD_KEY* pChord, BYTE bPlayMode, BYTE bChordLevel, BYTE* pbMIDIValue)
{
HRESULT WINAPI IDirectMusicPerformance8Impl_MusicToMIDI (LPDIRECTMUSICPERFORMANCE8 iface, WORD wMusicValue, DMUS_CHORD_KEY* pChord, BYTE bPlayMode, BYTE bChordLevel, BYTE* pbMIDIValue) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %d, %p, %d, %d, %p): stub\n", This, wMusicValue, pChord, bPlayMode, bChordLevel, pbMIDIValue);
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8Impl_TimeToRhythm (LPDIRECTMUSICPERFORMANCE8 iface, MUSIC_TIME mtTime, DMUS_TIMESIGNATURE* pTimeSig, WORD* pwMeasure, BYTE* pbBeat, BYTE* pbGrid, short* pnOffset)
{
HRESULT WINAPI IDirectMusicPerformance8Impl_TimeToRhythm (LPDIRECTMUSICPERFORMANCE8 iface, MUSIC_TIME mtTime, DMUS_TIMESIGNATURE* pTimeSig, WORD* pwMeasure, BYTE* pbBeat, BYTE* pbGrid, short* pnOffset) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %ld, %p, %p, %p, %p, %p): stub\n", This, mtTime, pTimeSig, pwMeasure, pbBeat, pbGrid, pnOffset);
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8Impl_RhythmToTime (LPDIRECTMUSICPERFORMANCE8 iface, WORD wMeasure, BYTE bBeat, BYTE bGrid, short nOffset, DMUS_TIMESIGNATURE* pTimeSig, MUSIC_TIME* pmtTime)
{
HRESULT WINAPI IDirectMusicPerformance8Impl_RhythmToTime (LPDIRECTMUSICPERFORMANCE8 iface, WORD wMeasure, BYTE bBeat, BYTE bGrid, short nOffset, DMUS_TIMESIGNATURE* pTimeSig, MUSIC_TIME* pmtTime) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %d, %d, %d, %i, %p, %p): stub\n", This, wMeasure, bBeat, bGrid, nOffset, pTimeSig, pmtTime);
return S_OK;
}
@ -531,8 +409,7 @@ HRESULT WINAPI IDirectMusicPerformance8ImplInitAudio (LPDIRECTMUSICPERFORMANCE8
DWORD dwDefaultPathType,
DWORD dwPChannelCount,
DWORD dwFlags,
DMUS_AUDIOPARAMS* pParams)
{
DMUS_AUDIOPARAMS* pParams) {
IDirectSound* dsound;
HRESULT hr = S_OK;
@ -579,47 +456,34 @@ HRESULT WINAPI IDirectMusicPerformance8ImplInitAudio (LPDIRECTMUSICPERFORMANCE8
return hr;
}
HRESULT WINAPI IDirectMusicPerformance8ImplPlaySegmentEx (LPDIRECTMUSICPERFORMANCE8 iface, IUnknown* pSource, WCHAR* pwzSegmentName, IUnknown* pTransition, DWORD dwFlags, __int64 i64StartTime, IDirectMusicSegmentState** ppSegmentState, IUnknown* pFrom, IUnknown* pAudioPath)
{
HRESULT WINAPI IDirectMusicPerformance8ImplPlaySegmentEx (LPDIRECTMUSICPERFORMANCE8 iface, IUnknown* pSource, WCHAR* pwzSegmentName, IUnknown* pTransition, DWORD dwFlags, __int64 i64StartTime, IDirectMusicSegmentState** ppSegmentState, IUnknown* pFrom, IUnknown* pAudioPath) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %p, %p, %p, %ld, %lli, %p, %p, %p): stub\n", This, pSource, pwzSegmentName, pTransition, dwFlags, i64StartTime, ppSegmentState, pFrom, pAudioPath);
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8ImplStopEx (LPDIRECTMUSICPERFORMANCE8 iface, IUnknown* pObjectToStop, __int64 i64StopTime, DWORD dwFlags)
{
HRESULT WINAPI IDirectMusicPerformance8ImplStopEx (LPDIRECTMUSICPERFORMANCE8 iface, IUnknown* pObjectToStop, __int64 i64StopTime, DWORD dwFlags) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %p, %lli, %ld): stub\n", This, pObjectToStop, i64StopTime, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8ImplClonePMsg (LPDIRECTMUSICPERFORMANCE8 iface, DMUS_PMSG* pSourcePMSG, DMUS_PMSG** ppCopyPMSG)
{
HRESULT WINAPI IDirectMusicPerformance8ImplClonePMsg (LPDIRECTMUSICPERFORMANCE8 iface, DMUS_PMSG* pSourcePMSG, DMUS_PMSG** ppCopyPMSG) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %p, %p): stub\n", This, pSourcePMSG, ppCopyPMSG);
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8ImplCreateAudioPath (LPDIRECTMUSICPERFORMANCE8 iface, IUnknown* pSourceConfig, BOOL fActivate, IDirectMusicAudioPath** ppNewPath)
{
HRESULT WINAPI IDirectMusicPerformance8ImplCreateAudioPath (LPDIRECTMUSICPERFORMANCE8 iface, IUnknown* pSourceConfig, BOOL fActivate, IDirectMusicAudioPath** ppNewPath) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %p, %d, %p): stub\n", This, pSourceConfig, fActivate, ppNewPath);
return S_OK;
}
/**
* see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directX/htm/standardaudiopaths.asp
*/
HRESULT WINAPI IDirectMusicPerformance8ImplCreateStandardAudioPath (LPDIRECTMUSICPERFORMANCE8 iface, DWORD dwType, DWORD dwPChannelCount, BOOL fActivate, IDirectMusicAudioPath** ppNewPath)
{
HRESULT WINAPI IDirectMusicPerformance8ImplCreateStandardAudioPath (LPDIRECTMUSICPERFORMANCE8 iface, DWORD dwType, DWORD dwPChannelCount, BOOL fActivate, IDirectMusicAudioPath** ppNewPath) {
IDirectMusicAudioPathImpl *default_path;
DSBUFFERDESC desc;
WAVEFORMATEX format;
@ -633,13 +497,8 @@ HRESULT WINAPI IDirectMusicPerformance8ImplCreateStandardAudioPath (LPDIRECTMUSI
if (NULL == ppNewPath) {
return E_POINTER;
}
default_path = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicAudioPathImpl));
if (NULL == default_path) {
*ppNewPath = (LPDIRECTMUSICAUDIOPATH) NULL;
return E_OUTOFMEMORY;
}
default_path->lpVtbl = &DirectMusicAudioPath_Vtbl;
default_path->ref = 1;
DMUSIC_CreateDirectMusicAudioPathImpl (&IID_IDirectMusicAudioPath, (LPVOID*)&default_path, NULL);
default_path->pPerf = (IDirectMusicPerformance8*) This;
/* Secondary buffer description */
@ -712,42 +571,39 @@ HRESULT WINAPI IDirectMusicPerformance8ImplCreateStandardAudioPath (LPDIRECTMUSI
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8ImplSetDefaultAudioPath (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicAudioPath* pAudioPath)
{
HRESULT WINAPI IDirectMusicPerformance8ImplSetDefaultAudioPath (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicAudioPath* pAudioPath) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %p): semi-stub\n", This, pAudioPath);
if (NULL != This->pDefaultPath) {
IDirectMusicAudioPathImpl_Release((LPDIRECTMUSICAUDIOPATH) This->pDefaultPath);
IDirectMusicAudioPath_Release((LPDIRECTMUSICAUDIOPATH) This->pDefaultPath);
((IDirectMusicAudioPathImpl*) This->pDefaultPath)->pPerf = NULL;
This->pDefaultPath = NULL;
}
This->pDefaultPath = pAudioPath;
if (NULL != This->pDefaultPath) {
IDirectMusicAudioPathImpl_AddRef((LPDIRECTMUSICAUDIOPATH) This->pDefaultPath);
IDirectMusicAudioPath_AddRef((LPDIRECTMUSICAUDIOPATH) This->pDefaultPath);
((IDirectMusicAudioPathImpl*) This->pDefaultPath)->pPerf = (IDirectMusicPerformance8*) This;
}
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8ImplGetDefaultAudioPath (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicAudioPath** ppAudioPath)
{
HRESULT WINAPI IDirectMusicPerformance8ImplGetDefaultAudioPath (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicAudioPath** ppAudioPath) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %p): semi-stub\n", This, ppAudioPath);
if (NULL != This->pDefaultPath) {
*ppAudioPath = (LPDIRECTMUSICAUDIOPATH) This->pDefaultPath;
IDirectMusicAudioPathImpl_AddRef(*ppAudioPath);
IDirectMusicAudioPath_AddRef(*ppAudioPath);
} else {
*ppAudioPath = NULL;
}
return S_OK;
}
HRESULT WINAPI IDirectMusicPerformance8ImplGetParamEx (LPDIRECTMUSICPERFORMANCE8 iface, REFGUID rguidType, DWORD dwTrackID, DWORD dwGroupBits, DWORD dwIndex, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam)
{
HRESULT WINAPI IDirectMusicPerformance8ImplGetParamEx (LPDIRECTMUSICPERFORMANCE8 iface, REFGUID rguidType, DWORD dwTrackID, DWORD dwGroupBits, DWORD dwIndex, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam) {
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %s, %ld, %ld, %ld, %ld, %p, %p): stub\n", This, debugstr_guid(rguidType), dwTrackID, dwGroupBits, dwIndex, mtTime, pmtNext, pParam);
@ -755,8 +611,7 @@ HRESULT WINAPI IDirectMusicPerformance8ImplGetParamEx (LPDIRECTMUSICPERFORMANCE8
return S_OK;
}
ICOM_VTABLE(IDirectMusicPerformance8) DirectMusicPerformance8_Vtbl =
{
ICOM_VTABLE(IDirectMusicPerformance8) DirectMusicPerformance8_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicPerformance8Impl_QueryInterface,
IDirectMusicPerformance8Impl_AddRef,
@ -814,29 +669,21 @@ ICOM_VTABLE(IDirectMusicPerformance8) DirectMusicPerformance8_Vtbl =
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicPerformance (LPCGUID lpcGUID, LPDIRECTMUSICPERFORMANCE8 *ppDMPerf, LPUNKNOWN pUnkOuter)
{
IDirectMusicPerformance8Impl *pPerf;
HRESULT WINAPI DMUSIC_CreateDirectMusicPerformanceImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) {
IDirectMusicPerformance8Impl *obj;
TRACE("(%p,%p,%p)\n",lpcGUID, ppDMPerf, pUnkOuter);
if (IsEqualIID (lpcGUID, &IID_IDirectMusicPerformance) ||
IsEqualIID (lpcGUID, &IID_IDirectMusicPerformance8)) {
pPerf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicPerformance8Impl));
if (NULL == pPerf)
{
*ppDMPerf = (LPDIRECTMUSICPERFORMANCE8)NULL;
return E_OUTOFMEMORY;
}
pPerf->lpVtbl = &DirectMusicPerformance8_Vtbl;
pPerf->ref = 1;
pPerf->pDirectMusic = NULL;
pPerf->pDirectSound = NULL;
pPerf->pDefaultPath = NULL;
*ppDMPerf = (LPDIRECTMUSICPERFORMANCE8) pPerf;
return S_OK;
TRACE("(%p,%p,%p)\n", lpcGUID, ppobj, pUnkOuter);
obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicPerformance8Impl));
if (NULL == obj) {
*ppobj = (LPDIRECTMUSICPERFORMANCE8)NULL;
return E_OUTOFMEMORY;
}
WARN("No interface found\n");
obj->lpVtbl = &DirectMusicPerformance8_Vtbl;
obj->ref = 1;
obj->pDirectMusic = NULL;
obj->pDirectSound = NULL;
obj->pDefaultPath = NULL;
return E_NOINTERFACE;
return IDirectMusicPerformance8Impl_QueryInterface ((LPDIRECTMUSICPERFORMANCE8)obj, lpcGUID, ppobj);
}

View File

@ -18,21 +18,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdarg.h>
#include <string.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winreg.h"
#include "winerror.h"
#include "dmusics.h"
#include "dmusici.h"
#include "dmplugin.h"
#include "wine/debug.h"
#include "dmime_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmime);
@ -44,8 +30,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(dmime);
/***********************************************************************
* interface for self-registering
*/
struct regsvr_interface
{
struct regsvr_interface {
IID const *iid; /* NULL for end of list */
LPCSTR name; /* can be NULL to omit */
IID const *base_iid; /* can be NULL to omit */
@ -57,8 +42,7 @@ struct regsvr_interface
static HRESULT register_interfaces(struct regsvr_interface const *list);
static HRESULT unregister_interfaces(struct regsvr_interface const *list);
struct regsvr_coclass
{
struct regsvr_coclass {
CLSID const *clsid; /* NULL for end of list */
LPCSTR name; /* can be NULL to omit */
LPCSTR ips; /* can be NULL to omit */
@ -124,8 +108,7 @@ static LONG recursive_delete_keyW(HKEY base, WCHAR const *name);
/***********************************************************************
* register_interfaces
*/
static HRESULT register_interfaces(struct regsvr_interface const *list)
{
static HRESULT register_interfaces(struct regsvr_interface const *list) {
LONG res = ERROR_SUCCESS;
HKEY interface_key;
@ -194,8 +177,7 @@ error_return:
/***********************************************************************
* unregister_interfaces
*/
static HRESULT unregister_interfaces(struct regsvr_interface const *list)
{
static HRESULT unregister_interfaces(struct regsvr_interface const *list) {
LONG res = ERROR_SUCCESS;
HKEY interface_key;
@ -219,8 +201,7 @@ error_return:
/***********************************************************************
* register_coclasses
*/
static HRESULT register_coclasses(struct regsvr_coclass const *list)
{
static HRESULT register_coclasses(struct regsvr_coclass const *list) {
LONG res = ERROR_SUCCESS;
HKEY coclass_key;
@ -301,8 +282,7 @@ error_return:
/***********************************************************************
* unregister_coclasses
*/
static HRESULT unregister_coclasses(struct regsvr_coclass const *list)
{
static HRESULT unregister_coclasses(struct regsvr_coclass const *list) {
LONG res = ERROR_SUCCESS;
HKEY coclass_key;
@ -338,8 +318,7 @@ error_return:
/***********************************************************************
* regsvr_key_guid
*/
static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid)
{
static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid) {
WCHAR buf[39];
StringFromGUID2(guid, buf, 39);
@ -352,8 +331,7 @@ static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid)
static LONG register_key_defvalueW(
HKEY base,
WCHAR const *name,
WCHAR const *value)
{
WCHAR const *value) {
LONG res;
HKEY key;
@ -372,8 +350,7 @@ static LONG register_key_defvalueW(
static LONG register_key_defvalueA(
HKEY base,
WCHAR const *name,
char const *value)
{
char const *value) {
LONG res;
HKEY key;
@ -394,8 +371,7 @@ static LONG register_progid(
char const *progid,
char const *curver_progid,
char const *name,
char const *extra)
{
char const *extra) {
LONG res;
HKEY progid_key;
@ -439,8 +415,7 @@ error_close_progid_key:
/***********************************************************************
* recursive_delete_key
*/
static LONG recursive_delete_key(HKEY key)
{
static LONG recursive_delete_key(HKEY key) {
LONG res;
WCHAR subkey_name[MAX_PATH];
DWORD cName;
@ -471,8 +446,7 @@ static LONG recursive_delete_key(HKEY key)
/***********************************************************************
* recursive_delete_keyA
*/
static LONG recursive_delete_keyA(HKEY base, char const *name)
{
static LONG recursive_delete_keyA(HKEY base, char const *name) {
LONG res;
HKEY key;
@ -487,8 +461,7 @@ static LONG recursive_delete_keyA(HKEY base, char const *name)
/***********************************************************************
* recursive_delete_keyW
*/
static LONG recursive_delete_keyW(HKEY base, WCHAR const *name)
{
static LONG recursive_delete_keyW(HKEY base, WCHAR const *name) {
LONG res;
HKEY key;
@ -592,14 +565,6 @@ static struct regsvr_coclass const coclass_list[] = {
"Microsoft.DirectMusicLyricsTrack.1",
"Microsoft.DirectMusicLyricsTrack"
},
{ &CLSID_DirectMusicSong,
"DirectMusicSong",
NULL,
"dmime.dll",
"Both",
"Microsoft.DirectMusicSong.1",
"Microsoft.DirectMusicSong"
},
{ &CLSID_DirectMusicSegTriggerTrack,
"DirectMusicSegTriggerTrack",
NULL,
@ -638,8 +603,7 @@ static struct regsvr_interface const interface_list[] = {
/***********************************************************************
* DllRegisterServer (DMIME.3)
*/
HRESULT WINAPI DMIME_DllRegisterServer(void)
{
HRESULT WINAPI DMIME_DllRegisterServer(void) {
HRESULT hr;
TRACE("\n");
@ -653,8 +617,7 @@ HRESULT WINAPI DMIME_DllRegisterServer(void)
/***********************************************************************
* DllUnregisterServer (DMIME.4)
*/
HRESULT WINAPI DMIME_DllUnregisterServer(void)
{
HRESULT WINAPI DMIME_DllUnregisterServer(void) {
HRESULT hr;
TRACE("\n");

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
/* IDirectMusicSegmentState8 Implementation
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -17,22 +17,12 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "dmime_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmime);
/* IDirectMusicSegmentState8 IUnknown part: */
HRESULT WINAPI IDirectMusicSegmentState8Impl_QueryInterface (LPDIRECTMUSICSEGMENTSTATE8 iface, REFIID riid, LPVOID *ppobj)
{
/* IDirectMusicSegmentState8Impl IUnknown part: */
HRESULT WINAPI IDirectMusicSegmentState8Impl_QueryInterface (LPDIRECTMUSICSEGMENTSTATE8 iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IDirectMusicSegmentState8Impl,iface);
if (IsEqualIID(riid, &IID_IUnknown) ||
@ -46,15 +36,13 @@ HRESULT WINAPI IDirectMusicSegmentState8Impl_QueryInterface (LPDIRECTMUSICSEGMEN
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicSegmentState8Impl_AddRef (LPDIRECTMUSICSEGMENTSTATE8 iface)
{
ULONG WINAPI IDirectMusicSegmentState8Impl_AddRef (LPDIRECTMUSICSEGMENTSTATE8 iface) {
ICOM_THIS(IDirectMusicSegmentState8Impl,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicSegmentState8Impl_Release (LPDIRECTMUSICSEGMENTSTATE8 iface)
{
ULONG WINAPI IDirectMusicSegmentState8Impl_Release (LPDIRECTMUSICSEGMENTSTATE8 iface) {
ICOM_THIS(IDirectMusicSegmentState8Impl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
@ -64,73 +52,51 @@ ULONG WINAPI IDirectMusicSegmentState8Impl_Release (LPDIRECTMUSICSEGMENTSTATE8 i
return ref;
}
/* IDirectMusicSegmentState8 IDirectMusicSegmentState part: */
HRESULT WINAPI IDirectMusicSegmentState8Impl_GetRepeats (LPDIRECTMUSICSEGMENTSTATE8 iface, DWORD* pdwRepeats)
{
/* IDirectMusicSegmentState8Impl IDirectMusicSegmentState part: */
HRESULT WINAPI IDirectMusicSegmentState8Impl_GetRepeats (LPDIRECTMUSICSEGMENTSTATE8 iface, DWORD* pdwRepeats) {
ICOM_THIS(IDirectMusicSegmentState8Impl,iface);
FIXME("(%p, %p): stub\n", This, pdwRepeats);
return S_OK;
}
HRESULT WINAPI IDirectMusicSegmentState8Impl_GetSegment (LPDIRECTMUSICSEGMENTSTATE8 iface, IDirectMusicSegment** ppSegment)
{
HRESULT WINAPI IDirectMusicSegmentState8Impl_GetSegment (LPDIRECTMUSICSEGMENTSTATE8 iface, IDirectMusicSegment** ppSegment) {
ICOM_THIS(IDirectMusicSegmentState8Impl,iface);
FIXME("(%p, %p): stub\n", This, ppSegment);
return S_OK;
}
HRESULT WINAPI IDirectMusicSegmentState8Impl_GetStartTime (LPDIRECTMUSICSEGMENTSTATE8 iface, MUSIC_TIME* pmtStart)
{
HRESULT WINAPI IDirectMusicSegmentState8Impl_GetStartTime (LPDIRECTMUSICSEGMENTSTATE8 iface, MUSIC_TIME* pmtStart) {
ICOM_THIS(IDirectMusicSegmentState8Impl,iface);
FIXME("(%p, %p): stub\n", This, pmtStart);
return S_OK;
}
HRESULT WINAPI IDirectMusicSegmentState8Impl_GetSeek (LPDIRECTMUSICSEGMENTSTATE8 iface, MUSIC_TIME* pmtSeek)
{
HRESULT WINAPI IDirectMusicSegmentState8Impl_GetSeek (LPDIRECTMUSICSEGMENTSTATE8 iface, MUSIC_TIME* pmtSeek) {
ICOM_THIS(IDirectMusicSegmentState8Impl,iface);
FIXME("(%p, %p): stub\n", This, pmtSeek);
return S_OK;
}
HRESULT WINAPI IDirectMusicSegmentState8Impl_GetStartPoint (LPDIRECTMUSICSEGMENTSTATE8 iface, MUSIC_TIME* pmtStart)
{
HRESULT WINAPI IDirectMusicSegmentState8Impl_GetStartPoint (LPDIRECTMUSICSEGMENTSTATE8 iface, MUSIC_TIME* pmtStart) {
ICOM_THIS(IDirectMusicSegmentState8Impl,iface);
FIXME("(%p, %p): stub\n", This, pmtStart);
return S_OK;
}
/* IDirectMusicSegmentState8 IDirectMusicSegmentState8 part: */
HRESULT WINAPI IDirectMusicSegmentState8Impl_SetTrackConfig (LPDIRECTMUSICSEGMENTSTATE8 iface, REFGUID rguidTrackClassID, DWORD dwGroupBits, DWORD dwIndex, DWORD dwFlagsOn, DWORD dwFlagsOff)
{
/* IDirectMusicSegmentState8Impl IDirectMusicSegmentState8 part: */
HRESULT WINAPI IDirectMusicSegmentState8Impl_SetTrackConfig (LPDIRECTMUSICSEGMENTSTATE8 iface, REFGUID rguidTrackClassID, DWORD dwGroupBits, DWORD dwIndex, DWORD dwFlagsOn, DWORD dwFlagsOff) {
ICOM_THIS(IDirectMusicSegmentState8Impl,iface);
FIXME("(%p, %s, %ld, %ld, %ld, %ld): stub\n", This, debugstr_guid(rguidTrackClassID), dwGroupBits, dwIndex, dwFlagsOn, dwFlagsOff);
return S_OK;
}
HRESULT WINAPI IDirectMusicSegmentState8Impl_GetObjectInPath (LPDIRECTMUSICSEGMENTSTATE8 iface, DWORD dwPChannel, DWORD dwStage, DWORD dwBuffer, REFGUID guidObject, DWORD dwIndex, REFGUID iidInterface, void** ppObject)
{
HRESULT WINAPI IDirectMusicSegmentState8Impl_GetObjectInPath (LPDIRECTMUSICSEGMENTSTATE8 iface, DWORD dwPChannel, DWORD dwStage, DWORD dwBuffer, REFGUID guidObject, DWORD dwIndex, REFGUID iidInterface, void** ppObject) {
ICOM_THIS(IDirectMusicSegmentState8Impl,iface);
FIXME("(%p, %ld, %ld, %ld, %s, %ld, %s, %p): stub\n", This, dwPChannel, dwStage, dwBuffer, debugstr_guid(guidObject), dwIndex, debugstr_guid(iidInterface), ppObject);
return S_OK;
}
ICOM_VTABLE(IDirectMusicSegmentState8) DirectMusicSegmentState8_Vtbl =
{
ICOM_VTABLE(IDirectMusicSegmentState8) DirectMusicSegmentState8_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicSegmentState8Impl_QueryInterface,
IDirectMusicSegmentState8Impl_AddRef,
@ -145,14 +111,16 @@ ICOM_VTABLE(IDirectMusicSegmentState8) DirectMusicSegmentState8_Vtbl =
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicSegmentState (LPCGUID lpcGUID, LPDIRECTMUSICSEGMENTSTATE8 *ppDMSeg, LPUNKNOWN pUnkOuter)
{
if (IsEqualIID (lpcGUID, &IID_IDirectMusicSegmentState)
|| IsEqualIID (lpcGUID, &IID_IDirectMusicSegmentState8)) {
FIXME("Not yet\n");
return E_NOINTERFACE;
}
WARN("No interface found\n");
HRESULT WINAPI DMUSIC_CreateDirectMusicSegmentStateImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) {
IDirectMusicSegmentState8Impl* obj;
return E_NOINTERFACE;
obj = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicSegmentState8Impl));
if (NULL == obj) {
*ppobj = (LPVOID) NULL;
return E_OUTOFMEMORY;
}
obj->lpVtbl = &DirectMusicSegmentState8_Vtbl;
obj->ref = 0; /* will be inited by QueryInterface */
return IDirectMusicSegmentState8Impl_QueryInterface ((LPDIRECTMUSICSEGMENTSTATE8)obj, lpcGUID, ppobj);
}

View File

@ -1,6 +1,6 @@
/* IDirectMusicSegTriggerTrack Implementation
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -17,14 +17,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "dmime_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmime);
@ -34,19 +26,21 @@ WINE_DECLARE_DEBUG_CHANNEL(dmfile);
* IDirectMusicSegTriggerTrack implementation
*/
/* IDirectMusicSegTriggerTrack IUnknown part: */
HRESULT WINAPI IDirectMusicSegTriggerTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicSegTriggerTrack,iface);
HRESULT WINAPI IDirectMusicSegTriggerTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicSegTriggerTrack, UnknownVtbl, iface);
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IDirectMusicTrack) ||
IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
IDirectMusicSegTriggerTrack_AddRef(iface);
*ppobj = This;
if (IsEqualIID (riid, &IID_IUnknown)) {
*ppobj = (LPUNKNOWN)&This->UnknownVtbl;
IDirectMusicSegTriggerTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicTrack)
|| IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
*ppobj = (LPDIRECTMUSICTRACK8)&This->TrackVtbl;
IDirectMusicSegTriggerTrack_IDirectMusicTrack_AddRef ((LPDIRECTMUSICTRACK8)&This->TrackVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicSegTriggerTrackStream_AddRef ((LPPERSISTSTREAM)This->pStream);
*ppobj = This->pStream;
*ppobj = (LPPERSISTSTREAM)&This->PersistStreamVtbl;
IDirectMusicSegTriggerTrack_IPersistStream_AddRef ((LPPERSISTSTREAM)&This->PersistStreamVtbl);
return S_OK;
}
@ -54,16 +48,14 @@ HRESULT WINAPI IDirectMusicSegTriggerTrack_QueryInterface (LPDIRECTMUSICTRACK8 i
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicSegTriggerTrack_AddRef (LPDIRECTMUSICTRACK8 iface)
{
ICOM_THIS(IDirectMusicSegTriggerTrack,iface);
ULONG WINAPI IDirectMusicSegTriggerTrack_IUnknown_AddRef (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicSegTriggerTrack, UnknownVtbl, iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicSegTriggerTrack_Release (LPDIRECTMUSICTRACK8 iface)
{
ICOM_THIS(IDirectMusicSegTriggerTrack,iface);
ULONG WINAPI IDirectMusicSegTriggerTrack_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicSegTriggerTrack, UnknownVtbl, iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
@ -72,269 +64,214 @@ ULONG WINAPI IDirectMusicSegTriggerTrack_Release (LPDIRECTMUSICTRACK8 iface)
return ref;
}
/* IDirectMusicSegTriggerTrack IDirectMusicTrack part: */
HRESULT WINAPI IDirectMusicSegTriggerTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment)
{
ICOM_THIS(IDirectMusicSegTriggerTrack,iface);
ICOM_VTABLE(IUnknown) DirectMusicSegTriggerTrack_Unknown_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicSegTriggerTrack_IUnknown_QueryInterface,
IDirectMusicSegTriggerTrack_IUnknown_AddRef,
IDirectMusicSegTriggerTrack_IUnknown_Release
};
/* IDirectMusicSegTriggerTrack IDirectMusicTrack8 part: */
HRESULT WINAPI IDirectMusicSegTriggerTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicSegTriggerTrack, TrackVtbl, iface);
return IDirectMusicSegTriggerTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicSegTriggerTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface) {
ICOM_THIS_MULTI(IDirectMusicSegTriggerTrack, TrackVtbl, iface);
return IDirectMusicSegTriggerTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicSegTriggerTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface) {
ICOM_THIS_MULTI(IDirectMusicSegTriggerTrack, TrackVtbl, iface);
return IDirectMusicSegTriggerTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicSegTriggerTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment)
{
ICOM_THIS_MULTI(IDirectMusicSegTriggerTrack, TrackVtbl, iface);
FIXME("(%p, %p): stub\n", This, pSegment);
return S_OK;
}
HRESULT WINAPI IDirectMusicSegTriggerTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags)
HRESULT WINAPI IDirectMusicSegTriggerTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicSegTriggerTrack,iface);
ICOM_THIS_MULTI(IDirectMusicSegTriggerTrack, TrackVtbl, iface);
FIXME("(%p, %p, %p, %p, %ld, %ld): stub\n", This, pSegmentState, pPerformance, ppStateData, dwVirtualTrack8ID, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicSegTriggerTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData)
HRESULT WINAPI IDirectMusicSegTriggerTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData)
{
ICOM_THIS(IDirectMusicSegTriggerTrack,iface);
ICOM_THIS_MULTI(IDirectMusicSegTriggerTrack, TrackVtbl, iface);
FIXME("(%p, %p): stub\n", This, pStateData);
return S_OK;
}
HRESULT WINAPI IDirectMusicSegTriggerTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
HRESULT WINAPI IDirectMusicSegTriggerTrack_IDirectMusicTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
{
ICOM_THIS(IDirectMusicSegTriggerTrack,iface);
ICOM_THIS_MULTI(IDirectMusicSegTriggerTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %ld, %ld, %ld, %p, %p, %ld): stub\n", This, pStateData, mtStart, mtEnd, mtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
return S_OK;
}
HRESULT WINAPI IDirectMusicSegTriggerTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam)
{
ICOM_THIS(IDirectMusicSegTriggerTrack,iface);
HRESULT WINAPI IDirectMusicSegTriggerTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam) {
ICOM_THIS_MULTI(IDirectMusicSegTriggerTrack, TrackVtbl, iface);
FIXME("(%p, %s, %ld, %p, %p): stub\n", This, debugstr_guid(rguidType), mtTime, pmtNext, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicSegTriggerTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam)
{
ICOM_THIS(IDirectMusicSegTriggerTrack,iface);
HRESULT WINAPI IDirectMusicSegTriggerTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam) {
ICOM_THIS_MULTI(IDirectMusicSegTriggerTrack, TrackVtbl, iface);
FIXME("(%p, %s, %ld, %p): stub\n", This, debugstr_guid(rguidType), mtTime, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicSegTriggerTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType)
{
ICOM_THIS(IDirectMusicSegTriggerTrack,iface);
HRESULT WINAPI IDirectMusicSegTriggerTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType) {
ICOM_THIS_MULTI(IDirectMusicSegTriggerTrack, TrackVtbl, iface);
TRACE("(%p, %s): ", This, debugstr_guid(rguidType));
/* didn't find any params */
TRACE("param unsupported\n");
return DMUS_E_TYPE_UNSUPPORTED;
}
HRESULT WINAPI IDirectMusicSegTriggerTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType)
{
ICOM_THIS(IDirectMusicSegTriggerTrack,iface);
HRESULT WINAPI IDirectMusicSegTriggerTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
ICOM_THIS_MULTI(IDirectMusicSegTriggerTrack, TrackVtbl, iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
return S_OK;
}
HRESULT WINAPI IDirectMusicSegTriggerTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType)
{
ICOM_THIS(IDirectMusicSegTriggerTrack,iface);
HRESULT WINAPI IDirectMusicSegTriggerTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
ICOM_THIS_MULTI(IDirectMusicSegTriggerTrack, TrackVtbl, iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
return S_OK;
}
HRESULT WINAPI IDirectMusicSegTriggerTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack)
{
ICOM_THIS(IDirectMusicSegTriggerTrack,iface);
HRESULT WINAPI IDirectMusicSegTriggerTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack) {
ICOM_THIS_MULTI(IDirectMusicSegTriggerTrack, TrackVtbl, iface);
FIXME("(%p, %ld, %ld, %p): stub\n", This, mtStart, mtEnd, ppTrack);
return S_OK;
}
/* IDirectMusicSegTriggerTrack IDirectMusicTrack8 part: */
HRESULT WINAPI IDirectMusicSegTriggerTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
{
ICOM_THIS(IDirectMusicSegTriggerTrack,iface);
HRESULT WINAPI IDirectMusicSegTriggerTrack_IDirectMusicTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID) {
ICOM_THIS_MULTI(IDirectMusicSegTriggerTrack, TrackVtbl, iface);
FIXME("(%p, %p, %lli, %lli, %lli, %ld, %p, %p, %ld): stub\n", This, pStateData, rtStart, rtEnd, rtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
return S_OK;
}
HRESULT WINAPI IDirectMusicSegTriggerTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicSegTriggerTrack,iface);
HRESULT WINAPI IDirectMusicSegTriggerTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicSegTriggerTrack, TrackVtbl, iface);
FIXME("(%p, %s, %lli, %p, %p, %p, %ld): stub\n", This, debugstr_guid(rguidType), rtTime, prtNext, pParam, pStateData, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicSegTriggerTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicSegTriggerTrack,iface);
HRESULT WINAPI IDirectMusicSegTriggerTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicSegTriggerTrack, TrackVtbl, iface);
FIXME("(%p, %s, %lli, %p, %p, %ld): stub\n", This, debugstr_guid(rguidType), rtTime, pParam, pStateData, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicSegTriggerTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack)
{
ICOM_THIS(IDirectMusicSegTriggerTrack,iface);
HRESULT WINAPI IDirectMusicSegTriggerTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
ICOM_THIS_MULTI(IDirectMusicSegTriggerTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %p): stub\n", This, pContext, dwTrackGroup, ppResultTrack);
return S_OK;
}
HRESULT WINAPI IDirectMusicSegTriggerTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack)
{
ICOM_THIS(IDirectMusicSegTriggerTrack,iface);
HRESULT WINAPI IDirectMusicSegTriggerTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
ICOM_THIS_MULTI(IDirectMusicSegTriggerTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %p, %ld, %p): stub\n", This, pNewTrack, mtJoin, pContext, dwTrackGroup, ppResultTrack);
return S_OK;
}
ICOM_VTABLE(IDirectMusicTrack8) DirectMusicSegTriggerTrack_Vtbl =
{
ICOM_VTABLE(IDirectMusicTrack8) DirectMusicSegTriggerTrack_Track_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicSegTriggerTrack_QueryInterface,
IDirectMusicSegTriggerTrack_AddRef,
IDirectMusicSegTriggerTrack_Release,
IDirectMusicSegTriggerTrack_Init,
IDirectMusicSegTriggerTrack_InitPlay,
IDirectMusicSegTriggerTrack_EndPlay,
IDirectMusicSegTriggerTrack_Play,
IDirectMusicSegTriggerTrack_GetParam,
IDirectMusicSegTriggerTrack_SetParam,
IDirectMusicSegTriggerTrack_IsParamSupported,
IDirectMusicSegTriggerTrack_AddNotificationType,
IDirectMusicSegTriggerTrack_RemoveNotificationType,
IDirectMusicSegTriggerTrack_Clone,
IDirectMusicSegTriggerTrack_PlayEx,
IDirectMusicSegTriggerTrack_GetParamEx,
IDirectMusicSegTriggerTrack_SetParamEx,
IDirectMusicSegTriggerTrack_Compose,
IDirectMusicSegTriggerTrack_Join
IDirectMusicSegTriggerTrack_IDirectMusicTrack_QueryInterface,
IDirectMusicSegTriggerTrack_IDirectMusicTrack_AddRef,
IDirectMusicSegTriggerTrack_IDirectMusicTrack_Release,
IDirectMusicSegTriggerTrack_IDirectMusicTrack_Init,
IDirectMusicSegTriggerTrack_IDirectMusicTrack_InitPlay,
IDirectMusicSegTriggerTrack_IDirectMusicTrack_EndPlay,
IDirectMusicSegTriggerTrack_IDirectMusicTrack_Play,
IDirectMusicSegTriggerTrack_IDirectMusicTrack_GetParam,
IDirectMusicSegTriggerTrack_IDirectMusicTrack_SetParam,
IDirectMusicSegTriggerTrack_IDirectMusicTrack_IsParamSupported,
IDirectMusicSegTriggerTrack_IDirectMusicTrack_AddNotificationType,
IDirectMusicSegTriggerTrack_IDirectMusicTrack_RemoveNotificationType,
IDirectMusicSegTriggerTrack_IDirectMusicTrack_Clone,
IDirectMusicSegTriggerTrack_IDirectMusicTrack_PlayEx,
IDirectMusicSegTriggerTrack_IDirectMusicTrack_GetParamEx,
IDirectMusicSegTriggerTrack_IDirectMusicTrack_SetParamEx,
IDirectMusicSegTriggerTrack_IDirectMusicTrack_Compose,
IDirectMusicSegTriggerTrack_IDirectMusicTrack_Join
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicSegTriggerTrack (LPCGUID lpcGUID, LPDIRECTMUSICTRACK8 *ppTrack, LPUNKNOWN pUnkOuter)
{
IDirectMusicSegTriggerTrack* track;
if (IsEqualIID (lpcGUID, &IID_IDirectMusicTrack)
|| IsEqualIID (lpcGUID, &IID_IDirectMusicTrack8)) {
track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicSegTriggerTrack));
if (NULL == track) {
*ppTrack = (LPDIRECTMUSICTRACK8) NULL;
return E_OUTOFMEMORY;
}
track->lpVtbl = &DirectMusicSegTriggerTrack_Vtbl;
track->ref = 1;
track->pStream = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(IDirectMusicSegTriggerTrackStream));
track->pStream->lpVtbl = &DirectMusicSegTriggerTrackStream_Vtbl;
track->pStream->ref = 1;
track->pStream->pParentTrack = track;
*ppTrack = (LPDIRECTMUSICTRACK8) track;
return S_OK;
}
WARN("No interface found\n");
return E_NOINTERFACE;
/* IDirectMusicSegTriggerTrack IPersistStream part: */
HRESULT WINAPI IDirectMusicSegTriggerTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicSegTriggerTrack, PersistStreamVtbl, iface);
return IDirectMusicSegTriggerTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
/*****************************************************************************
* IDirectMusicSegTriggerTrackStream implementation
*/
/* IDirectMusicSegTriggerTrackStream IUnknown part follow: */
HRESULT WINAPI IDirectMusicSegTriggerTrackStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicSegTriggerTrackStream,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicSegTriggerTrackStream_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
ULONG WINAPI IDirectMusicSegTriggerTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicSegTriggerTrack, PersistStreamVtbl, iface);
return IDirectMusicSegTriggerTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicSegTriggerTrackStream_AddRef (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicSegTriggerTrackStream,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
ULONG WINAPI IDirectMusicSegTriggerTrack_IPersistStream_Release (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicSegTriggerTrack, PersistStreamVtbl, iface);
return IDirectMusicSegTriggerTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicSegTriggerTrackStream_Release (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicSegTriggerTrackStream,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicSegTriggerTrackStream IPersist part: */
HRESULT WINAPI IDirectMusicSegTriggerTrackStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID)
{
HRESULT WINAPI IDirectMusicSegTriggerTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) {
return E_NOTIMPL;
}
/* IDirectMusicSegTriggerTrackStream IPersistStream part: */
HRESULT WINAPI IDirectMusicSegTriggerTrackStream_IsDirty (LPPERSISTSTREAM iface)
{
HRESULT WINAPI IDirectMusicSegTriggerTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicSegTriggerTrackStream_Load (LPPERSISTSTREAM iface, IStream* pStm)
{
HRESULT WINAPI IDirectMusicSegTriggerTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm) {
FIXME(": Loading not implemented yet\n");
return S_OK;
}
HRESULT WINAPI IDirectMusicSegTriggerTrackStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty)
{
HRESULT WINAPI IDirectMusicSegTriggerTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicSegTriggerTrackStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize)
{
HRESULT WINAPI IDirectMusicSegTriggerTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) {
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicSegTriggerTrackStream_Vtbl =
{
ICOM_VTABLE(IPersistStream) DirectMusicSegTriggerTrack_PersistStream_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicSegTriggerTrackStream_QueryInterface,
IDirectMusicSegTriggerTrackStream_AddRef,
IDirectMusicSegTriggerTrackStream_Release,
IDirectMusicSegTriggerTrackStream_GetClassID,
IDirectMusicSegTriggerTrackStream_IsDirty,
IDirectMusicSegTriggerTrackStream_Load,
IDirectMusicSegTriggerTrackStream_Save,
IDirectMusicSegTriggerTrackStream_GetSizeMax
IDirectMusicSegTriggerTrack_IPersistStream_QueryInterface,
IDirectMusicSegTriggerTrack_IPersistStream_AddRef,
IDirectMusicSegTriggerTrack_IPersistStream_Release,
IDirectMusicSegTriggerTrack_IPersistStream_GetClassID,
IDirectMusicSegTriggerTrack_IPersistStream_IsDirty,
IDirectMusicSegTriggerTrack_IPersistStream_Load,
IDirectMusicSegTriggerTrack_IPersistStream_Save,
IDirectMusicSegTriggerTrack_IPersistStream_GetSizeMax
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicSegTriggerTrack (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) {
IDirectMusicSegTriggerTrack* track;
track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicSegTriggerTrack));
if (NULL == track) {
*ppobj = (LPVOID) NULL;
return E_OUTOFMEMORY;
}
track->UnknownVtbl = &DirectMusicSegTriggerTrack_Unknown_Vtbl;
track->TrackVtbl = &DirectMusicSegTriggerTrack_Track_Vtbl;
track->PersistStreamVtbl = &DirectMusicSegTriggerTrack_PersistStream_Vtbl;
track->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC));
DM_STRUCT_INIT(track->pDesc);
track->pDesc->dwValidData |= DMUS_OBJ_CLASS;
memcpy (&track->pDesc->guidClass, &CLSID_DirectMusicSegTriggerTrack, sizeof (CLSID));
track->ref = 0; /* will be inited by QueryInterface */
return IDirectMusicSegTriggerTrack_IUnknown_QueryInterface ((LPUNKNOWN)&track->UnknownVtbl, lpcGUID, ppobj);
}

View File

@ -1,6 +1,6 @@
/* IDirectMusicSeqTrack Implementation
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -17,14 +17,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "dmime_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmime);
@ -34,19 +26,21 @@ WINE_DECLARE_DEBUG_CHANNEL(dmfile);
* IDirectMusicSeqTrack implementation
*/
/* IDirectMusicSeqTrack IUnknown part: */
HRESULT WINAPI IDirectMusicSeqTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicSeqTrack,iface);
HRESULT WINAPI IDirectMusicSeqTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicSeqTrack, UnknownVtbl, iface);
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IDirectMusicTrack) ||
IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
IDirectMusicSeqTrack_AddRef(iface);
*ppobj = This;
if (IsEqualIID (riid, &IID_IUnknown)) {
*ppobj = (LPUNKNOWN)&This->UnknownVtbl;
IDirectMusicSeqTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicTrack)
|| IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
*ppobj = (LPDIRECTMUSICTRACK8)&This->TrackVtbl;
IDirectMusicSeqTrack_IDirectMusicTrack_AddRef ((LPDIRECTMUSICTRACK8)&This->TrackVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicSeqTrackStream_AddRef ((LPPERSISTSTREAM)This->pStream);
*ppobj = This->pStream;
*ppobj = (LPPERSISTSTREAM)&This->PersistStreamVtbl;
IDirectMusicSeqTrack_IPersistStream_AddRef ((LPPERSISTSTREAM)&This->PersistStreamVtbl);
return S_OK;
}
@ -54,16 +48,14 @@ HRESULT WINAPI IDirectMusicSeqTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, R
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicSeqTrack_AddRef (LPDIRECTMUSICTRACK8 iface)
{
ICOM_THIS(IDirectMusicSeqTrack,iface);
ULONG WINAPI IDirectMusicSeqTrack_IUnknown_AddRef (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicSeqTrack, UnknownVtbl, iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicSeqTrack_Release (LPDIRECTMUSICTRACK8 iface)
{
ICOM_THIS(IDirectMusicSeqTrack,iface);
ULONG WINAPI IDirectMusicSeqTrack_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicSeqTrack, UnknownVtbl, iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
@ -72,269 +64,214 @@ ULONG WINAPI IDirectMusicSeqTrack_Release (LPDIRECTMUSICTRACK8 iface)
return ref;
}
/* IDirectMusicSeqTrack IDirectMusicTrack part: */
HRESULT WINAPI IDirectMusicSeqTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment)
{
ICOM_THIS(IDirectMusicSeqTrack,iface);
ICOM_VTABLE(IUnknown) DirectMusicSeqTrack_Unknown_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicSeqTrack_IUnknown_QueryInterface,
IDirectMusicSeqTrack_IUnknown_AddRef,
IDirectMusicSeqTrack_IUnknown_Release
};
/* IDirectMusicSeqTrack IDirectMusicTrack8 part: */
HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicSeqTrack, TrackVtbl, iface);
return IDirectMusicSeqTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface) {
ICOM_THIS_MULTI(IDirectMusicSeqTrack, TrackVtbl, iface);
return IDirectMusicSeqTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface) {
ICOM_THIS_MULTI(IDirectMusicSeqTrack, TrackVtbl, iface);
return IDirectMusicSeqTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment)
{
ICOM_THIS_MULTI(IDirectMusicSeqTrack, TrackVtbl, iface);
FIXME("(%p, %p): stub\n", This, pSegment);
return S_OK;
}
HRESULT WINAPI IDirectMusicSeqTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags)
HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicSeqTrack,iface);
ICOM_THIS_MULTI(IDirectMusicSeqTrack, TrackVtbl, iface);
FIXME("(%p, %p, %p, %p, %ld, %ld): stub\n", This, pSegmentState, pPerformance, ppStateData, dwVirtualTrack8ID, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicSeqTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData)
HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData)
{
ICOM_THIS(IDirectMusicSeqTrack,iface);
ICOM_THIS_MULTI(IDirectMusicSeqTrack, TrackVtbl, iface);
FIXME("(%p, %p): stub\n", This, pStateData);
return S_OK;
}
HRESULT WINAPI IDirectMusicSeqTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
{
ICOM_THIS(IDirectMusicSeqTrack,iface);
ICOM_THIS_MULTI(IDirectMusicSeqTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %ld, %ld, %ld, %p, %p, %ld): stub\n", This, pStateData, mtStart, mtEnd, mtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
return S_OK;
}
HRESULT WINAPI IDirectMusicSeqTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam)
{
ICOM_THIS(IDirectMusicSeqTrack,iface);
HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam) {
ICOM_THIS_MULTI(IDirectMusicSeqTrack, TrackVtbl, iface);
FIXME("(%p, %s, %ld, %p, %p): stub\n", This, debugstr_guid(rguidType), mtTime, pmtNext, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicSeqTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam)
{
ICOM_THIS(IDirectMusicSeqTrack,iface);
HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam) {
ICOM_THIS_MULTI(IDirectMusicSeqTrack, TrackVtbl, iface);
FIXME("(%p, %s, %ld, %p): stub\n", This, debugstr_guid(rguidType), mtTime, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicSeqTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType)
{
ICOM_THIS(IDirectMusicSeqTrack,iface);
HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType) {
ICOM_THIS_MULTI(IDirectMusicSeqTrack, TrackVtbl, iface);
TRACE("(%p, %s): ", This, debugstr_guid(rguidType));
/* didn't find any params */
TRACE("param unsupported\n");
return DMUS_E_TYPE_UNSUPPORTED;
}
HRESULT WINAPI IDirectMusicSeqTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType)
{
ICOM_THIS(IDirectMusicSeqTrack,iface);
HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
ICOM_THIS_MULTI(IDirectMusicSeqTrack, TrackVtbl, iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
return S_OK;
}
HRESULT WINAPI IDirectMusicSeqTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType)
{
ICOM_THIS(IDirectMusicSeqTrack,iface);
HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
ICOM_THIS_MULTI(IDirectMusicSeqTrack, TrackVtbl, iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
return S_OK;
}
HRESULT WINAPI IDirectMusicSeqTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack)
{
ICOM_THIS(IDirectMusicSeqTrack,iface);
HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack) {
ICOM_THIS_MULTI(IDirectMusicSeqTrack, TrackVtbl, iface);
FIXME("(%p, %ld, %ld, %p): stub\n", This, mtStart, mtEnd, ppTrack);
return S_OK;
}
/* IDirectMusicSeqTrack IDirectMusicTrack8 part: */
HRESULT WINAPI IDirectMusicSeqTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
{
ICOM_THIS(IDirectMusicSeqTrack,iface);
HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID) {
ICOM_THIS_MULTI(IDirectMusicSeqTrack, TrackVtbl, iface);
FIXME("(%p, %p, %lli, %lli, %lli, %ld, %p, %p, %ld): stub\n", This, pStateData, rtStart, rtEnd, rtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
return S_OK;
}
HRESULT WINAPI IDirectMusicSeqTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicSeqTrack,iface);
HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicSeqTrack, TrackVtbl, iface);
FIXME("(%p, %s, %lli, %p, %p, %p, %ld): stub\n", This, debugstr_guid(rguidType), rtTime, prtNext, pParam, pStateData, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicSeqTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicSeqTrack,iface);
HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicSeqTrack, TrackVtbl, iface);
FIXME("(%p, %s, %lli, %p, %p, %ld): stub\n", This, debugstr_guid(rguidType), rtTime, pParam, pStateData, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicSeqTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack)
{
ICOM_THIS(IDirectMusicSeqTrack,iface);
HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
ICOM_THIS_MULTI(IDirectMusicSeqTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %p): stub\n", This, pContext, dwTrackGroup, ppResultTrack);
return S_OK;
}
HRESULT WINAPI IDirectMusicSeqTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack)
{
ICOM_THIS(IDirectMusicSeqTrack,iface);
HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
ICOM_THIS_MULTI(IDirectMusicSeqTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %p, %ld, %p): stub\n", This, pNewTrack, mtJoin, pContext, dwTrackGroup, ppResultTrack);
return S_OK;
}
ICOM_VTABLE(IDirectMusicTrack8) DirectMusicSeqTrack_Vtbl =
{
ICOM_VTABLE(IDirectMusicTrack8) DirectMusicSeqTrack_Track_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicSeqTrack_QueryInterface,
IDirectMusicSeqTrack_AddRef,
IDirectMusicSeqTrack_Release,
IDirectMusicSeqTrack_Init,
IDirectMusicSeqTrack_InitPlay,
IDirectMusicSeqTrack_EndPlay,
IDirectMusicSeqTrack_Play,
IDirectMusicSeqTrack_GetParam,
IDirectMusicSeqTrack_SetParam,
IDirectMusicSeqTrack_IsParamSupported,
IDirectMusicSeqTrack_AddNotificationType,
IDirectMusicSeqTrack_RemoveNotificationType,
IDirectMusicSeqTrack_Clone,
IDirectMusicSeqTrack_PlayEx,
IDirectMusicSeqTrack_GetParamEx,
IDirectMusicSeqTrack_SetParamEx,
IDirectMusicSeqTrack_Compose,
IDirectMusicSeqTrack_Join
IDirectMusicSeqTrack_IDirectMusicTrack_QueryInterface,
IDirectMusicSeqTrack_IDirectMusicTrack_AddRef,
IDirectMusicSeqTrack_IDirectMusicTrack_Release,
IDirectMusicSeqTrack_IDirectMusicTrack_Init,
IDirectMusicSeqTrack_IDirectMusicTrack_InitPlay,
IDirectMusicSeqTrack_IDirectMusicTrack_EndPlay,
IDirectMusicSeqTrack_IDirectMusicTrack_Play,
IDirectMusicSeqTrack_IDirectMusicTrack_GetParam,
IDirectMusicSeqTrack_IDirectMusicTrack_SetParam,
IDirectMusicSeqTrack_IDirectMusicTrack_IsParamSupported,
IDirectMusicSeqTrack_IDirectMusicTrack_AddNotificationType,
IDirectMusicSeqTrack_IDirectMusicTrack_RemoveNotificationType,
IDirectMusicSeqTrack_IDirectMusicTrack_Clone,
IDirectMusicSeqTrack_IDirectMusicTrack_PlayEx,
IDirectMusicSeqTrack_IDirectMusicTrack_GetParamEx,
IDirectMusicSeqTrack_IDirectMusicTrack_SetParamEx,
IDirectMusicSeqTrack_IDirectMusicTrack_Compose,
IDirectMusicSeqTrack_IDirectMusicTrack_Join
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicSeqTrack (LPCGUID lpcGUID, LPDIRECTMUSICTRACK8 *ppTrack, LPUNKNOWN pUnkOuter)
{
IDirectMusicSeqTrack* track;
if (IsEqualIID (lpcGUID, &IID_IDirectMusicTrack)
|| IsEqualIID (lpcGUID, &IID_IDirectMusicTrack8)) {
track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicSeqTrack));
if (NULL == track) {
*ppTrack = (LPDIRECTMUSICTRACK8) NULL;
return E_OUTOFMEMORY;
}
track->lpVtbl = &DirectMusicSeqTrack_Vtbl;
track->ref = 1;
track->pStream = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(IDirectMusicSeqTrackStream));
track->pStream->lpVtbl = &DirectMusicSeqTrackStream_Vtbl;
track->pStream->ref = 1;
track->pStream->pParentTrack = track;
*ppTrack = (LPDIRECTMUSICTRACK8) track;
return S_OK;
}
WARN("No interface found\n");
return E_NOINTERFACE;
/* IDirectMusicSeqTrack IPersistStream part: */
HRESULT WINAPI IDirectMusicSeqTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicSeqTrack, PersistStreamVtbl, iface);
return IDirectMusicSeqTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
/*****************************************************************************
* IDirectMusicSeqTrackStream implementation
*/
/* IDirectMusicSeqTrackStream IUnknown part: */
HRESULT WINAPI IDirectMusicSeqTrackStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicSeqTrackStream,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicSeqTrackStream_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
ULONG WINAPI IDirectMusicSeqTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicSeqTrack, PersistStreamVtbl, iface);
return IDirectMusicSeqTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicSeqTrackStream_AddRef (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicSeqTrackStream,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
ULONG WINAPI IDirectMusicSeqTrack_IPersistStream_Release (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicSeqTrack, PersistStreamVtbl, iface);
return IDirectMusicSeqTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicSeqTrackStream_Release (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicSeqTrackStream,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicSeqTrackStream IPersist part: */
HRESULT WINAPI IDirectMusicSeqTrackStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID)
{
HRESULT WINAPI IDirectMusicSeqTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) {
return E_NOTIMPL;
}
/* IDirectMusicSeqTrackStream IPersistStream part: */
HRESULT WINAPI IDirectMusicSeqTrackStream_IsDirty (LPPERSISTSTREAM iface)
{
HRESULT WINAPI IDirectMusicSeqTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicSeqTrackStream_Load (LPPERSISTSTREAM iface, IStream* pStm)
{
HRESULT WINAPI IDirectMusicSeqTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm) {
FIXME(": Loading not implemented yet\n");
return S_OK;
}
HRESULT WINAPI IDirectMusicSeqTrackStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty)
{
HRESULT WINAPI IDirectMusicSeqTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicSeqTrackStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize)
{
HRESULT WINAPI IDirectMusicSeqTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) {
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicSeqTrackStream_Vtbl =
{
ICOM_VTABLE(IPersistStream) DirectMusicSeqTrack_PersistStream_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicSeqTrackStream_QueryInterface,
IDirectMusicSeqTrackStream_AddRef,
IDirectMusicSeqTrackStream_Release,
IDirectMusicSeqTrackStream_GetClassID,
IDirectMusicSeqTrackStream_IsDirty,
IDirectMusicSeqTrackStream_Load,
IDirectMusicSeqTrackStream_Save,
IDirectMusicSeqTrackStream_GetSizeMax
IDirectMusicSeqTrack_IPersistStream_QueryInterface,
IDirectMusicSeqTrack_IPersistStream_AddRef,
IDirectMusicSeqTrack_IPersistStream_Release,
IDirectMusicSeqTrack_IPersistStream_GetClassID,
IDirectMusicSeqTrack_IPersistStream_IsDirty,
IDirectMusicSeqTrack_IPersistStream_Load,
IDirectMusicSeqTrack_IPersistStream_Save,
IDirectMusicSeqTrack_IPersistStream_GetSizeMax
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicSeqTrack (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) {
IDirectMusicSeqTrack* track;
track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicSeqTrack));
if (NULL == track) {
*ppobj = (LPVOID) NULL;
return E_OUTOFMEMORY;
}
track->UnknownVtbl = &DirectMusicSeqTrack_Unknown_Vtbl;
track->TrackVtbl = &DirectMusicSeqTrack_Track_Vtbl;
track->PersistStreamVtbl = &DirectMusicSeqTrack_PersistStream_Vtbl;
track->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC));
DM_STRUCT_INIT(track->pDesc);
track->pDesc->dwValidData |= DMUS_OBJ_CLASS;
memcpy (&track->pDesc->guidClass, &CLSID_DirectMusicSeqTrack, sizeof (CLSID));
track->ref = 0; /* will be inited by QueryInterface */
return IDirectMusicSeqTrack_IUnknown_QueryInterface ((LPUNKNOWN)&track->UnknownVtbl, lpcGUID, ppobj);
}

View File

@ -1,356 +0,0 @@
/* IDirectMusicSong 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 <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "dmime_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmime);
/* IDirectMusicSong IUnknown part: */
HRESULT WINAPI IDirectMusicSongImpl_QueryInterface (LPDIRECTMUSICSONG iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicSongImpl,iface);
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IDirectMusicSong)) {
IDirectMusicSongImpl_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicSongImpl_AddRef (LPDIRECTMUSICSONG iface)
{
ICOM_THIS(IDirectMusicSongImpl,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicSongImpl_Release (LPDIRECTMUSICSONG iface)
{
ICOM_THIS(IDirectMusicSongImpl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicSong IDirectMusicSong part: */
HRESULT WINAPI IDirectMusicSongImpl_Compose (LPDIRECTMUSICSONG iface)
{
ICOM_THIS(IDirectMusicSongImpl,iface);
FIXME("(%p): stub\n", This);
return S_OK;
}
HRESULT WINAPI IDirectMusicSongImpl_GetParam (LPDIRECTMUSICSONG iface, REFGUID rguidType, DWORD dwGroupBits, DWORD dwIndex, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam)
{
ICOM_THIS(IDirectMusicSongImpl,iface);
FIXME("(%p, %s, %ld, %ld, %ld, %p, %p): stub\n", This, debugstr_guid(rguidType), dwGroupBits, dwIndex, mtTime, pmtNext, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicSongImpl_GetSegment (LPDIRECTMUSICSONG iface, WCHAR* pwzName, IDirectMusicSegment** ppSegment)
{
ICOM_THIS(IDirectMusicSongImpl,iface);
FIXME("(%p, %p, %p): stub\n", This, pwzName, ppSegment);
return S_OK;
}
HRESULT WINAPI IDirectMusicSongImpl_GetAudioPathConfig (LPDIRECTMUSICSONG iface, IUnknown** ppAudioPathConfig)
{
ICOM_THIS(IDirectMusicSongImpl,iface);
FIXME("(%p, %p): stub\n", This, ppAudioPathConfig);
return S_OK;
}
HRESULT WINAPI IDirectMusicSongImpl_Download (LPDIRECTMUSICSONG iface, IUnknown* pAudioPath)
{
ICOM_THIS(IDirectMusicSongImpl,iface);
FIXME("(%p, %p): stub\n", This, pAudioPath);
return S_OK;
}
HRESULT WINAPI IDirectMusicSongImpl_Unload (LPDIRECTMUSICSONG iface, IUnknown* pAudioPath)
{
ICOM_THIS(IDirectMusicSongImpl,iface);
FIXME("(%p, %p): stub\n", This, pAudioPath);
return S_OK;
}
HRESULT WINAPI IDirectMusicSongImpl_EnumSegment (LPDIRECTMUSICSONG iface, DWORD dwIndex, IDirectMusicSegment** ppSegment)
{
ICOM_THIS(IDirectMusicSongImpl,iface);
FIXME("(%p, %ld, %p): stub\n", This, dwIndex, ppSegment);
return S_OK;
}
ICOM_VTABLE(IDirectMusicSong) DirectMusicSong_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicSongImpl_QueryInterface,
IDirectMusicSongImpl_AddRef,
IDirectMusicSongImpl_Release,
IDirectMusicSongImpl_Compose,
IDirectMusicSongImpl_GetParam,
IDirectMusicSongImpl_GetSegment,
IDirectMusicSongImpl_GetAudioPathConfig,
IDirectMusicSongImpl_Download,
IDirectMusicSongImpl_Unload,
IDirectMusicSongImpl_EnumSegment
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicSong (LPCGUID lpcGUID, LPDIRECTMUSICSONG *ppDMSng, LPUNKNOWN pUnkOuter)
{
IDirectMusicSongImpl* dmsong;
if (IsEqualIID (lpcGUID, &IID_IDirectMusicSong)) {
dmsong = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicSongImpl));
if (NULL == dmsong) {
*ppDMSng = (LPDIRECTMUSICSONG) NULL;
return E_OUTOFMEMORY;
}
dmsong->lpVtbl = &DirectMusicSong_Vtbl;
dmsong->ref = 1;
*ppDMSng = (LPDIRECTMUSICSONG) dmsong;
return S_OK;
}
WARN("No interface found\n");
return E_NOINTERFACE;
}
/*****************************************************************************
* IDirectMusicSongObject implementation
*/
/* IDirectMusicSongObject IUnknown part: */
HRESULT WINAPI IDirectMusicSongObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicSongObject,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IDirectMusicObject)) {
IDirectMusicSongObject_AddRef(iface);
*ppobj = This;
return S_OK;
} else if (IsEqualIID (riid, &IID_IPersistStream)) {
IPersistStream_AddRef ((LPPERSISTSTREAM)This->pStream);
*ppobj = (LPPERSISTSTREAM)This->pStream;
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicSong)) {
IDirectMusicSong_AddRef ((LPDIRECTMUSICSONG)This->pSong);
*ppobj = (LPDIRECTMUSICSONG)This->pSong;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicSongObject_AddRef (LPDIRECTMUSICOBJECT iface)
{
ICOM_THIS(IDirectMusicSongObject,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicSongObject_Release (LPDIRECTMUSICOBJECT iface)
{
ICOM_THIS(IDirectMusicSongObject,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicSongObject IDirectMusicObject part: */
HRESULT WINAPI IDirectMusicSongObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicSongObject,iface);
TRACE("(%p, %p)\n", This, pDesc);
pDesc = This->pDesc;
return S_OK;
}
HRESULT WINAPI IDirectMusicSongObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicSongObject,iface);
TRACE("(%p, %p)\n", This, pDesc);
This->pDesc = pDesc;
return S_OK;
}
HRESULT WINAPI IDirectMusicSongObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicSongObject,iface);
FIXME("(%p, %p, %p): stub\n", This, pStream, pDesc);
return S_OK;
}
ICOM_VTABLE(IDirectMusicObject) DirectMusicSongObject_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicSongObject_QueryInterface,
IDirectMusicSongObject_AddRef,
IDirectMusicSongObject_Release,
IDirectMusicSongObject_GetDescriptor,
IDirectMusicSongObject_SetDescriptor,
IDirectMusicSongObject_ParseDescriptor
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicSongObject (LPCGUID lpcGUID, LPDIRECTMUSICOBJECT* ppObject, LPUNKNOWN pUnkOuter)
{
IDirectMusicSongObject *obj;
TRACE("(%p,%p,%p)\n", lpcGUID, ppObject, pUnkOuter);
if (IsEqualIID (lpcGUID, &IID_IDirectMusicObject)) {
obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicSongObject));
if (NULL == obj) {
*ppObject = (LPDIRECTMUSICOBJECT) NULL;
return E_OUTOFMEMORY;
}
obj->lpVtbl = &DirectMusicSongObject_Vtbl;
obj->ref = 1;
/* prepare IPersistStream */
obj->pStream = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(IDirectMusicSongObjectStream));
obj->pStream->lpVtbl = &DirectMusicSongObjectStream_Vtbl;
obj->pStream->ref = 1;
obj->pStream->pParentObject = obj;
/* prepare IDirectMusicSong */
DMUSIC_CreateDirectMusicSong (&IID_IDirectMusicSong, (LPDIRECTMUSICSONG*)&obj->pSong, NULL);
obj->pSong->pObject = obj;
*ppObject = (LPDIRECTMUSICOBJECT) obj;
return S_OK;
}
WARN("No interface found\n");
return E_NOINTERFACE;
}
/*****************************************************************************
* IDirectMusicSongObjectStream implementation
*/
/* IDirectMusicSongObjectStream IUnknown part: */
HRESULT WINAPI IDirectMusicSongObjectStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicSongObjectStream,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicSongObjectStream_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicSongObjectStream_AddRef (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicSongObjectStream,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicSongObjectStream_Release (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicSongObjectStream,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicSongObjectStream IPersist part: */
HRESULT WINAPI IDirectMusicSongObjectStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID)
{
return E_NOTIMPL;
}
/* IDirectMusicSongObjectStream IPersistStream part: */
HRESULT WINAPI IDirectMusicSongObjectStream_IsDirty (LPPERSISTSTREAM iface)
{
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicSongObjectStream_Load (LPPERSISTSTREAM iface, IStream* pStm)
{
FIXME(": Loading not implemented yet\n");
return S_OK;
}
HRESULT WINAPI IDirectMusicSongObjectStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty)
{
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicSongObjectStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize)
{
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicSongObjectStream_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicSongObjectStream_QueryInterface,
IDirectMusicSongObjectStream_AddRef,
IDirectMusicSongObjectStream_Release,
IDirectMusicSongObjectStream_GetClassID,
IDirectMusicSongObjectStream_IsDirty,
IDirectMusicSongObjectStream_Load,
IDirectMusicSongObjectStream_Save,
IDirectMusicSongObjectStream_GetSizeMax
};

View File

@ -1,6 +1,6 @@
/* IDirectMusicSysExTrack Implementation
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -17,14 +17,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "dmime_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmime);
@ -34,35 +26,36 @@ WINE_DECLARE_DEBUG_CHANNEL(dmfile);
* IDirectMusicSysExTrack implementation
*/
/* IDirectMusicSysExTrack IUnknown part: */
HRESULT WINAPI IDirectMusicSysExTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicSysExTrack,iface);
HRESULT WINAPI IDirectMusicSysExTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicSysExTrack, UnknownVtbl, iface);
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IDirectMusicTrack) ||
IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
IDirectMusicSysExTrack_AddRef(iface);
*ppobj = This;
if (IsEqualIID (riid, &IID_IUnknown)) {
*ppobj = (LPUNKNOWN)&This->UnknownVtbl;
IDirectMusicSysExTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicTrack)
|| IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
*ppobj = (LPDIRECTMUSICTRACK8)&This->TrackVtbl;
IDirectMusicSysExTrack_IDirectMusicTrack_AddRef ((LPDIRECTMUSICTRACK8)&This->TrackVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicSysExTrackStream_AddRef ((LPPERSISTSTREAM)This->pStream);
*ppobj = This->pStream;
*ppobj = (LPPERSISTSTREAM)&This->PersistStreamVtbl;
IDirectMusicSysExTrack_IPersistStream_AddRef ((LPPERSISTSTREAM)&This->PersistStreamVtbl);
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicSysExTrack_AddRef (LPDIRECTMUSICTRACK8 iface)
{
ICOM_THIS(IDirectMusicSysExTrack,iface);
ULONG WINAPI IDirectMusicSysExTrack_IUnknown_AddRef (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicSysExTrack, UnknownVtbl, iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicSysExTrack_Release (LPDIRECTMUSICTRACK8 iface)
{
ICOM_THIS(IDirectMusicSysExTrack,iface);
ULONG WINAPI IDirectMusicSysExTrack_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicSysExTrack, UnknownVtbl, iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
@ -71,269 +64,214 @@ ULONG WINAPI IDirectMusicSysExTrack_Release (LPDIRECTMUSICTRACK8 iface)
return ref;
}
/* IDirectMusicSysExTrack IDirectMusicTrack part: */
HRESULT WINAPI IDirectMusicSysExTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment)
{
ICOM_THIS(IDirectMusicSysExTrack,iface);
ICOM_VTABLE(IUnknown) DirectMusicSysExTrack_Unknown_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicSysExTrack_IUnknown_QueryInterface,
IDirectMusicSysExTrack_IUnknown_AddRef,
IDirectMusicSysExTrack_IUnknown_Release
};
/* IDirectMusicSysExTrack IDirectMusicTrack8 part: */
HRESULT WINAPI IDirectMusicSysExTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicSysExTrack, TrackVtbl, iface);
return IDirectMusicSysExTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicSysExTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface) {
ICOM_THIS_MULTI(IDirectMusicSysExTrack, TrackVtbl, iface);
return IDirectMusicSysExTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicSysExTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface) {
ICOM_THIS_MULTI(IDirectMusicSysExTrack, TrackVtbl, iface);
return IDirectMusicSysExTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicSysExTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment)
{
ICOM_THIS_MULTI(IDirectMusicSysExTrack, TrackVtbl, iface);
FIXME("(%p, %p): stub\n", This, pSegment);
return S_OK;
}
HRESULT WINAPI IDirectMusicSysExTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags)
HRESULT WINAPI IDirectMusicSysExTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicSysExTrack,iface);
ICOM_THIS_MULTI(IDirectMusicSysExTrack, TrackVtbl, iface);
FIXME("(%p, %p, %p, %p, %ld, %ld): stub\n", This, pSegmentState, pPerformance, ppStateData, dwVirtualTrack8ID, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicSysExTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData)
HRESULT WINAPI IDirectMusicSysExTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData)
{
ICOM_THIS(IDirectMusicSysExTrack,iface);
ICOM_THIS_MULTI(IDirectMusicSysExTrack, TrackVtbl, iface);
FIXME("(%p, %p): stub\n", This, pStateData);
return S_OK;
}
HRESULT WINAPI IDirectMusicSysExTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
HRESULT WINAPI IDirectMusicSysExTrack_IDirectMusicTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
{
ICOM_THIS(IDirectMusicSysExTrack,iface);
ICOM_THIS_MULTI(IDirectMusicSysExTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %ld, %ld, %ld, %p, %p, %ld): stub\n", This, pStateData, mtStart, mtEnd, mtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
return S_OK;
}
HRESULT WINAPI IDirectMusicSysExTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam)
{
ICOM_THIS(IDirectMusicSysExTrack,iface);
HRESULT WINAPI IDirectMusicSysExTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam) {
ICOM_THIS_MULTI(IDirectMusicSysExTrack, TrackVtbl, iface);
FIXME("(%p, %s, %ld, %p, %p): stub\n", This, debugstr_guid(rguidType), mtTime, pmtNext, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicSysExTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam)
{
ICOM_THIS(IDirectMusicSysExTrack,iface);
HRESULT WINAPI IDirectMusicSysExTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam) {
ICOM_THIS_MULTI(IDirectMusicSysExTrack, TrackVtbl, iface);
FIXME("(%p, %s, %ld, %p): stub\n", This, debugstr_guid(rguidType), mtTime, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicSysExTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType)
{
ICOM_THIS(IDirectMusicSysExTrack,iface);
HRESULT WINAPI IDirectMusicSysExTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType) {
ICOM_THIS_MULTI(IDirectMusicSysExTrack, TrackVtbl, iface);
TRACE("(%p, %s): ", This, debugstr_guid(rguidType));
/* didn't find any params */
TRACE("param unsupported\n");
return DMUS_E_TYPE_UNSUPPORTED;
}
HRESULT WINAPI IDirectMusicSysExTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType)
{
ICOM_THIS(IDirectMusicSysExTrack,iface);
HRESULT WINAPI IDirectMusicSysExTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
ICOM_THIS_MULTI(IDirectMusicSysExTrack, TrackVtbl, iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
return S_OK;
}
HRESULT WINAPI IDirectMusicSysExTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType)
{
ICOM_THIS(IDirectMusicSysExTrack,iface);
HRESULT WINAPI IDirectMusicSysExTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
ICOM_THIS_MULTI(IDirectMusicSysExTrack, TrackVtbl, iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
return S_OK;
}
HRESULT WINAPI IDirectMusicSysExTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack)
{
ICOM_THIS(IDirectMusicSysExTrack,iface);
HRESULT WINAPI IDirectMusicSysExTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack) {
ICOM_THIS_MULTI(IDirectMusicSysExTrack, TrackVtbl, iface);
FIXME("(%p, %ld, %ld, %p): stub\n", This, mtStart, mtEnd, ppTrack);
return S_OK;
}
/* IDirectMusicSysExTrack IDirectMusicTrack8 part: */
HRESULT WINAPI IDirectMusicSysExTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
{
ICOM_THIS(IDirectMusicSysExTrack,iface);
HRESULT WINAPI IDirectMusicSysExTrack_IDirectMusicTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID) {
ICOM_THIS_MULTI(IDirectMusicSysExTrack, TrackVtbl, iface);
FIXME("(%p, %p, %lli, %lli, %lli, %ld, %p, %p, %ld): stub\n", This, pStateData, rtStart, rtEnd, rtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
return S_OK;
}
HRESULT WINAPI IDirectMusicSysExTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicSysExTrack,iface);
HRESULT WINAPI IDirectMusicSysExTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicSysExTrack, TrackVtbl, iface);
FIXME("(%p, %s, %lli, %p, %p, %p, %ld): stub\n", This, debugstr_guid(rguidType), rtTime, prtNext, pParam, pStateData, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicSysExTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicSysExTrack,iface);
HRESULT WINAPI IDirectMusicSysExTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicSysExTrack, TrackVtbl, iface);
FIXME("(%p, %s, %lli, %p, %p, %ld): stub\n", This, debugstr_guid(rguidType), rtTime, pParam, pStateData, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicSysExTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack)
{
ICOM_THIS(IDirectMusicSysExTrack,iface);
HRESULT WINAPI IDirectMusicSysExTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
ICOM_THIS_MULTI(IDirectMusicSysExTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %p): stub\n", This, pContext, dwTrackGroup, ppResultTrack);
return S_OK;
}
HRESULT WINAPI IDirectMusicSysExTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack)
{
ICOM_THIS(IDirectMusicSysExTrack,iface);
HRESULT WINAPI IDirectMusicSysExTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
ICOM_THIS_MULTI(IDirectMusicSysExTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %p, %ld, %p): stub\n", This, pNewTrack, mtJoin, pContext, dwTrackGroup, ppResultTrack);
return S_OK;
}
ICOM_VTABLE(IDirectMusicTrack8) DirectMusicSysExTrack_Vtbl =
{
ICOM_VTABLE(IDirectMusicTrack8) DirectMusicSysExTrack_Track_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicSysExTrack_QueryInterface,
IDirectMusicSysExTrack_AddRef,
IDirectMusicSysExTrack_Release,
IDirectMusicSysExTrack_Init,
IDirectMusicSysExTrack_InitPlay,
IDirectMusicSysExTrack_EndPlay,
IDirectMusicSysExTrack_Play,
IDirectMusicSysExTrack_GetParam,
IDirectMusicSysExTrack_SetParam,
IDirectMusicSysExTrack_IsParamSupported,
IDirectMusicSysExTrack_AddNotificationType,
IDirectMusicSysExTrack_RemoveNotificationType,
IDirectMusicSysExTrack_Clone,
IDirectMusicSysExTrack_PlayEx,
IDirectMusicSysExTrack_GetParamEx,
IDirectMusicSysExTrack_SetParamEx,
IDirectMusicSysExTrack_Compose,
IDirectMusicSysExTrack_Join
IDirectMusicSysExTrack_IDirectMusicTrack_QueryInterface,
IDirectMusicSysExTrack_IDirectMusicTrack_AddRef,
IDirectMusicSysExTrack_IDirectMusicTrack_Release,
IDirectMusicSysExTrack_IDirectMusicTrack_Init,
IDirectMusicSysExTrack_IDirectMusicTrack_InitPlay,
IDirectMusicSysExTrack_IDirectMusicTrack_EndPlay,
IDirectMusicSysExTrack_IDirectMusicTrack_Play,
IDirectMusicSysExTrack_IDirectMusicTrack_GetParam,
IDirectMusicSysExTrack_IDirectMusicTrack_SetParam,
IDirectMusicSysExTrack_IDirectMusicTrack_IsParamSupported,
IDirectMusicSysExTrack_IDirectMusicTrack_AddNotificationType,
IDirectMusicSysExTrack_IDirectMusicTrack_RemoveNotificationType,
IDirectMusicSysExTrack_IDirectMusicTrack_Clone,
IDirectMusicSysExTrack_IDirectMusicTrack_PlayEx,
IDirectMusicSysExTrack_IDirectMusicTrack_GetParamEx,
IDirectMusicSysExTrack_IDirectMusicTrack_SetParamEx,
IDirectMusicSysExTrack_IDirectMusicTrack_Compose,
IDirectMusicSysExTrack_IDirectMusicTrack_Join
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicSysExTrack (LPCGUID lpcGUID, LPDIRECTMUSICTRACK8 *ppTrack, LPUNKNOWN pUnkOuter)
{
IDirectMusicSysExTrack* track;
if (IsEqualIID (lpcGUID, &IID_IDirectMusicTrack)
|| IsEqualIID (lpcGUID, &IID_IDirectMusicTrack8)) {
track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicSysExTrack));
if (NULL == track) {
*ppTrack = (LPDIRECTMUSICTRACK8) NULL;
return E_OUTOFMEMORY;
}
track->lpVtbl = &DirectMusicSysExTrack_Vtbl;
track->ref = 1;
track->pStream = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(IDirectMusicSysExTrackStream));
track->pStream->lpVtbl = &DirectMusicSysExTrackStream_Vtbl;
track->pStream->ref = 1;
track->pStream->pParentTrack = track;
*ppTrack = (LPDIRECTMUSICTRACK8) track;
return S_OK;
}
WARN("No interface found\n");
return E_NOINTERFACE;
/* IDirectMusicSysExTrack IPersistStream part: */
HRESULT WINAPI IDirectMusicSysExTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicSysExTrack, PersistStreamVtbl, iface);
return IDirectMusicSysExTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
/*****************************************************************************
* IDirectMusicSysExTrackStream implementation
*/
/* IDirectMusicSysExTrackStream IUnknown part follow: */
HRESULT WINAPI IDirectMusicSysExTrackStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicSysExTrackStream,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicSysExTrackStream_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
ULONG WINAPI IDirectMusicSysExTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicSysExTrack, PersistStreamVtbl, iface);
return IDirectMusicSysExTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicSysExTrackStream_AddRef (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicSysExTrackStream,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
ULONG WINAPI IDirectMusicSysExTrack_IPersistStream_Release (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicSysExTrack, PersistStreamVtbl, iface);
return IDirectMusicSysExTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicSysExTrackStream_Release (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicSysExTrackStream,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicSysExTrackStream IPersist part: */
HRESULT WINAPI IDirectMusicSysExTrackStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID)
{
HRESULT WINAPI IDirectMusicSysExTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) {
return E_NOTIMPL;
}
/* IDirectMusicSysExTrackStream IPersistStream part: */
HRESULT WINAPI IDirectMusicSysExTrackStream_IsDirty (LPPERSISTSTREAM iface)
{
HRESULT WINAPI IDirectMusicSysExTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicSysExTrackStream_Load (LPPERSISTSTREAM iface, IStream* pStm)
{
HRESULT WINAPI IDirectMusicSysExTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm) {
FIXME(": Loading not implemented yet\n");
return S_OK;
}
HRESULT WINAPI IDirectMusicSysExTrackStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty)
{
HRESULT WINAPI IDirectMusicSysExTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicSysExTrackStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize)
{
HRESULT WINAPI IDirectMusicSysExTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) {
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicSysExTrackStream_Vtbl =
{
ICOM_VTABLE(IPersistStream) DirectMusicSysExTrack_PersistStream_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicSysExTrackStream_QueryInterface,
IDirectMusicSysExTrackStream_AddRef,
IDirectMusicSysExTrackStream_Release,
IDirectMusicSysExTrackStream_GetClassID,
IDirectMusicSysExTrackStream_IsDirty,
IDirectMusicSysExTrackStream_Load,
IDirectMusicSysExTrackStream_Save,
IDirectMusicSysExTrackStream_GetSizeMax
IDirectMusicSysExTrack_IPersistStream_QueryInterface,
IDirectMusicSysExTrack_IPersistStream_AddRef,
IDirectMusicSysExTrack_IPersistStream_Release,
IDirectMusicSysExTrack_IPersistStream_GetClassID,
IDirectMusicSysExTrack_IPersistStream_IsDirty,
IDirectMusicSysExTrack_IPersistStream_Load,
IDirectMusicSysExTrack_IPersistStream_Save,
IDirectMusicSysExTrack_IPersistStream_GetSizeMax
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicSysExTrack (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) {
IDirectMusicSysExTrack* track;
track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicSysExTrack));
if (NULL == track) {
*ppobj = (LPVOID) NULL;
return E_OUTOFMEMORY;
}
track->UnknownVtbl = &DirectMusicSysExTrack_Unknown_Vtbl;
track->TrackVtbl = &DirectMusicSysExTrack_Track_Vtbl;
track->PersistStreamVtbl = &DirectMusicSysExTrack_PersistStream_Vtbl;
track->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC));
DM_STRUCT_INIT(track->pDesc);
track->pDesc->dwValidData |= DMUS_OBJ_CLASS;
memcpy (&track->pDesc->guidClass, &CLSID_DirectMusicSysExTrack, sizeof (CLSID));
track->ref = 0; /* will be inited by QueryInterface */
return IDirectMusicSysExTrack_IUnknown_QueryInterface ((LPUNKNOWN)&track->UnknownVtbl, lpcGUID, ppobj);
}

View File

@ -1,6 +1,6 @@
/* IDirectMusicTempoTrack Implementation
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -17,14 +17,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "dmime_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmime);
@ -34,19 +26,21 @@ WINE_DECLARE_DEBUG_CHANNEL(dmfile);
* IDirectMusicTempoTrack implementation
*/
/* IDirectMusicTempoTrack IUnknown part: */
HRESULT WINAPI IDirectMusicTempoTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicTempoTrack,iface);
HRESULT WINAPI IDirectMusicTempoTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicTempoTrack, UnknownVtbl, iface);
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IDirectMusicTrack) ||
IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
IDirectMusicTempoTrack_AddRef(iface);
*ppobj = This;
if (IsEqualIID (riid, &IID_IUnknown)) {
*ppobj = (LPUNKNOWN)&This->UnknownVtbl;
IDirectMusicTempoTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicTrack)
|| IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
*ppobj = (LPDIRECTMUSICTRACK8)&This->TrackVtbl;
IDirectMusicTempoTrack_IDirectMusicTrack_AddRef ((LPDIRECTMUSICTRACK8)&This->TrackVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicTempoTrackStream_AddRef ((LPPERSISTSTREAM)This->pStream);
*ppobj = This->pStream;
*ppobj = (LPPERSISTSTREAM)&This->PersistStreamVtbl;
IDirectMusicTempoTrack_IPersistStream_AddRef ((LPPERSISTSTREAM)&This->PersistStreamVtbl);
return S_OK;
}
@ -54,16 +48,14 @@ HRESULT WINAPI IDirectMusicTempoTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface,
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicTempoTrack_AddRef (LPDIRECTMUSICTRACK8 iface)
{
ICOM_THIS(IDirectMusicTempoTrack,iface);
ULONG WINAPI IDirectMusicTempoTrack_IUnknown_AddRef (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicTempoTrack, UnknownVtbl, iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicTempoTrack_Release (LPDIRECTMUSICTRACK8 iface)
{
ICOM_THIS(IDirectMusicTempoTrack,iface);
ULONG WINAPI IDirectMusicTempoTrack_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicTempoTrack, UnknownVtbl, iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
@ -72,64 +64,71 @@ ULONG WINAPI IDirectMusicTempoTrack_Release (LPDIRECTMUSICTRACK8 iface)
return ref;
}
/* IDirectMusicTempoTrack IDirectMusicTrack part: */
HRESULT WINAPI IDirectMusicTempoTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment)
{
ICOM_THIS(IDirectMusicTempoTrack,iface);
ICOM_VTABLE(IUnknown) DirectMusicTempoTrack_Unknown_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicTempoTrack_IUnknown_QueryInterface,
IDirectMusicTempoTrack_IUnknown_AddRef,
IDirectMusicTempoTrack_IUnknown_Release
};
/* IDirectMusicTempoTrack IDirectMusicTrack8 part: */
HRESULT WINAPI IDirectMusicTempoTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicTempoTrack, TrackVtbl, iface);
return IDirectMusicTempoTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicTempoTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface) {
ICOM_THIS_MULTI(IDirectMusicTempoTrack, TrackVtbl, iface);
return IDirectMusicTempoTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicTempoTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface) {
ICOM_THIS_MULTI(IDirectMusicTempoTrack, TrackVtbl, iface);
return IDirectMusicTempoTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicTempoTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment)
{
ICOM_THIS_MULTI(IDirectMusicTempoTrack, TrackVtbl, iface);
FIXME("(%p, %p): stub\n", This, pSegment);
return S_OK;
}
HRESULT WINAPI IDirectMusicTempoTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags)
HRESULT WINAPI IDirectMusicTempoTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicTempoTrack,iface);
ICOM_THIS_MULTI(IDirectMusicTempoTrack, TrackVtbl, iface);
FIXME("(%p, %p, %p, %p, %ld, %ld): stub\n", This, pSegmentState, pPerformance, ppStateData, dwVirtualTrack8ID, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicTempoTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData)
HRESULT WINAPI IDirectMusicTempoTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData)
{
ICOM_THIS(IDirectMusicTempoTrack,iface);
ICOM_THIS_MULTI(IDirectMusicTempoTrack, TrackVtbl, iface);
FIXME("(%p, %p): stub\n", This, pStateData);
return S_OK;
}
HRESULT WINAPI IDirectMusicTempoTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
HRESULT WINAPI IDirectMusicTempoTrack_IDirectMusicTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
{
ICOM_THIS(IDirectMusicTempoTrack,iface);
ICOM_THIS_MULTI(IDirectMusicTempoTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %ld, %ld, %ld, %p, %p, %ld): stub\n", This, pStateData, mtStart, mtEnd, mtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
return S_OK;
}
HRESULT WINAPI IDirectMusicTempoTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam)
{
ICOM_THIS(IDirectMusicTempoTrack,iface);
HRESULT WINAPI IDirectMusicTempoTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam) {
ICOM_THIS_MULTI(IDirectMusicTempoTrack, TrackVtbl, iface);
FIXME("(%p, %s, %ld, %p, %p): stub\n", This, debugstr_guid(rguidType), mtTime, pmtNext, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicTempoTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam)
{
ICOM_THIS(IDirectMusicTempoTrack,iface);
HRESULT WINAPI IDirectMusicTempoTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam) {
ICOM_THIS_MULTI(IDirectMusicTempoTrack, TrackVtbl, iface);
FIXME("(%p, %s, %ld, %p): stub\n", This, debugstr_guid(rguidType), mtTime, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicTempoTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType)
{
ICOM_THIS(IDirectMusicTempoTrack,iface);
HRESULT WINAPI IDirectMusicTempoTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType) {
ICOM_THIS_MULTI(IDirectMusicTempoTrack, TrackVtbl, iface);
TRACE("(%p, %s): ", This, debugstr_guid(rguidType));
if (IsEqualGUID (rguidType, &GUID_DisableTempo)
@ -137,208 +136,147 @@ HRESULT WINAPI IDirectMusicTempoTrack_IsParamSupported (LPDIRECTMUSICTRACK8 ifac
|| IsEqualGUID (rguidType, &GUID_TempoParam)) {
TRACE("param supported\n");
return S_OK;
}
}
TRACE("param unsupported\n");
return DMUS_E_TYPE_UNSUPPORTED;
}
HRESULT WINAPI IDirectMusicTempoTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType)
{
ICOM_THIS(IDirectMusicTempoTrack,iface);
HRESULT WINAPI IDirectMusicTempoTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
ICOM_THIS_MULTI(IDirectMusicTempoTrack, TrackVtbl, iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
return S_OK;
}
HRESULT WINAPI IDirectMusicTempoTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType)
{
ICOM_THIS(IDirectMusicTempoTrack,iface);
HRESULT WINAPI IDirectMusicTempoTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
ICOM_THIS_MULTI(IDirectMusicTempoTrack, TrackVtbl, iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
return S_OK;
}
HRESULT WINAPI IDirectMusicTempoTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack)
{
ICOM_THIS(IDirectMusicTempoTrack,iface);
HRESULT WINAPI IDirectMusicTempoTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack) {
ICOM_THIS_MULTI(IDirectMusicTempoTrack, TrackVtbl, iface);
FIXME("(%p, %ld, %ld, %p): stub\n", This, mtStart, mtEnd, ppTrack);
return S_OK;
}
/* IDirectMusicTempoTrack IDirectMusicTrack8 part: */
HRESULT WINAPI IDirectMusicTempoTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
{
ICOM_THIS(IDirectMusicTempoTrack,iface);
HRESULT WINAPI IDirectMusicTempoTrack_IDirectMusicTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID) {
ICOM_THIS_MULTI(IDirectMusicTempoTrack, TrackVtbl, iface);
FIXME("(%p, %p, %lli, %lli, %lli, %ld, %p, %p, %ld): stub\n", This, pStateData, rtStart, rtEnd, rtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
return S_OK;
}
HRESULT WINAPI IDirectMusicTempoTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicTempoTrack,iface);
HRESULT WINAPI IDirectMusicTempoTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicTempoTrack, TrackVtbl, iface);
FIXME("(%p, %s, %lli, %p, %p, %p, %ld): stub\n", This, debugstr_guid(rguidType), rtTime, prtNext, pParam, pStateData, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicTempoTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicTempoTrack,iface);
HRESULT WINAPI IDirectMusicTempoTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicTempoTrack, TrackVtbl, iface);
FIXME("(%p, %s, %lli, %p, %p, %ld): stub\n", This, debugstr_guid(rguidType), rtTime, pParam, pStateData, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicTempoTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack)
{
ICOM_THIS(IDirectMusicTempoTrack,iface);
HRESULT WINAPI IDirectMusicTempoTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
ICOM_THIS_MULTI(IDirectMusicTempoTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %p): stub\n", This, pContext, dwTrackGroup, ppResultTrack);
return S_OK;
}
HRESULT WINAPI IDirectMusicTempoTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack)
{
ICOM_THIS(IDirectMusicTempoTrack,iface);
HRESULT WINAPI IDirectMusicTempoTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
ICOM_THIS_MULTI(IDirectMusicTempoTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %p, %ld, %p): stub\n", This, pNewTrack, mtJoin, pContext, dwTrackGroup, ppResultTrack);
return S_OK;
}
ICOM_VTABLE(IDirectMusicTrack8) DirectMusicTempoTrack_Vtbl =
{
ICOM_VTABLE(IDirectMusicTrack8) DirectMusicTempoTrack_Track_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicTempoTrack_QueryInterface,
IDirectMusicTempoTrack_AddRef,
IDirectMusicTempoTrack_Release,
IDirectMusicTempoTrack_Init,
IDirectMusicTempoTrack_InitPlay,
IDirectMusicTempoTrack_EndPlay,
IDirectMusicTempoTrack_Play,
IDirectMusicTempoTrack_GetParam,
IDirectMusicTempoTrack_SetParam,
IDirectMusicTempoTrack_IsParamSupported,
IDirectMusicTempoTrack_AddNotificationType,
IDirectMusicTempoTrack_RemoveNotificationType,
IDirectMusicTempoTrack_Clone,
IDirectMusicTempoTrack_PlayEx,
IDirectMusicTempoTrack_GetParamEx,
IDirectMusicTempoTrack_SetParamEx,
IDirectMusicTempoTrack_Compose,
IDirectMusicTempoTrack_Join
IDirectMusicTempoTrack_IDirectMusicTrack_QueryInterface,
IDirectMusicTempoTrack_IDirectMusicTrack_AddRef,
IDirectMusicTempoTrack_IDirectMusicTrack_Release,
IDirectMusicTempoTrack_IDirectMusicTrack_Init,
IDirectMusicTempoTrack_IDirectMusicTrack_InitPlay,
IDirectMusicTempoTrack_IDirectMusicTrack_EndPlay,
IDirectMusicTempoTrack_IDirectMusicTrack_Play,
IDirectMusicTempoTrack_IDirectMusicTrack_GetParam,
IDirectMusicTempoTrack_IDirectMusicTrack_SetParam,
IDirectMusicTempoTrack_IDirectMusicTrack_IsParamSupported,
IDirectMusicTempoTrack_IDirectMusicTrack_AddNotificationType,
IDirectMusicTempoTrack_IDirectMusicTrack_RemoveNotificationType,
IDirectMusicTempoTrack_IDirectMusicTrack_Clone,
IDirectMusicTempoTrack_IDirectMusicTrack_PlayEx,
IDirectMusicTempoTrack_IDirectMusicTrack_GetParamEx,
IDirectMusicTempoTrack_IDirectMusicTrack_SetParamEx,
IDirectMusicTempoTrack_IDirectMusicTrack_Compose,
IDirectMusicTempoTrack_IDirectMusicTrack_Join
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicTempoTrack (LPCGUID lpcGUID, LPDIRECTMUSICTRACK8 *ppTrack, LPUNKNOWN pUnkOuter)
{
IDirectMusicTempoTrack* track;
if (IsEqualIID (lpcGUID, &IID_IDirectMusicTrack)
|| IsEqualIID (lpcGUID, &IID_IDirectMusicTrack8)) {
track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicTempoTrack));
if (NULL == track) {
*ppTrack = (LPDIRECTMUSICTRACK8) NULL;
return E_OUTOFMEMORY;
}
track->lpVtbl = &DirectMusicTempoTrack_Vtbl;
track->ref = 1;
track->pStream = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(IDirectMusicTempoTrackStream));
track->pStream->lpVtbl = &DirectMusicTempoTrackStream_Vtbl;
track->pStream->ref = 1;
track->pStream->pParentTrack = track;
*ppTrack = (LPDIRECTMUSICTRACK8) track;
return S_OK;
}
WARN("No interface found\n");
return E_NOINTERFACE;
/* IDirectMusicTempoTrack IPersistStream part: */
HRESULT WINAPI IDirectMusicTempoTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicTempoTrack, PersistStreamVtbl, iface);
return IDirectMusicTempoTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
/*****************************************************************************
* IDirectMusicTempoTrackStream implementation
*/
/* IDirectMusicTempoTrackStream IUnknown part follow: */
HRESULT WINAPI IDirectMusicTempoTrackStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicTempoTrackStream,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicTempoTrackStream_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
ULONG WINAPI IDirectMusicTempoTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicTempoTrack, PersistStreamVtbl, iface);
return IDirectMusicTempoTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicTempoTrackStream_AddRef (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicTempoTrackStream,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
ULONG WINAPI IDirectMusicTempoTrack_IPersistStream_Release (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicTempoTrack, PersistStreamVtbl, iface);
return IDirectMusicTempoTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicTempoTrackStream_Release (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicTempoTrackStream,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicTempoTrackStream IPersist part: */
HRESULT WINAPI IDirectMusicTempoTrackStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID)
{
HRESULT WINAPI IDirectMusicTempoTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) {
return E_NOTIMPL;
}
/* IDirectMusicTempoTrackStream IPersistStream part: */
HRESULT WINAPI IDirectMusicTempoTrackStream_IsDirty (LPPERSISTSTREAM iface)
{
HRESULT WINAPI IDirectMusicTempoTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicTempoTrackStream_Load (LPPERSISTSTREAM iface, IStream* pStm)
{
HRESULT WINAPI IDirectMusicTempoTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm) {
FIXME(": Loading not implemented yet\n");
return S_OK;
}
HRESULT WINAPI IDirectMusicTempoTrackStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty)
{
HRESULT WINAPI IDirectMusicTempoTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicTempoTrackStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize)
{
HRESULT WINAPI IDirectMusicTempoTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) {
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicTempoTrackStream_Vtbl =
{
ICOM_VTABLE(IPersistStream) DirectMusicTempoTrack_PersistStream_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicTempoTrackStream_QueryInterface,
IDirectMusicTempoTrackStream_AddRef,
IDirectMusicTempoTrackStream_Release,
IDirectMusicTempoTrackStream_GetClassID,
IDirectMusicTempoTrackStream_IsDirty,
IDirectMusicTempoTrackStream_Load,
IDirectMusicTempoTrackStream_Save,
IDirectMusicTempoTrackStream_GetSizeMax
IDirectMusicTempoTrack_IPersistStream_QueryInterface,
IDirectMusicTempoTrack_IPersistStream_AddRef,
IDirectMusicTempoTrack_IPersistStream_Release,
IDirectMusicTempoTrack_IPersistStream_GetClassID,
IDirectMusicTempoTrack_IPersistStream_IsDirty,
IDirectMusicTempoTrack_IPersistStream_Load,
IDirectMusicTempoTrack_IPersistStream_Save,
IDirectMusicTempoTrack_IPersistStream_GetSizeMax
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicTempoTrack (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) {
IDirectMusicTempoTrack* track;
track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicTempoTrack));
if (NULL == track) {
*ppobj = (LPVOID) NULL;
return E_OUTOFMEMORY;
}
track->UnknownVtbl = &DirectMusicTempoTrack_Unknown_Vtbl;
track->TrackVtbl = &DirectMusicTempoTrack_Track_Vtbl;
track->PersistStreamVtbl = &DirectMusicTempoTrack_PersistStream_Vtbl;
track->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC));
DM_STRUCT_INIT(track->pDesc);
track->pDesc->dwValidData |= DMUS_OBJ_CLASS;
memcpy (&track->pDesc->guidClass, &CLSID_DirectMusicTempoTrack, sizeof (CLSID));
track->ref = 0; /* will be inited by QueryInterface */
return IDirectMusicTempoTrack_IUnknown_QueryInterface ((LPUNKNOWN)&track->UnknownVtbl, lpcGUID, ppobj);
}

View File

@ -1,6 +1,6 @@
/* IDirectMusicTimeSigTrack Implementation
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -17,14 +17,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "dmime_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmime);
@ -34,35 +26,36 @@ WINE_DECLARE_DEBUG_CHANNEL(dmfile);
* IDirectMusicTimeSigTrack implementation
*/
/* IDirectMusicTimeSigTrack IUnknown part: */
HRESULT WINAPI IDirectMusicTimeSigTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicTimeSigTrack,iface);
HRESULT WINAPI IDirectMusicTimeSigTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicTimeSigTrack, UnknownVtbl, iface);
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IDirectMusicTrack) ||
IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
IDirectMusicTimeSigTrack_AddRef(iface);
*ppobj = This;
if (IsEqualIID (riid, &IID_IUnknown)) {
*ppobj = (LPUNKNOWN)&This->UnknownVtbl;
IDirectMusicTimeSigTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicTrack)
|| IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
*ppobj = (LPDIRECTMUSICTRACK8)&This->TrackVtbl;
IDirectMusicTimeSigTrack_IDirectMusicTrack_AddRef ((LPDIRECTMUSICTRACK8)&This->TrackVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicTimeSigTrackStream_AddRef ((LPPERSISTSTREAM)This->pStream);
*ppobj = This->pStream;
*ppobj = (LPPERSISTSTREAM)&This->PersistStreamVtbl;
IDirectMusicTimeSigTrack_IPersistStream_AddRef ((LPPERSISTSTREAM)&This->PersistStreamVtbl);
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicTimeSigTrack_AddRef (LPDIRECTMUSICTRACK8 iface)
{
ICOM_THIS(IDirectMusicTimeSigTrack,iface);
ULONG WINAPI IDirectMusicTimeSigTrack_IUnknown_AddRef (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicTimeSigTrack, UnknownVtbl, iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicTimeSigTrack_Release (LPDIRECTMUSICTRACK8 iface)
{
ICOM_THIS(IDirectMusicTimeSigTrack,iface);
ULONG WINAPI IDirectMusicTimeSigTrack_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicTimeSigTrack, UnknownVtbl, iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
@ -71,64 +64,71 @@ ULONG WINAPI IDirectMusicTimeSigTrack_Release (LPDIRECTMUSICTRACK8 iface)
return ref;
}
/* IDirectMusicTimeSigTrack IDirectMusicTrack part: */
HRESULT WINAPI IDirectMusicTimeSigTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment)
{
ICOM_THIS(IDirectMusicTimeSigTrack,iface);
ICOM_VTABLE(IUnknown) DirectMusicTimeSigTrack_Unknown_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicTimeSigTrack_IUnknown_QueryInterface,
IDirectMusicTimeSigTrack_IUnknown_AddRef,
IDirectMusicTimeSigTrack_IUnknown_Release
};
/* IDirectMusicTimeSigTrack IDirectMusicTrack8 part: */
HRESULT WINAPI IDirectMusicTimeSigTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicTimeSigTrack, TrackVtbl, iface);
return IDirectMusicTimeSigTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicTimeSigTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface) {
ICOM_THIS_MULTI(IDirectMusicTimeSigTrack, TrackVtbl, iface);
return IDirectMusicTimeSigTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicTimeSigTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface) {
ICOM_THIS_MULTI(IDirectMusicTimeSigTrack, TrackVtbl, iface);
return IDirectMusicTimeSigTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicTimeSigTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment)
{
ICOM_THIS_MULTI(IDirectMusicTimeSigTrack, TrackVtbl, iface);
FIXME("(%p, %p): stub\n", This, pSegment);
return S_OK;
}
HRESULT WINAPI IDirectMusicTimeSigTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags)
HRESULT WINAPI IDirectMusicTimeSigTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicTimeSigTrack,iface);
ICOM_THIS_MULTI(IDirectMusicTimeSigTrack, TrackVtbl, iface);
FIXME("(%p, %p, %p, %p, %ld, %ld): stub\n", This, pSegmentState, pPerformance, ppStateData, dwVirtualTrack8ID, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicTimeSigTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData)
HRESULT WINAPI IDirectMusicTimeSigTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData)
{
ICOM_THIS(IDirectMusicTimeSigTrack,iface);
ICOM_THIS_MULTI(IDirectMusicTimeSigTrack, TrackVtbl, iface);
FIXME("(%p, %p): stub\n", This, pStateData);
return S_OK;
}
HRESULT WINAPI IDirectMusicTimeSigTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
HRESULT WINAPI IDirectMusicTimeSigTrack_IDirectMusicTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
{
ICOM_THIS(IDirectMusicTimeSigTrack,iface);
ICOM_THIS_MULTI(IDirectMusicTimeSigTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %ld, %ld, %ld, %p, %p, %ld): stub\n", This, pStateData, mtStart, mtEnd, mtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
return S_OK;
}
HRESULT WINAPI IDirectMusicTimeSigTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam)
{
ICOM_THIS(IDirectMusicTimeSigTrack,iface);
HRESULT WINAPI IDirectMusicTimeSigTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam) {
ICOM_THIS_MULTI(IDirectMusicTimeSigTrack, TrackVtbl, iface);
FIXME("(%p, %s, %ld, %p, %p): stub\n", This, debugstr_guid(rguidType), mtTime, pmtNext, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicTimeSigTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam)
{
ICOM_THIS(IDirectMusicTimeSigTrack,iface);
HRESULT WINAPI IDirectMusicTimeSigTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam) {
ICOM_THIS_MULTI(IDirectMusicTimeSigTrack, TrackVtbl, iface);
FIXME("(%p, %s, %ld, %p): stub\n", This, debugstr_guid(rguidType), mtTime, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicTimeSigTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType)
{
ICOM_THIS(IDirectMusicTimeSigTrack,iface);
HRESULT WINAPI IDirectMusicTimeSigTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType) {
ICOM_THIS_MULTI(IDirectMusicTimeSigTrack, TrackVtbl, iface);
TRACE("(%p, %s): ", This, debugstr_guid(rguidType));
if (IsEqualGUID (rguidType, &GUID_DisableTimeSig)
@ -136,208 +136,147 @@ HRESULT WINAPI IDirectMusicTimeSigTrack_IsParamSupported (LPDIRECTMUSICTRACK8 if
|| IsEqualGUID (rguidType, &GUID_TimeSignature)) {
TRACE("param supported\n");
return S_OK;
}
}
TRACE("param unsupported\n");
return DMUS_E_TYPE_UNSUPPORTED;
}
HRESULT WINAPI IDirectMusicTimeSigTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType)
{
ICOM_THIS(IDirectMusicTimeSigTrack,iface);
HRESULT WINAPI IDirectMusicTimeSigTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
ICOM_THIS_MULTI(IDirectMusicTimeSigTrack, TrackVtbl, iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
return S_OK;
}
HRESULT WINAPI IDirectMusicTimeSigTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType)
{
ICOM_THIS(IDirectMusicTimeSigTrack,iface);
HRESULT WINAPI IDirectMusicTimeSigTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
ICOM_THIS_MULTI(IDirectMusicTimeSigTrack, TrackVtbl, iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
return S_OK;
}
HRESULT WINAPI IDirectMusicTimeSigTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack)
{
ICOM_THIS(IDirectMusicTimeSigTrack,iface);
HRESULT WINAPI IDirectMusicTimeSigTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack) {
ICOM_THIS_MULTI(IDirectMusicTimeSigTrack, TrackVtbl, iface);
FIXME("(%p, %ld, %ld, %p): stub\n", This, mtStart, mtEnd, ppTrack);
return S_OK;
}
/* IDirectMusicTimeSigTrack IDirectMusicTrack8 part: */
HRESULT WINAPI IDirectMusicTimeSigTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
{
ICOM_THIS(IDirectMusicTimeSigTrack,iface);
HRESULT WINAPI IDirectMusicTimeSigTrack_IDirectMusicTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID) {
ICOM_THIS_MULTI(IDirectMusicTimeSigTrack, TrackVtbl, iface);
FIXME("(%p, %p, %lli, %lli, %lli, %ld, %p, %p, %ld): stub\n", This, pStateData, rtStart, rtEnd, rtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
return S_OK;
}
HRESULT WINAPI IDirectMusicTimeSigTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicTimeSigTrack,iface);
HRESULT WINAPI IDirectMusicTimeSigTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicTimeSigTrack, TrackVtbl, iface);
FIXME("(%p, %s, %lli, %p, %p, %p, %ld): stub\n", This, debugstr_guid(rguidType), rtTime, prtNext, pParam, pStateData, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicTimeSigTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicTimeSigTrack,iface);
HRESULT WINAPI IDirectMusicTimeSigTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicTimeSigTrack, TrackVtbl, iface);
FIXME("(%p, %s, %lli, %p, %p, %ld): stub\n", This, debugstr_guid(rguidType), rtTime, pParam, pStateData, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicTimeSigTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack)
{
ICOM_THIS(IDirectMusicTimeSigTrack,iface);
HRESULT WINAPI IDirectMusicTimeSigTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
ICOM_THIS_MULTI(IDirectMusicTimeSigTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %p): stub\n", This, pContext, dwTrackGroup, ppResultTrack);
return S_OK;
}
HRESULT WINAPI IDirectMusicTimeSigTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack)
{
ICOM_THIS(IDirectMusicTimeSigTrack,iface);
HRESULT WINAPI IDirectMusicTimeSigTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
ICOM_THIS_MULTI(IDirectMusicTimeSigTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %p, %ld, %p): stub\n", This, pNewTrack, mtJoin, pContext, dwTrackGroup, ppResultTrack);
return S_OK;
}
ICOM_VTABLE(IDirectMusicTrack8) DirectMusicTimeSigTrack_Vtbl =
{
ICOM_VTABLE(IDirectMusicTrack8) DirectMusicTimeSigTrack_Track_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicTimeSigTrack_QueryInterface,
IDirectMusicTimeSigTrack_AddRef,
IDirectMusicTimeSigTrack_Release,
IDirectMusicTimeSigTrack_Init,
IDirectMusicTimeSigTrack_InitPlay,
IDirectMusicTimeSigTrack_EndPlay,
IDirectMusicTimeSigTrack_Play,
IDirectMusicTimeSigTrack_GetParam,
IDirectMusicTimeSigTrack_SetParam,
IDirectMusicTimeSigTrack_IsParamSupported,
IDirectMusicTimeSigTrack_AddNotificationType,
IDirectMusicTimeSigTrack_RemoveNotificationType,
IDirectMusicTimeSigTrack_Clone,
IDirectMusicTimeSigTrack_PlayEx,
IDirectMusicTimeSigTrack_GetParamEx,
IDirectMusicTimeSigTrack_SetParamEx,
IDirectMusicTimeSigTrack_Compose,
IDirectMusicTimeSigTrack_Join
IDirectMusicTimeSigTrack_IDirectMusicTrack_QueryInterface,
IDirectMusicTimeSigTrack_IDirectMusicTrack_AddRef,
IDirectMusicTimeSigTrack_IDirectMusicTrack_Release,
IDirectMusicTimeSigTrack_IDirectMusicTrack_Init,
IDirectMusicTimeSigTrack_IDirectMusicTrack_InitPlay,
IDirectMusicTimeSigTrack_IDirectMusicTrack_EndPlay,
IDirectMusicTimeSigTrack_IDirectMusicTrack_Play,
IDirectMusicTimeSigTrack_IDirectMusicTrack_GetParam,
IDirectMusicTimeSigTrack_IDirectMusicTrack_SetParam,
IDirectMusicTimeSigTrack_IDirectMusicTrack_IsParamSupported,
IDirectMusicTimeSigTrack_IDirectMusicTrack_AddNotificationType,
IDirectMusicTimeSigTrack_IDirectMusicTrack_RemoveNotificationType,
IDirectMusicTimeSigTrack_IDirectMusicTrack_Clone,
IDirectMusicTimeSigTrack_IDirectMusicTrack_PlayEx,
IDirectMusicTimeSigTrack_IDirectMusicTrack_GetParamEx,
IDirectMusicTimeSigTrack_IDirectMusicTrack_SetParamEx,
IDirectMusicTimeSigTrack_IDirectMusicTrack_Compose,
IDirectMusicTimeSigTrack_IDirectMusicTrack_Join
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicTimeSigTrack (LPCGUID lpcGUID, LPDIRECTMUSICTRACK8 *ppTrack, LPUNKNOWN pUnkOuter)
{
IDirectMusicTimeSigTrack* track;
if (IsEqualIID (lpcGUID, &IID_IDirectMusicTrack)
|| IsEqualIID (lpcGUID, &IID_IDirectMusicTrack8)) {
track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicTimeSigTrack));
if (NULL == track) {
*ppTrack = (LPDIRECTMUSICTRACK8) NULL;
return E_OUTOFMEMORY;
}
track->lpVtbl = &DirectMusicTimeSigTrack_Vtbl;
track->ref = 1;
track->pStream = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(IDirectMusicTimeSigTrackStream));
track->pStream->lpVtbl = &DirectMusicTimeSigTrackStream_Vtbl;
track->pStream->ref = 1;
track->pStream->pParentTrack = track;
*ppTrack = (LPDIRECTMUSICTRACK8) track;
return S_OK;
}
WARN("No interface found\n");
return E_NOINTERFACE;
/* IDirectMusicTimeSigTrack IPersistStream part: */
HRESULT WINAPI IDirectMusicTimeSigTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicTimeSigTrack, PersistStreamVtbl, iface);
return IDirectMusicTimeSigTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
/*****************************************************************************
* IDirectMusicTimeSigTrackStream implementation
*/
/* IDirectMusicTimeSigTrackStream IUnknown part follow: */
HRESULT WINAPI IDirectMusicTimeSigTrackStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicTimeSigTrackStream,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicTimeSigTrackStream_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
ULONG WINAPI IDirectMusicTimeSigTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicTimeSigTrack, PersistStreamVtbl, iface);
return IDirectMusicTimeSigTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicTimeSigTrackStream_AddRef (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicTimeSigTrackStream,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
ULONG WINAPI IDirectMusicTimeSigTrack_IPersistStream_Release (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicTimeSigTrack, PersistStreamVtbl, iface);
return IDirectMusicTimeSigTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicTimeSigTrackStream_Release (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicTimeSigTrackStream,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicTimeSigTrackStream IPersist part: */
HRESULT WINAPI IDirectMusicTimeSigTrackStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID)
{
HRESULT WINAPI IDirectMusicTimeSigTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) {
return E_NOTIMPL;
}
/* IDirectMusicTimeSigTrackStream IPersistStream part: */
HRESULT WINAPI IDirectMusicTimeSigTrackStream_IsDirty (LPPERSISTSTREAM iface)
{
HRESULT WINAPI IDirectMusicTimeSigTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicTimeSigTrackStream_Load (LPPERSISTSTREAM iface, IStream* pStm)
{
HRESULT WINAPI IDirectMusicTimeSigTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm) {
FIXME(": Loading not implemented yet\n");
return S_OK;
}
HRESULT WINAPI IDirectMusicTimeSigTrackStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty)
{
HRESULT WINAPI IDirectMusicTimeSigTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicTimeSigTrackStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize)
{
HRESULT WINAPI IDirectMusicTimeSigTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) {
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicTimeSigTrackStream_Vtbl =
{
ICOM_VTABLE(IPersistStream) DirectMusicTimeSigTrack_PersistStream_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicTimeSigTrackStream_QueryInterface,
IDirectMusicTimeSigTrackStream_AddRef,
IDirectMusicTimeSigTrackStream_Release,
IDirectMusicTimeSigTrackStream_GetClassID,
IDirectMusicTimeSigTrackStream_IsDirty,
IDirectMusicTimeSigTrackStream_Load,
IDirectMusicTimeSigTrackStream_Save,
IDirectMusicTimeSigTrackStream_GetSizeMax
IDirectMusicTimeSigTrack_IPersistStream_QueryInterface,
IDirectMusicTimeSigTrack_IPersistStream_AddRef,
IDirectMusicTimeSigTrack_IPersistStream_Release,
IDirectMusicTimeSigTrack_IPersistStream_GetClassID,
IDirectMusicTimeSigTrack_IPersistStream_IsDirty,
IDirectMusicTimeSigTrack_IPersistStream_Load,
IDirectMusicTimeSigTrack_IPersistStream_Save,
IDirectMusicTimeSigTrack_IPersistStream_GetSizeMax
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicTimeSigTrack (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) {
IDirectMusicTimeSigTrack* track;
track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicTimeSigTrack));
if (NULL == track) {
*ppobj = (LPVOID) NULL;
return E_OUTOFMEMORY;
}
track->UnknownVtbl = &DirectMusicTimeSigTrack_Unknown_Vtbl;
track->TrackVtbl = &DirectMusicTimeSigTrack_Track_Vtbl;
track->PersistStreamVtbl = &DirectMusicTimeSigTrack_PersistStream_Vtbl;
track->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC));
DM_STRUCT_INIT(track->pDesc);
track->pDesc->dwValidData |= DMUS_OBJ_CLASS;
memcpy (&track->pDesc->guidClass, &CLSID_DirectMusicTimeSigTrack, sizeof (CLSID));
track->ref = 0; /* will be inited by QueryInterface */
return IDirectMusicTimeSigTrack_IUnknown_QueryInterface ((LPUNKNOWN)&track->UnknownVtbl, lpcGUID, ppobj);
}

View File

@ -1,6 +1,6 @@
/* IDirectMusicTool8 Implementation
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -17,24 +17,13 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "dmime_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmime);
/* IDirectMusicTool8 IUnknown part: */
HRESULT WINAPI IDirectMusicTool8Impl_QueryInterface (LPDIRECTMUSICTOOL8 iface, REFIID riid, LPVOID *ppobj)
{
/* IDirectMusicTool8Impl IUnknown part: */
HRESULT WINAPI IDirectMusicTool8Impl_QueryInterface (LPDIRECTMUSICTOOL8 iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IDirectMusicTool8Impl,iface);
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IDirectMusicTool) ||
IsEqualIID (riid, &IID_IDirectMusicTool8)) {
@ -46,15 +35,13 @@ HRESULT WINAPI IDirectMusicTool8Impl_QueryInterface (LPDIRECTMUSICTOOL8 iface, R
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicTool8Impl_AddRef (LPDIRECTMUSICTOOL8 iface)
{
ULONG WINAPI IDirectMusicTool8Impl_AddRef (LPDIRECTMUSICTOOL8 iface) {
ICOM_THIS(IDirectMusicTool8Impl,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicTool8Impl_Release (LPDIRECTMUSICTOOL8 iface)
{
ULONG WINAPI IDirectMusicTool8Impl_Release (LPDIRECTMUSICTOOL8 iface) {
ICOM_THIS(IDirectMusicTool8Impl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
@ -64,73 +51,51 @@ ULONG WINAPI IDirectMusicTool8Impl_Release (LPDIRECTMUSICTOOL8 iface)
return ref;
}
/* IDirectMusicTool8 IDirectMusicTool part: */
HRESULT WINAPI IDirectMusicTool8Impl_Init (LPDIRECTMUSICTOOL8 iface, IDirectMusicGraph* pGraph)
{
/* IDirectMusicTool8Impl IDirectMusicTool part: */
HRESULT WINAPI IDirectMusicTool8Impl_Init (LPDIRECTMUSICTOOL8 iface, IDirectMusicGraph* pGraph) {
ICOM_THIS(IDirectMusicTool8Impl,iface);
FIXME("(%p, %p): stub\n", This, pGraph);
return S_OK;
}
HRESULT WINAPI IDirectMusicTool8Impl_GetMsgDeliveryType (LPDIRECTMUSICTOOL8 iface, DWORD* pdwDeliveryType)
{
HRESULT WINAPI IDirectMusicTool8Impl_GetMsgDeliveryType (LPDIRECTMUSICTOOL8 iface, DWORD* pdwDeliveryType) {
ICOM_THIS(IDirectMusicTool8Impl,iface);
FIXME("(%p, %p): stub\n", This, pdwDeliveryType);
return S_OK;
}
HRESULT WINAPI IDirectMusicTool8Impl_GetMediaTypeArraySize (LPDIRECTMUSICTOOL8 iface, DWORD* pdwNumElements)
{
HRESULT WINAPI IDirectMusicTool8Impl_GetMediaTypeArraySize (LPDIRECTMUSICTOOL8 iface, DWORD* pdwNumElements) {
ICOM_THIS(IDirectMusicTool8Impl,iface);
FIXME("(%p, %p): stub\n", This, pdwNumElements);
return S_OK;
}
HRESULT WINAPI IDirectMusicTool8Impl_GetMediaTypes (LPDIRECTMUSICTOOL8 iface, DWORD** padwMediaTypes, DWORD dwNumElements)
{
HRESULT WINAPI IDirectMusicTool8Impl_GetMediaTypes (LPDIRECTMUSICTOOL8 iface, DWORD** padwMediaTypes, DWORD dwNumElements) {
ICOM_THIS(IDirectMusicTool8Impl,iface);
FIXME("(%p, %p, %ld): stub\n", This, padwMediaTypes, dwNumElements);
return S_OK;
}
HRESULT WINAPI IDirectMusicTool8Impl_ProcessPMsg (LPDIRECTMUSICTOOL8 iface, IDirectMusicPerformance* pPerf, DMUS_PMSG* pPMSG)
{
HRESULT WINAPI IDirectMusicTool8Impl_ProcessPMsg (LPDIRECTMUSICTOOL8 iface, IDirectMusicPerformance* pPerf, DMUS_PMSG* pPMSG) {
ICOM_THIS(IDirectMusicTool8Impl,iface);
FIXME("(%p, %p, %p): stub\n", This, pPerf, pPMSG);
return S_OK;
}
HRESULT WINAPI IDirectMusicTool8Impl_Flush (LPDIRECTMUSICTOOL8 iface, IDirectMusicPerformance* pPerf, DMUS_PMSG* pPMSG, REFERENCE_TIME rtTime)
{
HRESULT WINAPI IDirectMusicTool8Impl_Flush (LPDIRECTMUSICTOOL8 iface, IDirectMusicPerformance* pPerf, DMUS_PMSG* pPMSG, REFERENCE_TIME rtTime) {
ICOM_THIS(IDirectMusicTool8Impl,iface);
FIXME("(%p, %p, %p, %lli): stub\n", This, pPerf, pPMSG, rtTime);
return S_OK;
}
/* IDirectMusicTool8 IDirectMusicTool8 part: */
HRESULT WINAPI IDirectMusicTool8Impl_Clone (LPDIRECTMUSICTOOL8 iface, IDirectMusicTool** ppTool)
{
/* IDirectMusicTool8Impl IDirectMusicTool8 part: */
HRESULT WINAPI IDirectMusicTool8Impl_Clone (LPDIRECTMUSICTOOL8 iface, IDirectMusicTool** ppTool) {
ICOM_THIS(IDirectMusicTool8Impl,iface);
FIXME("(%p, %p): stub\n", This, ppTool);
return S_OK;
}
ICOM_VTABLE(IDirectMusicTool8) DirectMusicTool8_Vtbl =
{
ICOM_VTABLE(IDirectMusicTool8) DirectMusicTool8_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicTool8Impl_QueryInterface,
IDirectMusicTool8Impl_AddRef,
@ -145,13 +110,16 @@ ICOM_VTABLE(IDirectMusicTool8) DirectMusicTool8_Vtbl =
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicTool (LPCGUID lpcGUID, LPDIRECTMUSICTOOL8 *ppDMTool, LPUNKNOWN pUnkOuter)
{
if (IsEqualIID (lpcGUID, &IID_IDirectMusicComposer)) {
FIXME("Not yet\n");
return E_NOINTERFACE;
}
WARN("No interface found\n");
HRESULT WINAPI DMUSIC_CreateDirectMusicobjImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) {
IDirectMusicTool8Impl* obj;
return E_NOINTERFACE;
obj = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicTool8Impl));
if (NULL == obj) {
*ppobj = (LPVOID) NULL;
return E_OUTOFMEMORY;
}
obj->lpVtbl = &DirectMusicTool8_Vtbl;
obj->ref = 0; /* will be inited by QueryInterface */
return IDirectMusicTool8Impl_QueryInterface ((LPDIRECTMUSICTOOL8)obj, lpcGUID, ppobj);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 Rok Mandeljc <rok.mandeljc@gimb.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -18,10 +18,10 @@
#define WINE_FILEDESCRIPTION_STR "Wine DirectMusic Interactive Engine"
#define WINE_FILENAME_STR "dmime.dll"
#define WINE_FILEVERSION 4,8,1,881
#define WINE_FILEVERSION_STR "4.8.1.881"
#define WINE_PRODUCTVERSION 4,8,1,881
#define WINE_PRODUCTVERSION_STR "4.8"
#define WINE_FILEVERSION 4,9,0,900
#define WINE_FILEVERSION_STR "4.9.0.900"
#define WINE_PRODUCTVERSION 4,9,0,900
#define WINE_PRODUCTVERSION_STR "4.9"
#define WINE_PRODUCTNAME_STR "DirectX"
#include "wine/wine_common_ver.rc"

View File

@ -1,6 +1,6 @@
/* IDirectMusicWaveTrack Implementation
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -17,14 +17,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "dmime_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmime);
@ -34,19 +26,21 @@ WINE_DECLARE_DEBUG_CHANNEL(dmfile);
* IDirectMusicWaveTrack implementation
*/
/* IDirectMusicWaveTrack IUnknown part: */
HRESULT WINAPI IDirectMusicWaveTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicWaveTrack,iface);
HRESULT WINAPI IDirectMusicWaveTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicWaveTrack, UnknownVtbl, iface);
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IDirectMusicTrack) ||
IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
IDirectMusicWaveTrack_AddRef(iface);
*ppobj = This;
if (IsEqualIID (riid, &IID_IUnknown)) {
*ppobj = (LPUNKNOWN)&This->UnknownVtbl;
IDirectMusicWaveTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicTrack)
|| IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
*ppobj = (LPDIRECTMUSICTRACK8)&This->TrackVtbl;
IDirectMusicWaveTrack_IDirectMusicTrack_AddRef ((LPDIRECTMUSICTRACK8)&This->TrackVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicWaveTrackStream_AddRef ((LPPERSISTSTREAM)This->pStream);
*ppobj = This->pStream;
*ppobj = (LPPERSISTSTREAM)&This->PersistStreamVtbl;
IDirectMusicWaveTrack_IPersistStream_AddRef ((LPPERSISTSTREAM)&This->PersistStreamVtbl);
return S_OK;
}
@ -54,16 +48,14 @@ HRESULT WINAPI IDirectMusicWaveTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface,
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicWaveTrack_AddRef (LPDIRECTMUSICTRACK8 iface)
{
ICOM_THIS(IDirectMusicWaveTrack,iface);
ULONG WINAPI IDirectMusicWaveTrack_IUnknown_AddRef (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicWaveTrack, UnknownVtbl, iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicWaveTrack_Release (LPDIRECTMUSICTRACK8 iface)
{
ICOM_THIS(IDirectMusicWaveTrack,iface);
ULONG WINAPI IDirectMusicWaveTrack_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicWaveTrack, UnknownVtbl, iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
@ -72,64 +64,71 @@ ULONG WINAPI IDirectMusicWaveTrack_Release (LPDIRECTMUSICTRACK8 iface)
return ref;
}
/* IDirectMusicWaveTrack IDirectMusicTrack part: */
HRESULT WINAPI IDirectMusicWaveTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment)
{
ICOM_THIS(IDirectMusicWaveTrack,iface);
ICOM_VTABLE(IUnknown) DirectMusicWaveTrack_Unknown_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicWaveTrack_IUnknown_QueryInterface,
IDirectMusicWaveTrack_IUnknown_AddRef,
IDirectMusicWaveTrack_IUnknown_Release
};
/* IDirectMusicWaveTrack IDirectMusicTrack8 part: */
HRESULT WINAPI IDirectMusicWaveTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicWaveTrack, TrackVtbl, iface);
return IDirectMusicWaveTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicWaveTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface) {
ICOM_THIS_MULTI(IDirectMusicWaveTrack, TrackVtbl, iface);
return IDirectMusicWaveTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicWaveTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface) {
ICOM_THIS_MULTI(IDirectMusicWaveTrack, TrackVtbl, iface);
return IDirectMusicWaveTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicWaveTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment)
{
ICOM_THIS_MULTI(IDirectMusicWaveTrack, TrackVtbl, iface);
FIXME("(%p, %p): stub\n", This, pSegment);
return S_OK;
}
HRESULT WINAPI IDirectMusicWaveTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags)
HRESULT WINAPI IDirectMusicWaveTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicWaveTrack,iface);
ICOM_THIS_MULTI(IDirectMusicWaveTrack, TrackVtbl, iface);
FIXME("(%p, %p, %p, %p, %ld, %ld): stub\n", This, pSegmentState, pPerformance, ppStateData, dwVirtualTrack8ID, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicWaveTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData)
HRESULT WINAPI IDirectMusicWaveTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData)
{
ICOM_THIS(IDirectMusicWaveTrack,iface);
ICOM_THIS_MULTI(IDirectMusicWaveTrack, TrackVtbl, iface);
FIXME("(%p, %p): stub\n", This, pStateData);
return S_OK;
}
HRESULT WINAPI IDirectMusicWaveTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
HRESULT WINAPI IDirectMusicWaveTrack_IDirectMusicTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
{
ICOM_THIS(IDirectMusicWaveTrack,iface);
ICOM_THIS_MULTI(IDirectMusicWaveTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %ld, %ld, %ld, %p, %p, %ld): stub\n", This, pStateData, mtStart, mtEnd, mtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
return S_OK;
}
HRESULT WINAPI IDirectMusicWaveTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam)
{
ICOM_THIS(IDirectMusicWaveTrack,iface);
HRESULT WINAPI IDirectMusicWaveTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam) {
ICOM_THIS_MULTI(IDirectMusicWaveTrack, TrackVtbl, iface);
FIXME("(%p, %s, %ld, %p, %p): stub\n", This, debugstr_guid(rguidType), mtTime, pmtNext, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicWaveTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam)
{
ICOM_THIS(IDirectMusicWaveTrack,iface);
HRESULT WINAPI IDirectMusicWaveTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam) {
ICOM_THIS_MULTI(IDirectMusicWaveTrack, TrackVtbl, iface);
FIXME("(%p, %s, %ld, %p): stub\n", This, debugstr_guid(rguidType), mtTime, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicWaveTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType)
{
ICOM_THIS(IDirectMusicWaveTrack,iface);
HRESULT WINAPI IDirectMusicWaveTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType) {
ICOM_THIS_MULTI(IDirectMusicWaveTrack, TrackVtbl, iface);
TRACE("(%p, %s): ", This, debugstr_guid(rguidType));
if (IsEqualGUID (rguidType, &GUID_Disable_Auto_Download)
@ -138,208 +137,147 @@ HRESULT WINAPI IDirectMusicWaveTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface
|| IsEqualGUID (rguidType, &GUID_Enable_Auto_Download)) {
TRACE("param supported\n");
return S_OK;
}
}
TRACE("param unsupported\n");
return DMUS_E_TYPE_UNSUPPORTED;
}
HRESULT WINAPI IDirectMusicWaveTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType)
{
ICOM_THIS(IDirectMusicWaveTrack,iface);
HRESULT WINAPI IDirectMusicWaveTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
ICOM_THIS_MULTI(IDirectMusicWaveTrack, TrackVtbl, iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
return S_OK;
}
HRESULT WINAPI IDirectMusicWaveTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType)
{
ICOM_THIS(IDirectMusicWaveTrack,iface);
HRESULT WINAPI IDirectMusicWaveTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
ICOM_THIS_MULTI(IDirectMusicWaveTrack, TrackVtbl, iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
return S_OK;
}
HRESULT WINAPI IDirectMusicWaveTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack)
{
ICOM_THIS(IDirectMusicWaveTrack,iface);
HRESULT WINAPI IDirectMusicWaveTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack) {
ICOM_THIS_MULTI(IDirectMusicWaveTrack, TrackVtbl, iface);
FIXME("(%p, %ld, %ld, %p): stub\n", This, mtStart, mtEnd, ppTrack);
return S_OK;
}
/* IDirectMusicWaveTrack IDirectMusicTrack8 part: */
HRESULT WINAPI IDirectMusicWaveTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
{
ICOM_THIS(IDirectMusicWaveTrack,iface);
HRESULT WINAPI IDirectMusicWaveTrack_IDirectMusicTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID) {
ICOM_THIS_MULTI(IDirectMusicWaveTrack, TrackVtbl, iface);
FIXME("(%p, %p, %lli, %lli, %lli, %ld, %p, %p, %ld): stub\n", This, pStateData, rtStart, rtEnd, rtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
return S_OK;
}
HRESULT WINAPI IDirectMusicWaveTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicWaveTrack,iface);
HRESULT WINAPI IDirectMusicWaveTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicWaveTrack, TrackVtbl, iface);
FIXME("(%p, %s, %lli, %p, %p, %p, %ld): stub\n", This, debugstr_guid(rguidType), rtTime, prtNext, pParam, pStateData, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicWaveTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicWaveTrack,iface);
HRESULT WINAPI IDirectMusicWaveTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicWaveTrack, TrackVtbl, iface);
FIXME("(%p, %s, %lli, %p, %p, %ld): stub\n", This, debugstr_guid(rguidType), rtTime, pParam, pStateData, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicWaveTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack)
{
ICOM_THIS(IDirectMusicWaveTrack,iface);
HRESULT WINAPI IDirectMusicWaveTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
ICOM_THIS_MULTI(IDirectMusicWaveTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %p): stub\n", This, pContext, dwTrackGroup, ppResultTrack);
return S_OK;
}
HRESULT WINAPI IDirectMusicWaveTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack)
{
ICOM_THIS(IDirectMusicWaveTrack,iface);
HRESULT WINAPI IDirectMusicWaveTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
ICOM_THIS_MULTI(IDirectMusicWaveTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %p, %ld, %p): stub\n", This, pNewTrack, mtJoin, pContext, dwTrackGroup, ppResultTrack);
return S_OK;
}
ICOM_VTABLE(IDirectMusicTrack8) DirectMusicWaveTrack_Vtbl =
{
ICOM_VTABLE(IDirectMusicTrack8) DirectMusicWaveTrack_Track_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicWaveTrack_QueryInterface,
IDirectMusicWaveTrack_AddRef,
IDirectMusicWaveTrack_Release,
IDirectMusicWaveTrack_Init,
IDirectMusicWaveTrack_InitPlay,
IDirectMusicWaveTrack_EndPlay,
IDirectMusicWaveTrack_Play,
IDirectMusicWaveTrack_GetParam,
IDirectMusicWaveTrack_SetParam,
IDirectMusicWaveTrack_IsParamSupported,
IDirectMusicWaveTrack_AddNotificationType,
IDirectMusicWaveTrack_RemoveNotificationType,
IDirectMusicWaveTrack_Clone,
IDirectMusicWaveTrack_PlayEx,
IDirectMusicWaveTrack_GetParamEx,
IDirectMusicWaveTrack_SetParamEx,
IDirectMusicWaveTrack_Compose,
IDirectMusicWaveTrack_Join
IDirectMusicWaveTrack_IDirectMusicTrack_QueryInterface,
IDirectMusicWaveTrack_IDirectMusicTrack_AddRef,
IDirectMusicWaveTrack_IDirectMusicTrack_Release,
IDirectMusicWaveTrack_IDirectMusicTrack_Init,
IDirectMusicWaveTrack_IDirectMusicTrack_InitPlay,
IDirectMusicWaveTrack_IDirectMusicTrack_EndPlay,
IDirectMusicWaveTrack_IDirectMusicTrack_Play,
IDirectMusicWaveTrack_IDirectMusicTrack_GetParam,
IDirectMusicWaveTrack_IDirectMusicTrack_SetParam,
IDirectMusicWaveTrack_IDirectMusicTrack_IsParamSupported,
IDirectMusicWaveTrack_IDirectMusicTrack_AddNotificationType,
IDirectMusicWaveTrack_IDirectMusicTrack_RemoveNotificationType,
IDirectMusicWaveTrack_IDirectMusicTrack_Clone,
IDirectMusicWaveTrack_IDirectMusicTrack_PlayEx,
IDirectMusicWaveTrack_IDirectMusicTrack_GetParamEx,
IDirectMusicWaveTrack_IDirectMusicTrack_SetParamEx,
IDirectMusicWaveTrack_IDirectMusicTrack_Compose,
IDirectMusicWaveTrack_IDirectMusicTrack_Join
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicWaveTrack (LPCGUID lpcGUID, LPDIRECTMUSICTRACK8 *ppTrack, LPUNKNOWN pUnkOuter)
{
IDirectMusicWaveTrack* track;
if (IsEqualIID (lpcGUID, &IID_IDirectMusicTrack)
|| IsEqualIID (lpcGUID, &IID_IDirectMusicTrack8)) {
track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicWaveTrack));
if (NULL == track) {
*ppTrack = (LPDIRECTMUSICTRACK8) NULL;
return E_OUTOFMEMORY;
}
track->lpVtbl = &DirectMusicWaveTrack_Vtbl;
track->ref = 1;
track->pStream = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(IDirectMusicWaveTrackStream));
track->pStream->lpVtbl = &DirectMusicWaveTrackStream_Vtbl;
track->pStream->ref = 1;
track->pStream->pParentTrack = track;
*ppTrack = (LPDIRECTMUSICTRACK8) track;
return S_OK;
}
WARN("No interface found\n");
return E_NOINTERFACE;
/* IDirectMusicWaveTrack IPersistStream part: */
HRESULT WINAPI IDirectMusicWaveTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicWaveTrack, PersistStreamVtbl, iface);
return IDirectMusicWaveTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
/*****************************************************************************
* IDirectMusicWaveTrackStream implementation
*/
/* IDirectMusicWaveTrackStream IUnknown part follow: */
HRESULT WINAPI IDirectMusicWaveTrackStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicWaveTrackStream,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicWaveTrackStream_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
ULONG WINAPI IDirectMusicWaveTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicWaveTrack, PersistStreamVtbl, iface);
return IDirectMusicWaveTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicWaveTrackStream_AddRef (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicWaveTrackStream,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
ULONG WINAPI IDirectMusicWaveTrack_IPersistStream_Release (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicWaveTrack, PersistStreamVtbl, iface);
return IDirectMusicWaveTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicWaveTrackStream_Release (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicWaveTrackStream,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicWaveTrackStream IPersist part: */
HRESULT WINAPI IDirectMusicWaveTrackStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID)
{
HRESULT WINAPI IDirectMusicWaveTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) {
return E_NOTIMPL;
}
/* IDirectMusicWaveTrackStream IPersistStream part: */
HRESULT WINAPI IDirectMusicWaveTrackStream_IsDirty (LPPERSISTSTREAM iface)
{
HRESULT WINAPI IDirectMusicWaveTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicWaveTrackStream_Load (LPPERSISTSTREAM iface, IStream* pStm)
{
HRESULT WINAPI IDirectMusicWaveTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm) {
FIXME(": Loading not implemented yet\n");
return S_OK;
}
HRESULT WINAPI IDirectMusicWaveTrackStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty)
{
HRESULT WINAPI IDirectMusicWaveTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicWaveTrackStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize)
{
HRESULT WINAPI IDirectMusicWaveTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) {
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicWaveTrackStream_Vtbl =
{
ICOM_VTABLE(IPersistStream) DirectMusicWaveTrack_PersistStream_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicWaveTrackStream_QueryInterface,
IDirectMusicWaveTrackStream_AddRef,
IDirectMusicWaveTrackStream_Release,
IDirectMusicWaveTrackStream_GetClassID,
IDirectMusicWaveTrackStream_IsDirty,
IDirectMusicWaveTrackStream_Load,
IDirectMusicWaveTrackStream_Save,
IDirectMusicWaveTrackStream_GetSizeMax
IDirectMusicWaveTrack_IPersistStream_QueryInterface,
IDirectMusicWaveTrack_IPersistStream_AddRef,
IDirectMusicWaveTrack_IPersistStream_Release,
IDirectMusicWaveTrack_IPersistStream_GetClassID,
IDirectMusicWaveTrack_IPersistStream_IsDirty,
IDirectMusicWaveTrack_IPersistStream_Load,
IDirectMusicWaveTrack_IPersistStream_Save,
IDirectMusicWaveTrack_IPersistStream_GetSizeMax
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicWaveTrack (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) {
IDirectMusicWaveTrack* track;
track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicWaveTrack));
if (NULL == track) {
*ppobj = (LPVOID) NULL;
return E_OUTOFMEMORY;
}
track->UnknownVtbl = &DirectMusicWaveTrack_Unknown_Vtbl;
track->TrackVtbl = &DirectMusicWaveTrack_Track_Vtbl;
track->PersistStreamVtbl = &DirectMusicWaveTrack_PersistStream_Vtbl;
track->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC));
DM_STRUCT_INIT(track->pDesc);
track->pDesc->dwValidData |= DMUS_OBJ_CLASS;
memcpy (&track->pDesc->guidClass, &CLSID_DirectMusicWaveTrack, sizeof (CLSID));
track->ref = 0; /* will be inited by QueryInterface */
return IDirectMusicWaveTrack_IUnknown_QueryInterface ((LPUNKNOWN)&track->UnknownVtbl, lpcGUID, ppobj);
}

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
/* DirectMusicLoader Main
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -21,8 +21,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(dmloader);
typedef struct
{
typedef struct {
/* IUnknown fields */
ICOM_VFIELD(IClassFactory);
DWORD ref;
@ -31,43 +30,30 @@ typedef struct
/******************************************************************
* DirectMusicLoader ClassFactory
*/
static HRESULT WINAPI LoaderCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI LoaderCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI LoaderCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI LoaderCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI LoaderCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI LoaderCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI LoaderCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI LoaderCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualIID (&IID_IDirectMusicLoader, riid) ||
IsEqualIID (&IID_IDirectMusicLoader8, riid)) {
return DMUSIC_CreateDirectMusicLoader(riid, (LPDIRECTMUSICLOADER8*) ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
return DMUSIC_CreateDirectMusicLoaderImpl (riid, (LPVOID*) ppobj, pOuter);
}
static HRESULT WINAPI LoaderCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI LoaderCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -87,44 +73,30 @@ static IClassFactoryImpl Loader_CF = {&LoaderCF_Vtbl, 1 };
/******************************************************************
* DirectMusicContainer ClassFactory
*/
static HRESULT WINAPI ContainerCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI ContainerCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI ContainerCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI ContainerCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI ContainerCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI ContainerCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI ContainerCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI ContainerCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualIID (riid, &IID_IDirectMusicContainer)) {
return DMUSIC_CreateDirectMusicContainer (riid, (LPDIRECTMUSICCONTAINER*) ppobj, pOuter);
} else if (IsEqualIID (riid, &IID_IDirectMusicObject)) {
return DMUSIC_CreateDirectMusicContainerObject (riid, (LPDIRECTMUSICOBJECT*) ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
return DMUSIC_CreateDirectMusicContainerImpl (riid, (LPVOID*) ppobj, pOuter);
}
static HRESULT WINAPI ContainerCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI ContainerCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -146,18 +118,14 @@ static IClassFactoryImpl Container_CF = {&ContainerCF_Vtbl, 1 };
*
*
*/
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
if (fdwReason == DLL_PROCESS_ATTACH)
{
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
if (fdwReason == DLL_PROCESS_ATTACH) {
DisableThreadLibraryCalls(hinstDLL);
/* FIXME: Initialisation */
}
else if (fdwReason == DLL_PROCESS_DETACH)
{
else if (fdwReason == DLL_PROCESS_DETACH) {
/* FIXME: Cleanup */
}
return TRUE;
}
@ -167,10 +135,8 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
*
*
*/
HRESULT WINAPI DMLOADER_DllCanUnloadNow(void)
{
HRESULT WINAPI DMLOADER_DllCanUnloadNow(void) {
FIXME("(void): stub\n");
return S_FALSE;
}
@ -180,8 +146,7 @@ HRESULT WINAPI DMLOADER_DllCanUnloadNow(void)
*
*
*/
HRESULT WINAPI DMLOADER_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
{
HRESULT WINAPI DMLOADER_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) {
TRACE("(%p,%p,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
if (IsEqualCLSID (rclsid, &CLSID_DirectMusicLoader) && IsEqualIID (riid, &IID_IClassFactory)) {
*ppv = (LPVOID) &Loader_CF;

View File

@ -1,6 +1,6 @@
/* DirectMusicLoader Private Include
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -23,30 +23,42 @@
#include <stdarg.h>
#include "windef.h"
#include "wine/debug.h"
#include "winbase.h"
#include "winnt.h"
#include "wingdi.h"
#include "dmusicc.h"
#include "dmusici.h"
#include "dmusics.h"
#include "dmplugin.h"
#include "dmusicf.h"
#include "dsound.h"
#include "wine/list.h"
#include "winuser.h"
#include "wine/debug.h"
#include "wine/list.h"
#include "wine/unicode.h"
#include "winreg.h"
#include "dmusici.h"
#include "dmusicf.h"
#include "dmusics.h"
/*****************************************************************************
* Auxiliary definitions
*/
/* cache entry */
typedef struct _DMUS_PRIVATE_CACHE_ENTRY {
struct list entry; /* for listing elements */
GUID guidObject;
WCHAR wzFileName[MAX_PATH];
WCHAR wzName[256];
IDirectMusicObject* pObject;
BOOL bIsFaultyDLS; /* my workaround for enabling caching of "faulty" dls collections */
LPDIRECTMUSICOBJECT pObject; /* pointer to object */
} DMUS_PRIVATE_CACHE_ENTRY, *LPDMUS_PRIVATE_CACHE_ENTRY;
/* alias entry */
typedef struct _DMUS_PRIVATE_ALIAS_ENTRY {
struct list entry; /* for listing elements */
LPDMUS_OBJECTDESC pDesc; /* descriptor, containing info */
} DMUS_PRIVATE_ALIAS_ENTRY, *LPDMUS_PRIVATE_ALIAS_ENTRY;
/* contained object entry */
typedef struct _DMUS_PRIVATE_CONTAINED_OBJECT_ENTRY {
struct list entry; /* for listing elements */
WCHAR* wszAlias;
LPDMUS_OBJECTDESC pDesc;
} DMUS_PRIVATE_CONTAINED_OBJECT_ENTRY, *LPDMUS_PRIVATE_CONTAINED_OBJECT_ENTRY;
/*****************************************************************************
* Interfaces
@ -54,19 +66,17 @@ typedef struct _DMUS_PRIVATE_CACHE_ENTRY {
typedef struct IDirectMusicLoader8Impl IDirectMusicLoader8Impl;
typedef struct IDirectMusicContainerImpl IDirectMusicContainerImpl;
typedef struct IDirectMusicContainerObject IDirectMusicContainerObject;
typedef struct IDirectMusicContainerObjectStream IDirectMusicContainerObjectStream;
typedef struct ILoaderStream ILoaderStream;
/*****************************************************************************
* Predeclare the interface implementation structures
*/
extern ICOM_VTABLE(IDirectMusicLoader8) DirectMusicLoader8_Vtbl;
extern ICOM_VTABLE(IDirectMusicContainer) DirectMusicContainer_Vtbl;
extern ICOM_VTABLE(IDirectMusicObject) DirectMusicContainerObject_Vtbl;
extern ICOM_VTABLE(IPersistStream) DirectMusicContainerObjectStream_Vtbl;
extern ICOM_VTABLE(IUnknown) DirectMusicContainer_Unknown_Vtbl;
extern ICOM_VTABLE(IDirectMusicContainer) DirectMusicContainer_Container_Vtbl;
extern ICOM_VTABLE(IDirectMusicObject) DirectMusicContainer_Object_Vtbl;
extern ICOM_VTABLE(IPersistStream) DirectMusicContainer_PersistStream_Vtbl;
extern ICOM_VTABLE(IUnknown) LoaderStream_Unknown_Vtbl;
extern ICOM_VTABLE(IStream) LoaderStream_Stream_Vtbl;
@ -75,24 +85,15 @@ extern ICOM_VTABLE(IDirectMusicGetLoader) LoaderStream_GetLoader_Vtbl;
/*****************************************************************************
* ClassFactory
*/
/* can support IID_IDirectMusicLoader and IID_IDirectMusicLoader8
* return always an IDirectMusicLoader8Impl
*/
extern HRESULT WINAPI DMUSIC_CreateDirectMusicLoader (LPCGUID lpcGUID, LPDIRECTMUSICLOADER8 *ppDMLoad, LPUNKNOWN pUnkOuter);
/* can support IID_IDirectMusicContainer
* return always an IDirectMusicContainerImpl
*/
extern HRESULT WINAPI DMUSIC_CreateDirectMusicContainer (LPCGUID lpcGUID, LPDIRECTMUSICCONTAINER *ppDMCon, LPUNKNOWN pUnkOuter);
extern HRESULT WINAPI DMUSIC_CreateDirectMusicLoaderImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter);
extern HRESULT WINAPI DMUSIC_CreateDirectMusicContainerImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter);
extern HRESULT WINAPI DMUSIC_CreateDirectMusicContainerObject (LPCGUID lpcGUID, LPDIRECTMUSICOBJECT* ppObject, LPUNKNOWN pUnkOuter);
extern HRESULT WINAPI DMUSIC_CreateLoaderStream (LPSTREAM *ppStream);
extern HRESULT WINAPI DMUSIC_CreateLoaderStream (LPVOID *ppobj);
/*****************************************************************************
* IDirectMusicLoader8Impl implementation structure
*/
struct IDirectMusicLoader8Impl
{
struct IDirectMusicLoader8Impl {
/* IUnknown fields */
ICOM_VFIELD(IDirectMusicLoader8);
DWORD ref;
@ -102,6 +103,7 @@ struct IDirectMusicLoader8Impl
/* simple cache (linked list) */
struct list CacheList;
struct list AliasList;
};
/* IUnknown: */
@ -126,80 +128,56 @@ extern HRESULT WINAPI IDirectMusicLoader8Impl_LoadObjectFromFile (LPDIRECTMUSICL
/*****************************************************************************
* IDirectMusicContainerImpl implementation structure
*/
struct IDirectMusicContainerImpl
{
struct IDirectMusicContainerImpl {
/* IUnknown fields */
ICOM_VFIELD(IDirectMusicContainer);
ICOM_VTABLE(IUnknown) *UnknownVtbl;
ICOM_VTABLE(IDirectMusicContainer) *ContainerVtbl;
ICOM_VTABLE(IDirectMusicObject) *ObjectVtbl;
ICOM_VTABLE(IPersistStream) *PersistStreamVtbl;
DWORD ref;
/* IDirectMusicContainerImpl fields */
IDirectMusicContainerObject* pObject;
};
/* IUnknown: */
extern HRESULT WINAPI IDirectMusicContainerImpl_QueryInterface (LPDIRECTMUSICCONTAINER iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicContainerImpl_AddRef (LPDIRECTMUSICCONTAINER iface);
extern ULONG WINAPI IDirectMusicContainerImpl_Release (LPDIRECTMUSICCONTAINER iface);
/* IDirectMusicContainer: */
extern HRESULT WINAPI IDirectMusicContainerImpl_EnumObject (LPDIRECTMUSICCONTAINER iface, REFGUID rguidClass, DWORD dwIndex, LPDMUS_OBJECTDESC pDesc, WCHAR* pwszAlias);
/*****************************************************************************
* IDirectMusicContainerObject implementation structure
*/
struct IDirectMusicContainerObject
{
/* IUnknown fields */
ICOM_VFIELD(IDirectMusicObject);
DWORD ref;
/* IDirectMusicObjectImpl fields */
LPDMUS_OBJECTDESC pDesc;
IDirectMusicContainerObjectStream* pStream;
IDirectMusicContainerImpl* pContainer;
DMUS_IO_CONTAINER_HEADER* pHeader;
/* list of objects */
struct list ObjectsList;
};
/* IUnknown: */
extern HRESULT WINAPI IDirectMusicContainerObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicContainerObject_AddRef (LPDIRECTMUSICOBJECT iface);
extern ULONG WINAPI IDirectMusicContainerObject_Release (LPDIRECTMUSICOBJECT iface);
extern HRESULT WINAPI IDirectMusicContainerImpl_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicContainerImpl_IUnknown_AddRef (LPUNKNOWN iface);
extern ULONG WINAPI IDirectMusicContainerImpl_IUnknown_Release (LPUNKNOWN iface);
/* IDirectMusicContainer: */
extern HRESULT WINAPI IDirectMusicContainerImpl_IDirectMusicContainer_QueryInterface (LPDIRECTMUSICCONTAINER iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicContainerImpl_IDirectMusicContainer_AddRef (LPDIRECTMUSICCONTAINER iface);
extern ULONG WINAPI IDirectMusicContainerImpl_IDirectMusicContainer_Release (LPDIRECTMUSICCONTAINER iface);
extern HRESULT WINAPI IDirectMusicContainerImpl_IDirectMusicContainer_EnumObject (LPDIRECTMUSICCONTAINER iface, REFGUID rguidClass, DWORD dwIndex, LPDMUS_OBJECTDESC pDesc, WCHAR* pwszAlias);
/* IDirectMusicObject: */
extern HRESULT WINAPI IDirectMusicContainerObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc);
extern HRESULT WINAPI IDirectMusicContainerObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc);
extern HRESULT WINAPI IDirectMusicContainerObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc);
extern HRESULT WINAPI IDirectMusicContainerImpl_IDirectMusicObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicContainerImpl_IDirectMusicObject_AddRef (LPDIRECTMUSICOBJECT iface);
extern ULONG WINAPI IDirectMusicContainerImpl_IDirectMusicObject_Release (LPDIRECTMUSICOBJECT iface);
extern HRESULT WINAPI IDirectMusicContainerImpl_IDirectMusicObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc);
extern HRESULT WINAPI IDirectMusicContainerImpl_IDirectMusicObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc);
extern HRESULT WINAPI IDirectMusicContainerImpl_IDirectMusicObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc);
/*****************************************************************************
* IDirectMusicContainerObjectStream implementation structure
*/
struct IDirectMusicContainerObjectStream
{
/* IUnknown fields */
ICOM_VFIELD (IPersistStream);
DWORD ref;
/* IPersistStreamImpl fields */
IDirectMusicContainerObject* pParentObject;
};
/* IUnknown: */
extern HRESULT WINAPI IDirectMusicContainerObjectStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject);
extern ULONG WINAPI IDirectMusicContainerObjectStream_AddRef (LPPERSISTSTREAM iface);
extern ULONG WINAPI IDirectMusicContainerObjectStream_Release (LPPERSISTSTREAM iface);
/* IPersist: */
extern HRESULT WINAPI IDirectMusicContainerObjectStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID);
/* IPersistStream: */
extern HRESULT WINAPI IDirectMusicContainerObjectStream_IsDirty (LPPERSISTSTREAM iface);
extern HRESULT WINAPI IDirectMusicContainerObjectStream_Load (LPPERSISTSTREAM iface, IStream* pStm);
extern HRESULT WINAPI IDirectMusicContainerObjectStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty);
extern HRESULT WINAPI IDirectMusicContainerObjectStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize);
extern HRESULT WINAPI IDirectMusicContainerImpl_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject);
extern ULONG WINAPI IDirectMusicContainerImpl_IPersistStream_AddRef (LPPERSISTSTREAM iface);
extern ULONG WINAPI IDirectMusicContainerImpl_IPersistStream_Release (LPPERSISTSTREAM iface);
extern HRESULT WINAPI IDirectMusicContainerImpl_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID);
extern HRESULT WINAPI IDirectMusicContainerImpl_IPersistStream_IsDirty (LPPERSISTSTREAM iface);
extern HRESULT WINAPI IDirectMusicContainerImpl_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm);
extern HRESULT WINAPI IDirectMusicContainerImpl_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty);
extern HRESULT WINAPI IDirectMusicContainerImpl_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize);
/*****************************************************************************
* ILoaderStream implementation structure
*/
struct ILoaderStream
{
struct ILoaderStream {
/* IUnknown fields */
ICOM_VTABLE(IUnknown) *UnknownVtbl;
ICOM_VTABLE(IStream) *StreamVtbl;
ICOM_VTABLE(IDirectMusicGetLoader) *GetLoaderVtbl;
DWORD ref;
@ -211,17 +189,21 @@ struct ILoaderStream
};
/* Custom: */
extern HRESULT WINAPI ILoaderStream_Attach (ILoaderStream* iface, LPCWSTR wzFile, IDirectMusicLoader *pLoader);
extern void WINAPI ILoaderStream_Detach (ILoaderStream* iface);
extern HRESULT WINAPI ILoaderStream_Attach (LPSTREAM iface, LPCWSTR wzFile, IDirectMusicLoader *pLoader);
extern void WINAPI ILoaderStream_Detach (LPSTREAM iface);
/* IUnknown: */
extern HRESULT WINAPI ILoaderStream_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, void** ppobj);
extern ULONG WINAPI ILoaderStream_IUnknown_AddRef (LPUNKNOWN iface);
extern ULONG WINAPI ILoaderStream_IUnknown_Release (LPUNKNOWN iface);
/* IDirectMusicGetLoader: */
extern HRESULT WINAPI ILoaderStream_IDirectMusicGetLoader_QueryInterface (LPDIRECTMUSICGETLOADER iface, REFIID riid, void** ppobj);
extern ULONG WINAPI ILoaderStream_IDirectMusicGetLoader_AddRef (LPDIRECTMUSICGETLOADER iface);
extern ULONG WINAPI ILoaderStream_IDirectMusicGetLoader_Release (LPDIRECTMUSICGETLOADER iface);
extern ULONG WINAPI ILoaderStream_IDirectMusicGetLoader_AddRef (LPDIRECTMUSICGETLOADER iface);
extern ULONG WINAPI ILoaderStream_IDirectMusicGetLoader_Release (LPDIRECTMUSICGETLOADER iface);
extern HRESULT WINAPI ILoaderStream_IDirectMusicGetLoader_GetLoader (LPDIRECTMUSICGETLOADER iface, IDirectMusicLoader **ppLoader);
/* IStream: */
extern HRESULT WINAPI ILoaderStream_IStream_QueryInterface (LPSTREAM iface, REFIID riid, void** ppobj);
extern ULONG WINAPI ILoaderStream_IStream_AddRef (LPSTREAM iface);
extern ULONG WINAPI ILoaderStream_IStream_Release (LPSTREAM iface);extern HRESULT WINAPI ILoaderStream_IStream_Read (IStream* iface, void* pv, ULONG cb, ULONG* pcbRead);
extern ULONG WINAPI ILoaderStream_IStream_AddRef (LPSTREAM iface);
extern ULONG WINAPI ILoaderStream_IStream_Release (LPSTREAM iface);extern HRESULT WINAPI ILoaderStream_IStream_Read (IStream* iface, void* pv, ULONG cb, ULONG* pcbRead);
extern HRESULT WINAPI ILoaderStream_IStream_Write (LPSTREAM iface, const void* pv, ULONG cb, ULONG* pcbWritten);
extern HRESULT WINAPI ILoaderStream_IStream_Seek (LPSTREAM iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER* plibNewPosition);
extern HRESULT WINAPI ILoaderStream_IStream_SetSize (LPSTREAM iface, ULARGE_INTEGER libNewSize);
@ -233,4 +215,133 @@ extern HRESULT WINAPI ILoaderStream_IStream_UnlockRegion (LPSTREAM iface, ULARGE
extern HRESULT WINAPI ILoaderStream_IStream_Stat (LPSTREAM iface, STATSTG* pstatstg, DWORD grfStatFlag);
extern HRESULT WINAPI ILoaderStream_IStream_Clone (LPSTREAM iface, IStream** ppstm);
/*****************************************************************************
* Misc.
*/
/* for simpler reading */
typedef struct _DMUS_PRIVATE_CHUNK {
FOURCC fccID; /* FOURCC ID of the chunk */
DWORD dwSize; /* size of the chunk */
} DMUS_PRIVATE_CHUNK, *LPDMUS_PRIVATE_CHUNK;
/* check whether the given DWORD is even (return 0) or odd (return 1) */
static inline int even_or_odd (DWORD number) {
return (number & 0x1); /* basically, check if bit 0 is set ;) */
}
/* translate STREAM_SEEK flag to string */
static inline const char *resolve_STREAM_SEEK (DWORD flag) {
switch (flag) {
case STREAM_SEEK_SET:
return wine_dbg_sprintf ("STREAM_SEEK_SET");
case STREAM_SEEK_CUR:
return wine_dbg_sprintf ("STREAM_SEEK_CUR");
case STREAM_SEEK_END:
return wine_dbg_sprintf ("STREAM_SEEK_END");
default:
return wine_dbg_sprintf ("()");
}
}
/* FOURCC to string conversion for debug messages */
static inline const char *debugstr_fourcc (DWORD fourcc) {
if (!fourcc) return "'null'";
return wine_dbg_sprintf ("\'%c%c%c%c\'",
(char)(fourcc), (char)(fourcc >> 8),
(char)(fourcc >> 16), (char)(fourcc >> 24));
}
/* DMUS_VERSION struct to string conversion for debug messages */
static inline const char *debugstr_dmversion (LPDMUS_VERSION version) {
if (!version) return "'null'";
return wine_dbg_sprintf ("\'%i,%i,%i,%i\'",
(int)((version->dwVersionMS && 0xFFFF0000) >> 8), (int)(version->dwVersionMS && 0x0000FFFF),
(int)((version->dwVersionLS && 0xFFFF0000) >> 8), (int)(version->dwVersionLS && 0x0000FFFF));
}
/* used for initialising structs (primarily for DMUS_OBJECTDESC) */
#define DM_STRUCT_INIT(x) \
do { \
memset((x), 0, sizeof(*(x))); \
(x)->dwSize = sizeof(*x); \
} while (0)
/* used for generic dumping (copied from ddraw) */
typedef struct {
DWORD val;
const char* name;
} flag_info;
#define FE(x) { x, #x }
#define DMUSIC_dump_flags(flags,names,num_names) DMUSIC_dump_flags_(flags, names, num_names, 1)
/* generic dump function */
static inline void DMUSIC_dump_flags_ (DWORD flags, const flag_info* names, size_t num_names, int newline) {
unsigned int i;
for (i=0; i < num_names; i++) {
if ((flags & names[i].val) || /* standard flag value */
((!flags) && (!names[i].val))) /* zero value only */
DPRINTF("%s ", names[i].name);
}
if (newline) DPRINTF("\n");
}
static inline void DMUSIC_dump_DMUS_OBJ_FLAGS (DWORD flagmask) {
static const flag_info flags[] = {
FE(DMUS_OBJ_OBJECT),
FE(DMUS_OBJ_CLASS),
FE(DMUS_OBJ_NAME),
FE(DMUS_OBJ_CATEGORY),
FE(DMUS_OBJ_FILENAME),
FE(DMUS_OBJ_FULLPATH),
FE(DMUS_OBJ_URL),
FE(DMUS_OBJ_VERSION),
FE(DMUS_OBJ_DATE),
FE(DMUS_OBJ_LOADED),
FE(DMUS_OBJ_MEMORY),
FE(DMUS_OBJ_STREAM)
};
DMUSIC_dump_flags(flagmask, flags, sizeof(flags)/sizeof(flags[0]));
}
static inline void DMUSIC_dump_DMUS_CONTAINER_FLAGS (DWORD flagmask) {
static const flag_info flags[] = {
FE(DMUS_CONTAINER_NOLOADS)
};
DMUSIC_dump_flags(flagmask, flags, sizeof(flags)/sizeof(flags[0]));
}
static inline void DMUSIC_dump_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) {
if (pDesc) {
DPRINTF("DMUS_OBJECTDESC (%p)\n", pDesc);
DPRINTF(" - dwSize = %ld\n", pDesc->dwSize);
DPRINTF(" - dwValidData = ");
DMUSIC_dump_DMUS_OBJ_FLAGS (pDesc->dwValidData);
if (pDesc->dwValidData & DMUS_OBJ_CLASS) DPRINTF(" - guidClass = %s\n", debugstr_guid(&pDesc->guidClass));
if (pDesc->dwValidData & DMUS_OBJ_OBJECT) DPRINTF(" - guidObject = %s\n", debugstr_guid(&pDesc->guidObject));
if (pDesc->dwValidData & DMUS_OBJ_DATE) DPRINTF(" - ftDate = FIXME\n");
if (pDesc->dwValidData & DMUS_OBJ_VERSION) DPRINTF(" - vVersion = %s\n", debugstr_dmversion(&pDesc->vVersion));
if (pDesc->dwValidData & DMUS_OBJ_NAME) DPRINTF(" - wszName = %s\n", debugstr_w(pDesc->wszName));
if (pDesc->dwValidData & DMUS_OBJ_CATEGORY) DPRINTF(" - wszCategory = %s\n", debugstr_w(pDesc->wszCategory));
if (pDesc->dwValidData & DMUS_OBJ_FILENAME) DPRINTF(" - wszFileName = %s\n", debugstr_w(pDesc->wszFileName));
if (pDesc->dwValidData & DMUS_OBJ_MEMORY) DPRINTF(" - llMemLength = %lli\n - pbMemData = %p\n", pDesc->llMemLength, pDesc->pbMemData);
if (pDesc->dwValidData & DMUS_OBJ_STREAM) DPRINTF(" - pStream = %p\n", pDesc->pStream);
} else {
DPRINTF("(NULL)\n");
}
}
/* check whether chunkID is valid dmobject form chunk */
static inline BOOL IS_VALID_DMFORM(chunkID) {
if ((chunkID == DMUS_FOURCC_AUDIOPATH_FORM) || (chunkID == DMUS_FOURCC_BAND_FORM) || (chunkID == DMUS_FOURCC_CHORDMAP_FORM)
|| (chunkID == DMUS_FOURCC_CONTAINER_FORM) || (chunkID == FOURCC_DLS) || (chunkID == DMUS_FOURCC_SCRIPT_FORM)
|| (chunkID == DMUS_FOURCC_SEGMENT_FORM) || (chunkID == DMUS_FOURCC_STYLE_FORM) || (chunkID == DMUS_FOURCC_TOOLGRAPH_FORM)
|| (chunkID == DMUS_FOURCC_TRACK_FORM) || (chunkID == mmioFOURCC('W','A','V','E'))) return TRUE;
else return FALSE;
}
#endif /* __WINE_DMLOADER_PRIVATE_H */

View File

@ -1,6 +1,6 @@
/* IDirectMusicLoader8 Implementation
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -17,16 +17,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "winreg.h"
#include "dmloader_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmloader);
@ -34,8 +24,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(dmloader);
HRESULT WINAPI DMUSIC_GetDefaultGMPath (WCHAR wszPath[MAX_PATH]);
/* IDirectMusicLoader8 IUnknown part: */
HRESULT WINAPI IDirectMusicLoader8Impl_QueryInterface (LPDIRECTMUSICLOADER8 iface, REFIID riid, LPVOID *ppobj)
{
HRESULT WINAPI IDirectMusicLoader8Impl_QueryInterface (LPDIRECTMUSICLOADER8 iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IDirectMusicLoader8Impl,iface);
if (IsEqualIID (riid, &IID_IUnknown) ||
@ -50,15 +39,13 @@ HRESULT WINAPI IDirectMusicLoader8Impl_QueryInterface (LPDIRECTMUSICLOADER8 ifac
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicLoader8Impl_AddRef (LPDIRECTMUSICLOADER8 iface)
{
ULONG WINAPI IDirectMusicLoader8Impl_AddRef (LPDIRECTMUSICLOADER8 iface) {
ICOM_THIS(IDirectMusicLoader8Impl,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicLoader8Impl_Release (LPDIRECTMUSICLOADER8 iface)
{
ULONG WINAPI IDirectMusicLoader8Impl_Release (LPDIRECTMUSICLOADER8 iface) {
ICOM_THIS(IDirectMusicLoader8Impl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
@ -69,91 +56,163 @@ ULONG WINAPI IDirectMusicLoader8Impl_Release (LPDIRECTMUSICLOADER8 iface)
}
/* IDirectMusicLoader8 IDirectMusicLoader part: */
HRESULT WINAPI IDirectMusicLoader8Impl_GetObject (LPDIRECTMUSICLOADER8 iface, LPDMUS_OBJECTDESC pDesc, REFIID riid, LPVOID* ppv)
{
IDirectMusicObject* pObject;
HRESULT WINAPI IDirectMusicLoader8Impl_GetObject (LPDIRECTMUSICLOADER8 iface, LPDMUS_OBJECTDESC pDesc, REFIID riid, LPVOID* ppv) {
ICOM_THIS(IDirectMusicLoader8Impl,iface);
HRESULT result;
HRESULT result = 0;
struct list *listEntry;
LPDMUS_PRIVATE_ALIAS_ENTRY aliasEntry;
DMUS_PRIVATE_CACHE_ENTRY *cacheEntry;
DMUS_OBJECTDESC CacheDesc;
IDirectMusicObject* pObject;
LPDMUS_PRIVATE_CACHE_ENTRY newEntry;
TRACE("(%p, %p(dwValidData:0x%08lx), %s, %p)\n", This, pDesc, pDesc->dwValidData, debugstr_guid(riid), ppv);
TRACE("looking up cache...\n");
TRACE("(%p, %p, %s, %p): pDesc:\n", This, pDesc, debugstr_guid(riid), ppv);
if (TRACE_ON(dmloader))
DMUSIC_dump_DMUS_OBJECTDESC(pDesc);
/* if I understand correctly, SetObject makes sort of aliases for entries in cache;
therefore I created alias list, which is similiar to cache list, and is used as resolver
(it maps let's say GUID to filename) */
TRACE(": looking for alias\n");
LIST_FOR_EACH (listEntry, &This->AliasList) {
aliasEntry = LIST_ENTRY(listEntry, DMUS_PRIVATE_ALIAS_ENTRY, entry);
/* for the time being, we support only GUID/name mapping */
if ((aliasEntry->pDesc->dwValidData & DMUS_OBJ_OBJECT) && (pDesc->dwValidData & DMUS_OBJ_OBJECT)
&& IsEqualGUID (&aliasEntry->pDesc->guidObject, &pDesc->guidObject)) {
TRACE(": found alias by GUID (%s)... mapping:\n", debugstr_guid(&aliasEntry->pDesc->guidObject));
if ((aliasEntry->pDesc->dwValidData & DMUS_OBJ_FILENAME) && !(pDesc->dwValidData & DMUS_OBJ_FILENAME)) {
TRACE(": - to filename (%s)\n", debugstr_w(aliasEntry->pDesc->wszFileName));
pDesc->dwValidData |= DMUS_OBJ_FILENAME;
pDesc->dwValidData |= (aliasEntry->pDesc->dwValidData & DMUS_OBJ_FULLPATH);
strncpyW (pDesc->wszFileName, aliasEntry->pDesc->wszFileName, DMUS_MAX_FILENAME);
}
if ((aliasEntry->pDesc->dwValidData & DMUS_OBJ_NAME) && !(pDesc->dwValidData & DMUS_OBJ_NAME)) {
TRACE(": - to name (%s)\n", debugstr_w(aliasEntry->pDesc->wszName));
pDesc->dwValidData |= DMUS_OBJ_NAME;
strncpyW (pDesc->wszName, aliasEntry->pDesc->wszName, DMUS_MAX_NAME);
}
if ((aliasEntry->pDesc->dwValidData & DMUS_OBJ_MEMORY) && !(pDesc->dwValidData & DMUS_OBJ_MEMORY)) {
TRACE(": - to memory location\n");
pDesc->dwValidData |= DMUS_OBJ_MEMORY;
/* FIXME: is this correct? */
pDesc->pbMemData = aliasEntry->pDesc->pbMemData;
pDesc->llMemLength = aliasEntry->pDesc->llMemLength;
}
if ((aliasEntry->pDesc->dwValidData & DMUS_OBJ_STREAM) && !(pDesc->dwValidData & DMUS_OBJ_STREAM)) {
TRACE(": - to stream\n");
pDesc->dwValidData |= DMUS_OBJ_STREAM;
IStream_Clone (aliasEntry->pDesc->pStream, &pDesc->pStream);
}
}
else if ((aliasEntry->pDesc->dwValidData & DMUS_OBJ_NAME) && (pDesc->dwValidData & DMUS_OBJ_NAME)
&& !strncmpW (aliasEntry->pDesc->wszName, pDesc->wszName, DMUS_MAX_NAME)) {
TRACE(": found alias by name (%s)... mapping:\n", debugstr_w(aliasEntry->pDesc->wszName));
if ((aliasEntry->pDesc->dwValidData & DMUS_OBJ_FILENAME) && !(pDesc->dwValidData & DMUS_OBJ_FILENAME)) {
TRACE(": - to filename (%s)\n", debugstr_w(aliasEntry->pDesc->wszFileName));
pDesc->dwValidData |= DMUS_OBJ_FILENAME;
pDesc->dwValidData |= (aliasEntry->pDesc->dwValidData & DMUS_OBJ_FULLPATH);
strncpyW (pDesc->wszFileName, aliasEntry->pDesc->wszFileName, DMUS_MAX_FILENAME);
}
if ((aliasEntry->pDesc->dwValidData & DMUS_OBJ_OBJECT) && !(pDesc->dwValidData & DMUS_OBJ_OBJECT)) {
TRACE(": - to object GUID (%s)\n", debugstr_guid(&aliasEntry->pDesc->guidObject));
pDesc->dwValidData |= DMUS_OBJ_OBJECT;
memcpy (&pDesc->guidObject, &aliasEntry->pDesc->guidObject, sizeof(GUID));
}
if ((aliasEntry->pDesc->dwValidData & DMUS_OBJ_MEMORY) && !(pDesc->dwValidData & DMUS_OBJ_MEMORY)) {
TRACE(": - to memory location\n");
pDesc->dwValidData |= DMUS_OBJ_MEMORY;
/* FIXME: is this correct? */
pDesc->pbMemData = aliasEntry->pDesc->pbMemData;
pDesc->llMemLength = aliasEntry->pDesc->llMemLength;
}
if ((aliasEntry->pDesc->dwValidData & DMUS_OBJ_STREAM) && !(pDesc->dwValidData & DMUS_OBJ_STREAM)) {
TRACE(": - to stream\n");
pDesc->dwValidData |= DMUS_OBJ_STREAM;
IStream_Clone (aliasEntry->pDesc->pStream, &pDesc->pStream);
}
}
/*else FIXME(": implement other types of mapping\n"); */
}
/* iterate through cache and check whether object has already been loaded */
TRACE(": looking up cache...\n");
DM_STRUCT_INIT(&CacheDesc);
LIST_FOR_EACH (listEntry, &This->CacheList) {
cacheEntry = LIST_ENTRY( listEntry, DMUS_PRIVATE_CACHE_ENTRY, entry );
if ((pDesc->dwValidData & DMUS_OBJ_OBJECT) || (pDesc->dwValidData & DMUS_OBJ_FILENAME)) {
if (pDesc->dwValidData & DMUS_OBJ_OBJECT) {
if (IsEqualGUID (&cacheEntry->guidObject, &pDesc->guidObject)) {
TRACE(": found it by GUID\n");
if (cacheEntry->pObject)
return IDirectMusicObject_QueryInterface ((LPDIRECTMUSICOBJECT) cacheEntry->pObject, riid, ppv);
}
cacheEntry = LIST_ENTRY(listEntry, DMUS_PRIVATE_CACHE_ENTRY, entry);
/* first check whether cached object is "faulty" default dls collection;
* I don't think it's recongised by object descriptor, since it contains no
* data; it's not very elegant way, but it works :)
*/
if (cacheEntry->bIsFaultyDLS == TRUE) {
if ((pDesc->dwValidData & DMUS_OBJ_OBJECT) && IsEqualGUID (&GUID_DefaultGMCollection, &pDesc->guidObject)) {
TRACE(": found faulty default DLS collection... enabling M$ compliant behaviour\n");
return DMUS_E_LOADER_NOFILENAME;
}
if (pDesc->dwValidData & DMUS_OBJ_FILENAME) {
if (cacheEntry->wzFileName && !strncmpW (pDesc->wszFileName, cacheEntry->wzFileName, MAX_PATH)) {
TRACE(": found it by FileName\n");
if (cacheEntry->pObject)
return IDirectMusicObject_QueryInterface ((LPDIRECTMUSICOBJECT) cacheEntry->pObject, riid, ppv);
}
}
/* I think it shouldn't happen that pObject is NULL, but better be safe */
if (cacheEntry->pObject) {
DM_STRUCT_INIT(&CacheDesc); /* prepare desc for reuse */
IDirectMusicObject_GetDescriptor (cacheEntry->pObject, &CacheDesc);
/* according to MSDN, search order is:
1. DMUS_OBJ_OBJECT
2. DMUS_OBJ_MEMORY (FIXME)
3. DMUS_OBJ_FILENAME & DMUS_OBJ_FULLPATH
4. DMUS_OBJ_NAME & DMUS_OBJ_CATEGORY
5. DMUS_OBJ_NAME
6. DMUS_OBJ_FILENAME */
if ((pDesc->dwValidData & DMUS_OBJ_OBJECT) && (CacheDesc.dwValidData & DMUS_OBJ_OBJECT)
&& IsEqualGUID (&pDesc->guidObject, &CacheDesc.guidObject)) {
TRACE(": found it by object GUID\n");
return IDirectMusicObject_QueryInterface (cacheEntry->pObject, riid, ppv);
}
if ((pDesc->dwValidData & DMUS_OBJ_MEMORY) && (CacheDesc.dwValidData & DMUS_OBJ_MEMORY)) {
FIXME(": DMUS_OBJ_MEMORY not supported yet\n");
}
if ((pDesc->dwValidData & DMUS_OBJ_FILENAME) && (pDesc->dwValidData & DMUS_OBJ_FULLPATH)
&& (CacheDesc.dwValidData & DMUS_OBJ_FILENAME) && (CacheDesc.dwValidData & DMUS_OBJ_FULLPATH)
&& !strncmpW (pDesc->wszFileName, CacheDesc.wszFileName, DMUS_MAX_FILENAME)) {
TRACE(": found it by fullpath filename\n");
return IDirectMusicObject_QueryInterface (cacheEntry->pObject, riid, ppv);
}
if ((pDesc->dwValidData & DMUS_OBJ_NAME) && (pDesc->dwValidData & DMUS_OBJ_CATEGORY)
&& (CacheDesc.dwValidData & DMUS_OBJ_NAME) && (CacheDesc.dwValidData & DMUS_OBJ_CATEGORY)
&& !strncmpW (pDesc->wszName, CacheDesc.wszName, DMUS_MAX_NAME)
&& !strncmpW (pDesc->wszCategory, CacheDesc.wszCategory, DMUS_MAX_CATEGORY)) {
TRACE(": found it by name and category\n");
return IDirectMusicObject_QueryInterface (cacheEntry->pObject, riid, ppv);
}
if ((pDesc->dwValidData & DMUS_OBJ_NAME) && (CacheDesc.dwValidData & DMUS_OBJ_NAME)
&& !strncmpW (pDesc->wszName, CacheDesc.wszName, DMUS_MAX_NAME)) {
TRACE(": found it by name\n");
return IDirectMusicObject_QueryInterface (cacheEntry->pObject, riid, ppv);
}
if ((pDesc->dwValidData & DMUS_OBJ_FILENAME) && (CacheDesc.dwValidData & DMUS_OBJ_FILENAME)
&& !strncmpW (pDesc->wszFileName, CacheDesc.wszFileName, DMUS_MAX_FILENAME)) {
TRACE(": found it by filename\n");
return IDirectMusicObject_QueryInterface (cacheEntry->pObject, riid, ppv);
}
} else if (pDesc->dwValidData & DMUS_OBJ_NAME) {
/**
* Usually search by name (for example main procedure name for scripts) after containers loading
* TODO: container loading code
*/
TRACE(" comparing %s with cached %s (file:%s)\n", debugstr_w (pDesc->wszName), debugstr_w (cacheEntry->wzName), debugstr_w(cacheEntry->wzFileName));
if (cacheEntry->wzName && !strncmpW (pDesc->wszName, cacheEntry->wzName, 256)) {
TRACE(": found it by Name\n");
if (NULL != cacheEntry->pObject)
return IDirectMusicObject_QueryInterface ((LPDIRECTMUSICOBJECT) cacheEntry->pObject, riid, ppv);
}
}
}
/* object doesn't exist in cache... guess we'll have to load it */
TRACE(": object does not exist in cache\n");
if (pDesc->dwValidData & DMUS_OBJ_LOADED) {
ERR("Wanted a on-memory (cached) entry, but not found. Active Hack (waiting for Load code)\n");
/* ugly hack waiting for Load impl */
result = CoCreateInstance (&pDesc->guidClass, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicObject, (LPVOID*) &pObject);
if (SUCCEEDED(result)) {
/* add object to cache */
result = IDirectMusicObject_QueryInterface (pObject, riid, ppv);
if (SUCCEEDED(result)) {
newEntry = (LPDMUS_PRIVATE_CACHE_ENTRY) HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(DMUS_PRIVATE_CACHE_ENTRY));
if (pDesc->dwValidData & DMUS_OBJ_NAME)
strncpyW (newEntry->wzName, pDesc->wszName, 256);
newEntry->pObject = pObject;
list_add_tail (&This->CacheList, &newEntry->entry);
TRACE(": filled in cache entry\n");
} else {
IDirectMusicObject_Release(pObject);
}
}
return result;
/*
* Normal code
*ppv = NULL;
return E_FAIL;
*/
}
/* sometimes it happens that guidClass is missing */
if (!(pDesc->dwValidData & DMUS_OBJ_CLASS)) {
WARN("guidClass not valid but needed. What they want to do ?\n");
ERR(": guidClass not valid but needed\n");
*ppv = NULL;
return DMUS_E_LOADER_NOCLASSID;
}
result = CoCreateInstance (&pDesc->guidClass, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicObject, (LPVOID*) &pObject);
if (FAILED(result)) return result;
if (pDesc->dwValidData & DMUS_OBJ_FILENAME) {
/* load object from file */
/* generate filename; if it's full path, don't add search
directory path, otherwise do */
WCHAR wzFileName[MAX_PATH];
ILoaderStream* pStream;
IPersistStream* pPersistStream = NULL;
/* if it's full path, don't add search directory path, otherwise do */
DMUS_OBJECTDESC GotDesc;
LPSTREAM pStream;
IPersistStream* pPersistStream = NULL;
if (pDesc->dwValidData & DMUS_OBJ_FULLPATH) {
lstrcpyW(wzFileName, pDesc->wszFileName);
} else {
@ -164,61 +223,229 @@ HRESULT WINAPI IDirectMusicLoader8Impl_GetObject (LPDIRECTMUSICLOADER8 iface, LP
strcpyW(p, pDesc->wszFileName);
}
TRACE(": loading from file (%s)\n", debugstr_w(wzFileName));
result = DMUSIC_CreateLoaderStream ((LPSTREAM*) &pStream);
if (FAILED(result)) return result;
result = ILoaderStream_Attach (pStream, wzFileName, (LPDIRECTMUSICLOADER) iface);
if (FAILED(result)) return result;
result = IDirectMusicObject_QueryInterface (pObject, &IID_IPersistStream, (LPVOID*) &pPersistStream);
if (FAILED(result)) return result;
result = IPersistStream_Load (pPersistStream, (LPSTREAM) pStream);
if (FAILED(result)) return result;
ILoaderStream_IStream_Release ((LPSTREAM) pStream);
IPersistStream_Release (pPersistStream);
} else if (pDesc->dwValidData & DMUS_OBJ_STREAM) {
/* load object from stream */
IStream* pClonedStream = NULL;
/* create stream and associate it with dls collection file */
result = DMUSIC_CreateLoaderStream ((LPVOID*)&pStream);
if (FAILED(result)) {
ERR(": could not create loader stream\n");
return result;
}
result = ILoaderStream_Attach (pStream, wzFileName, (LPDIRECTMUSICLOADER)iface);
if (FAILED(result)) {
ERR(": could not attach stream to file\n");
return result;
}
/* create object */
result = CoCreateInstance (&pDesc->guidClass, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicObject, (LPVOID*)&pObject);
if (FAILED(result)) {
ERR(": could not create object\n");
return result;
}
/* acquire PersistStream interface */
result = IDirectMusicObject_QueryInterface (pObject, &IID_IPersistStream, (LPVOID*)&pPersistStream);
if (FAILED(result)) {
ERR("failed to Query\n");
return result;
}
/* load */
result = IPersistStream_Load (pPersistStream, pStream);
if (FAILED(result)) {
ERR(": failed to load object\n");
return result;
}
/* get descriptor */
DM_STRUCT_INIT(&GotDesc);
result = IDirectMusicObject_GetDescriptor (pObject, &GotDesc);
if (FAILED(result)) {
ERR(": failed to get descriptor\n");
return result;
}
/* now set the "missing" info (check comment at "Loading default DLS collection") */
GotDesc.dwValidData |= (DMUS_OBJ_FILENAME | DMUS_OBJ_LOADED); /* this time only these are missing */
strncpyW (GotDesc.wszFileName, pDesc->wszFileName, DMUS_MAX_FILENAME); /* set wszFileName, even if futile */
/* set descriptor */
IDirectMusicObject_SetDescriptor (pObject, &GotDesc);
/* release all loading related stuff */
IStream_Release (pStream);
IPersistStream_Release (pPersistStream);
}
else if (pDesc->dwValidData & DMUS_OBJ_STREAM) {
LPSTREAM pClonedStream = NULL;
IPersistStream* pPersistStream = NULL;
DMUS_OBJECTDESC GotDesc;
/* load object from stream */
TRACE(": loading from stream\n");
result = IDirectMusicObject_QueryInterface (pObject, &IID_IPersistStream, (LPVOID*) &pPersistStream);
if (FAILED(result)) return result;
result = IStream_Clone (pDesc->pStream, &pClonedStream);
if (FAILED(result)) return result;
result = IPersistStream_Load (pPersistStream, pClonedStream);
if (FAILED(result)) return result;
/* clone stream, given in pDesc */
result = IStream_Clone (pDesc->pStream, &pClonedStream);
if (FAILED(result)) {
ERR(": failed to clone stream\n");
return result;
}
/* create object */
result = CoCreateInstance (&pDesc->guidClass, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicObject, (LPVOID*)&pObject);
if (FAILED(result)) {
ERR(": could not create object\n");
return result;
}
/* acquire PersistStream interface */
result = IDirectMusicObject_QueryInterface (pObject, &IID_IPersistStream, (LPVOID*)&pPersistStream);
if (FAILED(result)) {
ERR(": could not acquire IPersistStream\n");
return result;
}
/* load */
result = IPersistStream_Load (pPersistStream, pClonedStream);
if (FAILED(result)) {
ERR(": failed to load object\n");
return result;
}
/* get descriptor */
DM_STRUCT_INIT(&GotDesc);
result = IDirectMusicObject_GetDescriptor (pObject, &GotDesc);
if (FAILED(result)) {
ERR(": failed to get descriptor\n");
return result;
}
/* now set the "missing" info */
GotDesc.dwValidData |= DMUS_OBJ_LOADED; /* only missing data with streams */
/* set descriptor */
IDirectMusicObject_SetDescriptor (pObject, &GotDesc);
/* release all loading-related stuff */
IPersistStream_Release (pPersistStream);
IStream_Release (pClonedStream);
} else if (pDesc->dwValidData & DMUS_OBJ_OBJECT) {
}
else if (pDesc->dwValidData & DMUS_OBJ_OBJECT) {
/* load object by GUID */
TRACE(": loading by GUID (only default DLS supported)\n");
if (IsEqualGUID (&pDesc->guidObject, &GUID_DefaultGMCollection)) {
WCHAR wzFileName[MAX_PATH];
/* Loading default DLS collection: *dirty* secret (TM)
* By mixing native and builtin loader and collection and
* various .dls files, I found out following undocumented
* behaviour:
* - loader creates two instances of collection object
* - it calls ParseDescriptor on first, then releases it
* - then it checks returned descriptor; I'm not sure, but
* it seems that DMUS_OBJ_OBJECT is not present if DLS
* collection is indeed *real* one (gm.dls)
* - if above mentioned flag is not set, it creates another
* instance and loads it; it also gets descriptor and adds
* guidObject and wszFileName (even though this one cannot be
* set on native collection, or so it seems)
* => it seems to be sort of check whether given 'default
* DLS collection' is really one shipped with DX before
* actually loading it
* -cheers, Rok
*/
WCHAR wzFileName[DMUS_MAX_FILENAME];
LPSTREAM pStream;
LPSTREAM pProbeStream;
IDirectMusicObject *pProbeObject;
DMUS_OBJECTDESC ProbeDesc;
DMUS_OBJECTDESC GotDesc;
IPersistStream *pPersistStream = NULL;
ILoaderStream* pStream;
if (FAILED(DMUSIC_GetDefaultGMPath (wzFileName)))
/* get the path for default collection */
TRACE(": getting default DLS collection path...\n");
if (FAILED(DMUSIC_GetDefaultGMPath (wzFileName))) {
ERR(": could not get default collection path\n");
return E_FAIL;
/* load object from file */
result = DMUSIC_CreateLoaderStream ((LPSTREAM*) &pStream);
if (FAILED(result)) return result;
result = ILoaderStream_Attach (pStream, wzFileName, (LPDIRECTMUSICLOADER) iface);
if (FAILED(result)) return result;
}
/* create stream and associate it with dls collection file */
TRACE(": creating stream...\n");
result = DMUSIC_CreateLoaderStream ((LPVOID*) &pStream);
if (FAILED(result)) {
ERR(": could not create loader stream\n");
return result;
}
TRACE(": attaching stream...\n");
result = ILoaderStream_Attach (pStream, wzFileName, (LPDIRECTMUSICLOADER)iface);
if (FAILED(result)) {
ERR(": could not attach stream to file\n");
return result;
}
/* now create a clone of stream for "probe" */
TRACE(": cloning stream (for probing)...\n");
result = IStream_Clone (pStream, &pProbeStream);
if (FAILED(result)) {
ERR(": could not clone stream\n");
return result;
}
/* create object for "probing" */
TRACE(": creating IDirectMusicObject (for probing)...\n");
result = CoCreateInstance (&pDesc->guidClass, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicObject, (LPVOID*) &pProbeObject);
if (FAILED(result)) {
ERR(": could not create object (for probing)\n");
return result;
}
/* get descriptor from stream */
TRACE(": parsing descriptor on probe stream...\n");
DM_STRUCT_INIT(&ProbeDesc);
result = IDirectMusicObject_ParseDescriptor (pProbeObject, pProbeStream, &ProbeDesc);
if (FAILED(result)) {
ERR(": could not parse descriptor\n");
return result;
}
/* release all probing-related stuff */
TRACE(": releasing probing-related stuff...\n");
IStream_Release (pProbeStream);
IDirectMusicObject_Release (pProbeObject);
/* now, if it happens by any chance that dls collection isn't *the one*
* TODO: - check if the way below is the appropriate one
*/
if (ProbeDesc.dwValidData & DMUS_OBJ_OBJECT) {
LPDMUS_PRIVATE_CACHE_ENTRY newEntry;
WARN(": the default DLS collection is not the one shipped with DX\n");
/* my tests show that we return pointer to something or NULL, depending on + how
* input object was defined (therefore we probably don't return anything for object)
* and DMUS_E_LOADER_NOFILENAME as error code
* (I'd personally rather return DMUS_S_PARTIALLOAD, but I don't set rules)
*/
newEntry = (LPDMUS_PRIVATE_CACHE_ENTRY) HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(DMUS_PRIVATE_CACHE_ENTRY));
newEntry->pObject = NULL;
newEntry->bIsFaultyDLS = TRUE; /* so that cache won't try to get descriptor */
list_add_tail (&This->CacheList, &newEntry->entry);
TRACE(": filled in cache entry\n");
return DMUS_E_LOADER_NOFILENAME;
}
/* now the real loading... create object */
TRACE(": creating IDirectMusicObject (for loading)\n");
result = CoCreateInstance (&pDesc->guidClass, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicObject, (LPVOID*) &pObject);
if (FAILED(result)) {
ERR(": could not create object (for loading)\n");
return result;
}
/* acquire PersistStream interface */
TRACE(": getting IPersistStream on object...\n");
result = IDirectMusicObject_QueryInterface (pObject, &IID_IPersistStream, (LPVOID*) &pPersistStream);
if (FAILED(result)) return result;
result = IPersistStream_Load (pPersistStream, (LPSTREAM) pStream);
if (FAILED(result)) return result;
ILoaderStream_IStream_Release ((LPSTREAM) pStream);
if (FAILED(result)) {
ERR(": could not acquire IPersistStream\n");
return result;
}
/* load */
TRACE(": loading object..\n");
result = IPersistStream_Load (pPersistStream, pStream);
if (FAILED(result)) {
ERR(": failed to load object\n");
return result;
}
/* get descriptor */
TRACE(": getting descriptor of loaded object...\n");
DM_STRUCT_INIT(&GotDesc);
result = IDirectMusicObject_GetDescriptor (pObject, &GotDesc);
if (FAILED(result)) {
ERR(": failed to get descriptor\n");
return result;
}
/* now set the "missing" info */
TRACE(": adding \"missing\" info...\n");
GotDesc.dwValidData |= (DMUS_OBJ_OBJECT | DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH | DMUS_OBJ_LOADED);
memcpy (&GotDesc.guidObject, &pDesc->guidObject, sizeof(GUID)); /* set guidObject */
strncpyW (GotDesc.wszFileName, wzFileName, DMUS_MAX_FILENAME); /* set wszFileName, even if futile */
/* set descriptor */
TRACE(": setting descriptor\n");
IDirectMusicObject_SetDescriptor (pObject, &GotDesc);
/* release all loading related stuff */
TRACE(": releasing all loading-related stuff\n");
IStream_Release (pStream);
IPersistStream_Release (pPersistStream);
} else {
return E_FAIL;
@ -228,129 +455,187 @@ HRESULT WINAPI IDirectMusicLoader8Impl_GetObject (LPDIRECTMUSICLOADER8 iface, LP
FIXME(": unknown/unsupported way of loading\n");
return E_FAIL;
}
/* add object to cache */
newEntry = (LPDMUS_PRIVATE_CACHE_ENTRY) HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(DMUS_PRIVATE_CACHE_ENTRY));
if (pDesc->dwValidData & DMUS_OBJ_OBJECT)
memcpy (&newEntry->guidObject, &pDesc->guidObject, sizeof (pDesc->guidObject));
if (pDesc->dwValidData & DMUS_OBJ_FILENAME)
strncpyW (newEntry->wzFileName, pDesc->wszFileName, MAX_PATH);
if (pObject)
if (pObject) {
newEntry->pObject = pObject;
newEntry->bIsFaultyDLS = FALSE;
}
list_add_tail (&This->CacheList, &newEntry->entry);
TRACE(": filled in cache entry\n");
/* for debug purposes (e.g. to check if all files are cached) */
#if 0
/* for debug purposes (e.g. to check if all files are cached) */
TRACE("*** Loader's cache ***\n");
int i = 0;
LIST_FOR_EACH (listEntry, &This->CacheList) {
i++;
cacheEntry = LIST_ENTRY( listEntry, DMUS_PRIVATE_CACHE_ENTRY, entry );
TRACE("Entry nr. %i: GUID = %s, FileName = %s\n", i, debugstr_guid (&cacheEntry->guidObject), debugstr_w (cacheEntry->wzFileName));
TRACE("Entry nr. %i:\n", i);
cacheEntry = LIST_ENTRY(listEntry, DMUS_PRIVATE_CACHE_ENTRY, entry);
if (cacheEntry->bIsFaultyDLS == FALSE) {
DM_STRUCT_INIT(&CacheDesc); /* prepare desc for reuse */
IDirectMusicObject_GetDescriptor (cacheEntry->pObject, &CacheDesc);
DMUSIC_dump_DMUS_OBJECTDESC(&CacheDesc);
} else {
DPRINTF("faulty DLS collection\n");
}
}
#endif
return IDirectMusicObject_QueryInterface (pObject, riid, ppv);
}
HRESULT WINAPI IDirectMusicLoader8Impl_SetObject (LPDIRECTMUSICLOADER8 iface, LPDMUS_OBJECTDESC pDesc)
{
HRESULT WINAPI IDirectMusicLoader8Impl_SetObject (LPDIRECTMUSICLOADER8 iface, LPDMUS_OBJECTDESC pDesc) {
ICOM_THIS(IDirectMusicLoader8Impl,iface);
DMUS_PRIVATE_ALIAS_ENTRY *newEntry;
DMUS_OBJECTDESC Desc;
TRACE("(%p, %p): pDesc:\n", This, pDesc);
if (TRACE_ON(dmloader))
DMUSIC_dump_DMUS_OBJECTDESC(pDesc);
/* create stream and load additional info from it */
if (pDesc->dwValidData & DMUS_OBJ_FILENAME) {
/* generate filename; if it's full path, don't add search
directory path, otherwise do */
WCHAR wzFileName[MAX_PATH];
LPSTREAM pStream;
IDirectMusicObject* pObject;
FIXME("(%p, %p): stub\n", This, pDesc);
if (pDesc->dwValidData & DMUS_OBJ_FULLPATH) {
lstrcpyW(wzFileName, pDesc->wszFileName);
} else {
WCHAR *p;
lstrcpyW(wzFileName, This->wzSearchPath);
p = wzFileName + lstrlenW(wzFileName);
if (p > wzFileName && p[-1] != '\\') *p++ = '\\';
strcpyW(p, pDesc->wszFileName);
}
/* create stream */
DMUSIC_CreateLoaderStream ((LPVOID*) &pStream);
/* attach stream */
ILoaderStream_Attach (pStream, wzFileName, (LPDIRECTMUSICLOADER)iface);
/* create object */
CoCreateInstance (&pDesc->guidClass, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicObject, (LPVOID*)&pObject);
/* parse descriptor */
DM_STRUCT_INIT(&Desc);
IDirectMusicObject_ParseDescriptor (pObject, pStream, &Desc);
/* release everything */
IDirectMusicObject_Release (pObject);
IStream_Release (pStream);
}
else if (pDesc->dwValidData & DMUS_OBJ_STREAM) {
/* clone stream */
LPSTREAM pStream = NULL;
IDirectMusicObject* pObject;
IStream_Clone (pDesc->pStream, &pStream);
/* create object */
CoCreateInstance (&pDesc->guidClass, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicObject, (LPVOID*)&pObject);
/* parse descriptor */
DM_STRUCT_INIT(&Desc);
IDirectMusicObject_ParseDescriptor (pObject, pStream, &Desc);
/* release everything */
IDirectMusicObject_Release (pObject);
IStream_Release (pStream);
}
else {
WARN(": no way to get additional info\n");
}
/* now set additional info... my tests show that existing fields should be overwritten */
if (Desc.dwValidData & DMUS_OBJ_OBJECT)
memcpy (&pDesc->guidObject, &Desc.guidObject, sizeof(Desc.guidObject));
if (Desc.dwValidData & DMUS_OBJ_CLASS)
memcpy (&pDesc->guidClass, &Desc.guidClass, sizeof(Desc.guidClass));
if (Desc.dwValidData & DMUS_OBJ_NAME)
strncpyW (pDesc->wszName, Desc.wszName, DMUS_MAX_NAME);
if (Desc.dwValidData & DMUS_OBJ_CATEGORY)
strncpyW (pDesc->wszCategory, Desc.wszCategory, DMUS_MAX_CATEGORY);
if (Desc.dwValidData & DMUS_OBJ_FILENAME)
strncpyW (pDesc->wszFileName, Desc.wszFileName, DMUS_MAX_FILENAME);
if (Desc.dwValidData & DMUS_OBJ_VERSION)
memcpy (&pDesc->vVersion, &Desc.vVersion, sizeof(Desc.vVersion));
if (Desc.dwValidData & DMUS_OBJ_DATE)
memcpy (&pDesc->ftDate, &Desc.ftDate, sizeof(Desc.ftDate));
pDesc->dwValidData |= Desc.dwValidData; /* add new flags */
/* add new entry */
TRACE(": adding alias entry with following info:\n");
if (TRACE_ON(dmloader))
DMUSIC_dump_DMUS_OBJECTDESC(pDesc);
newEntry = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(DMUS_PRIVATE_ALIAS_ENTRY));
newEntry->pDesc = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC));
memcpy (newEntry->pDesc, pDesc, sizeof(DMUS_OBJECTDESC));
list_add_tail (&This->AliasList, &newEntry->entry);
return S_OK;
}
HRESULT WINAPI IDirectMusicLoader8Impl_SetSearchDirectory (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClass, WCHAR* pwzPath, BOOL fClear)
{
HRESULT WINAPI IDirectMusicLoader8Impl_SetSearchDirectory (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClass, WCHAR* pwzPath, BOOL fClear) {
ICOM_THIS(IDirectMusicLoader8Impl,iface);
TRACE("(%p, %s, %s, %d)\n", This, debugstr_guid(rguidClass), debugstr_w(pwzPath), fClear);
if (0 == strncmpW(This->wzSearchPath, pwzPath, MAX_PATH)) {
return S_FALSE;
}
strncpyW(This->wzSearchPath, pwzPath, MAX_PATH);
return S_OK;
}
HRESULT WINAPI IDirectMusicLoader8Impl_ScanDirectory (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClass, WCHAR* pwzFileExtension, WCHAR* pwzScanFileName)
{
HRESULT WINAPI IDirectMusicLoader8Impl_ScanDirectory (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClass, WCHAR* pwzFileExtension, WCHAR* pwzScanFileName) {
ICOM_THIS(IDirectMusicLoader8Impl,iface);
FIXME("(%p, %s, %p, %p): stub\n", This, debugstr_guid(rguidClass), pwzFileExtension, pwzScanFileName);
return S_OK;
}
HRESULT WINAPI IDirectMusicLoader8Impl_CacheObject (LPDIRECTMUSICLOADER8 iface, IDirectMusicObject* pObject)
{
HRESULT WINAPI IDirectMusicLoader8Impl_CacheObject (LPDIRECTMUSICLOADER8 iface, IDirectMusicObject* pObject) {
ICOM_THIS(IDirectMusicLoader8Impl,iface);
FIXME("(%p, %p): stub\n", This, pObject);
return S_OK;
}
HRESULT WINAPI IDirectMusicLoader8Impl_ReleaseObject (LPDIRECTMUSICLOADER8 iface, IDirectMusicObject* pObject)
{
HRESULT WINAPI IDirectMusicLoader8Impl_ReleaseObject (LPDIRECTMUSICLOADER8 iface, IDirectMusicObject* pObject) {
ICOM_THIS(IDirectMusicLoader8Impl,iface);
FIXME("(%p, %p): stub\n", This, pObject);
return S_OK;
}
HRESULT WINAPI IDirectMusicLoader8Impl_ClearCache (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClass)
{
HRESULT WINAPI IDirectMusicLoader8Impl_ClearCache (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClass) {
ICOM_THIS(IDirectMusicLoader8Impl,iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidClass));
return S_OK;
}
HRESULT WINAPI IDirectMusicLoader8Impl_EnableCache (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClass, BOOL fEnable)
{
HRESULT WINAPI IDirectMusicLoader8Impl_EnableCache (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClass, BOOL fEnable) {
ICOM_THIS(IDirectMusicLoader8Impl,iface);
FIXME("(%p, %s, %d): stub\n", This, debugstr_guid(rguidClass), fEnable);
return S_OK;
}
HRESULT WINAPI IDirectMusicLoader8Impl_EnumObject (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClass, DWORD dwIndex, LPDMUS_OBJECTDESC pDesc)
{
HRESULT WINAPI IDirectMusicLoader8Impl_EnumObject (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClass, DWORD dwIndex, LPDMUS_OBJECTDESC pDesc) {
ICOM_THIS(IDirectMusicLoader8Impl,iface);
FIXME("(%p, %s, %ld, %p): stub\n", This, debugstr_guid(rguidClass), dwIndex, pDesc);
return S_OK;
}
/* IDirectMusicLoader8 Interface part follow: */
void WINAPI IDirectMusicLoader8Impl_CollectGarbage (LPDIRECTMUSICLOADER8 iface)
{
void WINAPI IDirectMusicLoader8Impl_CollectGarbage (LPDIRECTMUSICLOADER8 iface) {
ICOM_THIS(IDirectMusicLoader8Impl,iface);
FIXME("(%p): stub\n", This);
}
HRESULT WINAPI IDirectMusicLoader8Impl_ReleaseObjectByUnknown (LPDIRECTMUSICLOADER8 iface, IUnknown* pObject)
{
HRESULT WINAPI IDirectMusicLoader8Impl_ReleaseObjectByUnknown (LPDIRECTMUSICLOADER8 iface, IUnknown* pObject) {
ICOM_THIS(IDirectMusicLoader8Impl,iface);
FIXME("(%p, %p): stub\n", This, pObject);
return S_OK;
}
HRESULT WINAPI IDirectMusicLoader8Impl_LoadObjectFromFile (LPDIRECTMUSICLOADER8 iface,
HRESULT WINAPI IDirectMusicLoader8Impl_LoadObjectFromFile (LPDIRECTMUSICLOADER8 iface,
REFGUID rguidClassID,
REFIID iidInterfaceID,
WCHAR* pwzFilePath,
void** ppObject)
{
void** ppObject) {
ICOM_THIS(IDirectMusicLoader8Impl,iface);
DMUS_OBJECTDESC ObjDesc;
@ -381,8 +666,7 @@ HRESULT WINAPI IDirectMusicLoader8Impl_LoadObjectFromFile (LPDIRECTMUSICLOADER8
return IDirectMusicLoader8Impl_GetObject (iface, &ObjDesc, iidInterfaceID, ppObject);
}
ICOM_VTABLE(IDirectMusicLoader8) DirectMusicLoader8_Vtbl =
{
ICOM_VTABLE(IDirectMusicLoader8) DirectMusicLoader8_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicLoader8Impl_QueryInterface,
IDirectMusicLoader8Impl_AddRef,
@ -402,33 +686,26 @@ ICOM_VTABLE(IDirectMusicLoader8) DirectMusicLoader8_Vtbl =
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicLoader (LPCGUID lpcGUID, LPDIRECTMUSICLOADER8 *ppDMLoad, LPUNKNOWN pUnkOuter)
{
IDirectMusicLoader8Impl *dmloader;
HRESULT WINAPI DMUSIC_CreateDirectMusicLoaderImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) {
IDirectMusicLoader8Impl *obj;
TRACE("(%p,%p,%p)\n",lpcGUID, ppDMLoad, pUnkOuter);
if (IsEqualIID (lpcGUID, &IID_IDirectMusicLoader) ||
IsEqualIID (lpcGUID, &IID_IDirectMusicLoader8)) {
dmloader = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicLoader8Impl));
if (NULL == dmloader) {
*ppDMLoad = (LPDIRECTMUSICLOADER8)NULL;
return E_OUTOFMEMORY;
}
dmloader->lpVtbl = &DirectMusicLoader8_Vtbl;
dmloader->ref = 1;
MultiByteToWideChar (CP_ACP, 0, ".\\", -1, dmloader->wzSearchPath, MAX_PATH);
list_init (&dmloader->CacheList);
*ppDMLoad = (LPDIRECTMUSICLOADER8)dmloader;
return S_OK;
TRACE("(%p,%p,%p)\n",lpcGUID, ppobj, pUnkOuter);
obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicLoader8Impl));
if (NULL == obj) {
*ppobj = (LPDIRECTMUSICLOADER8)NULL;
return E_OUTOFMEMORY;
}
WARN("No interface found\n");
return E_NOINTERFACE;
obj->lpVtbl = &DirectMusicLoader8_Vtbl;
obj->ref = 0; /* will be inited with QueryInterface */
MultiByteToWideChar (CP_ACP, 0, ".\\", -1, obj->wzSearchPath, MAX_PATH);
list_init (&obj->CacheList);
list_init (&obj->AliasList);
return IDirectMusicLoader8Impl_QueryInterface ((LPDIRECTMUSICLOADER8)obj, lpcGUID, ppobj);
}
/* help function for IDirectMusicLoader8Impl_GetObject */
HRESULT WINAPI DMUSIC_GetDefaultGMPath (WCHAR wszPath[MAX_PATH])
{
HRESULT WINAPI DMUSIC_GetDefaultGMPath (WCHAR wszPath[MAX_PATH]) {
HKEY hkDM;
DWORD returnType, sizeOfReturnBuffer = MAX_PATH;
char szPath[MAX_PATH];

View File

@ -1,6 +1,6 @@
/* ILoaderStream Implementation
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -19,30 +19,23 @@
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "dmloader_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmloader);
WINE_DECLARE_DEBUG_CHANNEL(dmfileraw);
/*****************************************************************************
* Custom functions:
*/
HRESULT WINAPI ILoaderStream_Attach (ILoaderStream* This, LPCWSTR wzFile, IDirectMusicLoader *pLoader)
{
HRESULT WINAPI ILoaderStream_Attach (LPSTREAM iface, LPCWSTR wzFile, IDirectMusicLoader *pLoader) {
ICOM_THIS_MULTI(ILoaderStream, StreamVtbl, iface);
TRACE("(%p, %s, %p)\n", This, debugstr_w(wzFile), pLoader);
ILoaderStream_Detach (This);
ILoaderStream_Detach (iface);
This->hFile = CreateFileW (wzFile, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (This->hFile == INVALID_HANDLE_VALUE) {
TRACE(": failed\n");
return E_FAIL;
return DMUS_E_LOADER_FAILEDOPEN;
}
/* create IDirectMusicGetLoader */
(LPDIRECTMUSICLOADER) This->pLoader = pLoader;
@ -51,8 +44,8 @@ HRESULT WINAPI ILoaderStream_Attach (ILoaderStream* This, LPCWSTR wzFile, IDirec
return S_OK;
}
void WINAPI ILoaderStream_Detach (ILoaderStream* This)
{
void WINAPI ILoaderStream_Detach (LPSTREAM iface) {
ICOM_THIS_MULTI(ILoaderStream, StreamVtbl, iface);
if (This->hFile != INVALID_HANDLE_VALUE) {
CloseHandle(This->hFile);
}
@ -60,20 +53,24 @@ void WINAPI ILoaderStream_Detach (ILoaderStream* This)
}
/*****************************************************************************
* ILoaderStream IStream:
* ILoaderStream implementation
*/
HRESULT WINAPI ILoaderStream_IStream_QueryInterface (LPSTREAM iface, REFIID riid, void** ppobj)
{
ICOM_THIS_MULTI(ILoaderStream, StreamVtbl, iface);
/* ILoaderStream IUnknown part: */
HRESULT WINAPI ILoaderStream_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, void** ppobj) {
ICOM_THIS_MULTI(ILoaderStream, UnknownVtbl, iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IStream)) {
TRACE("(%p, %s, %p)\n", This, debugstr_guid(riid), ppobj);
if (IsEqualIID (riid, &IID_IUnknown)) {
*ppobj = (LPVOID)&This->UnknownVtbl;
ILoaderStream_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IStream)) {
*ppobj = (LPVOID)&This->StreamVtbl;
ILoaderStream_IStream_AddRef (iface);
ILoaderStream_IStream_AddRef ((LPSTREAM)&This->StreamVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicGetLoader)) {
*ppobj = (LPVOID)&This->GetLoaderVtbl;
ILoaderStream_IStream_AddRef (iface);
ILoaderStream_IDirectMusicGetLoader_AddRef ((LPDIRECTMUSICGETLOADER)&This->GetLoaderVtbl);
return S_OK;
}
@ -81,16 +78,14 @@ HRESULT WINAPI ILoaderStream_IStream_QueryInterface (LPSTREAM iface, REFIID riid
return E_NOINTERFACE;
}
ULONG WINAPI ILoaderStream_IStream_AddRef (LPSTREAM iface)
{
ICOM_THIS_MULTI(ILoaderStream, StreamVtbl, iface);
ULONG WINAPI ILoaderStream_IUnknown_AddRef (LPUNKNOWN iface) {
ICOM_THIS_MULTI(ILoaderStream, UnknownVtbl, iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI ILoaderStream_IStream_Release (LPSTREAM iface)
{
ICOM_THIS_MULTI(ILoaderStream, StreamVtbl, iface);
ULONG WINAPI ILoaderStream_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI(ILoaderStream, UnknownVtbl, iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
@ -99,22 +94,45 @@ ULONG WINAPI ILoaderStream_IStream_Release (LPSTREAM iface)
return ref;
}
HRESULT WINAPI ILoaderStream_IStream_Read (LPSTREAM iface, void* pv, ULONG cb, ULONG* pcbRead)
{
ICOM_VTABLE(IUnknown) LoaderStream_Unknown_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
ILoaderStream_IUnknown_QueryInterface,
ILoaderStream_IUnknown_AddRef,
ILoaderStream_IUnknown_Release
};
/* ILoaderStream IStream part: */
HRESULT WINAPI ILoaderStream_IStream_QueryInterface (LPSTREAM iface, REFIID riid, void** ppobj) {
ICOM_THIS_MULTI(ILoaderStream, StreamVtbl, iface);
return ILoaderStream_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI ILoaderStream_IStream_AddRef (LPSTREAM iface) {
ICOM_THIS_MULTI(ILoaderStream, StreamVtbl, iface);
return ILoaderStream_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI ILoaderStream_IStream_Release (LPSTREAM iface) {
ICOM_THIS_MULTI(ILoaderStream, StreamVtbl, iface);
return ILoaderStream_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI ILoaderStream_IStream_Read (LPSTREAM iface, void* pv, ULONG cb, ULONG* pcbRead) {
ICOM_THIS_MULTI(ILoaderStream, StreamVtbl, iface);
ULONG cbRead;
TRACE_(dmfileraw)("(%p, %p, 0x%04lx, %p)\n", This, pv, cb, pcbRead);
if (This->hFile == INVALID_HANDLE_VALUE) return E_FAIL;
if (pcbRead == NULL) pcbRead = &cbRead;
if (!ReadFile (This->hFile, pv, cb, pcbRead, NULL) || *pcbRead != cb) return E_FAIL;
TRACE_(dmfileraw)(": data (size = 0x%04lx): '%s'\n", *pcbRead, debugstr_an(pv, *pcbRead));
return S_OK;
}
HRESULT WINAPI ILoaderStream_IStream_Seek (LPSTREAM iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER* plibNewPosition)
{
HRESULT WINAPI ILoaderStream_IStream_Seek (LPSTREAM iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER* plibNewPosition) {
ICOM_THIS_MULTI(ILoaderStream, StreamVtbl, iface);
LARGE_INTEGER liNewPos;
TRACE_(dmfileraw)("(%p, 0x%04llx, %s, %p)\n", This, dlibMove.QuadPart, resolve_STREAM_SEEK(dwOrigin), plibNewPosition);
if (This->hFile == INVALID_HANDLE_VALUE) return E_FAIL;
@ -127,14 +145,13 @@ HRESULT WINAPI ILoaderStream_IStream_Seek (LPSTREAM iface, LARGE_INTEGER dlibMov
return S_OK;
}
HRESULT WINAPI ILoaderStream_IStream_Clone (LPSTREAM iface, IStream** ppstm)
{
HRESULT WINAPI ILoaderStream_IStream_Clone (LPSTREAM iface, IStream** ppstm) {
ICOM_THIS_MULTI(ILoaderStream, StreamVtbl, iface);
ILoaderStream* pOther = NULL;
LPSTREAM pOther = NULL;
HRESULT result;
TRACE("(%p, %p)\n", iface, ppstm);
result = DMUSIC_CreateLoaderStream ((LPSTREAM*)&pOther);
result = DMUSIC_CreateLoaderStream ((LPVOID*)&pOther);
if (FAILED(result)) return result;
if (This->hFile != INVALID_HANDLE_VALUE) {
ULARGE_INTEGER ullCurrentPosition;
@ -160,57 +177,47 @@ HRESULT WINAPI ILoaderStream_IStream_Clone (LPSTREAM iface, IStream** ppstm)
return S_OK;
}
/* not needed*/
HRESULT WINAPI ILoaderStream_IStream_Write (LPSTREAM iface, const void* pv, ULONG cb, ULONG* pcbWritten)
{
HRESULT WINAPI ILoaderStream_IStream_Write (LPSTREAM iface, const void* pv, ULONG cb, ULONG* pcbWritten) {
ERR(": should not be needed\n");
return E_NOTIMPL;
}
HRESULT WINAPI ILoaderStream_IStream_SetSize (LPSTREAM iface, ULARGE_INTEGER libNewSize)
{
HRESULT WINAPI ILoaderStream_IStream_SetSize (LPSTREAM iface, ULARGE_INTEGER libNewSize) {
ERR(": should not be needed\n");
return E_NOTIMPL;
}
HRESULT WINAPI ILoaderStream_IStream_CopyTo (LPSTREAM iface, IStream* pstm, ULARGE_INTEGER cb, ULARGE_INTEGER* pcbRead, ULARGE_INTEGER* pcbWritten)
{
HRESULT WINAPI ILoaderStream_IStream_CopyTo (LPSTREAM iface, IStream* pstm, ULARGE_INTEGER cb, ULARGE_INTEGER* pcbRead, ULARGE_INTEGER* pcbWritten) {
ERR(": should not be needed\n");
return E_NOTIMPL;
}
HRESULT WINAPI ILoaderStream_IStream_Commit (LPSTREAM iface, DWORD grfCommitFlags)
{
HRESULT WINAPI ILoaderStream_IStream_Commit (LPSTREAM iface, DWORD grfCommitFlags) {
ERR(": should not be needed\n");
return E_NOTIMPL;
}
HRESULT WINAPI ILoaderStream_IStream_Revert (LPSTREAM iface)
{
HRESULT WINAPI ILoaderStream_IStream_Revert (LPSTREAM iface) {
ERR(": should not be needed\n");
return E_NOTIMPL;
}
HRESULT WINAPI ILoaderStream_IStream_LockRegion (LPSTREAM iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
{
HRESULT WINAPI ILoaderStream_IStream_LockRegion (LPSTREAM iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) {
ERR(": should not be needed\n");
return E_NOTIMPL;
}
HRESULT WINAPI ILoaderStream_IStream_UnlockRegion (LPSTREAM iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
{
HRESULT WINAPI ILoaderStream_IStream_UnlockRegion (LPSTREAM iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) {
ERR(": should not be needed\n");
return E_NOTIMPL;
}
HRESULT WINAPI ILoaderStream_IStream_Stat (LPSTREAM iface, STATSTG* pstatstg, DWORD grfStatFlag)
{
HRESULT WINAPI ILoaderStream_IStream_Stat (LPSTREAM iface, STATSTG* pstatstg, DWORD grfStatFlag) {
ERR(": should not be needed\n");
return E_NOTIMPL;
}
ICOM_VTABLE(IStream) LoaderStream_Stream_Vtbl =
{
ICOM_VTABLE(IStream) LoaderStream_Stream_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
ILoaderStream_IStream_QueryInterface,
ILoaderStream_IStream_AddRef,
@ -229,28 +236,24 @@ ICOM_VTABLE(IStream) LoaderStream_Stream_Vtbl =
};
/*****************************************************************************
* ILoaderStream IDirectMusicGetLoader:
* ILoaderStream IDirectMusicGetLoader part:
*/
HRESULT WINAPI ILoaderStream_IDirectMusicGetLoader_QueryInterface (LPDIRECTMUSICGETLOADER iface, REFIID riid, void** ppobj)
{
HRESULT WINAPI ILoaderStream_IDirectMusicGetLoader_QueryInterface (LPDIRECTMUSICGETLOADER iface, REFIID riid, void** ppobj) {
ICOM_THIS_MULTI(ILoaderStream, GetLoaderVtbl, iface);
return ILoaderStream_IStream_QueryInterface ((LPSTREAM)&This->StreamVtbl, riid, ppobj);
return ILoaderStream_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI ILoaderStream_IDirectMusicGetLoader_AddRef (LPDIRECTMUSICGETLOADER iface)
{
ULONG WINAPI ILoaderStream_IDirectMusicGetLoader_AddRef (LPDIRECTMUSICGETLOADER iface) {
ICOM_THIS_MULTI(ILoaderStream, GetLoaderVtbl, iface);
return ILoaderStream_IStream_AddRef ((LPSTREAM)&This->StreamVtbl);
return ILoaderStream_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI ILoaderStream_IDirectMusicGetLoader_Release (LPDIRECTMUSICGETLOADER iface)
{
ULONG WINAPI ILoaderStream_IDirectMusicGetLoader_Release (LPDIRECTMUSICGETLOADER iface) {
ICOM_THIS_MULTI(ILoaderStream, GetLoaderVtbl, iface);
return ILoaderStream_IStream_Release ((LPSTREAM)&This->StreamVtbl);
return ILoaderStream_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI ILoaderStream_IDirectMusicGetLoader_GetLoader (LPDIRECTMUSICGETLOADER iface, IDirectMusicLoader **ppLoader)
{
HRESULT WINAPI ILoaderStream_IDirectMusicGetLoader_GetLoader (LPDIRECTMUSICGETLOADER iface, IDirectMusicLoader **ppLoader) {
ICOM_THIS_MULTI(ILoaderStream, GetLoaderVtbl, iface);
TRACE("(%p, %p)\n", This, ppLoader);
@ -260,8 +263,7 @@ HRESULT WINAPI ILoaderStream_IDirectMusicGetLoader_GetLoader (LPDIRECTMUSICGETLO
return S_OK;
}
ICOM_VTABLE(IDirectMusicGetLoader) LoaderStream_GetLoader_Vtbl =
{
ICOM_VTABLE(IDirectMusicGetLoader) LoaderStream_GetLoader_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
ILoaderStream_IDirectMusicGetLoader_QueryInterface,
ILoaderStream_IDirectMusicGetLoader_AddRef,
@ -269,22 +271,19 @@ ICOM_VTABLE(IDirectMusicGetLoader) LoaderStream_GetLoader_Vtbl =
ILoaderStream_IDirectMusicGetLoader_GetLoader
};
HRESULT WINAPI DMUSIC_CreateLoaderStream (LPSTREAM* ppStream)
{
HRESULT WINAPI DMUSIC_CreateLoaderStream (LPVOID* ppobj) {
ILoaderStream *pStream;
TRACE("(%p)\n", ppStream);
TRACE("(%p)\n", ppobj);
pStream = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(ILoaderStream));
if (NULL == pStream) {
*ppStream = (LPSTREAM)NULL;
*ppobj = (LPVOID) NULL;
return E_OUTOFMEMORY;
}
pStream->UnknownVtbl = &LoaderStream_Unknown_Vtbl;
pStream->StreamVtbl = &LoaderStream_Stream_Vtbl;
pStream->GetLoaderVtbl = &LoaderStream_GetLoader_Vtbl;
pStream->ref = 1;
*ppStream = (LPSTREAM)pStream;
return S_OK;
pStream->ref = 0; /* will be inited with QueryInterface */
return ILoaderStream_IUnknown_QueryInterface ((LPUNKNOWN)&pStream->UnknownVtbl, &IID_IStream, ppobj);
}

View File

@ -18,21 +18,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdarg.h>
#include <string.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winreg.h"
#include "winerror.h"
#include "dmusics.h"
#include "dmusici.h"
#include "dmplugin.h"
#include "wine/debug.h"
#include "dmloader_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmloader);
@ -44,8 +30,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(dmloader);
/***********************************************************************
* interface for self-registering
*/
struct regsvr_interface
{
struct regsvr_interface {
IID const *iid; /* NULL for end of list */
LPCSTR name; /* can be NULL to omit */
IID const *base_iid; /* can be NULL to omit */
@ -57,8 +42,7 @@ struct regsvr_interface
static HRESULT register_interfaces(struct regsvr_interface const *list);
static HRESULT unregister_interfaces(struct regsvr_interface const *list);
struct regsvr_coclass
{
struct regsvr_coclass {
CLSID const *clsid; /* NULL for end of list */
LPCSTR name; /* can be NULL to omit */
LPCSTR ips; /* can be NULL to omit */
@ -124,8 +108,7 @@ static LONG recursive_delete_keyW(HKEY base, WCHAR const *name);
/***********************************************************************
* register_interfaces
*/
static HRESULT register_interfaces(struct regsvr_interface const *list)
{
static HRESULT register_interfaces(struct regsvr_interface const *list) {
LONG res = ERROR_SUCCESS;
HKEY interface_key;
@ -194,8 +177,7 @@ error_return:
/***********************************************************************
* unregister_interfaces
*/
static HRESULT unregister_interfaces(struct regsvr_interface const *list)
{
static HRESULT unregister_interfaces(struct regsvr_interface const *list) {
LONG res = ERROR_SUCCESS;
HKEY interface_key;
@ -219,8 +201,7 @@ error_return:
/***********************************************************************
* register_coclasses
*/
static HRESULT register_coclasses(struct regsvr_coclass const *list)
{
static HRESULT register_coclasses(struct regsvr_coclass const *list) {
LONG res = ERROR_SUCCESS;
HKEY coclass_key;
@ -301,8 +282,7 @@ error_return:
/***********************************************************************
* unregister_coclasses
*/
static HRESULT unregister_coclasses(struct regsvr_coclass const *list)
{
static HRESULT unregister_coclasses(struct regsvr_coclass const *list) {
LONG res = ERROR_SUCCESS;
HKEY coclass_key;
@ -338,8 +318,7 @@ error_return:
/***********************************************************************
* regsvr_key_guid
*/
static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid)
{
static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid) {
WCHAR buf[39];
StringFromGUID2(guid, buf, 39);
@ -352,8 +331,7 @@ static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid)
static LONG register_key_defvalueW(
HKEY base,
WCHAR const *name,
WCHAR const *value)
{
WCHAR const *value) {
LONG res;
HKEY key;
@ -372,8 +350,7 @@ static LONG register_key_defvalueW(
static LONG register_key_defvalueA(
HKEY base,
WCHAR const *name,
char const *value)
{
char const *value) {
LONG res;
HKEY key;
@ -394,8 +371,7 @@ static LONG register_progid(
char const *progid,
char const *curver_progid,
char const *name,
char const *extra)
{
char const *extra) {
LONG res;
HKEY progid_key;
@ -439,8 +415,7 @@ error_close_progid_key:
/***********************************************************************
* recursive_delete_key
*/
static LONG recursive_delete_key(HKEY key)
{
static LONG recursive_delete_key(HKEY key) {
LONG res;
WCHAR subkey_name[MAX_PATH];
DWORD cName;
@ -471,8 +446,7 @@ static LONG recursive_delete_key(HKEY key)
/***********************************************************************
* recursive_delete_keyA
*/
static LONG recursive_delete_keyA(HKEY base, char const *name)
{
static LONG recursive_delete_keyA(HKEY base, char const *name) {
LONG res;
HKEY key;
@ -487,8 +461,7 @@ static LONG recursive_delete_keyA(HKEY base, char const *name)
/***********************************************************************
* recursive_delete_keyW
*/
static LONG recursive_delete_keyW(HKEY base, WCHAR const *name)
{
static LONG recursive_delete_keyW(HKEY base, WCHAR const *name) {
LONG res;
HKEY key;
@ -534,8 +507,7 @@ static struct regsvr_interface const interface_list[] = {
/***********************************************************************
* DllRegisterServer (DMLOADER.3)
*/
HRESULT WINAPI DMLOADER_DllRegisterServer(void)
{
HRESULT WINAPI DMLOADER_DllRegisterServer(void) {
HRESULT hr;
TRACE("\n");
@ -549,8 +521,7 @@ HRESULT WINAPI DMLOADER_DllRegisterServer(void)
/***********************************************************************
* DllUnregisterServer (DMLOADER.4)
*/
HRESULT WINAPI DMLOADER_DllUnregisterServer(void)
{
HRESULT WINAPI DMLOADER_DllUnregisterServer(void) {
HRESULT hr;
TRACE("\n");

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 Rok Mandeljc <rok.mandeljc@gimb.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -18,10 +18,10 @@
#define WINE_FILEDESCRIPTION_STR "Wine DirectMusic Loader"
#define WINE_FILENAME_STR "dmloader.dll"
#define WINE_FILEVERSION 4,8,1,881
#define WINE_FILEVERSION_STR "4.8.1.881"
#define WINE_PRODUCTVERSION 4,8,1,881
#define WINE_PRODUCTVERSION_STR "4.8"
#define WINE_FILEVERSION 4,9,0,900
#define WINE_FILEVERSION_STR "4.9.0.900"
#define WINE_PRODUCTVERSION 4,9,0,900
#define WINE_PRODUCTVERSION_STR "4.9"
#define WINE_PRODUCTNAME_STR "DirectX"
#include "wine/wine_common_ver.rc"

View File

@ -1,6 +1,6 @@
/* DirectMusicScript Main
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -21,8 +21,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(dmscript);
typedef struct
{
typedef struct {
/* IUnknown fields */
ICOM_VFIELD(IClassFactory);
DWORD ref;
@ -31,41 +30,32 @@ typedef struct
/******************************************************************
* DirectMusicScriptAutoImplSegment ClassFactory
*/
static HRESULT WINAPI ScriptAutoImplSegmentCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI ScriptAutoImplSegmentCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI ScriptAutoImplSegmentCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI ScriptAutoImplSegmentCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI ScriptAutoImplSegmentCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI ScriptAutoImplSegmentCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI ScriptAutoImplSegmentCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI ScriptAutoImplSegmentCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
/* nothing here yet */
/* nothing here yet */
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
static HRESULT WINAPI ScriptAutoImplSegmentCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI ScriptAutoImplSegmentCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -85,44 +75,30 @@ static IClassFactoryImpl ScriptAutoImplSegment_CF = {&ScriptAutoImplSegmentCF_Vt
/******************************************************************
* DirectMusicScriptTrack ClassFactory
*/
static HRESULT WINAPI ScriptTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI ScriptTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI ScriptTrackCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI ScriptTrackCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI ScriptTrackCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI ScriptTrackCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI ScriptTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI ScriptTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualIID (riid, &IID_IDirectMusicTrack)
|| IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
return DMUSIC_CreateDirectMusicScriptTrack (riid, (LPDIRECTMUSICTRACK8*)ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
return DMUSIC_CreateDirectMusicScriptTrack (riid, ppobj, pOuter);
}
static HRESULT WINAPI ScriptTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI ScriptTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -142,41 +118,32 @@ static IClassFactoryImpl ScriptTrack_CF = {&ScriptTrackCF_Vtbl, 1 };
/******************************************************************
* DirectMusicAudioVBScript ClassFactory
*/
static HRESULT WINAPI AudioVBScriptCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI AudioVBScriptCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI AudioVBScriptCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI AudioVBScriptCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI AudioVBScriptCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI AudioVBScriptCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI AudioVBScriptCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI AudioVBScriptCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
/* nothing here yet */
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
static HRESULT WINAPI AudioVBScriptCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI AudioVBScriptCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -196,44 +163,30 @@ static IClassFactoryImpl AudioVBScript_CF = {&AudioVBScriptCF_Vtbl, 1 };
/******************************************************************
* DirectMusicScript ClassFactory
*/
static HRESULT WINAPI ScriptCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI ScriptCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI ScriptCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI ScriptCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI ScriptCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI ScriptCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI ScriptCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI ScriptCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualIID (riid, &IID_IDirectMusicScript)) {
return DMUSIC_CreateDirectMusicScript (riid, (LPDIRECTMUSICSCRIPT*)ppobj, pOuter);
} else if (IsEqualIID (riid, &IID_IDirectMusicObject)) {
return DMUSIC_CreateDirectMusicScriptObject (riid, (LPDIRECTMUSICOBJECT*)ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
return DMUSIC_CreateDirectMusicScriptImpl (riid, ppobj, pOuter);
}
static HRESULT WINAPI ScriptCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI ScriptCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -253,41 +206,32 @@ static IClassFactoryImpl Script_CF = {&ScriptCF_Vtbl, 1 };
/******************************************************************
* DirectMusicScriptAutoImplPerformance ClassFactory
*/
static HRESULT WINAPI ScriptAutoImplPerformanceCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI ScriptAutoImplPerformanceCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI ScriptAutoImplPerformanceCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI ScriptAutoImplPerformanceCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI ScriptAutoImplPerformanceCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI ScriptAutoImplPerformanceCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI ScriptAutoImplPerformanceCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI ScriptAutoImplPerformanceCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
/* nothing here yet */
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
static HRESULT WINAPI ScriptAutoImplPerformanceCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI ScriptAutoImplPerformanceCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -307,41 +251,32 @@ static IClassFactoryImpl ScriptAutoImplPerformance_CF = {&ScriptAutoImplPerforma
/******************************************************************
* DirectMusicScriptSourceCodeLoader ClassFactory
*/
static HRESULT WINAPI ScriptSourceCodeLoaderCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI ScriptSourceCodeLoaderCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI ScriptSourceCodeLoaderCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI ScriptSourceCodeLoaderCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI ScriptSourceCodeLoaderCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI ScriptSourceCodeLoaderCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI ScriptSourceCodeLoaderCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI ScriptSourceCodeLoaderCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
/* nothing here yet */
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
static HRESULT WINAPI ScriptSourceCodeLoaderCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI ScriptSourceCodeLoaderCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -361,41 +296,32 @@ static IClassFactoryImpl ScriptSourceCodeLoader_CF = {&ScriptSourceCodeLoaderCF_
/******************************************************************
* DirectMusicScriptAutoImplSegmentState ClassFactory
*/
static HRESULT WINAPI ScriptAutoImplSegmentStateCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI ScriptAutoImplSegmentStateCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI ScriptAutoImplSegmentStateCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI ScriptAutoImplSegmentStateCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI ScriptAutoImplSegmentStateCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI ScriptAutoImplSegmentStateCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI ScriptAutoImplSegmentStateCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI ScriptAutoImplSegmentStateCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
/* nothing here yet */
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
static HRESULT WINAPI ScriptAutoImplSegmentStateCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI ScriptAutoImplSegmentStateCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -415,41 +341,32 @@ static IClassFactoryImpl ScriptAutoImplSegmentState_CF = {&ScriptAutoImplSegment
/******************************************************************
* DirectMusicScriptAutoImplAudioPathConfig ClassFactory
*/
static HRESULT WINAPI ScriptAutoImplAudioPathConfigCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI ScriptAutoImplAudioPathConfigCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI ScriptAutoImplAudioPathConfigCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI ScriptAutoImplAudioPathConfigCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI ScriptAutoImplAudioPathConfigCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI ScriptAutoImplAudioPathConfigCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI ScriptAutoImplAudioPathConfigCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI ScriptAutoImplAudioPathConfigCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
/* nothing here yet */
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
static HRESULT WINAPI ScriptAutoImplAudioPathConfigCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI ScriptAutoImplAudioPathConfigCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -469,41 +386,32 @@ static IClassFactoryImpl ScriptAutoImplAudioPathConfig_CF = {&ScriptAutoImplAudi
/******************************************************************
* DirectMusicScriptAutoImplAudioPath ClassFactory
*/
static HRESULT WINAPI ScriptAutoImplAudioPathCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI ScriptAutoImplAudioPathCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI ScriptAutoImplAudioPathCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI ScriptAutoImplAudioPathCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI ScriptAutoImplAudioPathCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI ScriptAutoImplAudioPathCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI ScriptAutoImplAudioPathCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI ScriptAutoImplAudioPathCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
/* nothing here yet */
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
static HRESULT WINAPI ScriptAutoImplAudioPathCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI ScriptAutoImplAudioPathCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -523,41 +431,32 @@ static IClassFactoryImpl ScriptAutoImplAudioPath_CF = {&ScriptAutoImplAudioPathC
/******************************************************************
* DirectMusicScriptAutoImplSong ClassFactory
*/
static HRESULT WINAPI ScriptAutoImplSongCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI ScriptAutoImplSongCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI ScriptAutoImplSongCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI ScriptAutoImplSongCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI ScriptAutoImplSongCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI ScriptAutoImplSongCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI ScriptAutoImplSongCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI ScriptAutoImplSongCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
/* nothing here yet */
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
static HRESULT WINAPI ScriptAutoImplSongCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI ScriptAutoImplSongCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -579,15 +478,11 @@ static IClassFactoryImpl ScriptAutoImplSong_CF = {&ScriptAutoImplSongCF_Vtbl, 1
*
*
*/
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
if (fdwReason == DLL_PROCESS_ATTACH)
{
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
if (fdwReason == DLL_PROCESS_ATTACH) {
DisableThreadLibraryCalls(hinstDLL);
/* FIXME: Initialisation */
}
else if (fdwReason == DLL_PROCESS_DETACH)
{
} else if (fdwReason == DLL_PROCESS_DETACH) {
/* FIXME: Cleanup */
}
@ -600,10 +495,8 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
*
*
*/
HRESULT WINAPI DMSCRIPT_DllCanUnloadNow(void)
{
HRESULT WINAPI DMSCRIPT_DllCanUnloadNow(void) {
FIXME("(void): stub\n");
return S_FALSE;
}
@ -613,8 +506,7 @@ HRESULT WINAPI DMSCRIPT_DllCanUnloadNow(void)
*
*
*/
HRESULT WINAPI DMSCRIPT_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
{
HRESULT WINAPI DMSCRIPT_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) {
TRACE("(%p,%p,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
if (IsEqualCLSID (rclsid, &CLSID_DirectMusicScriptAutoImpSegment) && IsEqualIID (riid, &IID_IClassFactory)) {
*ppv = (LPVOID) &ScriptAutoImplSegment_CF;

View File

@ -1,6 +1,6 @@
/* DirectMusicScript Private Include
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -23,189 +23,240 @@
#include <stdarg.h>
#include "windef.h"
#include "wine/debug.h"
#include "winbase.h"
#include "winnt.h"
#include "wingdi.h"
#include "dmusicc.h"
#include "winuser.h"
#include "wine/debug.h"
#include "wine/list.h"
#include "wine/unicode.h"
#include "winreg.h"
#include "dmusici.h"
#include "dmusics.h"
#include "dmplugin.h"
#include "dmusicf.h"
#include "dsound.h"
#include "dmusics.h"
/*****************************************************************************
* Interfaces
*/
typedef struct IDirectMusicScriptImpl IDirectMusicScriptImpl;
typedef struct IDirectMusicScriptObject IDirectMusicScriptObject;
typedef struct IDirectMusicScriptObjectStream IDirectMusicScriptObjectStream;
typedef struct IDirectMusicScriptTrack IDirectMusicScriptTrack;
typedef struct IDirectMusicScriptTrackStream IDirectMusicScriptTrackStream;
/*****************************************************************************
* Predeclare the interface implementation structures
*/
extern ICOM_VTABLE(IDirectMusicScript) DirectMusicScript_Vtbl;
extern ICOM_VTABLE(IUnknown) DirectMusicScript_Unknown_Vtbl;
extern ICOM_VTABLE(IDirectMusicScript) DirectMusicScript_Script_Vtbl;
extern ICOM_VTABLE(IDirectMusicObject) DirectMusicScript_Object_Vtbl;
extern ICOM_VTABLE(IPersistStream) DirectMusicScript_PersistStream_Vtbl;
extern ICOM_VTABLE(IDirectMusicObject) DirectMusicScriptObject_Vtbl;
extern ICOM_VTABLE(IPersistStream) DirectMusicScriptObjectStream_Vtbl;
extern ICOM_VTABLE(IDirectMusicTrack8) DirectMusicScriptTrack_Vtbl;
extern ICOM_VTABLE(IPersistStream) DirectMusicScriptTrackStream_Vtbl;
extern ICOM_VTABLE(IUnknown) DirectMusicScriptTrack_Unknown_Vtbl;
extern ICOM_VTABLE(IDirectMusicTrack8) DirectMusicScriptTrack_Track_Vtbl;
extern ICOM_VTABLE(IPersistStream) DirectMusicScriptTrack_PersistStream_Vtbl;
/*****************************************************************************
* ClassFactory
*
* can support IID_IDirectMusicScript
* return always an IDirectMusicScriptImpl
*/
extern HRESULT WINAPI DMUSIC_CreateDirectMusicScript (LPCGUID lpcGUID, LPDIRECTMUSICSCRIPT* ppDMScript, LPUNKNOWN pUnkOuter);
extern HRESULT WINAPI DMUSIC_CreateDirectMusicScriptImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter);
extern HRESULT WINAPI DMUSIC_CreateDirectMusicScriptObject (LPCGUID lpcGUID, LPDIRECTMUSICOBJECT* ppObject, LPUNKNOWN pUnkOuter);
extern HRESULT WINAPI DMUSIC_CreateDirectMusicScriptTrack (LPCGUID lpcGUID, LPDIRECTMUSICTRACK8* ppTrack, LPUNKNOWN pUnkOuter);
extern HRESULT WINAPI DMUSIC_CreateDirectMusicScriptTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter);
/*****************************************************************************
* IDirectMusicScriptImpl implementation structure
*/
struct IDirectMusicScriptImpl
{
struct IDirectMusicScriptImpl {
/* IUnknown fields */
ICOM_VFIELD(IDirectMusicScript);
ICOM_VTABLE(IUnknown) *UnknownVtbl;
ICOM_VTABLE(IDirectMusicScript) *ScriptVtbl;
ICOM_VTABLE(IDirectMusicObject) *ObjectVtbl;
ICOM_VTABLE(IPersistStream) *PersistStreamVtbl;
DWORD ref;
/* IDirectMusicScriptImpl fields */
IDirectMusicScriptObject* pObject;
};
/* IUnknown: */
extern HRESULT WINAPI IDirectMusicScriptImpl_QueryInterface (LPDIRECTMUSICSCRIPT iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicScriptImpl_AddRef (LPDIRECTMUSICSCRIPT iface);
extern ULONG WINAPI IDirectMusicScriptImpl_Release (LPDIRECTMUSICSCRIPT iface);
/* IDirectMusicScript: */
extern HRESULT WINAPI IDirectMusicScriptImpl_Init (LPDIRECTMUSICSCRIPT iface, IDirectMusicPerformance* pPerformance, DMUS_SCRIPT_ERRORINFO* pErrorInfo);
extern HRESULT WINAPI IDirectMusicScriptImpl_CallRoutine (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszRoutineName, DMUS_SCRIPT_ERRORINFO* pErrorInfo);
extern HRESULT WINAPI IDirectMusicScriptImpl_SetVariableVariant (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, VARIANT varValue, BOOL fSetRef, DMUS_SCRIPT_ERRORINFO* pErrorInfo);
extern HRESULT WINAPI IDirectMusicScriptImpl_GetVariableVariant (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, VARIANT* pvarValue, DMUS_SCRIPT_ERRORINFO* pErrorInfo);
extern HRESULT WINAPI IDirectMusicScriptImpl_SetVariableNumber (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, LONG lValue, DMUS_SCRIPT_ERRORINFO* pErrorInfo);
extern HRESULT WINAPI IDirectMusicScriptImpl_GetVariableNumber (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, LONG* plValue, DMUS_SCRIPT_ERRORINFO* pErrorInfo);
extern HRESULT WINAPI IDirectMusicScriptImpl_SetVariableObject (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, IUnknown* punkValue, DMUS_SCRIPT_ERRORINFO* pErrorInfo);
extern HRESULT WINAPI IDirectMusicScriptImpl_GetVariableObject (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, REFIID riid, LPVOID* ppv, DMUS_SCRIPT_ERRORINFO* pErrorInfo);
extern HRESULT WINAPI IDirectMusicScriptImpl_EnumRoutine (LPDIRECTMUSICSCRIPT iface, DWORD dwIndex, WCHAR* pwszName);
extern HRESULT WINAPI IDirectMusicScriptImpl_EnumVariable (LPDIRECTMUSICSCRIPT iface, DWORD dwIndex, WCHAR* pwszName);
/*****************************************************************************
* IDirectMusicScriptObject implementation structure
*/
struct IDirectMusicScriptObject
{
/* IUnknown fields */
ICOM_VFIELD(IDirectMusicObject);
DWORD ref;
/* IDirectMusicObjectImpl fields */
LPDMUS_OBJECTDESC pDesc;
IDirectMusicScriptObjectStream* pStream;
IDirectMusicScriptImpl* pScript;
};
/* IUnknown: */
extern HRESULT WINAPI IDirectMusicScriptObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicScriptObject_AddRef (LPDIRECTMUSICOBJECT iface);
extern ULONG WINAPI IDirectMusicScriptObject_Release (LPDIRECTMUSICOBJECT iface);
extern HRESULT WINAPI IDirectMusicScriptImpl_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicScriptImpl_IUnknown_AddRef (LPUNKNOWN iface);
extern ULONG WINAPI IDirectMusicScriptImpl_IUnknown_Release (LPUNKNOWN iface);
/* IDirectMusicScript: */
extern HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicScript_QueryInterface (LPDIRECTMUSICSCRIPT iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicScriptImpl_IDirectMusicScript_AddRef (LPDIRECTMUSICSCRIPT iface);
extern ULONG WINAPI IDirectMusicScriptImpl_IDirectMusicScript_Release (LPDIRECTMUSICSCRIPT iface);
extern HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicScript_Init (LPDIRECTMUSICSCRIPT iface, IDirectMusicPerformance* pPerformance, DMUS_SCRIPT_ERRORINFO* pErrorInfo);
extern HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicScript_CallRoutine (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszRoutineName, DMUS_SCRIPT_ERRORINFO* pErrorInfo);
extern HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicScript_SetVariableVariant (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, VARIANT varValue, BOOL fSetRef, DMUS_SCRIPT_ERRORINFO* pErrorInfo);
extern HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicScript_GetVariableVariant (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, VARIANT* pvarValue, DMUS_SCRIPT_ERRORINFO* pErrorInfo);
extern HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicScript_SetVariableNumber (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, LONG lValue, DMUS_SCRIPT_ERRORINFO* pErrorInfo);
extern HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicScript_GetVariableNumber (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, LONG* plValue, DMUS_SCRIPT_ERRORINFO* pErrorInfo);
extern HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicScript_SetVariableObject (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, IUnknown* punkValue, DMUS_SCRIPT_ERRORINFO* pErrorInfo);
extern HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicScript_GetVariableObject (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, REFIID riid, LPVOID* ppv, DMUS_SCRIPT_ERRORINFO* pErrorInfo);
extern HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicScript_EnumRoutine (LPDIRECTMUSICSCRIPT iface, DWORD dwIndex, WCHAR* pwszName);
extern HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicScript_EnumVariable (LPDIRECTMUSICSCRIPT iface, DWORD dwIndex, WCHAR* pwszName);
/* IDirectMusicObject: */
extern HRESULT WINAPI IDirectMusicScriptObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc);
extern HRESULT WINAPI IDirectMusicScriptObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc);
extern HRESULT WINAPI IDirectMusicScriptObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc);
/*****************************************************************************
* IDirectMusicScriptObjectStream implementation structure
*/
struct IDirectMusicScriptObjectStream
{
/* IUnknown fields */
ICOM_VFIELD (IPersistStream);
DWORD ref;
/* IPersistStreamImpl fields */
IDirectMusicScriptObject* pParentObject;
};
/* IUnknown: */
extern HRESULT WINAPI IDirectMusicScriptObjectStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject);
extern ULONG WINAPI IDirectMusicScriptObjectStream_AddRef (LPPERSISTSTREAM iface);
extern ULONG WINAPI IDirectMusicScriptObjectStream_Release (LPPERSISTSTREAM iface);
/* IPersist: */
extern HRESULT WINAPI IDirectMusicScriptObjectStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID);
extern HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicScriptImpl_IDirectMusicObject_AddRef (LPDIRECTMUSICOBJECT iface);
extern ULONG WINAPI IDirectMusicScriptImpl_IDirectMusicObject_Release (LPDIRECTMUSICOBJECT iface);
extern HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc);
extern HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc);
extern HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc);
/* IPersistStream: */
extern HRESULT WINAPI IDirectMusicScriptObjectStream_IsDirty (LPPERSISTSTREAM iface);
extern HRESULT WINAPI IDirectMusicScriptObjectStream_Load (LPPERSISTSTREAM iface, IStream* pStm);
extern HRESULT WINAPI IDirectMusicScriptObjectStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty);
extern HRESULT WINAPI IDirectMusicScriptObjectStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize);
extern HRESULT WINAPI IDirectMusicScriptImpl_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject);
extern ULONG WINAPI IDirectMusicScriptImpl_IPersistStream_AddRef (LPPERSISTSTREAM iface);
extern ULONG WINAPI IDirectMusicScriptImpl_IPersistStream_Release (LPPERSISTSTREAM iface);
extern HRESULT WINAPI IDirectMusicScriptImpl_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID);
extern HRESULT WINAPI IDirectMusicScriptImpl_IPersistStream_IsDirty (LPPERSISTSTREAM iface);
extern HRESULT WINAPI IDirectMusicScriptImpl_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm);
extern HRESULT WINAPI IDirectMusicScriptImpl_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty);
extern HRESULT WINAPI IDirectMusicScriptImpl_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize);
/*****************************************************************************
* IDirectMusicScriptTrack implementation structure
*/
struct IDirectMusicScriptTrack
{
struct IDirectMusicScriptTrack {
/* IUnknown fields */
ICOM_VFIELD(IDirectMusicTrack8);
ICOM_VTABLE(IUnknown) *UnknownVtbl;
ICOM_VTABLE(IDirectMusicTrack8) *TrackVtbl;
ICOM_VTABLE(IPersistStream) *PersistStreamVtbl;
DWORD ref;
/* IDirectMusicScriptTrack fields */
IDirectMusicScriptTrackStream* pStream;
LPDMUS_OBJECTDESC pDesc;
};
/* IUnknown: */
extern HRESULT WINAPI IDirectMusicScriptTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicScriptTrack_AddRef (LPDIRECTMUSICTRACK8 iface);
extern ULONG WINAPI IDirectMusicScriptTrack_Release (LPDIRECTMUSICTRACK8 iface);
/* IDirectMusicTrack: */
extern HRESULT WINAPI IDirectMusicScriptTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment);
extern HRESULT WINAPI IDirectMusicScriptTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags);
extern HRESULT WINAPI IDirectMusicScriptTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData);
extern HRESULT WINAPI IDirectMusicScriptTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID);
extern HRESULT WINAPI IDirectMusicScriptTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam);
extern HRESULT WINAPI IDirectMusicScriptTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam);
extern HRESULT WINAPI IDirectMusicScriptTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType);
extern HRESULT WINAPI IDirectMusicScriptTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType);
extern HRESULT WINAPI IDirectMusicScriptTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType);
extern HRESULT WINAPI IDirectMusicScriptTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack);
/* IDirectMusicTrack8: */
extern HRESULT WINAPI IDirectMusicScriptTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID);
extern HRESULT WINAPI IDirectMusicScriptTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags);
extern HRESULT WINAPI IDirectMusicScriptTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags);
extern HRESULT WINAPI IDirectMusicScriptTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack);
extern HRESULT WINAPI IDirectMusicScriptTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack);
extern HRESULT WINAPI IDirectMusicScriptTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicScriptTrack_IUnknown_AddRef (LPUNKNOWN iface);
extern ULONG WINAPI IDirectMusicScriptTrack_IUnknown_Release (LPUNKNOWN iface);
/* IDirectMusicTrack(8): */
extern HRESULT WINAPI IDirectMusicScriptTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicScriptTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface);
extern ULONG WINAPI IDirectMusicScriptTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface);
extern HRESULT WINAPI IDirectMusicScriptTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment);
extern HRESULT WINAPI IDirectMusicScriptTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags);
extern HRESULT WINAPI IDirectMusicScriptTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData);
extern HRESULT WINAPI IDirectMusicScriptTrack_IDirectMusicTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID);
extern HRESULT WINAPI IDirectMusicScriptTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam);
extern HRESULT WINAPI IDirectMusicScriptTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam);
extern HRESULT WINAPI IDirectMusicScriptTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType);
extern HRESULT WINAPI IDirectMusicScriptTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType);
extern HRESULT WINAPI IDirectMusicScriptTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType);
extern HRESULT WINAPI IDirectMusicScriptTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack);
extern HRESULT WINAPI IDirectMusicScriptTrack_IDirectMusicTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID);
extern HRESULT WINAPI IDirectMusicScriptTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags);
extern HRESULT WINAPI IDirectMusicScriptTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags);
extern HRESULT WINAPI IDirectMusicScriptTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack);
extern HRESULT WINAPI IDirectMusicScriptTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack);
/* IPersistStream: */
extern HRESULT WINAPI IDirectMusicScriptTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject);
extern ULONG WINAPI IDirectMusicScriptTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface);
extern ULONG WINAPI IDirectMusicScriptTrack_IPersistStream_Release (LPPERSISTSTREAM iface);
extern HRESULT WINAPI IDirectMusicScriptTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID);
extern HRESULT WINAPI IDirectMusicScriptTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface);
extern HRESULT WINAPI IDirectMusicScriptTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm);
extern HRESULT WINAPI IDirectMusicScriptTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty);
extern HRESULT WINAPI IDirectMusicScriptTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize);
/*****************************************************************************
* IDirectMusicScriptTrackStream implementation structure
* Misc.
*/
struct IDirectMusicScriptTrackStream
{
/* IUnknown fields */
ICOM_VFIELD (IPersistStream);
DWORD ref;
/* for simpler reading */
typedef struct _DMUS_PRIVATE_CHUNK {
FOURCC fccID; /* FOURCC ID of the chunk */
DWORD dwSize; /* size of the chunk */
} DMUS_PRIVATE_CHUNK, *LPDMUS_PRIVATE_CHUNK;
/* IPersistStreamImpl fields */
IDirectMusicScriptTrack* pParentTrack;
};
/* check whether the given DWORD is even (return 0) or odd (return 1) */
static inline int even_or_odd (DWORD number) {
return (number & 0x1); /* basically, check if bit 0 is set ;) */
}
/* IUnknown: */
extern HRESULT WINAPI IDirectMusicScriptTrackStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject);
extern ULONG WINAPI IDirectMusicScriptTrackStream_AddRef (LPPERSISTSTREAM iface);
extern ULONG WINAPI IDirectMusicScriptTrackStream_Release (LPPERSISTSTREAM iface);
/* IPersist: */
extern HRESULT WINAPI IDirectMusicScriptTrackStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID);
/* IPersistStream: */
extern HRESULT WINAPI IDirectMusicScriptTrackStream_IsDirty (LPPERSISTSTREAM iface);
extern HRESULT WINAPI IDirectMusicScriptTrackStream_Load (LPPERSISTSTREAM iface, IStream* pStm);
extern HRESULT WINAPI IDirectMusicScriptTrackStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty);
extern HRESULT WINAPI IDirectMusicScriptTrackStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize);
/* FOURCC to string conversion for debug messages */
static inline const char *debugstr_fourcc (DWORD fourcc) {
if (!fourcc) return "'null'";
return wine_dbg_sprintf ("\'%c%c%c%c\'",
(char)(fourcc), (char)(fourcc >> 8),
(char)(fourcc >> 16), (char)(fourcc >> 24));
}
/* DMUS_VERSION struct to string conversion for debug messages */
static inline const char *debugstr_dmversion (LPDMUS_VERSION version) {
if (!version) return "'null'";
return wine_dbg_sprintf ("\'%i,%i,%i,%i\'",
(int)((version->dwVersionMS && 0xFFFF0000) >> 8), (int)(version->dwVersionMS && 0x0000FFFF),
(int)((version->dwVersionLS && 0xFFFF0000) >> 8), (int)(version->dwVersionLS && 0x0000FFFF));
}
/* used for initialising structs (primarily for DMUS_OBJECTDESC) */
#define DM_STRUCT_INIT(x) \
do { \
memset((x), 0, sizeof(*(x))); \
(x)->dwSize = sizeof(*x); \
} while (0)
/* used for generic dumping (copied from ddraw) */
typedef struct {
DWORD val;
const char* name;
} flag_info;
#define FE(x) { x, #x }
#define DMUSIC_dump_flags(flags,names,num_names) DMUSIC_dump_flags_(flags, names, num_names, 1)
/* generic dump function */
static inline void DMUSIC_dump_flags_ (DWORD flags, const flag_info* names, size_t num_names, int newline) {
unsigned int i;
for (i=0; i < num_names; i++) {
if ((flags & names[i].val) || /* standard flag value */
((!flags) && (!names[i].val))) /* zero value only */
DPRINTF("%s ", names[i].name);
}
if (newline) DPRINTF("\n");
}
static inline void DMUSIC_dump_DMUS_OBJ_FLAGS (DWORD flagmask) {
static const flag_info flags[] = {
FE(DMUS_OBJ_OBJECT),
FE(DMUS_OBJ_CLASS),
FE(DMUS_OBJ_NAME),
FE(DMUS_OBJ_CATEGORY),
FE(DMUS_OBJ_FILENAME),
FE(DMUS_OBJ_FULLPATH),
FE(DMUS_OBJ_URL),
FE(DMUS_OBJ_VERSION),
FE(DMUS_OBJ_DATE),
FE(DMUS_OBJ_LOADED),
FE(DMUS_OBJ_MEMORY),
FE(DMUS_OBJ_STREAM)
};
DMUSIC_dump_flags(flagmask, flags, sizeof(flags)/sizeof(flags[0]));
}
static inline void DMUSIC_dump_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) {
if (pDesc) {
DPRINTF("DMUS_OBJECTDESC (%p)\n", pDesc);
DPRINTF(" - dwSize = %ld\n", pDesc->dwSize);
DPRINTF(" - dwValidData = ");
DMUSIC_dump_DMUS_OBJ_FLAGS (pDesc->dwValidData);
if (pDesc->dwValidData & DMUS_OBJ_CLASS) DPRINTF(" - guidClass = %s\n", debugstr_guid(&pDesc->guidClass));
if (pDesc->dwValidData & DMUS_OBJ_OBJECT) DPRINTF(" - guidObject = %s\n", debugstr_guid(&pDesc->guidObject));
if (pDesc->dwValidData & DMUS_OBJ_DATE) DPRINTF(" - ftDate = FIXME\n");
if (pDesc->dwValidData & DMUS_OBJ_VERSION) DPRINTF(" - vVersion = %s\n", debugstr_dmversion(&pDesc->vVersion));
if (pDesc->dwValidData & DMUS_OBJ_NAME) DPRINTF(" - wszName = %s\n", debugstr_w(pDesc->wszName));
if (pDesc->dwValidData & DMUS_OBJ_CATEGORY) DPRINTF(" - wszCategory = %s\n", debugstr_w(pDesc->wszCategory));
if (pDesc->dwValidData & DMUS_OBJ_FILENAME) DPRINTF(" - wszFileName = %s\n", debugstr_w(pDesc->wszFileName));
if (pDesc->dwValidData & DMUS_OBJ_MEMORY) DPRINTF(" - llMemLength = %lli\n - pbMemData = %p\n", pDesc->llMemLength, pDesc->pbMemData);
if (pDesc->dwValidData & DMUS_OBJ_STREAM) DPRINTF(" - pStream = %p\n", pDesc->pStream);
} else {
DPRINTF("(NULL)\n");
}
}
#endif /* __WINE_DMSCRIPT_PRIVATE_H */

View File

@ -18,21 +18,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdarg.h>
#include <string.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winreg.h"
#include "winerror.h"
#include "dmusics.h"
#include "dmusici.h"
#include "dmplugin.h"
#include "wine/debug.h"
#include "dmscript_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmscript);
@ -44,8 +30,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(dmscript);
/***********************************************************************
* interface for self-registering
*/
struct regsvr_interface
{
struct regsvr_interface {
IID const *iid; /* NULL for end of list */
LPCSTR name; /* can be NULL to omit */
IID const *base_iid; /* can be NULL to omit */
@ -57,8 +42,7 @@ struct regsvr_interface
static HRESULT register_interfaces(struct regsvr_interface const *list);
static HRESULT unregister_interfaces(struct regsvr_interface const *list);
struct regsvr_coclass
{
struct regsvr_coclass {
CLSID const *clsid; /* NULL for end of list */
LPCSTR name; /* can be NULL to omit */
LPCSTR ips; /* can be NULL to omit */
@ -124,8 +108,7 @@ static LONG recursive_delete_keyW(HKEY base, WCHAR const *name);
/***********************************************************************
* register_interfaces
*/
static HRESULT register_interfaces(struct regsvr_interface const *list)
{
static HRESULT register_interfaces(struct regsvr_interface const *list) {
LONG res = ERROR_SUCCESS;
HKEY interface_key;
@ -194,8 +177,7 @@ error_return:
/***********************************************************************
* unregister_interfaces
*/
static HRESULT unregister_interfaces(struct regsvr_interface const *list)
{
static HRESULT unregister_interfaces(struct regsvr_interface const *list) {
LONG res = ERROR_SUCCESS;
HKEY interface_key;
@ -219,8 +201,7 @@ error_return:
/***********************************************************************
* register_coclasses
*/
static HRESULT register_coclasses(struct regsvr_coclass const *list)
{
static HRESULT register_coclasses(struct regsvr_coclass const *list) {
LONG res = ERROR_SUCCESS;
HKEY coclass_key;
@ -301,8 +282,7 @@ error_return:
/***********************************************************************
* unregister_coclasses
*/
static HRESULT unregister_coclasses(struct regsvr_coclass const *list)
{
static HRESULT unregister_coclasses(struct regsvr_coclass const *list) {
LONG res = ERROR_SUCCESS;
HKEY coclass_key;
@ -338,8 +318,7 @@ error_return:
/***********************************************************************
* regsvr_key_guid
*/
static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid)
{
static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid) {
WCHAR buf[39];
StringFromGUID2(guid, buf, 39);
@ -352,8 +331,7 @@ static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid)
static LONG register_key_defvalueW(
HKEY base,
WCHAR const *name,
WCHAR const *value)
{
WCHAR const *value) {
LONG res;
HKEY key;
@ -372,8 +350,7 @@ static LONG register_key_defvalueW(
static LONG register_key_defvalueA(
HKEY base,
WCHAR const *name,
char const *value)
{
char const *value) {
LONG res;
HKEY key;
@ -394,8 +371,7 @@ static LONG register_progid(
char const *progid,
char const *curver_progid,
char const *name,
char const *extra)
{
char const *extra) {
LONG res;
HKEY progid_key;
@ -439,8 +415,7 @@ error_close_progid_key:
/***********************************************************************
* recursive_delete_key
*/
static LONG recursive_delete_key(HKEY key)
{
static LONG recursive_delete_key(HKEY key) {
LONG res;
WCHAR subkey_name[MAX_PATH];
DWORD cName;
@ -471,8 +446,7 @@ static LONG recursive_delete_key(HKEY key)
/***********************************************************************
* recursive_delete_keyA
*/
static LONG recursive_delete_keyA(HKEY base, char const *name)
{
static LONG recursive_delete_keyA(HKEY base, char const *name) {
LONG res;
HKEY key;
@ -487,8 +461,7 @@ static LONG recursive_delete_keyA(HKEY base, char const *name)
/***********************************************************************
* recursive_delete_keyW
*/
static LONG recursive_delete_keyW(HKEY base, WCHAR const *name)
{
static LONG recursive_delete_keyW(HKEY base, WCHAR const *name) {
LONG res;
HKEY key;
@ -599,8 +572,7 @@ static struct regsvr_interface const interface_list[] = {
/***********************************************************************
* DllRegisterServer (DMSCRIPT.3)
*/
HRESULT WINAPI DMSCRIPT_DllRegisterServer(void)
{
HRESULT WINAPI DMSCRIPT_DllRegisterServer(void) {
HRESULT hr;
TRACE("\n");
@ -614,8 +586,7 @@ HRESULT WINAPI DMSCRIPT_DllRegisterServer(void)
/***********************************************************************
* DllUnregisterServer (DMSCRIPT.4)
*/
HRESULT WINAPI DMSCRIPT_DllUnregisterServer(void)
{
HRESULT WINAPI DMSCRIPT_DllUnregisterServer(void) {
HRESULT hr;
TRACE("\n");

View File

@ -1,6 +1,6 @@
/* IDirectMusicScript
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -17,27 +17,33 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "dmscript_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmscript);
WINE_DECLARE_DEBUG_CHANNEL(dmfile);
/* IDirectMusicScript IUnknown part: */
HRESULT WINAPI IDirectMusicScriptImpl_QueryInterface (LPDIRECTMUSICSCRIPT iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicScriptImpl,iface);
if (IsEqualIID(riid, &IID_IUnknown) ||
IsEqualIID(riid, &IID_IDirectMusicScript)) {
IDirectMusicScriptImpl_AddRef(iface);
*ppobj = This;
/*****************************************************************************
* IDirectMusicScriptImpl implementation
*/
/* IDirectMusicScriptImpl IUnknown part: */
HRESULT WINAPI IDirectMusicScriptImpl_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicScriptImpl, UnknownVtbl, iface);
if (IsEqualIID (riid, &IID_IUnknown)) {
*ppobj = (LPVOID)&This->UnknownVtbl;
IDirectMusicScriptImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicScript)) {
*ppobj = (LPVOID)&This->ScriptVtbl;
IDirectMusicScriptImpl_IDirectMusicScript_AddRef ((LPDIRECTMUSICSCRIPT)&This->ScriptVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicObject)) {
*ppobj = (LPVOID)&This->ObjectVtbl;
IDirectMusicScriptImpl_IDirectMusicObject_AddRef ((LPDIRECTMUSICOBJECT)&This->ObjectVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IPersistStream)) {
*ppobj = (LPVOID)&This->PersistStreamVtbl;
IDirectMusicScriptImpl_IPersistStream_AddRef ((LPPERSISTSTREAM)&This->PersistStreamVtbl);
return S_OK;
}
@ -45,16 +51,14 @@ HRESULT WINAPI IDirectMusicScriptImpl_QueryInterface (LPDIRECTMUSICSCRIPT iface,
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicScriptImpl_AddRef (LPDIRECTMUSICSCRIPT iface)
{
ICOM_THIS(IDirectMusicScriptImpl,iface);
ULONG WINAPI IDirectMusicScriptImpl_IUnknown_AddRef (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicScriptImpl, UnknownVtbl, iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicScriptImpl_Release (LPDIRECTMUSICSCRIPT iface)
{
ICOM_THIS(IDirectMusicScriptImpl,iface);
ULONG WINAPI IDirectMusicScriptImpl_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicScriptImpl, UnknownVtbl, iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
@ -63,328 +67,538 @@ ULONG WINAPI IDirectMusicScriptImpl_Release (LPDIRECTMUSICSCRIPT iface)
return ref;
}
/* IDirectMusicScript IDirectMusicScript part: */
HRESULT WINAPI IDirectMusicScriptImpl_Init (LPDIRECTMUSICSCRIPT iface, IDirectMusicPerformance* pPerformance, DMUS_SCRIPT_ERRORINFO* pErrorInfo)
{
ICOM_THIS(IDirectMusicScriptImpl,iface);
ICOM_VTABLE(IUnknown) DirectMusicScript_Unknown_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicScriptImpl_IUnknown_QueryInterface,
IDirectMusicScriptImpl_IUnknown_AddRef,
IDirectMusicScriptImpl_IUnknown_Release
};
/* IDirectMusicScriptImpl IDirectMusicScript part: */
HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicScript_QueryInterface (LPDIRECTMUSICSCRIPT iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicScriptImpl, ScriptVtbl, iface);
return IDirectMusicScriptImpl_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicScriptImpl_IDirectMusicScript_AddRef (LPDIRECTMUSICSCRIPT iface) {
ICOM_THIS_MULTI(IDirectMusicScriptImpl, ScriptVtbl, iface);
return IDirectMusicScriptImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicScriptImpl_IDirectMusicScript_Release (LPDIRECTMUSICSCRIPT iface) {
ICOM_THIS_MULTI(IDirectMusicScriptImpl, ScriptVtbl, iface);
return IDirectMusicScriptImpl_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicScript_Init (LPDIRECTMUSICSCRIPT iface, IDirectMusicPerformance* pPerformance, DMUS_SCRIPT_ERRORINFO* pErrorInfo) {
ICOM_THIS_MULTI(IDirectMusicScriptImpl, ScriptVtbl, iface);
FIXME("(%p, %p, %p): stub\n", This, pPerformance, pErrorInfo);
return S_OK;
}
HRESULT WINAPI IDirectMusicScriptImpl_CallRoutine (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszRoutineName, DMUS_SCRIPT_ERRORINFO* pErrorInfo)
{
ICOM_THIS(IDirectMusicScriptImpl,iface);
HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicScript_CallRoutine (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszRoutineName, DMUS_SCRIPT_ERRORINFO* pErrorInfo) {
ICOM_THIS_MULTI(IDirectMusicScriptImpl, ScriptVtbl, iface);
FIXME("(%p, %s, %p): stub\n", This, debugstr_w(pwszRoutineName), pErrorInfo);
return S_OK;
}
HRESULT WINAPI IDirectMusicScriptImpl_SetVariableVariant (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, VARIANT varValue, BOOL fSetRef, DMUS_SCRIPT_ERRORINFO* pErrorInfo)
{
ICOM_THIS(IDirectMusicScriptImpl,iface);
HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicScript_SetVariableVariant (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, VARIANT varValue, BOOL fSetRef, DMUS_SCRIPT_ERRORINFO* pErrorInfo) {
ICOM_THIS_MULTI(IDirectMusicScriptImpl, ScriptVtbl, iface);
FIXME("(%p, %p, FIXME, %d, %p): stub\n", This, pwszVariableName,/* varValue,*/ fSetRef, pErrorInfo);
return S_OK;
}
HRESULT WINAPI IDirectMusicScriptImpl_GetVariableVariant (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, VARIANT* pvarValue, DMUS_SCRIPT_ERRORINFO* pErrorInfo)
{
ICOM_THIS(IDirectMusicScriptImpl,iface);
HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicScript_GetVariableVariant (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, VARIANT* pvarValue, DMUS_SCRIPT_ERRORINFO* pErrorInfo) {
ICOM_THIS_MULTI(IDirectMusicScriptImpl, ScriptVtbl, iface);
FIXME("(%p, %p, %p, %p): stub\n", This, pwszVariableName, pvarValue, pErrorInfo);
return S_OK;
}
HRESULT WINAPI IDirectMusicScriptImpl_SetVariableNumber (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, LONG lValue, DMUS_SCRIPT_ERRORINFO* pErrorInfo)
{
ICOM_THIS(IDirectMusicScriptImpl,iface);
HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicScript_SetVariableNumber (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, LONG lValue, DMUS_SCRIPT_ERRORINFO* pErrorInfo) {
ICOM_THIS_MULTI(IDirectMusicScriptImpl, ScriptVtbl, iface);
FIXME("(%p, %p, %li, %p): stub\n", This, pwszVariableName, lValue, pErrorInfo);
return S_OK;
}
HRESULT WINAPI IDirectMusicScriptImpl_GetVariableNumber (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, LONG* plValue, DMUS_SCRIPT_ERRORINFO* pErrorInfo)
{
ICOM_THIS(IDirectMusicScriptImpl,iface);
HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicScript_GetVariableNumber (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, LONG* plValue, DMUS_SCRIPT_ERRORINFO* pErrorInfo) {
ICOM_THIS_MULTI(IDirectMusicScriptImpl, ScriptVtbl, iface);
FIXME("(%p, %p, %p, %p): stub\n", This, pwszVariableName, plValue, pErrorInfo);
return S_OK;
}
HRESULT WINAPI IDirectMusicScriptImpl_SetVariableObject (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, IUnknown* punkValue, DMUS_SCRIPT_ERRORINFO* pErrorInfo)
{
ICOM_THIS(IDirectMusicScriptImpl,iface);
HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicScript_SetVariableObject (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, IUnknown* punkValue, DMUS_SCRIPT_ERRORINFO* pErrorInfo) {
ICOM_THIS_MULTI(IDirectMusicScriptImpl, ScriptVtbl, iface);
FIXME("(%p, %p, %p, %p): stub\n", This, pwszVariableName, punkValue, pErrorInfo);
return S_OK;
}
HRESULT WINAPI IDirectMusicScriptImpl_GetVariableObject (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, REFIID riid, LPVOID* ppv, DMUS_SCRIPT_ERRORINFO* pErrorInfo)
{
ICOM_THIS(IDirectMusicScriptImpl,iface);
HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicScript_GetVariableObject (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, REFIID riid, LPVOID* ppv, DMUS_SCRIPT_ERRORINFO* pErrorInfo) {
ICOM_THIS_MULTI(IDirectMusicScriptImpl, ScriptVtbl, iface);
FIXME("(%p, %p, %s, %p, %p): stub\n", This, pwszVariableName, debugstr_guid(riid), ppv, pErrorInfo);
return S_OK;
}
HRESULT WINAPI IDirectMusicScriptImpl_EnumRoutine (LPDIRECTMUSICSCRIPT iface, DWORD dwIndex, WCHAR* pwszName)
{
ICOM_THIS(IDirectMusicScriptImpl,iface);
HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicScript_EnumRoutine (LPDIRECTMUSICSCRIPT iface, DWORD dwIndex, WCHAR* pwszName) {
ICOM_THIS_MULTI(IDirectMusicScriptImpl, ScriptVtbl, iface);
FIXME("(%p, %ld, %p): stub\n", This, dwIndex, pwszName);
return S_OK;
}
HRESULT WINAPI IDirectMusicScriptImpl_EnumVariable (LPDIRECTMUSICSCRIPT iface, DWORD dwIndex, WCHAR* pwszName)
{
ICOM_THIS(IDirectMusicScriptImpl,iface);
HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicScript_EnumVariable (LPDIRECTMUSICSCRIPT iface, DWORD dwIndex, WCHAR* pwszName) {
ICOM_THIS_MULTI(IDirectMusicScriptImpl, ScriptVtbl, iface);
FIXME("(%p, %ld, %p): stub\n", This, dwIndex, pwszName);
return S_OK;
}
ICOM_VTABLE(IDirectMusicScript) DirectMusicScript_Vtbl =
{
ICOM_VTABLE(IDirectMusicScript) DirectMusicScript_Script_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicScriptImpl_QueryInterface,
IDirectMusicScriptImpl_AddRef,
IDirectMusicScriptImpl_Release,
IDirectMusicScriptImpl_Init,
IDirectMusicScriptImpl_CallRoutine,
IDirectMusicScriptImpl_SetVariableVariant,
IDirectMusicScriptImpl_GetVariableVariant,
IDirectMusicScriptImpl_SetVariableNumber,
IDirectMusicScriptImpl_GetVariableNumber,
IDirectMusicScriptImpl_SetVariableObject,
IDirectMusicScriptImpl_GetVariableObject,
IDirectMusicScriptImpl_EnumRoutine,
IDirectMusicScriptImpl_EnumVariable
IDirectMusicScriptImpl_IDirectMusicScript_QueryInterface,
IDirectMusicScriptImpl_IDirectMusicScript_AddRef,
IDirectMusicScriptImpl_IDirectMusicScript_Release,
IDirectMusicScriptImpl_IDirectMusicScript_Init,
IDirectMusicScriptImpl_IDirectMusicScript_CallRoutine,
IDirectMusicScriptImpl_IDirectMusicScript_SetVariableVariant,
IDirectMusicScriptImpl_IDirectMusicScript_GetVariableVariant,
IDirectMusicScriptImpl_IDirectMusicScript_SetVariableNumber,
IDirectMusicScriptImpl_IDirectMusicScript_GetVariableNumber,
IDirectMusicScriptImpl_IDirectMusicScript_SetVariableObject,
IDirectMusicScriptImpl_IDirectMusicScript_GetVariableObject,
IDirectMusicScriptImpl_IDirectMusicScript_EnumRoutine,
IDirectMusicScriptImpl_IDirectMusicScript_EnumVariable
};
/* IDirectMusicScriptImpl IDirectMusicObject part: */
HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicScriptImpl, ObjectVtbl, iface);
return IDirectMusicScriptImpl_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicScriptImpl_IDirectMusicObject_AddRef (LPDIRECTMUSICOBJECT iface) {
ICOM_THIS_MULTI(IDirectMusicScriptImpl, ObjectVtbl, iface);
return IDirectMusicScriptImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicScriptImpl_IDirectMusicObject_Release (LPDIRECTMUSICOBJECT iface) {
ICOM_THIS_MULTI(IDirectMusicScriptImpl, ObjectVtbl, iface);
return IDirectMusicScriptImpl_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc) {
ICOM_THIS_MULTI(IDirectMusicScriptImpl, ObjectVtbl, iface);
TRACE("(%p, %p)\n", This, pDesc);
/* I think we shouldn't return pointer here since then values can be changed; it'd be a mess */
memcpy (pDesc, This->pDesc, This->pDesc->dwSize);
return S_OK;
}
HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc) {
ICOM_THIS_MULTI(IDirectMusicScriptImpl, ObjectVtbl, iface);
TRACE("(%p, %p): setting descriptor:\n", This, pDesc);
if (TRACE_ON(dmscript)) {
DMUSIC_dump_DMUS_OBJECTDESC (pDesc);
}
/* According to MSDN, we should copy only given values, not whole struct */
if (pDesc->dwValidData & DMUS_OBJ_OBJECT)
memcpy (&This->pDesc->guidObject, &pDesc->guidObject, sizeof (pDesc->guidObject));
if (pDesc->dwValidData & DMUS_OBJ_CLASS)
memcpy (&This->pDesc->guidClass, &pDesc->guidClass, sizeof (pDesc->guidClass));
if (pDesc->dwValidData & DMUS_OBJ_NAME)
strncpyW (This->pDesc->wszName, pDesc->wszName, DMUS_MAX_NAME);
if (pDesc->dwValidData & DMUS_OBJ_CATEGORY)
strncpyW (This->pDesc->wszCategory, pDesc->wszCategory, DMUS_MAX_CATEGORY);
if (pDesc->dwValidData & DMUS_OBJ_FILENAME)
strncpyW (This->pDesc->wszFileName, pDesc->wszFileName, DMUS_MAX_FILENAME);
if (pDesc->dwValidData & DMUS_OBJ_VERSION)
memcpy (&This->pDesc->vVersion, &pDesc->vVersion, sizeof (pDesc->vVersion));
if (pDesc->dwValidData & DMUS_OBJ_DATE)
memcpy (&This->pDesc->ftDate, &pDesc->ftDate, sizeof (pDesc->ftDate));
if (pDesc->dwValidData & DMUS_OBJ_MEMORY) {
memcpy (&This->pDesc->llMemLength, &pDesc->llMemLength, sizeof (pDesc->llMemLength));
memcpy (This->pDesc->pbMemData, pDesc->pbMemData, sizeof (pDesc->pbMemData));
}
if (pDesc->dwValidData & DMUS_OBJ_STREAM) {
/* according to MSDN, we copy the stream */
IStream_Clone (pDesc->pStream, &This->pDesc->pStream);
}
/* add new flags */
This->pDesc->dwValidData |= pDesc->dwValidData;
return S_OK;
}
HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc) {
ICOM_THIS_MULTI(IDirectMusicScriptImpl, ObjectVtbl, iface);
DMUS_PRIVATE_CHUNK Chunk;
DWORD StreamSize, StreamCount, ListSize[1], ListCount[1];
LARGE_INTEGER liMove; /* used when skipping chunks */
TRACE("(%p, %p, %p)\n", This, pStream, pDesc);
/* FIXME: should this be determined from stream? */
pDesc->dwValidData |= DMUS_OBJ_CLASS;
memcpy (&pDesc->guidClass, &CLSID_DirectMusicScript, sizeof(CLSID));
IStream_Read (pStream, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
TRACE_(dmfile)(": %s chunk (size = 0x%04lx)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
switch (Chunk.fccID) {
case FOURCC_RIFF: {
IStream_Read (pStream, &Chunk.fccID, sizeof(FOURCC), NULL);
TRACE_(dmfile)(": RIFF chunk of type %s", debugstr_fourcc(Chunk.fccID));
StreamSize = Chunk.dwSize - sizeof(FOURCC);
StreamCount = 0;
if (Chunk.fccID == DMUS_FOURCC_SCRIPT_FORM) {
TRACE_(dmfile)(": script form\n");
do {
IStream_Read (pStream, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
StreamCount += sizeof(FOURCC) + sizeof(DWORD) + Chunk.dwSize;
TRACE_(dmfile)(": %s chunk (size = 0x%04lx)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
switch (Chunk.fccID) {
case DMUS_FOURCC_GUID_CHUNK: {
TRACE_(dmfile)(": GUID chunk\n");
pDesc->dwValidData |= DMUS_OBJ_OBJECT;
IStream_Read (pStream, &pDesc->guidObject, Chunk.dwSize, NULL);
break;
}
case DMUS_FOURCC_VERSION_CHUNK: {
TRACE_(dmfile)(": version chunk\n");
pDesc->dwValidData |= DMUS_OBJ_VERSION;
IStream_Read (pStream, &pDesc->vVersion, Chunk.dwSize, NULL);
break;
}
case DMUS_FOURCC_CATEGORY_CHUNK: {
TRACE_(dmfile)(": category chunk\n");
pDesc->dwValidData |= DMUS_OBJ_CATEGORY;
IStream_Read (pStream, pDesc->wszCategory, Chunk.dwSize, NULL);
break;
}
case FOURCC_LIST: {
IStream_Read (pStream, &Chunk.fccID, sizeof(FOURCC), NULL);
TRACE_(dmfile)(": LIST chunk of type %s", debugstr_fourcc(Chunk.fccID));
ListSize[0] = Chunk.dwSize - sizeof(FOURCC);
ListCount[0] = 0;
switch (Chunk.fccID) {
/* evil M$ UNFO list, which can (!?) contain INFO elements */
case DMUS_FOURCC_UNFO_LIST: {
TRACE_(dmfile)(": UNFO list\n");
do {
IStream_Read (pStream, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
ListCount[0] += sizeof(FOURCC) + sizeof(DWORD) + Chunk.dwSize;
TRACE_(dmfile)(": %s chunk (size = 0x%04lx)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
switch (Chunk.fccID) {
/* don't ask me why, but M$ puts INFO elements in UNFO list sometimes
(though strings seem to be valid unicode) */
case mmioFOURCC('I','N','A','M'):
case DMUS_FOURCC_UNAM_CHUNK: {
TRACE_(dmfile)(": name chunk\n");
pDesc->dwValidData |= DMUS_OBJ_NAME;
IStream_Read (pStream, pDesc->wszName, Chunk.dwSize, NULL);
break;
}
case mmioFOURCC('I','A','R','T'):
case DMUS_FOURCC_UART_CHUNK: {
TRACE_(dmfile)(": artist chunk (ignored)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','C','O','P'):
case DMUS_FOURCC_UCOP_CHUNK: {
TRACE_(dmfile)(": copyright chunk (ignored)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','S','B','J'):
case DMUS_FOURCC_USBJ_CHUNK: {
TRACE_(dmfile)(": subject chunk (ignored)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','C','M','T'):
case DMUS_FOURCC_UCMT_CHUNK: {
TRACE_(dmfile)(": comment chunk (ignored)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (irrevelant & skipping)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
TRACE_(dmfile)(": ListCount[0] = %ld < ListSize[0] = %ld\n", ListCount[0], ListSize[0]);
} while (ListCount[0] < ListSize[0]);
break;
}
default: {
TRACE_(dmfile)(": unknown (skipping)\n");
liMove.QuadPart = Chunk.dwSize - sizeof(FOURCC);
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (irrevelant & skipping)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
TRACE_(dmfile)(": StreamCount[0] = %ld < StreamSize[0] = %ld\n", StreamCount, StreamSize);
} while (StreamCount < StreamSize);
break;
} else {
TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
liMove.QuadPart = StreamSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */
return E_FAIL;
}
TRACE_(dmfile)(": reading finished\n");
break;
}
default: {
TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */
return DMUS_E_INVALIDFILE;
}
}
TRACE(": returning descriptor:\n");
if (TRACE_ON(dmscript)) {
DMUSIC_dump_DMUS_OBJECTDESC (pDesc);
}
return S_OK;
}
ICOM_VTABLE(IDirectMusicObject) DirectMusicScript_Object_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicScriptImpl_IDirectMusicObject_QueryInterface,
IDirectMusicScriptImpl_IDirectMusicObject_AddRef,
IDirectMusicScriptImpl_IDirectMusicObject_Release,
IDirectMusicScriptImpl_IDirectMusicObject_GetDescriptor,
IDirectMusicScriptImpl_IDirectMusicObject_SetDescriptor,
IDirectMusicScriptImpl_IDirectMusicObject_ParseDescriptor
};
/* IDirectMusicScriptImpl IPersistStream part: */
HRESULT WINAPI IDirectMusicScriptImpl_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicScriptImpl, PersistStreamVtbl, iface);
return IDirectMusicScriptImpl_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicScriptImpl_IPersistStream_AddRef (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicScriptImpl, PersistStreamVtbl, iface);
return IDirectMusicScriptImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicScriptImpl_IPersistStream_Release (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicScriptImpl, PersistStreamVtbl, iface);
return IDirectMusicScriptImpl_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicScriptImpl_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicScriptImpl_IPersistStream_IsDirty (LPPERSISTSTREAM iface) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicScriptImpl_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm) {
ICOM_THIS_MULTI(IDirectMusicScriptImpl, PersistStreamVtbl, iface);
FOURCC chunkID;
DWORD chunkSize, StreamSize, StreamCount, ListSize[3], ListCount[3];
LARGE_INTEGER liMove; /* used when skipping chunks */
FIXME("(%p, %p): Loading not implemented yet\n", This, pStm);
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
IStream_Read (pStm, &chunkSize, sizeof(DWORD), NULL);
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (chunkID), chunkSize);
switch (chunkID) {
case FOURCC_RIFF: {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
TRACE_(dmfile)(": RIFF chunk of type %s", debugstr_fourcc(chunkID));
StreamSize = chunkSize - sizeof(FOURCC);
StreamCount = 0;
switch (chunkID) {
case DMUS_FOURCC_SCRIPT_FORM: {
TRACE_(dmfile)(": script form\n");
do {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
IStream_Read (pStm, &chunkSize, sizeof(FOURCC), NULL);
StreamCount += sizeof(FOURCC) + sizeof(DWORD) + chunkSize;
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (chunkID), chunkSize);
switch (chunkID) {
case DMUS_FOURCC_GUID_CHUNK: {
TRACE_(dmfile)(": GUID chunk\n");
This->pDesc->dwValidData |= DMUS_OBJ_OBJECT;
IStream_Read (pStm, &This->pDesc->guidObject, chunkSize, NULL);
break;
}
case DMUS_FOURCC_VERSION_CHUNK: {
TRACE_(dmfile)(": version chunk\n");
This->pDesc->dwValidData |= DMUS_OBJ_VERSION;
IStream_Read (pStm, &This->pDesc->vVersion, chunkSize, NULL);
break;
}
case DMUS_FOURCC_CATEGORY_CHUNK: {
TRACE_(dmfile)(": category chunk\n");
This->pDesc->dwValidData |= DMUS_OBJ_CATEGORY;
IStream_Read (pStm, This->pDesc->wszCategory, chunkSize, NULL);
break;
}
case FOURCC_LIST: {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
TRACE_(dmfile)(": LIST chunk of type %s", debugstr_fourcc(chunkID));
ListSize[0] = chunkSize - sizeof(FOURCC);
ListCount[0] = 0;
switch (chunkID) {
case DMUS_FOURCC_UNFO_LIST: {
TRACE_(dmfile)(": UNFO list\n");
do {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
IStream_Read (pStm, &chunkSize, sizeof(FOURCC), NULL);
ListCount[0] += sizeof(FOURCC) + sizeof(DWORD) + chunkSize;
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (chunkID), chunkSize);
switch (chunkID) {
/* don't ask me why, but M$ puts INFO elements in UNFO list sometimes
(though strings seem to be valid unicode) */
case mmioFOURCC('I','N','A','M'):
case DMUS_FOURCC_UNAM_CHUNK: {
TRACE_(dmfile)(": name chunk\n");
This->pDesc->dwValidData |= DMUS_OBJ_NAME;
IStream_Read (pStm, This->pDesc->wszName, chunkSize, NULL);
break;
}
case mmioFOURCC('I','A','R','T'):
case DMUS_FOURCC_UART_CHUNK: {
TRACE_(dmfile)(": artist chunk (ignored)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','C','O','P'):
case DMUS_FOURCC_UCOP_CHUNK: {
TRACE_(dmfile)(": copyright chunk (ignored)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','S','B','J'):
case DMUS_FOURCC_USBJ_CHUNK: {
TRACE_(dmfile)(": subject chunk (ignored)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','C','M','T'):
case DMUS_FOURCC_UCMT_CHUNK: {
TRACE_(dmfile)(": comment chunk (ignored)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (irrevelant & skipping)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
TRACE_(dmfile)(": ListCount[0] = %ld < ListSize[0] = %ld\n", ListCount[0], ListSize[0]);
} while (ListCount[0] < ListSize[0]);
break;
}
default: {
TRACE_(dmfile)(": unknown (skipping)\n");
liMove.QuadPart = chunkSize - sizeof(FOURCC);
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (irrevelant & skipping)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
TRACE_(dmfile)(": StreamCount[0] = %ld < StreamSize[0] = %ld\n", StreamCount, StreamSize);
} while (StreamCount < StreamSize);
break;
}
default: {
TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
liMove.QuadPart = StreamSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */
return E_FAIL;
}
}
TRACE_(dmfile)(": reading finished\n");
break;
}
default: {
TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */
return E_FAIL;
}
}
return S_OK;
}
HRESULT WINAPI IDirectMusicScriptImpl_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicScriptImpl_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) {
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicScript_PersistStream_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicScriptImpl_IPersistStream_QueryInterface,
IDirectMusicScriptImpl_IPersistStream_AddRef,
IDirectMusicScriptImpl_IPersistStream_Release,
IDirectMusicScriptImpl_IPersistStream_GetClassID,
IDirectMusicScriptImpl_IPersistStream_IsDirty,
IDirectMusicScriptImpl_IPersistStream_Load,
IDirectMusicScriptImpl_IPersistStream_Save,
IDirectMusicScriptImpl_IPersistStream_GetSizeMax
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicScript (LPCGUID lpcGUID, LPDIRECTMUSICSCRIPT* ppDMScript, LPUNKNOWN pUnkOuter)
{
IDirectMusicScriptImpl* dmscript;
HRESULT WINAPI DMUSIC_CreateDirectMusicScriptImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) {
IDirectMusicScriptImpl* obj;
TRACE("(%p,%p,%p)\n",lpcGUID, ppDMScript, pUnkOuter);
if (IsEqualIID (lpcGUID, &IID_IDirectMusicScript)) {
dmscript = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicScriptImpl));
if (NULL == dmscript) {
*ppDMScript = (LPDIRECTMUSICSCRIPT) NULL;
return E_OUTOFMEMORY;
}
dmscript->lpVtbl = &DirectMusicScript_Vtbl;
dmscript->ref = 1;
*ppDMScript = (LPDIRECTMUSICSCRIPT) dmscript;
return S_OK;
obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicScriptImpl));
if (NULL == obj) {
*ppobj = (LPVOID) NULL;
return E_OUTOFMEMORY;
}
obj->UnknownVtbl = &DirectMusicScript_Unknown_Vtbl;
obj->ScriptVtbl = &DirectMusicScript_Script_Vtbl;
obj->ObjectVtbl = &DirectMusicScript_Object_Vtbl;
obj->PersistStreamVtbl = &DirectMusicScript_PersistStream_Vtbl;
obj->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC));
DM_STRUCT_INIT(obj->pDesc);
obj->pDesc->dwValidData |= DMUS_OBJ_CLASS;
memcpy (&obj->pDesc->guidClass, &CLSID_DirectMusicScript, sizeof (CLSID));
obj->ref = 0; /* will be inited by QueryInterface */
WARN("No interface found\n");
return E_NOINTERFACE;
return IDirectMusicScriptImpl_IUnknown_QueryInterface ((LPUNKNOWN)&obj->UnknownVtbl, lpcGUID, ppobj);
}
/*****************************************************************************
* IDirectMusicScriptObject implementation
*/
/* IDirectMusicScriptObject IUnknown part: */
HRESULT WINAPI IDirectMusicScriptObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicScriptObject,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID(riid, &IID_IDirectMusicObject)) {
IDirectMusicScriptObject_AddRef(iface);
*ppobj = This;
return S_OK;
} else if (IsEqualIID (riid, &IID_IPersistStream)) {
IPersistStream_AddRef ((LPPERSISTSTREAM)This->pStream);
*ppobj = (LPPERSISTSTREAM)This->pStream;
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicScript)) {
IDirectMusicScript_AddRef ((LPDIRECTMUSICSCRIPT)This->pScript);
*ppobj = (LPDIRECTMUSICSCRIPT)This->pScript;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicScriptObject_AddRef (LPDIRECTMUSICOBJECT iface)
{
ICOM_THIS(IDirectMusicScriptObject,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicScriptObject_Release (LPDIRECTMUSICOBJECT iface)
{
ICOM_THIS(IDirectMusicScriptObject,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicScriptObject IDirectMusicObject part: */
HRESULT WINAPI IDirectMusicScriptObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicScriptObject,iface);
TRACE("(%p, %p)\n", This, pDesc);
pDesc = This->pDesc;
return S_OK;
}
HRESULT WINAPI IDirectMusicScriptObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicScriptObject,iface);
TRACE("(%p, %p)\n", This, pDesc);
This->pDesc = pDesc;
return S_OK;
}
HRESULT WINAPI IDirectMusicScriptObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicScriptObject,iface);
FIXME("(%p, %p, %p): stub\n", This, pStream, pDesc);
return S_OK;
}
ICOM_VTABLE(IDirectMusicObject) DirectMusicScriptObject_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicScriptObject_QueryInterface,
IDirectMusicScriptObject_AddRef,
IDirectMusicScriptObject_Release,
IDirectMusicScriptObject_GetDescriptor,
IDirectMusicScriptObject_SetDescriptor,
IDirectMusicScriptObject_ParseDescriptor
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicScriptObject (LPCGUID lpcGUID, LPDIRECTMUSICOBJECT* ppObject, LPUNKNOWN pUnkOuter)
{
IDirectMusicScriptObject *obj;
TRACE("(%p,%p,%p)\n", lpcGUID, ppObject, pUnkOuter);
if (IsEqualIID (lpcGUID, &IID_IDirectMusicObject)) {
obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicScriptObject));
if (NULL == obj) {
*ppObject = (LPDIRECTMUSICOBJECT) NULL;
return E_OUTOFMEMORY;
}
obj->lpVtbl = &DirectMusicScriptObject_Vtbl;
obj->ref = 1;
/* prepare IPersistStream */
obj->pStream = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(IDirectMusicScriptObjectStream));
obj->pStream->lpVtbl = &DirectMusicScriptObjectStream_Vtbl;
obj->pStream->ref = 1;
obj->pStream->pParentObject = obj;
/* prepare IDirectMusicScript */
DMUSIC_CreateDirectMusicScript (&IID_IDirectMusicScript, (LPDIRECTMUSICSCRIPT*)&obj->pScript, NULL);
obj->pScript->pObject = obj;
*ppObject = (LPDIRECTMUSICOBJECT) obj;
return S_OK;
}
WARN("No interface found\n");
return E_NOINTERFACE;
}
/*****************************************************************************
* IDirectMusicScriptObjectStream implementation
*/
/* IDirectMusicScriptObjectStream IUnknown part: */
HRESULT WINAPI IDirectMusicScriptObjectStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicScriptObjectStream,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicScriptObjectStream_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicScriptObjectStream_AddRef (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicScriptObjectStream,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicScriptObjectStream_Release (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicScriptObjectStream,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicScriptObjectStream IPersist part: */
HRESULT WINAPI IDirectMusicScriptObjectStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID)
{
*pClassID = CLSID_DirectMusicScript;
return S_OK;
}
/* IDirectMusicScriptObjectStream IPersistStream part: */
HRESULT WINAPI IDirectMusicScriptObjectStream_IsDirty (LPPERSISTSTREAM iface)
{
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicScriptObjectStream_Load (LPPERSISTSTREAM iface, IStream* pStm)
{
FIXME(": Loading not implemented yet\n");
return S_OK;
}
HRESULT WINAPI IDirectMusicScriptObjectStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty)
{
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicScriptObjectStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize)
{
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicScriptObjectStream_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicScriptObjectStream_QueryInterface,
IDirectMusicScriptObjectStream_AddRef,
IDirectMusicScriptObjectStream_Release,
IDirectMusicScriptObjectStream_GetClassID,
IDirectMusicScriptObjectStream_IsDirty,
IDirectMusicScriptObjectStream_Load,
IDirectMusicScriptObjectStream_Save,
IDirectMusicScriptObjectStream_GetSizeMax
};

View File

@ -1,6 +1,6 @@
/* IDirectMusicScriptTrack Implementation
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -17,14 +17,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "dmscript_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmscript);
@ -34,19 +26,21 @@ WINE_DECLARE_DEBUG_CHANNEL(dmfile);
* IDirectMusicScriptTrack implementation
*/
/* IDirectMusicScriptTrack IUnknown part: */
HRESULT WINAPI IDirectMusicScriptTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicScriptTrack,iface);
HRESULT WINAPI IDirectMusicScriptTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicScriptTrack, UnknownVtbl, iface);
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IDirectMusicTrack) ||
IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
IDirectMusicScriptTrack_AddRef(iface);
*ppobj = This;
if (IsEqualIID (riid, &IID_IUnknown)) {
*ppobj = (LPUNKNOWN)&This->UnknownVtbl;
IDirectMusicScriptTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicTrack)
|| IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
*ppobj = (LPDIRECTMUSICTRACK8)&This->TrackVtbl;
IDirectMusicScriptTrack_IDirectMusicTrack_AddRef ((LPDIRECTMUSICTRACK8)&This->TrackVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicScriptTrackStream_AddRef ((LPPERSISTSTREAM)This->pStream);
*ppobj = This->pStream;
*ppobj = (LPPERSISTSTREAM)&This->PersistStreamVtbl;
IDirectMusicScriptTrack_IPersistStream_AddRef ((LPPERSISTSTREAM)&This->PersistStreamVtbl);
return S_OK;
}
@ -54,16 +48,14 @@ HRESULT WINAPI IDirectMusicScriptTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicScriptTrack_AddRef (LPDIRECTMUSICTRACK8 iface)
{
ICOM_THIS(IDirectMusicScriptTrack,iface);
ULONG WINAPI IDirectMusicScriptTrack_IUnknown_AddRef (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicScriptTrack, UnknownVtbl, iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicScriptTrack_Release (LPDIRECTMUSICTRACK8 iface)
{
ICOM_THIS(IDirectMusicScriptTrack,iface);
ULONG WINAPI IDirectMusicScriptTrack_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicScriptTrack, UnknownVtbl, iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
@ -72,270 +64,214 @@ ULONG WINAPI IDirectMusicScriptTrack_Release (LPDIRECTMUSICTRACK8 iface)
return ref;
}
/* IDirectMusicScriptTrack IDirectMusicTrack part: */
HRESULT WINAPI IDirectMusicScriptTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment)
{
ICOM_THIS(IDirectMusicScriptTrack,iface);
ICOM_VTABLE(IUnknown) DirectMusicScriptTrack_Unknown_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicScriptTrack_IUnknown_QueryInterface,
IDirectMusicScriptTrack_IUnknown_AddRef,
IDirectMusicScriptTrack_IUnknown_Release
};
/* IDirectMusicScriptTrack IDirectMusicTrack8 part: */
HRESULT WINAPI IDirectMusicScriptTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicScriptTrack, TrackVtbl, iface);
return IDirectMusicScriptTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicScriptTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface) {
ICOM_THIS_MULTI(IDirectMusicScriptTrack, TrackVtbl, iface);
return IDirectMusicScriptTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicScriptTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface) {
ICOM_THIS_MULTI(IDirectMusicScriptTrack, TrackVtbl, iface);
return IDirectMusicScriptTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicScriptTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment)
{
ICOM_THIS_MULTI(IDirectMusicScriptTrack, TrackVtbl, iface);
FIXME("(%p, %p): stub\n", This, pSegment);
return S_OK;
}
HRESULT WINAPI IDirectMusicScriptTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags)
HRESULT WINAPI IDirectMusicScriptTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicScriptTrack,iface);
ICOM_THIS_MULTI(IDirectMusicScriptTrack, TrackVtbl, iface);
FIXME("(%p, %p, %p, %p, %ld, %ld): stub\n", This, pSegmentState, pPerformance, ppStateData, dwVirtualTrack8ID, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicScriptTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData)
HRESULT WINAPI IDirectMusicScriptTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData)
{
ICOM_THIS(IDirectMusicScriptTrack,iface);
ICOM_THIS_MULTI(IDirectMusicScriptTrack, TrackVtbl, iface);
FIXME("(%p, %p): stub\n", This, pStateData);
return S_OK;
}
HRESULT WINAPI IDirectMusicScriptTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
HRESULT WINAPI IDirectMusicScriptTrack_IDirectMusicTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
{
ICOM_THIS(IDirectMusicScriptTrack,iface);
ICOM_THIS_MULTI(IDirectMusicScriptTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %ld, %ld, %ld, %p, %p, %ld): stub\n", This, pStateData, mtStart, mtEnd, mtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
return S_OK;
}
HRESULT WINAPI IDirectMusicScriptTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam)
{
ICOM_THIS(IDirectMusicScriptTrack,iface);
HRESULT WINAPI IDirectMusicScriptTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam) {
ICOM_THIS_MULTI(IDirectMusicScriptTrack, TrackVtbl, iface);
FIXME("(%p, %s, %ld, %p, %p): stub\n", This, debugstr_guid(rguidType), mtTime, pmtNext, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicScriptTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam)
{
ICOM_THIS(IDirectMusicScriptTrack,iface);
HRESULT WINAPI IDirectMusicScriptTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam) {
ICOM_THIS_MULTI(IDirectMusicScriptTrack, TrackVtbl, iface);
FIXME("(%p, %s, %ld, %p): stub\n", This, debugstr_guid(rguidType), mtTime, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicScriptTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType)
{
ICOM_THIS(IDirectMusicScriptTrack,iface);
HRESULT WINAPI IDirectMusicScriptTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType) {
ICOM_THIS_MULTI(IDirectMusicScriptTrack, TrackVtbl, iface);
TRACE("(%p, %s): ", This, debugstr_guid(rguidType));
/* didn't find any params */
TRACE("param unsupported\n");
return DMUS_E_TYPE_UNSUPPORTED;
}
HRESULT WINAPI IDirectMusicScriptTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType)
{
ICOM_THIS(IDirectMusicScriptTrack,iface);
HRESULT WINAPI IDirectMusicScriptTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
ICOM_THIS_MULTI(IDirectMusicScriptTrack, TrackVtbl, iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
return S_OK;
}
HRESULT WINAPI IDirectMusicScriptTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType)
{
ICOM_THIS(IDirectMusicScriptTrack,iface);
HRESULT WINAPI IDirectMusicScriptTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
ICOM_THIS_MULTI(IDirectMusicScriptTrack, TrackVtbl, iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
return S_OK;
}
HRESULT WINAPI IDirectMusicScriptTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack)
{
ICOM_THIS(IDirectMusicScriptTrack,iface);
HRESULT WINAPI IDirectMusicScriptTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack) {
ICOM_THIS_MULTI(IDirectMusicScriptTrack, TrackVtbl, iface);
FIXME("(%p, %ld, %ld, %p): stub\n", This, mtStart, mtEnd, ppTrack);
return S_OK;
}
/* IDirectMusicScriptTrack IDirectMusicTrack8 part: */
HRESULT WINAPI IDirectMusicScriptTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
{
ICOM_THIS(IDirectMusicScriptTrack,iface);
HRESULT WINAPI IDirectMusicScriptTrack_IDirectMusicTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID) {
ICOM_THIS_MULTI(IDirectMusicScriptTrack, TrackVtbl, iface);
FIXME("(%p, %p, %lli, %lli, %lli, %ld, %p, %p, %ld): stub\n", This, pStateData, rtStart, rtEnd, rtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
return S_OK;
}
HRESULT WINAPI IDirectMusicScriptTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicScriptTrack,iface);
HRESULT WINAPI IDirectMusicScriptTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicScriptTrack, TrackVtbl, iface);
FIXME("(%p, %s, %lli, %p, %p, %p, %ld): stub\n", This, debugstr_guid(rguidType), rtTime, prtNext, pParam, pStateData, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicScriptTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicScriptTrack,iface);
HRESULT WINAPI IDirectMusicScriptTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicScriptTrack, TrackVtbl, iface);
FIXME("(%p, %s, %lli, %p, %p, %ld): stub\n", This, debugstr_guid(rguidType), rtTime, pParam, pStateData, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicScriptTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack)
{
ICOM_THIS(IDirectMusicScriptTrack,iface);
HRESULT WINAPI IDirectMusicScriptTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
ICOM_THIS_MULTI(IDirectMusicScriptTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %p): stub\n", This, pContext, dwTrackGroup, ppResultTrack);
return S_OK;
}
HRESULT WINAPI IDirectMusicScriptTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack)
{
ICOM_THIS(IDirectMusicScriptTrack,iface);
HRESULT WINAPI IDirectMusicScriptTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
ICOM_THIS_MULTI(IDirectMusicScriptTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %p, %ld, %p): stub\n", This, pNewTrack, mtJoin, pContext, dwTrackGroup, ppResultTrack);
return S_OK;
}
ICOM_VTABLE(IDirectMusicTrack8) DirectMusicScriptTrack_Vtbl =
{
ICOM_VTABLE(IDirectMusicTrack8) DirectMusicScriptTrack_Track_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicScriptTrack_QueryInterface,
IDirectMusicScriptTrack_AddRef,
IDirectMusicScriptTrack_Release,
IDirectMusicScriptTrack_Init,
IDirectMusicScriptTrack_InitPlay,
IDirectMusicScriptTrack_EndPlay,
IDirectMusicScriptTrack_Play,
IDirectMusicScriptTrack_GetParam,
IDirectMusicScriptTrack_SetParam,
IDirectMusicScriptTrack_IsParamSupported,
IDirectMusicScriptTrack_AddNotificationType,
IDirectMusicScriptTrack_RemoveNotificationType,
IDirectMusicScriptTrack_Clone,
IDirectMusicScriptTrack_PlayEx,
IDirectMusicScriptTrack_GetParamEx,
IDirectMusicScriptTrack_SetParamEx,
IDirectMusicScriptTrack_Compose,
IDirectMusicScriptTrack_Join
IDirectMusicScriptTrack_IDirectMusicTrack_QueryInterface,
IDirectMusicScriptTrack_IDirectMusicTrack_AddRef,
IDirectMusicScriptTrack_IDirectMusicTrack_Release,
IDirectMusicScriptTrack_IDirectMusicTrack_Init,
IDirectMusicScriptTrack_IDirectMusicTrack_InitPlay,
IDirectMusicScriptTrack_IDirectMusicTrack_EndPlay,
IDirectMusicScriptTrack_IDirectMusicTrack_Play,
IDirectMusicScriptTrack_IDirectMusicTrack_GetParam,
IDirectMusicScriptTrack_IDirectMusicTrack_SetParam,
IDirectMusicScriptTrack_IDirectMusicTrack_IsParamSupported,
IDirectMusicScriptTrack_IDirectMusicTrack_AddNotificationType,
IDirectMusicScriptTrack_IDirectMusicTrack_RemoveNotificationType,
IDirectMusicScriptTrack_IDirectMusicTrack_Clone,
IDirectMusicScriptTrack_IDirectMusicTrack_PlayEx,
IDirectMusicScriptTrack_IDirectMusicTrack_GetParamEx,
IDirectMusicScriptTrack_IDirectMusicTrack_SetParamEx,
IDirectMusicScriptTrack_IDirectMusicTrack_Compose,
IDirectMusicScriptTrack_IDirectMusicTrack_Join
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicScriptTrack (LPCGUID lpcGUID, LPDIRECTMUSICTRACK8 *ppTrack, LPUNKNOWN pUnkOuter)
{
IDirectMusicScriptTrack* track;
if (IsEqualIID (lpcGUID, &IID_IDirectMusicTrack)
|| IsEqualIID (lpcGUID, &IID_IDirectMusicTrack8)) {
track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicScriptTrack));
if (NULL == track) {
*ppTrack = (LPDIRECTMUSICTRACK8) NULL;
return E_OUTOFMEMORY;
}
track->lpVtbl = &DirectMusicScriptTrack_Vtbl;
track->ref = 1;
track->pStream = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(IDirectMusicScriptTrackStream));
track->pStream->lpVtbl = &DirectMusicScriptTrackStream_Vtbl;
track->pStream->ref = 1;
track->pStream->pParentTrack = track;
*ppTrack = (LPDIRECTMUSICTRACK8) track;
return S_OK;
}
WARN("No interface found\n");
return E_NOINTERFACE;
/* IDirectMusicScriptTrack IPersistStream part: */
HRESULT WINAPI IDirectMusicScriptTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicScriptTrack, PersistStreamVtbl, iface);
return IDirectMusicScriptTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
/*****************************************************************************
* IDirectMusicScriptTrackStream implementation
*/
/* IDirectMusicScriptTrackStream IUnknown part follow: */
HRESULT WINAPI IDirectMusicScriptTrackStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicScriptTrackStream,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicScriptTrackStream_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
ULONG WINAPI IDirectMusicScriptTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicScriptTrack, PersistStreamVtbl, iface);
return IDirectMusicScriptTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicScriptTrackStream_AddRef (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicScriptTrackStream,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
ULONG WINAPI IDirectMusicScriptTrack_IPersistStream_Release (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicScriptTrack, PersistStreamVtbl, iface);
return IDirectMusicScriptTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicScriptTrackStream_Release (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicScriptTrackStream,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicScriptTrackStream IPersist part: */
HRESULT WINAPI IDirectMusicScriptTrackStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID)
{
*pClassID = CLSID_DirectMusicScriptTrack;
return S_OK;
}
/* IDirectMusicScriptTrackStream IPersistStream part: */
HRESULT WINAPI IDirectMusicScriptTrackStream_IsDirty (LPPERSISTSTREAM iface)
{
HRESULT WINAPI IDirectMusicScriptTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicScriptTrackStream_Load (LPPERSISTSTREAM iface, IStream* pStm)
{
HRESULT WINAPI IDirectMusicScriptTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicScriptTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm) {
FIXME(": Loading not implemented yet\n");
return S_OK;
}
HRESULT WINAPI IDirectMusicScriptTrackStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty)
{
HRESULT WINAPI IDirectMusicScriptTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicScriptTrackStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize)
{
HRESULT WINAPI IDirectMusicScriptTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) {
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicScriptTrackStream_Vtbl =
{
ICOM_VTABLE(IPersistStream) DirectMusicScriptTrack_PersistStream_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicScriptTrackStream_QueryInterface,
IDirectMusicScriptTrackStream_AddRef,
IDirectMusicScriptTrackStream_Release,
IDirectMusicScriptTrackStream_GetClassID,
IDirectMusicScriptTrackStream_IsDirty,
IDirectMusicScriptTrackStream_Load,
IDirectMusicScriptTrackStream_Save,
IDirectMusicScriptTrackStream_GetSizeMax
IDirectMusicScriptTrack_IPersistStream_QueryInterface,
IDirectMusicScriptTrack_IPersistStream_AddRef,
IDirectMusicScriptTrack_IPersistStream_Release,
IDirectMusicScriptTrack_IPersistStream_GetClassID,
IDirectMusicScriptTrack_IPersistStream_IsDirty,
IDirectMusicScriptTrack_IPersistStream_Load,
IDirectMusicScriptTrack_IPersistStream_Save,
IDirectMusicScriptTrack_IPersistStream_GetSizeMax
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicScriptTrack (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) {
IDirectMusicScriptTrack* track;
track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicScriptTrack));
if (NULL == track) {
*ppobj = (LPVOID) NULL;
return E_OUTOFMEMORY;
}
track->UnknownVtbl = &DirectMusicScriptTrack_Unknown_Vtbl;
track->TrackVtbl = &DirectMusicScriptTrack_Track_Vtbl;
track->PersistStreamVtbl = &DirectMusicScriptTrack_PersistStream_Vtbl;
track->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC));
DM_STRUCT_INIT(track->pDesc);
track->pDesc->dwValidData |= DMUS_OBJ_CLASS;
memcpy (&track->pDesc->guidClass, &CLSID_DirectMusicScriptTrack, sizeof (CLSID));
track->ref = 0; /* will be inited by QueryInterface */
return IDirectMusicScriptTrack_IUnknown_QueryInterface ((LPUNKNOWN)&track->UnknownVtbl, lpcGUID, ppobj);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 Rok Mandeljc <rok.mandeljc@gimb.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -18,10 +18,10 @@
#define WINE_FILEDESCRIPTION_STR "Wine DirectMusic Scripting"
#define WINE_FILENAME_STR "dmscript.dll"
#define WINE_FILEVERSION 4,8,1,881
#define WINE_FILEVERSION_STR "4.8.1.881"
#define WINE_PRODUCTVERSION 4,8,1,881
#define WINE_PRODUCTVERSION_STR "4.8"
#define WINE_FILEVERSION 4,9,0,900
#define WINE_FILEVERSION_STR "4.9.0.900"
#define WINE_PRODUCTVERSION 4,9,0,900
#define WINE_PRODUCTVERSION_STR "4.9"
#define WINE_PRODUCTNAME_STR "DirectX"
#include "wine/wine_common_ver.rc"

View File

@ -11,7 +11,6 @@ C_SRCS = \
chordtrack.c \
commandtrack.c \
dmstyle_main.c \
melodyformulationtrack.c \
motiftrack.c \
mutetrack.c \
regsvr.c \

View File

@ -1,6 +1,6 @@
/* IDirectMusicAuditionTrack Implementation
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -17,14 +17,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "dmstyle_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmstyle);
@ -34,36 +26,36 @@ WINE_DECLARE_DEBUG_CHANNEL(dmfile);
* IDirectMusicAuditionTrack implementation
*/
/* IDirectMusicAuditionTrack IUnknown part: */
HRESULT WINAPI IDirectMusicAuditionTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicAuditionTrack,iface);
HRESULT WINAPI IDirectMusicAuditionTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicAuditionTrack, UnknownVtbl, iface);
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IDirectMusicTrack) ||
IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
IDirectMusicAuditionTrack_AddRef(iface);
*ppobj = This;
if (IsEqualIID (riid, &IID_IUnknown)) {
*ppobj = (LPUNKNOWN)&This->UnknownVtbl;
IDirectMusicAuditionTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicTrack)
|| IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
*ppobj = (LPDIRECTMUSICTRACK8)&This->TrackVtbl;
IDirectMusicAuditionTrack_IDirectMusicTrack_AddRef ((LPDIRECTMUSICTRACK8)&This->TrackVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicAuditionTrackStream_AddRef ((LPPERSISTSTREAM)This->pStream);
*ppobj = This->pStream;
*ppobj = (LPPERSISTSTREAM)&This->PersistStreamVtbl;
IDirectMusicAuditionTrack_IPersistStream_AddRef ((LPPERSISTSTREAM)&This->PersistStreamVtbl);
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicAuditionTrack_AddRef (LPDIRECTMUSICTRACK8 iface)
{
ICOM_THIS(IDirectMusicAuditionTrack,iface);
ULONG WINAPI IDirectMusicAuditionTrack_IUnknown_AddRef (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicAuditionTrack, UnknownVtbl, iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicAuditionTrack_Release (LPDIRECTMUSICTRACK8 iface)
{
ICOM_THIS(IDirectMusicAuditionTrack,iface);
ULONG WINAPI IDirectMusicAuditionTrack_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicAuditionTrack, UnknownVtbl, iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
@ -72,269 +64,214 @@ ULONG WINAPI IDirectMusicAuditionTrack_Release (LPDIRECTMUSICTRACK8 iface)
return ref;
}
/* IDirectMusicAuditionTrack IDirectMusicTrack part: */
HRESULT WINAPI IDirectMusicAuditionTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment)
{
ICOM_THIS(IDirectMusicAuditionTrack,iface);
ICOM_VTABLE(IUnknown) DirectMusicAuditionTrack_Unknown_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicAuditionTrack_IUnknown_QueryInterface,
IDirectMusicAuditionTrack_IUnknown_AddRef,
IDirectMusicAuditionTrack_IUnknown_Release
};
/* IDirectMusicAuditionTrack IDirectMusicTrack8 part: */
HRESULT WINAPI IDirectMusicAuditionTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicAuditionTrack, TrackVtbl, iface);
return IDirectMusicAuditionTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicAuditionTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface) {
ICOM_THIS_MULTI(IDirectMusicAuditionTrack, TrackVtbl, iface);
return IDirectMusicAuditionTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicAuditionTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface) {
ICOM_THIS_MULTI(IDirectMusicAuditionTrack, TrackVtbl, iface);
return IDirectMusicAuditionTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicAuditionTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment)
{
ICOM_THIS_MULTI(IDirectMusicAuditionTrack, TrackVtbl, iface);
FIXME("(%p, %p): stub\n", This, pSegment);
return S_OK;
}
HRESULT WINAPI IDirectMusicAuditionTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags)
HRESULT WINAPI IDirectMusicAuditionTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicAuditionTrack,iface);
ICOM_THIS_MULTI(IDirectMusicAuditionTrack, TrackVtbl, iface);
FIXME("(%p, %p, %p, %p, %ld, %ld): stub\n", This, pSegmentState, pPerformance, ppStateData, dwVirtualTrack8ID, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicAuditionTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData)
HRESULT WINAPI IDirectMusicAuditionTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData)
{
ICOM_THIS(IDirectMusicAuditionTrack,iface);
ICOM_THIS_MULTI(IDirectMusicAuditionTrack, TrackVtbl, iface);
FIXME("(%p, %p): stub\n", This, pStateData);
return S_OK;
}
HRESULT WINAPI IDirectMusicAuditionTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
HRESULT WINAPI IDirectMusicAuditionTrack_IDirectMusicTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
{
ICOM_THIS(IDirectMusicAuditionTrack,iface);
ICOM_THIS_MULTI(IDirectMusicAuditionTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %ld, %ld, %ld, %p, %p, %ld): stub\n", This, pStateData, mtStart, mtEnd, mtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
return S_OK;
}
HRESULT WINAPI IDirectMusicAuditionTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam)
{
ICOM_THIS(IDirectMusicAuditionTrack,iface);
HRESULT WINAPI IDirectMusicAuditionTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam) {
ICOM_THIS_MULTI(IDirectMusicAuditionTrack, TrackVtbl, iface);
FIXME("(%p, %s, %ld, %p, %p): stub\n", This, debugstr_guid(rguidType), mtTime, pmtNext, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicAuditionTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam)
{
ICOM_THIS(IDirectMusicAuditionTrack,iface);
HRESULT WINAPI IDirectMusicAuditionTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam) {
ICOM_THIS_MULTI(IDirectMusicAuditionTrack, TrackVtbl, iface);
FIXME("(%p, %s, %ld, %p): stub\n", This, debugstr_guid(rguidType), mtTime, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicAuditionTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType)
{
ICOM_THIS(IDirectMusicAuditionTrack,iface);
HRESULT WINAPI IDirectMusicAuditionTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType) {
ICOM_THIS_MULTI(IDirectMusicAuditionTrack, TrackVtbl, iface);
TRACE("(%p, %s): ", This, debugstr_guid(rguidType));
/* didn't find any params */
TRACE("param unsupported\n");
return DMUS_E_TYPE_UNSUPPORTED;
}
HRESULT WINAPI IDirectMusicAuditionTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType)
{
ICOM_THIS(IDirectMusicAuditionTrack,iface);
HRESULT WINAPI IDirectMusicAuditionTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
ICOM_THIS_MULTI(IDirectMusicAuditionTrack, TrackVtbl, iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
return S_OK;
}
HRESULT WINAPI IDirectMusicAuditionTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType)
{
ICOM_THIS(IDirectMusicAuditionTrack,iface);
HRESULT WINAPI IDirectMusicAuditionTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
ICOM_THIS_MULTI(IDirectMusicAuditionTrack, TrackVtbl, iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
return S_OK;
}
HRESULT WINAPI IDirectMusicAuditionTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack)
{
ICOM_THIS(IDirectMusicAuditionTrack,iface);
HRESULT WINAPI IDirectMusicAuditionTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack) {
ICOM_THIS_MULTI(IDirectMusicAuditionTrack, TrackVtbl, iface);
FIXME("(%p, %ld, %ld, %p): stub\n", This, mtStart, mtEnd, ppTrack);
return S_OK;
}
/* IDirectMusicAuditionTrack IDirectMusicTrack8 part: */
HRESULT WINAPI IDirectMusicAuditionTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
{
ICOM_THIS(IDirectMusicAuditionTrack,iface);
HRESULT WINAPI IDirectMusicAuditionTrack_IDirectMusicTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID) {
ICOM_THIS_MULTI(IDirectMusicAuditionTrack, TrackVtbl, iface);
FIXME("(%p, %p, %lli, %lli, %lli, %ld, %p, %p, %ld): stub\n", This, pStateData, rtStart, rtEnd, rtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
return S_OK;
}
HRESULT WINAPI IDirectMusicAuditionTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicAuditionTrack,iface);
HRESULT WINAPI IDirectMusicAuditionTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicAuditionTrack, TrackVtbl, iface);
FIXME("(%p, %s, %lli, %p, %p, %p, %ld): stub\n", This, debugstr_guid(rguidType), rtTime, prtNext, pParam, pStateData, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicAuditionTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicAuditionTrack,iface);
HRESULT WINAPI IDirectMusicAuditionTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicAuditionTrack, TrackVtbl, iface);
FIXME("(%p, %s, %lli, %p, %p, %ld): stub\n", This, debugstr_guid(rguidType), rtTime, pParam, pStateData, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicAuditionTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack)
{
ICOM_THIS(IDirectMusicAuditionTrack,iface);
HRESULT WINAPI IDirectMusicAuditionTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
ICOM_THIS_MULTI(IDirectMusicAuditionTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %p): stub\n", This, pContext, dwTrackGroup, ppResultTrack);
return S_OK;
}
HRESULT WINAPI IDirectMusicAuditionTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack)
{
ICOM_THIS(IDirectMusicAuditionTrack,iface);
HRESULT WINAPI IDirectMusicAuditionTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
ICOM_THIS_MULTI(IDirectMusicAuditionTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %p, %ld, %p): stub\n", This, pNewTrack, mtJoin, pContext, dwTrackGroup, ppResultTrack);
return S_OK;
}
ICOM_VTABLE(IDirectMusicTrack8) DirectMusicAuditionTrack_Vtbl =
{
ICOM_VTABLE(IDirectMusicTrack8) DirectMusicAuditionTrack_Track_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicAuditionTrack_QueryInterface,
IDirectMusicAuditionTrack_AddRef,
IDirectMusicAuditionTrack_Release,
IDirectMusicAuditionTrack_Init,
IDirectMusicAuditionTrack_InitPlay,
IDirectMusicAuditionTrack_EndPlay,
IDirectMusicAuditionTrack_Play,
IDirectMusicAuditionTrack_GetParam,
IDirectMusicAuditionTrack_SetParam,
IDirectMusicAuditionTrack_IsParamSupported,
IDirectMusicAuditionTrack_AddNotificationType,
IDirectMusicAuditionTrack_RemoveNotificationType,
IDirectMusicAuditionTrack_Clone,
IDirectMusicAuditionTrack_PlayEx,
IDirectMusicAuditionTrack_GetParamEx,
IDirectMusicAuditionTrack_SetParamEx,
IDirectMusicAuditionTrack_Compose,
IDirectMusicAuditionTrack_Join
IDirectMusicAuditionTrack_IDirectMusicTrack_QueryInterface,
IDirectMusicAuditionTrack_IDirectMusicTrack_AddRef,
IDirectMusicAuditionTrack_IDirectMusicTrack_Release,
IDirectMusicAuditionTrack_IDirectMusicTrack_Init,
IDirectMusicAuditionTrack_IDirectMusicTrack_InitPlay,
IDirectMusicAuditionTrack_IDirectMusicTrack_EndPlay,
IDirectMusicAuditionTrack_IDirectMusicTrack_Play,
IDirectMusicAuditionTrack_IDirectMusicTrack_GetParam,
IDirectMusicAuditionTrack_IDirectMusicTrack_SetParam,
IDirectMusicAuditionTrack_IDirectMusicTrack_IsParamSupported,
IDirectMusicAuditionTrack_IDirectMusicTrack_AddNotificationType,
IDirectMusicAuditionTrack_IDirectMusicTrack_RemoveNotificationType,
IDirectMusicAuditionTrack_IDirectMusicTrack_Clone,
IDirectMusicAuditionTrack_IDirectMusicTrack_PlayEx,
IDirectMusicAuditionTrack_IDirectMusicTrack_GetParamEx,
IDirectMusicAuditionTrack_IDirectMusicTrack_SetParamEx,
IDirectMusicAuditionTrack_IDirectMusicTrack_Compose,
IDirectMusicAuditionTrack_IDirectMusicTrack_Join
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicAuditionTrack (LPCGUID lpcGUID, LPDIRECTMUSICTRACK8 *ppTrack, LPUNKNOWN pUnkOuter)
{
IDirectMusicAuditionTrack* track;
if (IsEqualIID (lpcGUID, &IID_IDirectMusicTrack)
|| IsEqualIID (lpcGUID, &IID_IDirectMusicTrack8)) {
track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicAuditionTrack));
if (NULL == track) {
*ppTrack = (LPDIRECTMUSICTRACK8) NULL;
return E_OUTOFMEMORY;
}
track->lpVtbl = &DirectMusicAuditionTrack_Vtbl;
track->ref = 1;
track->pStream = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(IDirectMusicAuditionTrackStream));
track->pStream->lpVtbl = &DirectMusicAuditionTrackStream_Vtbl;
track->pStream->ref = 1;
track->pStream->pParentTrack = track;
*ppTrack = (LPDIRECTMUSICTRACK8) track;
return S_OK;
}
WARN("No interface found\n");
return E_NOINTERFACE;
/* IDirectMusicAuditionTrack IPersistStream part: */
HRESULT WINAPI IDirectMusicAuditionTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicAuditionTrack, PersistStreamVtbl, iface);
return IDirectMusicAuditionTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
/*****************************************************************************
* IDirectMusicAuditionTrackStream implementation
*/
/* IDirectMusicAuditionTrackStream IUnknown part follow: */
HRESULT WINAPI IDirectMusicAuditionTrackStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicAuditionTrackStream,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicAuditionTrackStream_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
ULONG WINAPI IDirectMusicAuditionTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicAuditionTrack, PersistStreamVtbl, iface);
return IDirectMusicAuditionTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicAuditionTrackStream_AddRef (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicAuditionTrackStream,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
ULONG WINAPI IDirectMusicAuditionTrack_IPersistStream_Release (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicAuditionTrack, PersistStreamVtbl, iface);
return IDirectMusicAuditionTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicAuditionTrackStream_Release (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicAuditionTrackStream,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicAuditionTrackStream IPersist part: */
HRESULT WINAPI IDirectMusicAuditionTrackStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID)
{
HRESULT WINAPI IDirectMusicAuditionTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) {
return E_NOTIMPL;
}
/* IDirectMusicAuditionTrackStream IPersistStream part: */
HRESULT WINAPI IDirectMusicAuditionTrackStream_IsDirty (LPPERSISTSTREAM iface)
{
HRESULT WINAPI IDirectMusicAuditionTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicAuditionTrackStream_Load (LPPERSISTSTREAM iface, IStream* pStm)
{
HRESULT WINAPI IDirectMusicAuditionTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm) {
FIXME(": Loading not implemented yet\n");
return S_OK;
}
HRESULT WINAPI IDirectMusicAuditionTrackStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty)
{
HRESULT WINAPI IDirectMusicAuditionTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicAuditionTrackStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize)
{
HRESULT WINAPI IDirectMusicAuditionTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) {
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicAuditionTrackStream_Vtbl =
{
ICOM_VTABLE(IPersistStream) DirectMusicAuditionTrack_PersistStream_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicAuditionTrackStream_QueryInterface,
IDirectMusicAuditionTrackStream_AddRef,
IDirectMusicAuditionTrackStream_Release,
IDirectMusicAuditionTrackStream_GetClassID,
IDirectMusicAuditionTrackStream_IsDirty,
IDirectMusicAuditionTrackStream_Load,
IDirectMusicAuditionTrackStream_Save,
IDirectMusicAuditionTrackStream_GetSizeMax
IDirectMusicAuditionTrack_IPersistStream_QueryInterface,
IDirectMusicAuditionTrack_IPersistStream_AddRef,
IDirectMusicAuditionTrack_IPersistStream_Release,
IDirectMusicAuditionTrack_IPersistStream_GetClassID,
IDirectMusicAuditionTrack_IPersistStream_IsDirty,
IDirectMusicAuditionTrack_IPersistStream_Load,
IDirectMusicAuditionTrack_IPersistStream_Save,
IDirectMusicAuditionTrack_IPersistStream_GetSizeMax
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicAuditionTrack (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) {
IDirectMusicAuditionTrack* track;
track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicAuditionTrack));
if (NULL == track) {
*ppobj = (LPVOID) NULL;
return E_OUTOFMEMORY;
}
track->UnknownVtbl = &DirectMusicAuditionTrack_Unknown_Vtbl;
track->TrackVtbl = &DirectMusicAuditionTrack_Track_Vtbl;
track->PersistStreamVtbl = &DirectMusicAuditionTrack_PersistStream_Vtbl;
track->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC));
DM_STRUCT_INIT(track->pDesc);
track->pDesc->dwValidData |= DMUS_OBJ_CLASS;
memcpy (&track->pDesc->guidClass, &CLSID_DirectMusicAuditionTrack, sizeof (CLSID));
track->ref = 0; /* will be inited by QueryInterface */
return IDirectMusicAuditionTrack_IUnknown_QueryInterface ((LPUNKNOWN)&track->UnknownVtbl, lpcGUID, ppobj);
}

View File

@ -1,6 +1,6 @@
/* IDirectMusicChordTrack Implementation
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -17,15 +17,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "dmstyle_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmstyle);
@ -35,36 +26,36 @@ WINE_DECLARE_DEBUG_CHANNEL(dmfile);
* IDirectMusicChordTrack implementation
*/
/* IDirectMusicChordTrack IUnknown part: */
HRESULT WINAPI IDirectMusicChordTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicChordTrack,iface);
HRESULT WINAPI IDirectMusicChordTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicChordTrack, UnknownVtbl, iface);
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IDirectMusicTrack) ||
IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
IDirectMusicChordTrack_AddRef(iface);
*ppobj = This;
if (IsEqualIID (riid, &IID_IUnknown)) {
*ppobj = (LPUNKNOWN)&This->UnknownVtbl;
IDirectMusicChordTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicTrack)
|| IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
*ppobj = (LPDIRECTMUSICTRACK8)&This->TrackVtbl;
IDirectMusicChordTrack_IDirectMusicTrack_AddRef ((LPDIRECTMUSICTRACK8)&This->TrackVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicChordTrackStream_AddRef ((LPPERSISTSTREAM)This->pStream);
*ppobj = This->pStream;
*ppobj = (LPPERSISTSTREAM)&This->PersistStreamVtbl;
IDirectMusicChordTrack_IPersistStream_AddRef ((LPPERSISTSTREAM)&This->PersistStreamVtbl);
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicChordTrack_AddRef (LPDIRECTMUSICTRACK8 iface)
{
ICOM_THIS(IDirectMusicChordTrack,iface);
ULONG WINAPI IDirectMusicChordTrack_IUnknown_AddRef (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicChordTrack, UnknownVtbl, iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicChordTrack_Release (LPDIRECTMUSICTRACK8 iface)
{
ICOM_THIS(IDirectMusicChordTrack,iface);
ULONG WINAPI IDirectMusicChordTrack_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicChordTrack, UnknownVtbl, iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
@ -73,64 +64,71 @@ ULONG WINAPI IDirectMusicChordTrack_Release (LPDIRECTMUSICTRACK8 iface)
return ref;
}
/* IDirectMusicChordTrack IDirectMusicTrack part: */
HRESULT WINAPI IDirectMusicChordTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment)
{
ICOM_THIS(IDirectMusicChordTrack,iface);
ICOM_VTABLE(IUnknown) DirectMusicChordTrack_Unknown_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicChordTrack_IUnknown_QueryInterface,
IDirectMusicChordTrack_IUnknown_AddRef,
IDirectMusicChordTrack_IUnknown_Release
};
/* IDirectMusicChordTrack IDirectMusicTrack8 part: */
HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
return IDirectMusicChordTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicChordTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface) {
ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
return IDirectMusicChordTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicChordTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface) {
ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
return IDirectMusicChordTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment)
{
ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
FIXME("(%p, %p): stub\n", This, pSegment);
return S_OK;
}
HRESULT WINAPI IDirectMusicChordTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags)
HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicChordTrack,iface);
ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
FIXME("(%p, %p, %p, %p, %ld, %ld): stub\n", This, pSegmentState, pPerformance, ppStateData, dwVirtualTrack8ID, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicChordTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData)
HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData)
{
ICOM_THIS(IDirectMusicChordTrack,iface);
ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
FIXME("(%p, %p): stub\n", This, pStateData);
return S_OK;
}
HRESULT WINAPI IDirectMusicChordTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
{
ICOM_THIS(IDirectMusicChordTrack,iface);
ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %ld, %ld, %ld, %p, %p, %ld): stub\n", This, pStateData, mtStart, mtEnd, mtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
return S_OK;
}
HRESULT WINAPI IDirectMusicChordTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam)
{
ICOM_THIS(IDirectMusicChordTrack,iface);
HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam) {
ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
FIXME("(%p, %s, %ld, %p, %p): stub\n", This, debugstr_guid(rguidType), mtTime, pmtNext, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicChordTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam)
{
ICOM_THIS(IDirectMusicChordTrack,iface);
HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam) {
ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
FIXME("(%p, %s, %ld, %p): stub\n", This, debugstr_guid(rguidType), mtTime, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicChordTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType)
{
ICOM_THIS(IDirectMusicChordTrack,iface);
HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType) {
ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
TRACE("(%p, %s): ", This, debugstr_guid(rguidType));
if (IsEqualGUID (rguidType, &GUID_BandParam)
@ -138,330 +136,147 @@ HRESULT WINAPI IDirectMusicChordTrack_IsParamSupported (LPDIRECTMUSICTRACK8 ifac
|| IsEqualGUID (rguidType, &GUID_RhythmParam)) {
TRACE("param supported\n");
return S_OK;
}
}
TRACE("param unsupported\n");
return DMUS_E_TYPE_UNSUPPORTED;
}
HRESULT WINAPI IDirectMusicChordTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType)
{
ICOM_THIS(IDirectMusicChordTrack,iface);
HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
return S_OK;
}
HRESULT WINAPI IDirectMusicChordTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType)
{
ICOM_THIS(IDirectMusicChordTrack,iface);
HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
return S_OK;
}
HRESULT WINAPI IDirectMusicChordTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack)
{
ICOM_THIS(IDirectMusicChordTrack,iface);
HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack) {
ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
FIXME("(%p, %ld, %ld, %p): stub\n", This, mtStart, mtEnd, ppTrack);
return S_OK;
}
/* IDirectMusicChordTrack IDirectMusicTrack8 part: */
HRESULT WINAPI IDirectMusicChordTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
{
ICOM_THIS(IDirectMusicChordTrack,iface);
HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID) {
ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
FIXME("(%p, %p, %lli, %lli, %lli, %ld, %p, %p, %ld): stub\n", This, pStateData, rtStart, rtEnd, rtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
return S_OK;
}
HRESULT WINAPI IDirectMusicChordTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicChordTrack,iface);
HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
FIXME("(%p, %s, %lli, %p, %p, %p, %ld): stub\n", This, debugstr_guid(rguidType), rtTime, prtNext, pParam, pStateData, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicChordTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicChordTrack,iface);
HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
FIXME("(%p, %s, %lli, %p, %p, %ld): stub\n", This, debugstr_guid(rguidType), rtTime, pParam, pStateData, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicChordTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack)
{
ICOM_THIS(IDirectMusicChordTrack,iface);
HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %p): stub\n", This, pContext, dwTrackGroup, ppResultTrack);
return S_OK;
}
HRESULT WINAPI IDirectMusicChordTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack)
{
ICOM_THIS(IDirectMusicChordTrack,iface);
HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %p, %ld, %p): stub\n", This, pNewTrack, mtJoin, pContext, dwTrackGroup, ppResultTrack);
return S_OK;
}
ICOM_VTABLE(IDirectMusicTrack8) DirectMusicChordTrack_Vtbl =
{
ICOM_VTABLE(IDirectMusicTrack8) DirectMusicChordTrack_Track_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicChordTrack_QueryInterface,
IDirectMusicChordTrack_AddRef,
IDirectMusicChordTrack_Release,
IDirectMusicChordTrack_Init,
IDirectMusicChordTrack_InitPlay,
IDirectMusicChordTrack_EndPlay,
IDirectMusicChordTrack_Play,
IDirectMusicChordTrack_GetParam,
IDirectMusicChordTrack_SetParam,
IDirectMusicChordTrack_IsParamSupported,
IDirectMusicChordTrack_AddNotificationType,
IDirectMusicChordTrack_RemoveNotificationType,
IDirectMusicChordTrack_Clone,
IDirectMusicChordTrack_PlayEx,
IDirectMusicChordTrack_GetParamEx,
IDirectMusicChordTrack_SetParamEx,
IDirectMusicChordTrack_Compose,
IDirectMusicChordTrack_Join
IDirectMusicChordTrack_IDirectMusicTrack_QueryInterface,
IDirectMusicChordTrack_IDirectMusicTrack_AddRef,
IDirectMusicChordTrack_IDirectMusicTrack_Release,
IDirectMusicChordTrack_IDirectMusicTrack_Init,
IDirectMusicChordTrack_IDirectMusicTrack_InitPlay,
IDirectMusicChordTrack_IDirectMusicTrack_EndPlay,
IDirectMusicChordTrack_IDirectMusicTrack_Play,
IDirectMusicChordTrack_IDirectMusicTrack_GetParam,
IDirectMusicChordTrack_IDirectMusicTrack_SetParam,
IDirectMusicChordTrack_IDirectMusicTrack_IsParamSupported,
IDirectMusicChordTrack_IDirectMusicTrack_AddNotificationType,
IDirectMusicChordTrack_IDirectMusicTrack_RemoveNotificationType,
IDirectMusicChordTrack_IDirectMusicTrack_Clone,
IDirectMusicChordTrack_IDirectMusicTrack_PlayEx,
IDirectMusicChordTrack_IDirectMusicTrack_GetParamEx,
IDirectMusicChordTrack_IDirectMusicTrack_SetParamEx,
IDirectMusicChordTrack_IDirectMusicTrack_Compose,
IDirectMusicChordTrack_IDirectMusicTrack_Join
};
/* IDirectMusicChordTrack IPersistStream part: */
HRESULT WINAPI IDirectMusicChordTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicChordTrack, PersistStreamVtbl, iface);
return IDirectMusicChordTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicChordTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicChordTrack, PersistStreamVtbl, iface);
return IDirectMusicChordTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicChordTrack_IPersistStream_Release (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicChordTrack, PersistStreamVtbl, iface);
return IDirectMusicChordTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicChordTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicChordTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicChordTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm) {
FIXME(": Loading not implemented yet\n");
return S_OK;
}
HRESULT WINAPI IDirectMusicChordTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicChordTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) {
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicChordTrack_PersistStream_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicChordTrack_IPersistStream_QueryInterface,
IDirectMusicChordTrack_IPersistStream_AddRef,
IDirectMusicChordTrack_IPersistStream_Release,
IDirectMusicChordTrack_IPersistStream_GetClassID,
IDirectMusicChordTrack_IPersistStream_IsDirty,
IDirectMusicChordTrack_IPersistStream_Load,
IDirectMusicChordTrack_IPersistStream_Save,
IDirectMusicChordTrack_IPersistStream_GetSizeMax
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicChordTrack (LPCGUID lpcGUID, LPDIRECTMUSICTRACK8 *ppTrack, LPUNKNOWN pUnkOuter)
{
HRESULT WINAPI DMUSIC_CreateDirectMusicChordTrack (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) {
IDirectMusicChordTrack* track;
if (IsEqualIID (lpcGUID, &IID_IDirectMusicTrack)
|| IsEqualIID (lpcGUID, &IID_IDirectMusicTrack8)) {
track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicChordTrack));
if (NULL == track) {
*ppTrack = (LPDIRECTMUSICTRACK8) NULL;
return E_OUTOFMEMORY;
}
track->lpVtbl = &DirectMusicChordTrack_Vtbl;
track->ref = 1;
track->pStream = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(IDirectMusicChordTrackStream));
track->pStream->lpVtbl = &DirectMusicChordTrackStream_Vtbl;
track->pStream->ref = 1;
track->pStream->pParentTrack = track;
*ppTrack = (LPDIRECTMUSICTRACK8) track;
return S_OK;
track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicChordTrack));
if (NULL == track) {
*ppobj = (LPVOID) NULL;
return E_OUTOFMEMORY;
}
track->UnknownVtbl = &DirectMusicChordTrack_Unknown_Vtbl;
track->TrackVtbl = &DirectMusicChordTrack_Track_Vtbl;
track->PersistStreamVtbl = &DirectMusicChordTrack_PersistStream_Vtbl;
track->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC));
DM_STRUCT_INIT(track->pDesc);
track->pDesc->dwValidData |= DMUS_OBJ_CLASS;
memcpy (&track->pDesc->guidClass, &CLSID_DirectMusicChordTrack, sizeof (CLSID));
track->ref = 0; /* will be inited by QueryInterface */
WARN("No interface found\n");
return E_NOINTERFACE;
return IDirectMusicChordTrack_IUnknown_QueryInterface ((LPUNKNOWN)&track->UnknownVtbl, lpcGUID, ppobj);
}
/*****************************************************************************
* IDirectMusicChordTrackStream implementation
*/
/* IDirectMusicChordTrackStream IUnknown part follow: */
HRESULT WINAPI IDirectMusicChordTrackStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicChordTrackStream,iface);
if (IsEqualGUID(riid, &IID_IUnknown)
|| IsEqualGUID(riid, &IID_IPersistStream)) {
IDirectMusicChordTrackStream_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicChordTrackStream_AddRef (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicChordTrackStream,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicChordTrackStream_Release (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicChordTrackStream,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicChordTrackStream IPersist part: */
HRESULT WINAPI IDirectMusicChordTrackStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID)
{
return E_NOTIMPL;
}
/* IDirectMusicChordTrackStream IPersistStream part: */
HRESULT WINAPI IDirectMusicChordTrackStream_IsDirty (LPPERSISTSTREAM iface)
{
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicChordTrackStream_Load (LPPERSISTSTREAM iface, IStream* pStm)
{
ICOM_THIS(IDirectMusicChordTrackStream,iface);
FOURCC chunkID;
DWORD chunkSize, dwSizeOfStruct, ListSize[1], ListCount[1];
LARGE_INTEGER liMove; /* used when skipping chunks */
IDirectMusicChordTrack* pTrack = This->pParentTrack; /* that's where we load data to */
DMUS_IO_CHORD tempChord; /* temporary, used for reading data */
DWORD tempSubChords;
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
IStream_Read (pStm, &chunkSize, sizeof(DWORD), NULL);
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (chunkID), chunkSize);
switch (chunkID) {
case FOURCC_LIST: {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
TRACE_(dmfile)(": LIST chunk of type %s", debugstr_fourcc(chunkID));
ListSize[0] = chunkSize - sizeof(FOURCC);
ListCount[0] = 0;
switch (chunkID) {
case DMUS_FOURCC_CHORDTRACK_LIST: {
TRACE_(dmfile)(": chord track list\n");
do {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
IStream_Read (pStm, &chunkSize, sizeof(FOURCC), NULL);
ListCount[0] += sizeof(FOURCC) + sizeof(DWORD) + chunkSize;
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (chunkID), chunkSize);
switch (chunkID) {
case DMUS_FOURCC_CHORDTRACKHEADER_CHUNK: {
TRACE_(dmfile)(": chord track header chunk\n");
IStream_Read (pStm, &pTrack->dwHeader, chunkSize, NULL);
TRACE_(dmfile)(": (READ): header: chord root = %i; chord scale = %i\n", (pTrack->dwHeader && 0xFF000000) >> 24, pTrack->dwHeader && 0x00FFFFFF);
break;
}
case DMUS_FOURCC_CHORDTRACKBODY_CHUNK: {
TRACE_(dmfile)(": chord track body chunk\n");
/* make space for one more structure */
/* pTrack->dwChordKeys++; */ /* moved at the end for correct counting */
/* FIXME: scheme with HeapReAlloc doesn't work so.. */
/* pTrack->pChordKeys = HeapReAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, pTrack->pChordKeys, sizeof(DMUS_CHORD_KEY) * pTrack->dwChordKeys); */
/* pTrack->pChordKeysTime = HeapReAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, pTrack->pChordKeysTime, sizeof(MUSIC_TIME) *pTrack->dwChordKeys); */
/* load size of DMUS_IO_CHORD */
IStream_Read (pStm, &dwSizeOfStruct, sizeof(DWORD), NULL);
if (dwSizeOfStruct != sizeof(DMUS_IO_CHORD)) {
TRACE_(dmfile)(": declared size of struct (=%ld) != actual size (=%i); loading failed\n", dwSizeOfStruct, sizeof(DMUS_IO_CHORD));
return E_FAIL;
}
/* reset temporary storage and fill it with data */
ZeroMemory (&tempChord, sizeof(DMUS_IO_CHORD));
IStream_Read (pStm, &tempChord, dwSizeOfStruct, NULL);
/* copy data to final destination */
strncpyW (pTrack->pChordKeys[pTrack->dwChordKeys].wszName, tempChord.wszName, 16);
/*pTrack->pChordKeys[pTrack->dwChordKeys].wszName = tempChord.wszName; */
pTrack->pChordKeys[pTrack->dwChordKeys].wMeasure = tempChord.wMeasure;
pTrack->pChordKeys[pTrack->dwChordKeys].bBeat = tempChord.bBeat;
pTrack->pChordKeys[pTrack->dwChordKeys].bFlags = tempChord.bFlags;
/* this one is my invention */
pTrack->pChordKeysTime[pTrack->dwChordKeys] = tempChord.mtTime;
/* FIXME: are these two are derived from header? */
pTrack->pChordKeys[pTrack->dwChordKeys].dwScale = pTrack->dwHeader && 0x00FFFFFF;
pTrack->pChordKeys[pTrack->dwChordKeys].bKey = (pTrack->dwHeader && 0xFF000000) >> 24;
/* now here comes number of subchords */
IStream_Read (pStm, &tempSubChords, sizeof(DWORD), NULL);
pTrack->pChordKeys[pTrack->dwChordKeys].bSubChordCount = tempSubChords;
/* load size of DMUS_IO_SUBCHORD */
IStream_Read (pStm, &dwSizeOfStruct, sizeof(DWORD), NULL);
if (dwSizeOfStruct != sizeof(DMUS_IO_SUBCHORD)) {
TRACE_(dmfile)(": declared size of struct (=%ld) != actual size (=%i); loading failed\n", dwSizeOfStruct, sizeof(DMUS_IO_SUBCHORD));
return E_FAIL;
}
IStream_Read (pStm, pTrack->pChordKeys[pTrack->dwChordKeys].SubChordList, dwSizeOfStruct * tempSubChords, NULL);
/* well, this should be it :) */
pTrack->dwChordKeys++;
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (skipping)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); /* skip this chunk */
break;
}
}
TRACE_(dmfile)(": ListCount[0] = %ld < ListSize[0] = %ld\n", ListCount[0], ListSize[0]);
} while (ListCount[0] < ListSize[0]);
break;
}
default: {
TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
liMove.QuadPart = ListSize[0];
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */
return E_FAIL;
}
}
/* in the end, let's see what we got */
TRACE_(dmfile)(": reading finished\n");
if (TRACE_ON(dmfile)) {
int i,j;
TRACE_(dmfile)(": (READ): number of chord keys in track = %ld\n", pTrack->dwChordKeys);
for (i = 0; i < pTrack->dwChordKeys; i++) {
TRACE_(dmfile)(": (READ): chord key[%i]: associated mtTime = %li\n", i, pTrack->pChordKeysTime[i]);
TRACE_(dmfile)(": (READ): chord key[%i]: wszName = %s; wMeasure = %d; bBeat = %i; dwScale = %ld; \
bKey = %i; bFlags = %i; bSubChordCount = %i\n", i, debugstr_w (pTrack->pChordKeys[i].wszName), \
pTrack->pChordKeys[i].wMeasure, pTrack->pChordKeys[i].bBeat, pTrack->pChordKeys[i].dwScale, \
pTrack->pChordKeys[i].bKey, pTrack->pChordKeys[i].bFlags, pTrack->pChordKeys[i].bSubChordCount);
for (j = 0; j < pTrack->pChordKeys[i].bSubChordCount; j++) {
TRACE_(dmfile)(": (READ): chord key[%i]: subchord[%i]: dwChordPattern = %ld; \
dwScalePattern = %ld; dwInversionPoints = %ld; dwLevels = %ld; bChordRoot = %i; \
bScaleRoot = %i\n", i, j, pTrack->pChordKeys[i].SubChordList[j].dwChordPattern, \
pTrack->pChordKeys[i].SubChordList[j].dwScalePattern, pTrack->pChordKeys[i].SubChordList[j].dwInversionPoints, \
pTrack->pChordKeys[i].SubChordList[j].dwLevels, pTrack->pChordKeys[i].SubChordList[j].bChordRoot, \
pTrack->pChordKeys[i].SubChordList[j].bScaleRoot);
}
}
}
break;
}
default: {
TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */
return E_FAIL;
}
}
return S_OK;
}
HRESULT WINAPI IDirectMusicChordTrackStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty)
{
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicChordTrackStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize)
{
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicChordTrackStream_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicChordTrackStream_QueryInterface,
IDirectMusicChordTrackStream_AddRef,
IDirectMusicChordTrackStream_Release,
IDirectMusicChordTrackStream_GetClassID,
IDirectMusicChordTrackStream_IsDirty,
IDirectMusicChordTrackStream_Load,
IDirectMusicChordTrackStream_Save,
IDirectMusicChordTrackStream_GetSizeMax
};

View File

@ -1,6 +1,6 @@
/* IDirectMusicCommandTrack Implementation
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -17,14 +17,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "dmstyle_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmstyle);
@ -34,36 +26,36 @@ WINE_DECLARE_DEBUG_CHANNEL(dmfile);
* IDirectMusicCommandTrack implementation
*/
/* IDirectMusicCommandTrack IUnknown part: */
HRESULT WINAPI IDirectMusicCommandTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicCommandTrack,iface);
HRESULT WINAPI IDirectMusicCommandTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicCommandTrack, UnknownVtbl, iface);
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IDirectMusicTrack) ||
IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
IDirectMusicCommandTrack_AddRef(iface);
*ppobj = This;
if (IsEqualIID (riid, &IID_IUnknown)) {
*ppobj = (LPUNKNOWN)&This->UnknownVtbl;
IDirectMusicCommandTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicTrack)
|| IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
*ppobj = (LPDIRECTMUSICTRACK8)&This->TrackVtbl;
IDirectMusicCommandTrack_IDirectMusicTrack_AddRef ((LPDIRECTMUSICTRACK8)&This->TrackVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicCommandTrackStream_AddRef ((LPPERSISTSTREAM)This->pStream);
*ppobj = This->pStream;
*ppobj = (LPPERSISTSTREAM)&This->PersistStreamVtbl;
IDirectMusicCommandTrack_IPersistStream_AddRef ((LPPERSISTSTREAM)&This->PersistStreamVtbl);
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicCommandTrack_AddRef (LPDIRECTMUSICTRACK8 iface)
{
ICOM_THIS(IDirectMusicCommandTrack,iface);
ULONG WINAPI IDirectMusicCommandTrack_IUnknown_AddRef (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicCommandTrack, UnknownVtbl, iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicCommandTrack_Release (LPDIRECTMUSICTRACK8 iface)
{
ICOM_THIS(IDirectMusicCommandTrack,iface);
ULONG WINAPI IDirectMusicCommandTrack_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicCommandTrack, UnknownVtbl, iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
@ -72,64 +64,71 @@ ULONG WINAPI IDirectMusicCommandTrack_Release (LPDIRECTMUSICTRACK8 iface)
return ref;
}
/* IDirectMusicCommandTrack IDirectMusicTrack part: */
HRESULT WINAPI IDirectMusicCommandTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment)
{
ICOM_THIS(IDirectMusicCommandTrack,iface);
ICOM_VTABLE(IUnknown) DirectMusicCommandTrack_Unknown_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicCommandTrack_IUnknown_QueryInterface,
IDirectMusicCommandTrack_IUnknown_AddRef,
IDirectMusicCommandTrack_IUnknown_Release
};
/* IDirectMusicCommandTrack IDirectMusicTrack8 part: */
HRESULT WINAPI IDirectMusicCommandTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicCommandTrack, TrackVtbl, iface);
return IDirectMusicCommandTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicCommandTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface) {
ICOM_THIS_MULTI(IDirectMusicCommandTrack, TrackVtbl, iface);
return IDirectMusicCommandTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicCommandTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface) {
ICOM_THIS_MULTI(IDirectMusicCommandTrack, TrackVtbl, iface);
return IDirectMusicCommandTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicCommandTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment)
{
ICOM_THIS_MULTI(IDirectMusicCommandTrack, TrackVtbl, iface);
FIXME("(%p, %p): stub\n", This, pSegment);
return S_OK;
}
HRESULT WINAPI IDirectMusicCommandTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags)
HRESULT WINAPI IDirectMusicCommandTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicCommandTrack,iface);
ICOM_THIS_MULTI(IDirectMusicCommandTrack, TrackVtbl, iface);
FIXME("(%p, %p, %p, %p, %ld, %ld): stub\n", This, pSegmentState, pPerformance, ppStateData, dwVirtualTrack8ID, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicCommandTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData)
HRESULT WINAPI IDirectMusicCommandTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData)
{
ICOM_THIS(IDirectMusicCommandTrack,iface);
ICOM_THIS_MULTI(IDirectMusicCommandTrack, TrackVtbl, iface);
FIXME("(%p, %p): stub\n", This, pStateData);
return S_OK;
}
HRESULT WINAPI IDirectMusicCommandTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
HRESULT WINAPI IDirectMusicCommandTrack_IDirectMusicTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
{
ICOM_THIS(IDirectMusicCommandTrack,iface);
ICOM_THIS_MULTI(IDirectMusicCommandTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %ld, %ld, %ld, %p, %p, %ld): stub\n", This, pStateData, mtStart, mtEnd, mtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
return S_OK;
}
HRESULT WINAPI IDirectMusicCommandTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam)
{
ICOM_THIS(IDirectMusicCommandTrack,iface);
HRESULT WINAPI IDirectMusicCommandTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam) {
ICOM_THIS_MULTI(IDirectMusicCommandTrack, TrackVtbl, iface);
FIXME("(%p, %s, %ld, %p, %p): stub\n", This, debugstr_guid(rguidType), mtTime, pmtNext, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicCommandTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam)
{
ICOM_THIS(IDirectMusicCommandTrack,iface);
HRESULT WINAPI IDirectMusicCommandTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam) {
ICOM_THIS_MULTI(IDirectMusicCommandTrack, TrackVtbl, iface);
FIXME("(%p, %s, %ld, %p): stub\n", This, debugstr_guid(rguidType), mtTime, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicCommandTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType)
{
ICOM_THIS(IDirectMusicCommandTrack,iface);
HRESULT WINAPI IDirectMusicCommandTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType) {
ICOM_THIS_MULTI(IDirectMusicCommandTrack, TrackVtbl, iface);
TRACE("(%p, %s): ", This, debugstr_guid(rguidType));
if (IsEqualGUID (rguidType, &GUID_CommandParam)
@ -137,223 +136,135 @@ HRESULT WINAPI IDirectMusicCommandTrack_IsParamSupported (LPDIRECTMUSICTRACK8 if
|| IsEqualGUID (rguidType, &GUID_CommandParamNext)) {
TRACE("param supported\n");
return S_OK;
}
}
TRACE("param unsupported\n");
return DMUS_E_TYPE_UNSUPPORTED;
}
HRESULT WINAPI IDirectMusicCommandTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType)
{
ICOM_THIS(IDirectMusicCommandTrack,iface);
HRESULT WINAPI IDirectMusicCommandTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
ICOM_THIS_MULTI(IDirectMusicCommandTrack, TrackVtbl, iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
return S_OK;
}
HRESULT WINAPI IDirectMusicCommandTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType)
{
ICOM_THIS(IDirectMusicCommandTrack,iface);
HRESULT WINAPI IDirectMusicCommandTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
ICOM_THIS_MULTI(IDirectMusicCommandTrack, TrackVtbl, iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
return S_OK;
}
HRESULT WINAPI IDirectMusicCommandTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack)
{
ICOM_THIS(IDirectMusicCommandTrack,iface);
HRESULT WINAPI IDirectMusicCommandTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack) {
ICOM_THIS_MULTI(IDirectMusicCommandTrack, TrackVtbl, iface);
FIXME("(%p, %ld, %ld, %p): stub\n", This, mtStart, mtEnd, ppTrack);
return S_OK;
}
/* IDirectMusicCommandTrack IDirectMusicTrack8 part: */
HRESULT WINAPI IDirectMusicCommandTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
{
ICOM_THIS(IDirectMusicCommandTrack,iface);
HRESULT WINAPI IDirectMusicCommandTrack_IDirectMusicTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID) {
ICOM_THIS_MULTI(IDirectMusicCommandTrack, TrackVtbl, iface);
FIXME("(%p, %p, %lli, %lli, %lli, %ld, %p, %p, %ld): stub\n", This, pStateData, rtStart, rtEnd, rtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
/* implement code for sending PMsgs */
return S_OK;
}
HRESULT WINAPI IDirectMusicCommandTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicCommandTrack,iface);
HRESULT WINAPI IDirectMusicCommandTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicCommandTrack, TrackVtbl, iface);
FIXME("(%p, %s, %lli, %p, %p, %p, %ld): stub\n", This, debugstr_guid(rguidType), rtTime, prtNext, pParam, pStateData, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicCommandTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicCommandTrack,iface);
HRESULT WINAPI IDirectMusicCommandTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicCommandTrack, TrackVtbl, iface);
FIXME("(%p, %s, %lli, %p, %p, %ld): stub\n", This, debugstr_guid(rguidType), rtTime, pParam, pStateData, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicCommandTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack)
{
ICOM_THIS(IDirectMusicCommandTrack,iface);
HRESULT WINAPI IDirectMusicCommandTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
ICOM_THIS_MULTI(IDirectMusicCommandTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %p): stub\n", This, pContext, dwTrackGroup, ppResultTrack);
return S_OK;
}
HRESULT WINAPI IDirectMusicCommandTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack)
{
ICOM_THIS(IDirectMusicCommandTrack,iface);
HRESULT WINAPI IDirectMusicCommandTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
ICOM_THIS_MULTI(IDirectMusicCommandTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %p, %ld, %p): stub\n", This, pNewTrack, mtJoin, pContext, dwTrackGroup, ppResultTrack);
return S_OK;
}
ICOM_VTABLE(IDirectMusicTrack8) DirectMusicCommandTrack_Vtbl =
{
ICOM_VTABLE(IDirectMusicTrack8) DirectMusicCommandTrack_Track_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicCommandTrack_QueryInterface,
IDirectMusicCommandTrack_AddRef,
IDirectMusicCommandTrack_Release,
IDirectMusicCommandTrack_Init,
IDirectMusicCommandTrack_InitPlay,
IDirectMusicCommandTrack_EndPlay,
IDirectMusicCommandTrack_Play,
IDirectMusicCommandTrack_GetParam,
IDirectMusicCommandTrack_SetParam,
IDirectMusicCommandTrack_IsParamSupported,
IDirectMusicCommandTrack_AddNotificationType,
IDirectMusicCommandTrack_RemoveNotificationType,
IDirectMusicCommandTrack_Clone,
IDirectMusicCommandTrack_PlayEx,
IDirectMusicCommandTrack_GetParamEx,
IDirectMusicCommandTrack_SetParamEx,
IDirectMusicCommandTrack_Compose,
IDirectMusicCommandTrack_Join
IDirectMusicCommandTrack_IDirectMusicTrack_QueryInterface,
IDirectMusicCommandTrack_IDirectMusicTrack_AddRef,
IDirectMusicCommandTrack_IDirectMusicTrack_Release,
IDirectMusicCommandTrack_IDirectMusicTrack_Init,
IDirectMusicCommandTrack_IDirectMusicTrack_InitPlay,
IDirectMusicCommandTrack_IDirectMusicTrack_EndPlay,
IDirectMusicCommandTrack_IDirectMusicTrack_Play,
IDirectMusicCommandTrack_IDirectMusicTrack_GetParam,
IDirectMusicCommandTrack_IDirectMusicTrack_SetParam,
IDirectMusicCommandTrack_IDirectMusicTrack_IsParamSupported,
IDirectMusicCommandTrack_IDirectMusicTrack_AddNotificationType,
IDirectMusicCommandTrack_IDirectMusicTrack_RemoveNotificationType,
IDirectMusicCommandTrack_IDirectMusicTrack_Clone,
IDirectMusicCommandTrack_IDirectMusicTrack_PlayEx,
IDirectMusicCommandTrack_IDirectMusicTrack_GetParamEx,
IDirectMusicCommandTrack_IDirectMusicTrack_SetParamEx,
IDirectMusicCommandTrack_IDirectMusicTrack_Compose,
IDirectMusicCommandTrack_IDirectMusicTrack_Join
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicCommandTrack (LPCGUID lpcGUID, LPDIRECTMUSICTRACK8 *ppTrack, LPUNKNOWN pUnkOuter)
{
IDirectMusicCommandTrack* track;
if (IsEqualIID (lpcGUID, &IID_IDirectMusicTrack)
|| IsEqualIID (lpcGUID, &IID_IDirectMusicTrack8)) {
track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicCommandTrack));
if (NULL == track) {
*ppTrack = (LPDIRECTMUSICTRACK8) NULL;
return E_OUTOFMEMORY;
}
track->lpVtbl = &DirectMusicCommandTrack_Vtbl;
track->ref = 1;
track->pStream = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(IDirectMusicCommandTrackStream));
track->pStream->lpVtbl = &DirectMusicCommandTrackStream_Vtbl;
track->pStream->ref = 1;
track->pStream->pParentTrack = track;
*ppTrack = (LPDIRECTMUSICTRACK8) track;
return S_OK;
}
WARN("No interface found\n");
return E_NOINTERFACE;
/* IDirectMusicCommandTrack IPersistStream part: */
HRESULT WINAPI IDirectMusicCommandTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicCommandTrack, PersistStreamVtbl, iface);
return IDirectMusicCommandTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
/*****************************************************************************
* IDirectMusicCommandTrackStream implementation
*/
/* IDirectMusicCommandTrackStream IUnknown part follow: */
HRESULT WINAPI IDirectMusicCommandTrackStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicCommandTrackStream,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicCommandTrackStream_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
ULONG WINAPI IDirectMusicCommandTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicCommandTrack, PersistStreamVtbl, iface);
return IDirectMusicCommandTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicCommandTrackStream_AddRef (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicCommandTrackStream,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
ULONG WINAPI IDirectMusicCommandTrack_IPersistStream_Release (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicCommandTrack, PersistStreamVtbl, iface);
return IDirectMusicCommandTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicCommandTrackStream_Release (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicCommandTrackStream,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicCommandTrackStream IPersist part: */
HRESULT WINAPI IDirectMusicCommandTrackStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID)
{
HRESULT WINAPI IDirectMusicCommandTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) {
return E_NOTIMPL;
}
/* IDirectMusicCommandTrackStream IPersistStream part: */
HRESULT WINAPI IDirectMusicCommandTrackStream_IsDirty (LPPERSISTSTREAM iface)
{
HRESULT WINAPI IDirectMusicCommandTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicCommandTrackStream_Load (LPPERSISTSTREAM iface, IStream* pStm)
{
ICOM_THIS(IDirectMusicCommandTrackStream,iface);
HRESULT WINAPI IDirectMusicCommandTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm) {
ICOM_THIS_MULTI(IDirectMusicCommandTrack, PersistStreamVtbl, iface);
FOURCC chunkID;
DWORD chunkSize, dwSizeOfStruct;
DWORD chunkSize, dwSizeOfStruct, nrCommands;
LARGE_INTEGER liMove; /* used when skipping chunks */
IDirectMusicCommandTrack* pTrack = This->pParentTrack; /* that's where we load data to */
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
IStream_Read (pStm, &chunkSize, sizeof(DWORD), NULL);
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (chunkID), chunkSize);
switch (chunkID) {
case DMUS_FOURCC_COMMANDTRACK_CHUNK: {
int count;
TRACE_(dmfile)(": command track chunk\n");
IStream_Read (pStm, &dwSizeOfStruct, sizeof(DWORD), NULL);
if (dwSizeOfStruct != sizeof(DMUS_IO_COMMAND)) {
TRACE_(dmfile)(": declared size of struct (=%ld) != actual size (=%i); loading failed\n", dwSizeOfStruct, sizeof(DMUS_IO_COMMAND));
liMove.QuadPart = chunkSize - sizeof(DWORD);
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */
return E_FAIL;
TRACE_(dmfile)(": declared size of struct (=%ld) != actual size (=%i); indicates older direct music version\n", dwSizeOfStruct, sizeof(DMUS_IO_COMMAND));
}
chunkSize -= sizeof(DWORD); /* now chunk size is one DWORD shorter */
pTrack->pCommands = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, chunkSize);
IStream_Read (pStm, pTrack->pCommands, chunkSize, NULL);
pTrack->dwCommands = chunkSize/dwSizeOfStruct;
/* in the end, let's see what we got */
TRACE_(dmfile)(": reading finished\n");
if (TRACE_ON(dmfile)) {
int i;
TRACE_(dmfile)(": (READ): number of commands in track = %ld\n", pTrack->dwCommands);
for (i = 0; i < pTrack->dwCommands; i++) {
TRACE_(dmfile)(": (READ): command[%i]: mtTime = %li; wMeasure = %d; bBeat = %i; bCommand = %i; bGrooveLevel = %i; bGrooveRange = %i; bRepeatMode = %i\n", \
i, pTrack->pCommands[i].mtTime, pTrack->pCommands[i].wMeasure, pTrack->pCommands[i].bBeat, pTrack->pCommands[i].bCommand, \
pTrack->pCommands[i].bGrooveLevel, pTrack->pCommands[i].bGrooveRange, pTrack->pCommands[i].bRepeatMode);
}
nrCommands = chunkSize/dwSizeOfStruct; /* and this is the number of commands */
/* load each command seperately in new entry */
for (count = 0; count < nrCommands; count++) {
LPDMUS_PRIVATE_COMMAND pNewCommand = (LPDMUS_PRIVATE_COMMAND) HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(DMUS_PRIVATE_COMMAND));
IStream_Read (pStm, &pNewCommand->pCommand, dwSizeOfStruct, NULL);
list_add_tail (&This->Commands, &pNewCommand->entry);
}
}
break;
TRACE_(dmfile)(": reading finished\n");
This->pDesc->dwValidData |= DMUS_OBJ_LOADED;
break;
}
default: {
TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
liMove.QuadPart = chunkSize;
@ -361,29 +272,69 @@ HRESULT WINAPI IDirectMusicCommandTrackStream_Load (LPPERSISTSTREAM iface, IStre
return E_FAIL;
}
}
/* DEBUG: dumps whole band track object tree: */
if (TRACE_ON(dmstyle)) {
int r = 0;
DMUS_PRIVATE_COMMAND *tmpEntry;
struct list *listEntry;
TRACE("*** IDirectMusicCommandTrack (%p) ***\n", (LPDIRECTMUSICTRACK8)This->TrackVtbl);
TRACE(" - Commands:\n");
LIST_FOR_EACH (listEntry, &This->Commands) {
tmpEntry = LIST_ENTRY (listEntry, DMUS_PRIVATE_COMMAND, entry);
TRACE(" - Command[%i]:\n", r);
TRACE(" - mtTime = %li\n", tmpEntry->pCommand.mtTime);
TRACE(" - wMeasure = %d\n", tmpEntry->pCommand.wMeasure);
TRACE(" - bBeat = %i\n", tmpEntry->pCommand.bBeat);
TRACE(" - bCommand = %i\n", tmpEntry->pCommand.bCommand);
TRACE(" - bGrooveLevel = %i\n", tmpEntry->pCommand.bGrooveLevel);
TRACE(" - bGrooveRange = %i\n", tmpEntry->pCommand.bGrooveRange);
TRACE(" - bRepeatMode = %i\n", tmpEntry->pCommand.bRepeatMode);
r++;
}
}
return S_OK;
}
HRESULT WINAPI IDirectMusicCommandTrackStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty)
{
HRESULT WINAPI IDirectMusicCommandTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicCommandTrackStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize)
{
HRESULT WINAPI IDirectMusicCommandTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) {
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicCommandTrackStream_Vtbl =
{
ICOM_VTABLE(IPersistStream) DirectMusicCommandTrack_PersistStream_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicCommandTrackStream_QueryInterface,
IDirectMusicCommandTrackStream_AddRef,
IDirectMusicCommandTrackStream_Release,
IDirectMusicCommandTrackStream_GetClassID,
IDirectMusicCommandTrackStream_IsDirty,
IDirectMusicCommandTrackStream_Load,
IDirectMusicCommandTrackStream_Save,
IDirectMusicCommandTrackStream_GetSizeMax
IDirectMusicCommandTrack_IPersistStream_QueryInterface,
IDirectMusicCommandTrack_IPersistStream_AddRef,
IDirectMusicCommandTrack_IPersistStream_Release,
IDirectMusicCommandTrack_IPersistStream_GetClassID,
IDirectMusicCommandTrack_IPersistStream_IsDirty,
IDirectMusicCommandTrack_IPersistStream_Load,
IDirectMusicCommandTrack_IPersistStream_Save,
IDirectMusicCommandTrack_IPersistStream_GetSizeMax
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicCommandTrack (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) {
IDirectMusicCommandTrack* track;
track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicCommandTrack));
if (NULL == track) {
*ppobj = (LPVOID) NULL;
return E_OUTOFMEMORY;
}
track->UnknownVtbl = &DirectMusicCommandTrack_Unknown_Vtbl;
track->TrackVtbl = &DirectMusicCommandTrack_Track_Vtbl;
track->PersistStreamVtbl = &DirectMusicCommandTrack_PersistStream_Vtbl;
track->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC));
DM_STRUCT_INIT(track->pDesc);
track->pDesc->dwValidData |= DMUS_OBJ_CLASS;
memcpy (&track->pDesc->guidClass, &CLSID_DirectMusicCommandTrack, sizeof (CLSID));
track->ref = 0; /* will be inited by QueryInterface */
list_init (&track->Commands);
return IDirectMusicCommandTrack_IUnknown_QueryInterface ((LPUNKNOWN)&track->UnknownVtbl, lpcGUID, ppobj);
}

View File

@ -1,6 +1,6 @@
/* DirectMusicStyle Main
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -21,8 +21,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(dmstyle);
typedef struct
{
typedef struct {
/* IUnknown fields */
ICOM_VFIELD(IClassFactory);
DWORD ref;
@ -31,41 +30,32 @@ typedef struct
/******************************************************************
* DirectMusicSection ClassFactory
*/
static HRESULT WINAPI SectionCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI SectionCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI SectionCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI SectionCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI SectionCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI SectionCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI SectionCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI SectionCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
/* nothing here yet */
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
static HRESULT WINAPI SectionCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI SectionCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -85,45 +75,30 @@ static IClassFactoryImpl Section_CF = {&SectionCF_Vtbl, 1 };
/******************************************************************
* DirectMusicStyle ClassFactory
*/
static HRESULT WINAPI StyleCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI StyleCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI StyleCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI StyleCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI StyleCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI StyleCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI StyleCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI StyleCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualIID (riid, &IID_IDirectMusicStyle) ||
IsEqualIID (riid, &IID_IDirectMusicStyle8)) {
return DMUSIC_CreateDirectMusicStyle (riid, (LPDIRECTMUSICSTYLE8*)ppobj, pOuter);
} else if (IsEqualIID (riid, &IID_IDirectMusicObject)) {
return DMUSIC_CreateDirectMusicStyleObject (riid, (LPDIRECTMUSICOBJECT*) ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
return DMUSIC_CreateDirectMusicStyleImpl (riid, ppobj, pOuter);
}
static HRESULT WINAPI StyleCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI StyleCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -143,43 +118,30 @@ static IClassFactoryImpl Style_CF = {&StyleCF_Vtbl, 1 };
/******************************************************************
* DirectMusicChordTrack ClassFactory
*/
static HRESULT WINAPI ChordTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI ChordTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI ChordTrackCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI ChordTrackCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI ChordTrackCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI ChordTrackCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI ChordTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI ChordTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualIID (riid, &IID_IDirectMusicTrack)
|| IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
return DMUSIC_CreateDirectMusicChordTrack (riid, (LPDIRECTMUSICTRACK8*) ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
return DMUSIC_CreateDirectMusicChordTrack (riid, ppobj, pOuter);
}
static HRESULT WINAPI ChordTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI ChordTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -199,43 +161,30 @@ static IClassFactoryImpl ChordTrack_CF = {&ChordTrackCF_Vtbl, 1 };
/******************************************************************
* DirectMusicCommandTrack ClassFactory
*/
static HRESULT WINAPI CommandTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI CommandTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI CommandTrackCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI CommandTrackCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI CommandTrackCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI CommandTrackCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI CommandTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI CommandTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualIID (riid, &IID_IDirectMusicTrack)
|| IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
return DMUSIC_CreateDirectMusicCommandTrack (riid, (LPDIRECTMUSICTRACK8*) ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
return DMUSIC_CreateDirectMusicCommandTrack (riid, ppobj, pOuter);
}
static HRESULT WINAPI CommandTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI CommandTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -255,43 +204,30 @@ static IClassFactoryImpl CommandTrack_CF = {&CommandTrackCF_Vtbl, 1 };
/******************************************************************
* DirectMusicStyleTrack ClassFactory
*/
static HRESULT WINAPI StyleTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI StyleTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI StyleTrackCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI StyleTrackCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI StyleTrackCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI StyleTrackCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI StyleTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI StyleTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualIID (riid, &IID_IDirectMusicTrack)
|| IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
return DMUSIC_CreateDirectMusicStyleTrack (riid, (LPDIRECTMUSICTRACK8*) ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
return DMUSIC_CreateDirectMusicStyleTrack (riid, ppobj, pOuter);
}
static HRESULT WINAPI StyleTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI StyleTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -311,43 +247,30 @@ static IClassFactoryImpl StyleTrack_CF = {&StyleTrackCF_Vtbl, 1 };
/******************************************************************
* DirectMusicMotifTrack ClassFactory
*/
static HRESULT WINAPI MotifTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI MotifTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI MotifTrackCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI MotifTrackCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI MotifTrackCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI MotifTrackCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI MotifTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI MotifTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualIID (riid, &IID_IDirectMusicTrack)
|| IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
return DMUSIC_CreateDirectMusicMotifTrack (riid, (LPDIRECTMUSICTRACK8*) ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
return DMUSIC_CreateDirectMusicMotifTrack (riid, ppobj, pOuter);
}
static HRESULT WINAPI MotifTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI MotifTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -367,43 +290,30 @@ static IClassFactoryImpl MotifTrack_CF = {&MotifTrackCF_Vtbl, 1 };
/******************************************************************
* DirectMusicAuditionTrack ClassFactory
*/
static HRESULT WINAPI AuditionTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI AuditionTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI AuditionTrackCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI AuditionTrackCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI AuditionTrackCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI AuditionTrackCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI AuditionTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI AuditionTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualIID (riid, &IID_IDirectMusicTrack)
|| IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
return DMUSIC_CreateDirectMusicAuditionTrack (riid, (LPDIRECTMUSICTRACK8*) ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
return DMUSIC_CreateDirectMusicAuditionTrack (riid, ppobj, pOuter);
}
static HRESULT WINAPI AuditionTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI AuditionTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -423,43 +333,30 @@ static IClassFactoryImpl AuditionTrack_CF = {&AuditionTrackCF_Vtbl, 1 };
/******************************************************************
* DirectMusicMuteTrack ClassFactory
*/
static HRESULT WINAPI MuteTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI MuteTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI MuteTrackCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI MuteTrackCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI MuteTrackCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI MuteTrackCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI MuteTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI MuteTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualIID (riid, &IID_IDirectMusicTrack)
|| IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
return DMUSIC_CreateDirectMusicMuteTrack (riid, (LPDIRECTMUSICTRACK8*) ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
return DMUSIC_CreateDirectMusicMuteTrack (riid, ppobj, pOuter);
}
static HRESULT WINAPI MuteTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI MuteTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -476,76 +373,16 @@ static ICOM_VTABLE(IClassFactory) MuteTrackCF_Vtbl = {
static IClassFactoryImpl MuteTrack_CF = {&MuteTrackCF_Vtbl, 1 };
/******************************************************************
* DirectMusicMelodyFormulationTrack ClassFactory
*/
static HRESULT WINAPI MelodyFormulationTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI MelodyFormulationTrackCF_AddRef(LPCLASSFACTORY iface)
{
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI MelodyFormulationTrackCF_Release(LPCLASSFACTORY iface)
{
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI MelodyFormulationTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualIID (riid, &IID_IDirectMusicTrack)
|| IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
return DMUSIC_CreateDirectMusicMelodyFormulationTrack (riid, (LPDIRECTMUSICTRACK8*) ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
static HRESULT WINAPI MelodyFormulationTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
}
static ICOM_VTABLE(IClassFactory) MelodyFormulationTrackCF_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
MelodyFormulationTrackCF_QueryInterface,
MelodyFormulationTrackCF_AddRef,
MelodyFormulationTrackCF_Release,
MelodyFormulationTrackCF_CreateInstance,
MelodyFormulationTrackCF_LockServer
};
static IClassFactoryImpl MelodyFormulationTrack_CF = {&MelodyFormulationTrackCF_Vtbl, 1 };
/******************************************************************
* DllMain
*
*
*/
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
if (fdwReason == DLL_PROCESS_ATTACH)
{
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
if (fdwReason == DLL_PROCESS_ATTACH) {
DisableThreadLibraryCalls(hinstDLL);
/* FIXME: Initialisation */
}
else if (fdwReason == DLL_PROCESS_DETACH)
{
} else if (fdwReason == DLL_PROCESS_DETACH) {
/* FIXME: Cleanup */
}
@ -558,10 +395,8 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
*
*
*/
HRESULT WINAPI DMSTYLE_DllCanUnloadNow(void)
{
HRESULT WINAPI DMSTYLE_DllCanUnloadNow(void) {
FIXME("(void): stub\n");
return S_FALSE;
}
@ -571,8 +406,7 @@ HRESULT WINAPI DMSTYLE_DllCanUnloadNow(void)
*
*
*/
HRESULT WINAPI DMSTYLE_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
{
HRESULT WINAPI DMSTYLE_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) {
TRACE("(%p,%p,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
if (IsEqualCLSID (rclsid, &CLSID_DirectMusicSection) && IsEqualIID (riid, &IID_IClassFactory)) {
@ -607,11 +441,7 @@ HRESULT WINAPI DMSTYLE_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *p
*ppv = (LPVOID) &MuteTrack_CF;
IClassFactory_AddRef((IClassFactory*)*ppv);
return S_OK;
} else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicMelodyFormulationTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
*ppv = (LPVOID) &MelodyFormulationTrack_CF;
IClassFactory_AddRef((IClassFactory*)*ppv);
return S_OK;
}
}
WARN("(%p,%p,%p): no interface found.\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
return CLASS_E_CLASSNOTAVAILABLE;

File diff suppressed because it is too large Load Diff

View File

@ -1,345 +0,0 @@
/* IDirectMusicMelodyFormulationTrack 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 <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "dmstyle_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmstyle);
WINE_DECLARE_DEBUG_CHANNEL(dmfile);
/*****************************************************************************
* IDirectMusicMelodyFormulationTrack implementation
*/
/* IDirectMusicMelodyFormulationTrack IUnknown part: */
HRESULT WINAPI IDirectMusicMelodyFormulationTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicMelodyFormulationTrack,iface);
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IDirectMusicTrack) ||
IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
IDirectMusicMelodyFormulationTrack_AddRef(iface);
*ppobj = This;
return S_OK;
} else if (IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicMelodyFormulationTrackStream_AddRef ((LPPERSISTSTREAM)This->pStream);
*ppobj = This->pStream;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicMelodyFormulationTrack_AddRef (LPDIRECTMUSICTRACK8 iface)
{
ICOM_THIS(IDirectMusicMelodyFormulationTrack,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicMelodyFormulationTrack_Release (LPDIRECTMUSICTRACK8 iface)
{
ICOM_THIS(IDirectMusicMelodyFormulationTrack,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicMelodyFormulationTrack IDirectMusicTrack part: */
HRESULT WINAPI IDirectMusicMelodyFormulationTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment)
{
ICOM_THIS(IDirectMusicMelodyFormulationTrack,iface);
FIXME("(%p, %p): stub\n", This, pSegment);
return S_OK;
}
HRESULT WINAPI IDirectMusicMelodyFormulationTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicMelodyFormulationTrack,iface);
FIXME("(%p, %p, %p, %p, %ld, %ld): stub\n", This, pSegmentState, pPerformance, ppStateData, dwVirtualTrack8ID, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicMelodyFormulationTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData)
{
ICOM_THIS(IDirectMusicMelodyFormulationTrack,iface);
FIXME("(%p, %p): stub\n", This, pStateData);
return S_OK;
}
HRESULT WINAPI IDirectMusicMelodyFormulationTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
{
ICOM_THIS(IDirectMusicMelodyFormulationTrack,iface);
FIXME("(%p, %p, %ld, %ld, %ld, %ld, %p, %p, %ld): stub\n", This, pStateData, mtStart, mtEnd, mtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
return S_OK;
}
HRESULT WINAPI IDirectMusicMelodyFormulationTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam)
{
ICOM_THIS(IDirectMusicMelodyFormulationTrack,iface);
FIXME("(%p, %s, %ld, %p, %p): stub\n", This, debugstr_guid(rguidType), mtTime, pmtNext, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicMelodyFormulationTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam)
{
ICOM_THIS(IDirectMusicMelodyFormulationTrack,iface);
FIXME("(%p, %s, %ld, %p): stub\n", This, debugstr_guid(rguidType), mtTime, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicMelodyFormulationTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType)
{
ICOM_THIS(IDirectMusicMelodyFormulationTrack,iface);
TRACE("(%p, %s): ", This, debugstr_guid(rguidType));
if (IsEqualGUID (rguidType, &GUID_BandParam)
|| IsEqualGUID (rguidType, &GUID_Clear_All_MelodyFragments)
|| IsEqualGUID (rguidType, &GUID_MelodyFragment)) {
TRACE("param supported\n");
return S_OK;
}
TRACE("param unsupported\n");
return DMUS_E_TYPE_UNSUPPORTED;
}
HRESULT WINAPI IDirectMusicMelodyFormulationTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType)
{
ICOM_THIS(IDirectMusicMelodyFormulationTrack,iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
return S_OK;
}
HRESULT WINAPI IDirectMusicMelodyFormulationTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType)
{
ICOM_THIS(IDirectMusicMelodyFormulationTrack,iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
return S_OK;
}
HRESULT WINAPI IDirectMusicMelodyFormulationTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack)
{
ICOM_THIS(IDirectMusicMelodyFormulationTrack,iface);
FIXME("(%p, %ld, %ld, %p): stub\n", This, mtStart, mtEnd, ppTrack);
return S_OK;
}
/* IDirectMusicMelodyFormulationTrack IDirectMusicTrack8 part: */
HRESULT WINAPI IDirectMusicMelodyFormulationTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
{
ICOM_THIS(IDirectMusicMelodyFormulationTrack,iface);
FIXME("(%p, %p, %lli, %lli, %lli, %ld, %p, %p, %ld): stub\n", This, pStateData, rtStart, rtEnd, rtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
return S_OK;
}
HRESULT WINAPI IDirectMusicMelodyFormulationTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicMelodyFormulationTrack,iface);
FIXME("(%p, %s, %lli, %p, %p, %p, %ld): stub\n", This, debugstr_guid(rguidType), rtTime, prtNext, pParam, pStateData, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicMelodyFormulationTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicMelodyFormulationTrack,iface);
FIXME("(%p, %s, %lli, %p, %p, %ld): stub\n", This, debugstr_guid(rguidType), rtTime, pParam, pStateData, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicMelodyFormulationTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack)
{
ICOM_THIS(IDirectMusicMelodyFormulationTrack,iface);
FIXME("(%p, %p, %ld, %p): stub\n", This, pContext, dwTrackGroup, ppResultTrack);
return S_OK;
}
HRESULT WINAPI IDirectMusicMelodyFormulationTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack)
{
ICOM_THIS(IDirectMusicMelodyFormulationTrack,iface);
FIXME("(%p, %p, %ld, %p, %ld, %p): stub\n", This, pNewTrack, mtJoin, pContext, dwTrackGroup, ppResultTrack);
return S_OK;
}
ICOM_VTABLE(IDirectMusicTrack8) DirectMusicMelodyFormulationTrack_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicMelodyFormulationTrack_QueryInterface,
IDirectMusicMelodyFormulationTrack_AddRef,
IDirectMusicMelodyFormulationTrack_Release,
IDirectMusicMelodyFormulationTrack_Init,
IDirectMusicMelodyFormulationTrack_InitPlay,
IDirectMusicMelodyFormulationTrack_EndPlay,
IDirectMusicMelodyFormulationTrack_Play,
IDirectMusicMelodyFormulationTrack_GetParam,
IDirectMusicMelodyFormulationTrack_SetParam,
IDirectMusicMelodyFormulationTrack_IsParamSupported,
IDirectMusicMelodyFormulationTrack_AddNotificationType,
IDirectMusicMelodyFormulationTrack_RemoveNotificationType,
IDirectMusicMelodyFormulationTrack_Clone,
IDirectMusicMelodyFormulationTrack_PlayEx,
IDirectMusicMelodyFormulationTrack_GetParamEx,
IDirectMusicMelodyFormulationTrack_SetParamEx,
IDirectMusicMelodyFormulationTrack_Compose,
IDirectMusicMelodyFormulationTrack_Join
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicMelodyFormulationTrack (LPCGUID lpcGUID, LPDIRECTMUSICTRACK8 *ppTrack, LPUNKNOWN pUnkOuter)
{
IDirectMusicMelodyFormulationTrack* track;
if (IsEqualIID (lpcGUID, &IID_IDirectMusicTrack)
|| IsEqualIID (lpcGUID, &IID_IDirectMusicTrack8)) {
track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicMelodyFormulationTrack));
if (NULL == track) {
*ppTrack = (LPDIRECTMUSICTRACK8) NULL;
return E_OUTOFMEMORY;
}
track->lpVtbl = &DirectMusicMelodyFormulationTrack_Vtbl;
track->ref = 1;
track->pStream = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(IDirectMusicMelodyFormulationTrackStream));
track->pStream->lpVtbl = &DirectMusicMelodyFormulationTrackStream_Vtbl;
track->pStream->ref = 1;
track->pStream->pParentTrack = track;
*ppTrack = (LPDIRECTMUSICTRACK8) track;
return S_OK;
}
WARN("No interface found\n");
return E_NOINTERFACE;
}
/*****************************************************************************
* IDirectMusicMelodyFormulationTrackStream implementation
*/
/* IDirectMusicMelodyFormulationTrackStream IUnknown part follow: */
HRESULT WINAPI IDirectMusicMelodyFormulationTrackStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicMelodyFormulationTrackStream,iface);
if (IsEqualIID(riid, &IID_IUnknown)
|| IsEqualIID(riid, &IID_IPersistStream)) {
IDirectMusicMelodyFormulationTrackStream_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicMelodyFormulationTrackStream_AddRef (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicMelodyFormulationTrackStream,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicMelodyFormulationTrackStream_Release (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicMelodyFormulationTrackStream,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicMelodyFormulationTrackStream IPersist part: */
HRESULT WINAPI IDirectMusicMelodyFormulationTrackStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID)
{
return E_NOTIMPL;
}
/* IDirectMusicMelodyFormulationTrackStream IPersistStream part: */
HRESULT WINAPI IDirectMusicMelodyFormulationTrackStream_IsDirty (LPPERSISTSTREAM iface)
{
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicMelodyFormulationTrackStream_Load (LPPERSISTSTREAM iface, IStream* pStm)
{
FIXME(": Loading not implemented yet\n");
return S_OK;
}
HRESULT WINAPI IDirectMusicMelodyFormulationTrackStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty)
{
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicMelodyFormulationTrackStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize)
{
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicMelodyFormulationTrackStream_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicMelodyFormulationTrackStream_QueryInterface,
IDirectMusicMelodyFormulationTrackStream_AddRef,
IDirectMusicMelodyFormulationTrackStream_Release,
IDirectMusicMelodyFormulationTrackStream_GetClassID,
IDirectMusicMelodyFormulationTrackStream_IsDirty,
IDirectMusicMelodyFormulationTrackStream_Load,
IDirectMusicMelodyFormulationTrackStream_Save,
IDirectMusicMelodyFormulationTrackStream_GetSizeMax
};

View File

@ -1,6 +1,6 @@
/* IDirectMusicMotifTrack Implementation
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -17,14 +17,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "dmstyle_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmstyle);
@ -34,36 +26,36 @@ WINE_DECLARE_DEBUG_CHANNEL(dmfile);
* IDirectMusicMotifTrack implementation
*/
/* IDirectMusicMotifTrack IUnknown part: */
HRESULT WINAPI IDirectMusicMotifTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicMotifTrack,iface);
HRESULT WINAPI IDirectMusicMotifTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicMotifTrack, UnknownVtbl, iface);
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IDirectMusicTrack) ||
IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
IDirectMusicMotifTrack_AddRef(iface);
*ppobj = This;
if (IsEqualIID (riid, &IID_IUnknown)) {
*ppobj = (LPUNKNOWN)&This->UnknownVtbl;
IDirectMusicMotifTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicTrack)
|| IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
*ppobj = (LPDIRECTMUSICTRACK8)&This->TrackVtbl;
IDirectMusicMotifTrack_IDirectMusicTrack_AddRef ((LPDIRECTMUSICTRACK8)&This->TrackVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicMotifTrackStream_AddRef ((LPPERSISTSTREAM)This->pStream);
*ppobj = This->pStream;
*ppobj = (LPPERSISTSTREAM)&This->PersistStreamVtbl;
IDirectMusicMotifTrack_IPersistStream_AddRef ((LPPERSISTSTREAM)&This->PersistStreamVtbl);
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicMotifTrack_AddRef (LPDIRECTMUSICTRACK8 iface)
{
ICOM_THIS(IDirectMusicMotifTrack,iface);
ULONG WINAPI IDirectMusicMotifTrack_IUnknown_AddRef (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicMotifTrack, UnknownVtbl, iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicMotifTrack_Release (LPDIRECTMUSICTRACK8 iface)
{
ICOM_THIS(IDirectMusicMotifTrack,iface);
ULONG WINAPI IDirectMusicMotifTrack_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicMotifTrack, UnknownVtbl, iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
@ -72,64 +64,71 @@ ULONG WINAPI IDirectMusicMotifTrack_Release (LPDIRECTMUSICTRACK8 iface)
return ref;
}
/* IDirectMusicMotifTrack IDirectMusicTrack part: */
HRESULT WINAPI IDirectMusicMotifTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment)
{
ICOM_THIS(IDirectMusicMotifTrack,iface);
ICOM_VTABLE(IUnknown) DirectMusicMotifTrack_Unknown_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicMotifTrack_IUnknown_QueryInterface,
IDirectMusicMotifTrack_IUnknown_AddRef,
IDirectMusicMotifTrack_IUnknown_Release
};
/* IDirectMusicMotifTrack IDirectMusicTrack8 part: */
HRESULT WINAPI IDirectMusicMotifTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicMotifTrack, TrackVtbl, iface);
return IDirectMusicMotifTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicMotifTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface) {
ICOM_THIS_MULTI(IDirectMusicMotifTrack, TrackVtbl, iface);
return IDirectMusicMotifTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicMotifTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface) {
ICOM_THIS_MULTI(IDirectMusicMotifTrack, TrackVtbl, iface);
return IDirectMusicMotifTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicMotifTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment)
{
ICOM_THIS_MULTI(IDirectMusicMotifTrack, TrackVtbl, iface);
FIXME("(%p, %p): stub\n", This, pSegment);
return S_OK;
}
HRESULT WINAPI IDirectMusicMotifTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags)
HRESULT WINAPI IDirectMusicMotifTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicMotifTrack,iface);
ICOM_THIS_MULTI(IDirectMusicMotifTrack, TrackVtbl, iface);
FIXME("(%p, %p, %p, %p, %ld, %ld): stub\n", This, pSegmentState, pPerformance, ppStateData, dwVirtualTrack8ID, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicMotifTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData)
HRESULT WINAPI IDirectMusicMotifTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData)
{
ICOM_THIS(IDirectMusicMotifTrack,iface);
ICOM_THIS_MULTI(IDirectMusicMotifTrack, TrackVtbl, iface);
FIXME("(%p, %p): stub\n", This, pStateData);
return S_OK;
}
HRESULT WINAPI IDirectMusicMotifTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
HRESULT WINAPI IDirectMusicMotifTrack_IDirectMusicTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
{
ICOM_THIS(IDirectMusicMotifTrack,iface);
ICOM_THIS_MULTI(IDirectMusicMotifTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %ld, %ld, %ld, %p, %p, %ld): stub\n", This, pStateData, mtStart, mtEnd, mtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
return S_OK;
}
HRESULT WINAPI IDirectMusicMotifTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam)
{
ICOM_THIS(IDirectMusicMotifTrack,iface);
HRESULT WINAPI IDirectMusicMotifTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam) {
ICOM_THIS_MULTI(IDirectMusicMotifTrack, TrackVtbl, iface);
FIXME("(%p, %s, %ld, %p, %p): stub\n", This, debugstr_guid(rguidType), mtTime, pmtNext, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicMotifTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam)
{
ICOM_THIS(IDirectMusicMotifTrack,iface);
HRESULT WINAPI IDirectMusicMotifTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam) {
ICOM_THIS_MULTI(IDirectMusicMotifTrack, TrackVtbl, iface);
FIXME("(%p, %s, %ld, %p): stub\n", This, debugstr_guid(rguidType), mtTime, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicMotifTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType)
{
ICOM_THIS(IDirectMusicMotifTrack,iface);
HRESULT WINAPI IDirectMusicMotifTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType) {
ICOM_THIS_MULTI(IDirectMusicMotifTrack, TrackVtbl, iface);
TRACE("(%p, %s): ", This, debugstr_guid(rguidType));
if (IsEqualGUID (rguidType, &GUID_DisableTimeSig)
@ -138,209 +137,147 @@ HRESULT WINAPI IDirectMusicMotifTrack_IsParamSupported (LPDIRECTMUSICTRACK8 ifac
|| IsEqualGUID (rguidType, &GUID_Valid_Start_Time)) {
TRACE("param supported\n");
return S_OK;
}
}
TRACE("param unsupported\n");
return DMUS_E_TYPE_UNSUPPORTED;
}
HRESULT WINAPI IDirectMusicMotifTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType)
{
ICOM_THIS(IDirectMusicMotifTrack,iface);
HRESULT WINAPI IDirectMusicMotifTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
ICOM_THIS_MULTI(IDirectMusicMotifTrack, TrackVtbl, iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
return S_OK;
}
HRESULT WINAPI IDirectMusicMotifTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType)
{
ICOM_THIS(IDirectMusicMotifTrack,iface);
HRESULT WINAPI IDirectMusicMotifTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
ICOM_THIS_MULTI(IDirectMusicMotifTrack, TrackVtbl, iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
return S_OK;
}
HRESULT WINAPI IDirectMusicMotifTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack)
{
ICOM_THIS(IDirectMusicMotifTrack,iface);
HRESULT WINAPI IDirectMusicMotifTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack) {
ICOM_THIS_MULTI(IDirectMusicMotifTrack, TrackVtbl, iface);
FIXME("(%p, %ld, %ld, %p): stub\n", This, mtStart, mtEnd, ppTrack);
return S_OK;
}
/* IDirectMusicMotifTrack IDirectMusicTrack8 part: */
HRESULT WINAPI IDirectMusicMotifTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
{
ICOM_THIS(IDirectMusicMotifTrack,iface);
HRESULT WINAPI IDirectMusicMotifTrack_IDirectMusicTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID) {
ICOM_THIS_MULTI(IDirectMusicMotifTrack, TrackVtbl, iface);
FIXME("(%p, %p, %lli, %lli, %lli, %ld, %p, %p, %ld): stub\n", This, pStateData, rtStart, rtEnd, rtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
return S_OK;
}
HRESULT WINAPI IDirectMusicMotifTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicMotifTrack,iface);
HRESULT WINAPI IDirectMusicMotifTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicMotifTrack, TrackVtbl, iface);
FIXME("(%p, %s, %lli, %p, %p, %p, %ld): stub\n", This, debugstr_guid(rguidType), rtTime, prtNext, pParam, pStateData, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicMotifTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicMotifTrack,iface);
HRESULT WINAPI IDirectMusicMotifTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicMotifTrack, TrackVtbl, iface);
FIXME("(%p, %s, %lli, %p, %p, %ld): stub\n", This, debugstr_guid(rguidType), rtTime, pParam, pStateData, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicMotifTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack)
{
ICOM_THIS(IDirectMusicMotifTrack,iface);
HRESULT WINAPI IDirectMusicMotifTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
ICOM_THIS_MULTI(IDirectMusicMotifTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %p): stub\n", This, pContext, dwTrackGroup, ppResultTrack);
return S_OK;
}
HRESULT WINAPI IDirectMusicMotifTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack)
{
ICOM_THIS(IDirectMusicMotifTrack,iface);
HRESULT WINAPI IDirectMusicMotifTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
ICOM_THIS_MULTI(IDirectMusicMotifTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %p, %ld, %p): stub\n", This, pNewTrack, mtJoin, pContext, dwTrackGroup, ppResultTrack);
return S_OK;
}
ICOM_VTABLE(IDirectMusicTrack8) DirectMusicMotifTrack_Vtbl =
{
ICOM_VTABLE(IDirectMusicTrack8) DirectMusicMotifTrack_Track_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicMotifTrack_QueryInterface,
IDirectMusicMotifTrack_AddRef,
IDirectMusicMotifTrack_Release,
IDirectMusicMotifTrack_Init,
IDirectMusicMotifTrack_InitPlay,
IDirectMusicMotifTrack_EndPlay,
IDirectMusicMotifTrack_Play,
IDirectMusicMotifTrack_GetParam,
IDirectMusicMotifTrack_SetParam,
IDirectMusicMotifTrack_IsParamSupported,
IDirectMusicMotifTrack_AddNotificationType,
IDirectMusicMotifTrack_RemoveNotificationType,
IDirectMusicMotifTrack_Clone,
IDirectMusicMotifTrack_PlayEx,
IDirectMusicMotifTrack_GetParamEx,
IDirectMusicMotifTrack_SetParamEx,
IDirectMusicMotifTrack_Compose,
IDirectMusicMotifTrack_Join
IDirectMusicMotifTrack_IDirectMusicTrack_QueryInterface,
IDirectMusicMotifTrack_IDirectMusicTrack_AddRef,
IDirectMusicMotifTrack_IDirectMusicTrack_Release,
IDirectMusicMotifTrack_IDirectMusicTrack_Init,
IDirectMusicMotifTrack_IDirectMusicTrack_InitPlay,
IDirectMusicMotifTrack_IDirectMusicTrack_EndPlay,
IDirectMusicMotifTrack_IDirectMusicTrack_Play,
IDirectMusicMotifTrack_IDirectMusicTrack_GetParam,
IDirectMusicMotifTrack_IDirectMusicTrack_SetParam,
IDirectMusicMotifTrack_IDirectMusicTrack_IsParamSupported,
IDirectMusicMotifTrack_IDirectMusicTrack_AddNotificationType,
IDirectMusicMotifTrack_IDirectMusicTrack_RemoveNotificationType,
IDirectMusicMotifTrack_IDirectMusicTrack_Clone,
IDirectMusicMotifTrack_IDirectMusicTrack_PlayEx,
IDirectMusicMotifTrack_IDirectMusicTrack_GetParamEx,
IDirectMusicMotifTrack_IDirectMusicTrack_SetParamEx,
IDirectMusicMotifTrack_IDirectMusicTrack_Compose,
IDirectMusicMotifTrack_IDirectMusicTrack_Join
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicMotifTrack (LPCGUID lpcGUID, LPDIRECTMUSICTRACK8 *ppTrack, LPUNKNOWN pUnkOuter)
{
IDirectMusicMotifTrack* track;
if (IsEqualIID (lpcGUID, &IID_IDirectMusicTrack)
|| IsEqualIID (lpcGUID, &IID_IDirectMusicTrack8)) {
track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicMotifTrack));
if (NULL == track) {
*ppTrack = (LPDIRECTMUSICTRACK8) NULL;
return E_OUTOFMEMORY;
}
track->lpVtbl = &DirectMusicMotifTrack_Vtbl;
track->ref = 1;
track->pStream = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(IDirectMusicMotifTrackStream));
track->pStream->lpVtbl = &DirectMusicMotifTrackStream_Vtbl;
track->pStream->ref = 1;
track->pStream->pParentTrack = track;
*ppTrack = (LPDIRECTMUSICTRACK8) track;
return S_OK;
}
WARN("No interface found\n");
return E_NOINTERFACE;
/* IDirectMusicMotifTrack IPersistStream part: */
HRESULT WINAPI IDirectMusicMotifTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicMotifTrack, PersistStreamVtbl, iface);
return IDirectMusicMotifTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
/*****************************************************************************
* IDirectMusicMotifTrackStream implementation
*/
/* IDirectMusicMotifTrackStream IUnknown part follow: */
HRESULT WINAPI IDirectMusicMotifTrackStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicMotifTrackStream,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicMotifTrackStream_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
ULONG WINAPI IDirectMusicMotifTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicMotifTrack, PersistStreamVtbl, iface);
return IDirectMusicMotifTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicMotifTrackStream_AddRef (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicMotifTrackStream,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
ULONG WINAPI IDirectMusicMotifTrack_IPersistStream_Release (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicMotifTrack, PersistStreamVtbl, iface);
return IDirectMusicMotifTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicMotifTrackStream_Release (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicMotifTrackStream,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicMotifTrackStream IPersist part: */
HRESULT WINAPI IDirectMusicMotifTrackStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID)
{
HRESULT WINAPI IDirectMusicMotifTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) {
return E_NOTIMPL;
}
/* IDirectMusicMotifTrackStream IPersistStream part: */
HRESULT WINAPI IDirectMusicMotifTrackStream_IsDirty (LPPERSISTSTREAM iface)
{
HRESULT WINAPI IDirectMusicMotifTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicMotifTrackStream_Load (LPPERSISTSTREAM iface, IStream* pStm)
{
HRESULT WINAPI IDirectMusicMotifTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm) {
FIXME(": Loading not implemented yet\n");
return S_OK;
}
HRESULT WINAPI IDirectMusicMotifTrackStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty)
{
HRESULT WINAPI IDirectMusicMotifTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicMotifTrackStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize)
{
HRESULT WINAPI IDirectMusicMotifTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) {
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicMotifTrackStream_Vtbl =
{
ICOM_VTABLE(IPersistStream) DirectMusicMotifTrack_PersistStream_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicMotifTrackStream_QueryInterface,
IDirectMusicMotifTrackStream_AddRef,
IDirectMusicMotifTrackStream_Release,
IDirectMusicMotifTrackStream_GetClassID,
IDirectMusicMotifTrackStream_IsDirty,
IDirectMusicMotifTrackStream_Load,
IDirectMusicMotifTrackStream_Save,
IDirectMusicMotifTrackStream_GetSizeMax
IDirectMusicMotifTrack_IPersistStream_QueryInterface,
IDirectMusicMotifTrack_IPersistStream_AddRef,
IDirectMusicMotifTrack_IPersistStream_Release,
IDirectMusicMotifTrack_IPersistStream_GetClassID,
IDirectMusicMotifTrack_IPersistStream_IsDirty,
IDirectMusicMotifTrack_IPersistStream_Load,
IDirectMusicMotifTrack_IPersistStream_Save,
IDirectMusicMotifTrack_IPersistStream_GetSizeMax
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicMotifTrack (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) {
IDirectMusicMotifTrack* track;
track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicMotifTrack));
if (NULL == track) {
*ppobj = (LPVOID) NULL;
return E_OUTOFMEMORY;
}
track->UnknownVtbl = &DirectMusicMotifTrack_Unknown_Vtbl;
track->TrackVtbl = &DirectMusicMotifTrack_Track_Vtbl;
track->PersistStreamVtbl = &DirectMusicMotifTrack_PersistStream_Vtbl;
track->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC));
DM_STRUCT_INIT(track->pDesc);
track->pDesc->dwValidData |= DMUS_OBJ_CLASS;
memcpy (&track->pDesc->guidClass, &CLSID_DirectMusicMotifTrack, sizeof (CLSID));
track->ref = 0; /* will be inited by QueryInterface */
return IDirectMusicMotifTrack_IUnknown_QueryInterface ((LPUNKNOWN)&track->UnknownVtbl, lpcGUID, ppobj);
}

View File

@ -1,6 +1,6 @@
/* IDirectMusicMuteTrack Implementation
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -17,14 +17,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "dmstyle_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmstyle);
@ -34,36 +26,36 @@ WINE_DECLARE_DEBUG_CHANNEL(dmfile);
* IDirectMusicMuteTrack implementation
*/
/* IDirectMusicMuteTrack IUnknown part: */
HRESULT WINAPI IDirectMusicMuteTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicMuteTrack,iface);
HRESULT WINAPI IDirectMusicMuteTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicMuteTrack, UnknownVtbl, iface);
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IDirectMusicTrack) ||
IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
IDirectMusicMuteTrack_AddRef(iface);
*ppobj = This;
if (IsEqualIID (riid, &IID_IUnknown)) {
*ppobj = (LPUNKNOWN)&This->UnknownVtbl;
IDirectMusicMuteTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicTrack)
|| IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
*ppobj = (LPDIRECTMUSICTRACK8)&This->TrackVtbl;
IDirectMusicMuteTrack_IDirectMusicTrack_AddRef ((LPDIRECTMUSICTRACK8)&This->TrackVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicMuteTrackStream_AddRef ((LPPERSISTSTREAM)This->pStream);
*ppobj = This->pStream;
*ppobj = (LPPERSISTSTREAM)&This->PersistStreamVtbl;
IDirectMusicMuteTrack_IPersistStream_AddRef ((LPPERSISTSTREAM)&This->PersistStreamVtbl);
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicMuteTrack_AddRef (LPDIRECTMUSICTRACK8 iface)
{
ICOM_THIS(IDirectMusicMuteTrack,iface);
ULONG WINAPI IDirectMusicMuteTrack_IUnknown_AddRef (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicMuteTrack, UnknownVtbl, iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicMuteTrack_Release (LPDIRECTMUSICTRACK8 iface)
{
ICOM_THIS(IDirectMusicMuteTrack,iface);
ULONG WINAPI IDirectMusicMuteTrack_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicMuteTrack, UnknownVtbl, iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
@ -72,315 +64,217 @@ ULONG WINAPI IDirectMusicMuteTrack_Release (LPDIRECTMUSICTRACK8 iface)
return ref;
}
/* IDirectMusicMuteTrack IDirectMusicTrack part: */
HRESULT WINAPI IDirectMusicMuteTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment)
{
ICOM_THIS(IDirectMusicMuteTrack,iface);
ICOM_VTABLE(IUnknown) DirectMusicMuteTrack_Unknown_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicMuteTrack_IUnknown_QueryInterface,
IDirectMusicMuteTrack_IUnknown_AddRef,
IDirectMusicMuteTrack_IUnknown_Release
};
/* IDirectMusicMuteTrack IDirectMusicTrack8 part: */
HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicMuteTrack, TrackVtbl, iface);
return IDirectMusicMuteTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface) {
ICOM_THIS_MULTI(IDirectMusicMuteTrack, TrackVtbl, iface);
return IDirectMusicMuteTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface) {
ICOM_THIS_MULTI(IDirectMusicMuteTrack, TrackVtbl, iface);
return IDirectMusicMuteTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment)
{
ICOM_THIS_MULTI(IDirectMusicMuteTrack, TrackVtbl, iface);
FIXME("(%p, %p): stub\n", This, pSegment);
return S_OK;
}
HRESULT WINAPI IDirectMusicMuteTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags)
HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicMuteTrack,iface);
ICOM_THIS_MULTI(IDirectMusicMuteTrack, TrackVtbl, iface);
FIXME("(%p, %p, %p, %p, %ld, %ld): stub\n", This, pSegmentState, pPerformance, ppStateData, dwVirtualTrack8ID, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicMuteTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData)
HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData)
{
ICOM_THIS(IDirectMusicMuteTrack,iface);
ICOM_THIS_MULTI(IDirectMusicMuteTrack, TrackVtbl, iface);
FIXME("(%p, %p): stub\n", This, pStateData);
return S_OK;
}
HRESULT WINAPI IDirectMusicMuteTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
{
ICOM_THIS(IDirectMusicMuteTrack,iface);
ICOM_THIS_MULTI(IDirectMusicMuteTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %ld, %ld, %ld, %p, %p, %ld): stub\n", This, pStateData, mtStart, mtEnd, mtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
return S_OK;
}
HRESULT WINAPI IDirectMusicMuteTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam)
{
ICOM_THIS(IDirectMusicMuteTrack,iface);
HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam) {
ICOM_THIS_MULTI(IDirectMusicMuteTrack, TrackVtbl, iface);
FIXME("(%p, %s, %ld, %p, %p): stub\n", This, debugstr_guid(rguidType), mtTime, pmtNext, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicMuteTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam)
{
ICOM_THIS(IDirectMusicMuteTrack,iface);
HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam) {
ICOM_THIS_MULTI(IDirectMusicMuteTrack, TrackVtbl, iface);
FIXME("(%p, %s, %ld, %p): stub\n", This, debugstr_guid(rguidType), mtTime, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicMuteTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType)
{
ICOM_THIS(IDirectMusicMuteTrack,iface);
HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType) {
ICOM_THIS_MULTI(IDirectMusicMuteTrack, TrackVtbl, iface);
TRACE("(%p, %s): ", This, debugstr_guid(rguidType));
if (IsEqualGUID (rguidType, &GUID_MuteParam)) {
TRACE("param supported\n");
return S_OK;
}
}
TRACE("param unsupported\n");
return DMUS_E_TYPE_UNSUPPORTED;
}
HRESULT WINAPI IDirectMusicMuteTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType)
{
ICOM_THIS(IDirectMusicMuteTrack,iface);
HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
ICOM_THIS_MULTI(IDirectMusicMuteTrack, TrackVtbl, iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
return S_OK;
}
HRESULT WINAPI IDirectMusicMuteTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType)
{
ICOM_THIS(IDirectMusicMuteTrack,iface);
HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
ICOM_THIS_MULTI(IDirectMusicMuteTrack, TrackVtbl, iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
return S_OK;
}
HRESULT WINAPI IDirectMusicMuteTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack)
{
ICOM_THIS(IDirectMusicMuteTrack,iface);
HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack) {
ICOM_THIS_MULTI(IDirectMusicMuteTrack, TrackVtbl, iface);
FIXME("(%p, %ld, %ld, %p): stub\n", This, mtStart, mtEnd, ppTrack);
return S_OK;
}
/* IDirectMusicMuteTrack IDirectMusicTrack8 part: */
HRESULT WINAPI IDirectMusicMuteTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
{
ICOM_THIS(IDirectMusicMuteTrack,iface);
HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID) {
ICOM_THIS_MULTI(IDirectMusicMuteTrack, TrackVtbl, iface);
FIXME("(%p, %p, %lli, %lli, %lli, %ld, %p, %p, %ld): stub\n", This, pStateData, rtStart, rtEnd, rtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
return S_OK;
}
HRESULT WINAPI IDirectMusicMuteTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicMuteTrack,iface);
HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicMuteTrack, TrackVtbl, iface);
FIXME("(%p, %s, %lli, %p, %p, %p, %ld): stub\n", This, debugstr_guid(rguidType), rtTime, prtNext, pParam, pStateData, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicMuteTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicMuteTrack,iface);
HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicMuteTrack, TrackVtbl, iface);
FIXME("(%p, %s, %lli, %p, %p, %ld): stub\n", This, debugstr_guid(rguidType), rtTime, pParam, pStateData, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicMuteTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack)
{
ICOM_THIS(IDirectMusicMuteTrack,iface);
HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
ICOM_THIS_MULTI(IDirectMusicMuteTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %p): stub\n", This, pContext, dwTrackGroup, ppResultTrack);
return S_OK;
}
HRESULT WINAPI IDirectMusicMuteTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack)
{
ICOM_THIS(IDirectMusicMuteTrack,iface);
HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
ICOM_THIS_MULTI(IDirectMusicMuteTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %p, %ld, %p): stub\n", This, pNewTrack, mtJoin, pContext, dwTrackGroup, ppResultTrack);
return S_OK;
}
ICOM_VTABLE(IDirectMusicTrack8) DirectMusicMuteTrack_Vtbl =
{
ICOM_VTABLE(IDirectMusicTrack8) DirectMusicMuteTrack_Track_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicMuteTrack_QueryInterface,
IDirectMusicMuteTrack_AddRef,
IDirectMusicMuteTrack_Release,
IDirectMusicMuteTrack_Init,
IDirectMusicMuteTrack_InitPlay,
IDirectMusicMuteTrack_EndPlay,
IDirectMusicMuteTrack_Play,
IDirectMusicMuteTrack_GetParam,
IDirectMusicMuteTrack_SetParam,
IDirectMusicMuteTrack_IsParamSupported,
IDirectMusicMuteTrack_AddNotificationType,
IDirectMusicMuteTrack_RemoveNotificationType,
IDirectMusicMuteTrack_Clone,
IDirectMusicMuteTrack_PlayEx,
IDirectMusicMuteTrack_GetParamEx,
IDirectMusicMuteTrack_SetParamEx,
IDirectMusicMuteTrack_Compose,
IDirectMusicMuteTrack_Join
IDirectMusicMuteTrack_IDirectMusicTrack_QueryInterface,
IDirectMusicMuteTrack_IDirectMusicTrack_AddRef,
IDirectMusicMuteTrack_IDirectMusicTrack_Release,
IDirectMusicMuteTrack_IDirectMusicTrack_Init,
IDirectMusicMuteTrack_IDirectMusicTrack_InitPlay,
IDirectMusicMuteTrack_IDirectMusicTrack_EndPlay,
IDirectMusicMuteTrack_IDirectMusicTrack_Play,
IDirectMusicMuteTrack_IDirectMusicTrack_GetParam,
IDirectMusicMuteTrack_IDirectMusicTrack_SetParam,
IDirectMusicMuteTrack_IDirectMusicTrack_IsParamSupported,
IDirectMusicMuteTrack_IDirectMusicTrack_AddNotificationType,
IDirectMusicMuteTrack_IDirectMusicTrack_RemoveNotificationType,
IDirectMusicMuteTrack_IDirectMusicTrack_Clone,
IDirectMusicMuteTrack_IDirectMusicTrack_PlayEx,
IDirectMusicMuteTrack_IDirectMusicTrack_GetParamEx,
IDirectMusicMuteTrack_IDirectMusicTrack_SetParamEx,
IDirectMusicMuteTrack_IDirectMusicTrack_Compose,
IDirectMusicMuteTrack_IDirectMusicTrack_Join
};
/* IDirectMusicMuteTrack IPersistStream part: */
HRESULT WINAPI IDirectMusicMuteTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicMuteTrack, PersistStreamVtbl, iface);
return IDirectMusicMuteTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicMuteTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicMuteTrack, PersistStreamVtbl, iface);
return IDirectMusicMuteTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicMuteTrack_IPersistStream_Release (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicMuteTrack, PersistStreamVtbl, iface);
return IDirectMusicMuteTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicMuteTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicMuteTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicMuteTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm) {
FIXME(": Loading not implemented yet\n");
return S_OK;
}
HRESULT WINAPI IDirectMusicMuteTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicMuteTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) {
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicMuteTrack_PersistStream_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicMuteTrack_IPersistStream_QueryInterface,
IDirectMusicMuteTrack_IPersistStream_AddRef,
IDirectMusicMuteTrack_IPersistStream_Release,
IDirectMusicMuteTrack_IPersistStream_GetClassID,
IDirectMusicMuteTrack_IPersistStream_IsDirty,
IDirectMusicMuteTrack_IPersistStream_Load,
IDirectMusicMuteTrack_IPersistStream_Save,
IDirectMusicMuteTrack_IPersistStream_GetSizeMax
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicMuteTrack (LPCGUID lpcGUID, LPDIRECTMUSICTRACK8 *ppTrack, LPUNKNOWN pUnkOuter)
{
HRESULT WINAPI DMUSIC_CreateDirectMusicMuteTrack (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) {
IDirectMusicMuteTrack* track;
if (IsEqualIID (lpcGUID, &IID_IDirectMusicTrack)
|| IsEqualIID (lpcGUID, &IID_IDirectMusicTrack8)) {
track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicMuteTrack));
if (NULL == track) {
*ppTrack = (LPDIRECTMUSICTRACK8) NULL;
return E_OUTOFMEMORY;
}
track->lpVtbl = &DirectMusicMuteTrack_Vtbl;
track->ref = 1;
track->pStream = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(IDirectMusicMuteTrackStream));
track->pStream->lpVtbl = &DirectMusicMuteTrackStream_Vtbl;
track->pStream->ref = 1;
track->pStream->pParentTrack = track;
*ppTrack = (LPDIRECTMUSICTRACK8) track;
return S_OK;
track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicMuteTrack));
if (NULL == track) {
*ppobj = (LPVOID) NULL;
return E_OUTOFMEMORY;
}
WARN("No interface found\n");
track->UnknownVtbl = &DirectMusicMuteTrack_Unknown_Vtbl;
track->TrackVtbl = &DirectMusicMuteTrack_Track_Vtbl;
track->PersistStreamVtbl = &DirectMusicMuteTrack_PersistStream_Vtbl;
track->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC));
DM_STRUCT_INIT(track->pDesc);
track->pDesc->dwValidData |= DMUS_OBJ_CLASS;
memcpy (&track->pDesc->guidClass, &CLSID_DirectMusicMuteTrack, sizeof (CLSID));
track->ref = 0; /* will be inited by QueryInterface */
return E_NOINTERFACE;
return IDirectMusicMuteTrack_IUnknown_QueryInterface ((LPUNKNOWN)&track->UnknownVtbl, lpcGUID, ppobj);
}
/*****************************************************************************
* IDirectMusicMuteTrackStream implementation
*/
/* IDirectMusicMuteTrackStream IUnknown part follow: */
HRESULT WINAPI IDirectMusicMuteTrackStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicMuteTrackStream,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicMuteTrackStream_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicMuteTrackStream_AddRef (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicMuteTrackStream,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicMuteTrackStream_Release (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicMuteTrackStream,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicMuteTrackStream IPersist part: */
HRESULT WINAPI IDirectMusicMuteTrackStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID)
{
return E_NOTIMPL;
}
/* IDirectMusicMuteTrackStream IPersistStream part: */
HRESULT WINAPI IDirectMusicMuteTrackStream_IsDirty (LPPERSISTSTREAM iface)
{
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicMuteTrackStream_Load (LPPERSISTSTREAM iface, IStream* pStm)
{
ICOM_THIS(IDirectMusicMuteTrackStream,iface);
FOURCC chunkID;
DWORD chunkSize, dwSizeOfStruct;
LARGE_INTEGER liMove; /* used when skipping chunks */
IDirectMusicMuteTrack* pTrack = This->pParentTrack; /* that's where we load data to */
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
IStream_Read (pStm, &chunkSize, sizeof(DWORD), NULL);
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (chunkID), chunkSize);
switch (chunkID) {
case DMUS_FOURCC_MUTE_CHUNK: {
TRACE_(dmfile)(": mute track chunk\n");
IStream_Read (pStm, &dwSizeOfStruct, sizeof(DWORD), NULL);
if (dwSizeOfStruct != sizeof(DMUS_IO_MUTE)) {
TRACE_(dmfile)(": declared size of struct (=%ld) != actual size (=%i); loading failed\n", dwSizeOfStruct, sizeof(DMUS_IO_MUTE));
liMove.QuadPart = chunkSize - sizeof(DWORD);
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */
return E_FAIL;
}
chunkSize -= sizeof(DWORD); /* now chunk size is one DWORD shorter */
pTrack->pMutes = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, chunkSize);
IStream_Read (pStm, pTrack->pMutes, chunkSize, NULL);
pTrack->dwMutes = chunkSize/dwSizeOfStruct;
/* in the end, let's see what we got */
TRACE_(dmfile)(": reading finished\n");
if (TRACE_ON(dmfile)) {
int i;
TRACE_(dmfile)(": (READ): number of mutes in track = %ld\n", pTrack->dwMutes);
for (i = 0; i < pTrack->dwMutes; i++) {
TRACE_(dmfile)(": (READ): mute[%i]: mtTime = %li; dwPChannel = %ld; dwPChannelMap = %ld\n", \
i, pTrack->pMutes[i].mtTime, pTrack->pMutes[i].dwPChannel, pTrack->pMutes[i].dwPChannelMap);
}
}
}
TRACE_(dmfile)(": reading finished\n");
break;
default: {
TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */
return E_FAIL;
}
}
return S_OK;
}
HRESULT WINAPI IDirectMusicMuteTrackStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty)
{
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicMuteTrackStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize)
{
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicMuteTrackStream_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicMuteTrackStream_QueryInterface,
IDirectMusicMuteTrackStream_AddRef,
IDirectMusicMuteTrackStream_Release,
IDirectMusicMuteTrackStream_GetClassID,
IDirectMusicMuteTrackStream_IsDirty,
IDirectMusicMuteTrackStream_Load,
IDirectMusicMuteTrackStream_Save,
IDirectMusicMuteTrackStream_GetSizeMax
};

View File

@ -18,21 +18,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdarg.h>
#include <string.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winreg.h"
#include "winerror.h"
#include "dmusics.h"
#include "dmusici.h"
#include "dmplugin.h"
#include "wine/debug.h"
#include "dmstyle_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmstyle);
@ -44,8 +30,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(dmstyle);
/***********************************************************************
* interface for self-registering
*/
struct regsvr_interface
{
struct regsvr_interface {
IID const *iid; /* NULL for end of list */
LPCSTR name; /* can be NULL to omit */
IID const *base_iid; /* can be NULL to omit */
@ -57,8 +42,7 @@ struct regsvr_interface
static HRESULT register_interfaces(struct regsvr_interface const *list);
static HRESULT unregister_interfaces(struct regsvr_interface const *list);
struct regsvr_coclass
{
struct regsvr_coclass {
CLSID const *clsid; /* NULL for end of list */
LPCSTR name; /* can be NULL to omit */
LPCSTR ips; /* can be NULL to omit */
@ -124,8 +108,7 @@ static LONG recursive_delete_keyW(HKEY base, WCHAR const *name);
/***********************************************************************
* register_interfaces
*/
static HRESULT register_interfaces(struct regsvr_interface const *list)
{
static HRESULT register_interfaces(struct regsvr_interface const *list) {
LONG res = ERROR_SUCCESS;
HKEY interface_key;
@ -194,8 +177,7 @@ error_return:
/***********************************************************************
* unregister_interfaces
*/
static HRESULT unregister_interfaces(struct regsvr_interface const *list)
{
static HRESULT unregister_interfaces(struct regsvr_interface const *list) {
LONG res = ERROR_SUCCESS;
HKEY interface_key;
@ -219,8 +201,7 @@ error_return:
/***********************************************************************
* register_coclasses
*/
static HRESULT register_coclasses(struct regsvr_coclass const *list)
{
static HRESULT register_coclasses(struct regsvr_coclass const *list) {
LONG res = ERROR_SUCCESS;
HKEY coclass_key;
@ -301,8 +282,7 @@ error_return:
/***********************************************************************
* unregister_coclasses
*/
static HRESULT unregister_coclasses(struct regsvr_coclass const *list)
{
static HRESULT unregister_coclasses(struct regsvr_coclass const *list) {
LONG res = ERROR_SUCCESS;
HKEY coclass_key;
@ -338,8 +318,7 @@ error_return:
/***********************************************************************
* regsvr_key_guid
*/
static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid)
{
static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid) {
WCHAR buf[39];
StringFromGUID2(guid, buf, 39);
@ -352,8 +331,7 @@ static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid)
static LONG register_key_defvalueW(
HKEY base,
WCHAR const *name,
WCHAR const *value)
{
WCHAR const *value) {
LONG res;
HKEY key;
@ -372,8 +350,7 @@ static LONG register_key_defvalueW(
static LONG register_key_defvalueA(
HKEY base,
WCHAR const *name,
char const *value)
{
char const *value) {
LONG res;
HKEY key;
@ -394,8 +371,7 @@ static LONG register_progid(
char const *progid,
char const *curver_progid,
char const *name,
char const *extra)
{
char const *extra) {
LONG res;
HKEY progid_key;
@ -439,8 +415,7 @@ error_close_progid_key:
/***********************************************************************
* recursive_delete_key
*/
static LONG recursive_delete_key(HKEY key)
{
static LONG recursive_delete_key(HKEY key) {
LONG res;
WCHAR subkey_name[MAX_PATH];
DWORD cName;
@ -471,8 +446,7 @@ static LONG recursive_delete_key(HKEY key)
/***********************************************************************
* recursive_delete_keyA
*/
static LONG recursive_delete_keyA(HKEY base, char const *name)
{
static LONG recursive_delete_keyA(HKEY base, char const *name) {
LONG res;
HKEY key;
@ -487,8 +461,7 @@ static LONG recursive_delete_keyA(HKEY base, char const *name)
/***********************************************************************
* recursive_delete_keyW
*/
static LONG recursive_delete_keyW(HKEY base, WCHAR const *name)
{
static LONG recursive_delete_keyW(HKEY base, WCHAR const *name) {
LONG res;
HKEY key;
@ -568,14 +541,6 @@ static struct regsvr_coclass const coclass_list[] = {
"Microsoft.DirectMusicMuteTrack.1",
"Microsoft.DirectMusicMuteTrack"
},
{ &CLSID_DirectMusicMelodyFormulationTrack,
"DirectMusicMelodyFormulationTrack",
NULL,
"dmstyle.dll",
"Both",
"Microsoft.DirectMusicMelodyFormulationTrack.1",
"Microsoft.DirectMusicMelodyFormulationTrack"
},
{ NULL } /* list terminator */
};
@ -590,8 +555,7 @@ static struct regsvr_interface const interface_list[] = {
/***********************************************************************
* DllRegisterServer (DMSTYLE.3)
*/
HRESULT WINAPI DMSTYLE_DllRegisterServer()
{
HRESULT WINAPI DMSTYLE_DllRegisterServer() {
HRESULT hr;
TRACE("\n");
@ -605,8 +569,7 @@ HRESULT WINAPI DMSTYLE_DllRegisterServer()
/***********************************************************************
* DllUnregisterServer (DMSTYLE.4)
*/
HRESULT WINAPI DMSTYLE_DllUnregisterServer()
{
HRESULT WINAPI DMSTYLE_DllUnregisterServer() {
HRESULT hr;
TRACE("\n");

View File

@ -1,6 +1,6 @@
/* IDirectMusicStyle8 Implementation
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -17,45 +17,48 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "dmstyle_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmstyle);
WINE_DECLARE_DEBUG_CHANNEL(dmfile);
/* IDirectMusicStyle8 IUnknown part: */
HRESULT WINAPI IDirectMusicStyle8Impl_QueryInterface (LPDIRECTMUSICSTYLE8 iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicStyle8Impl,iface);
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IDirectMusicStyle) ||
IsEqualIID (riid, &IID_IDirectMusicStyle8)) {
IDirectMusicStyle8Impl_AddRef(iface);
*ppobj = This;
/*****************************************************************************
* IDirectMusicStyleImpl implementation
*/
/* IDirectMusicStyleImpl IUnknown part: */
HRESULT WINAPI IDirectMusicStyle8Impl_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicStyle8Impl, UnknownVtbl, iface);
if (IsEqualIID (riid, &IID_IUnknown)) {
*ppobj = (LPVOID)&This->UnknownVtbl;
IDirectMusicStyle8Impl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicStyle)) {
*ppobj = (LPVOID)&This->StyleVtbl;
IDirectMusicStyle8Impl_IDirectMusicStyle8_AddRef ((LPDIRECTMUSICSTYLE8)&This->StyleVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicObject)) {
*ppobj = (LPVOID)&This->ObjectVtbl;
IDirectMusicStyle8Impl_IDirectMusicObject_AddRef ((LPDIRECTMUSICOBJECT)&This->ObjectVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IPersistStream)) {
*ppobj = (LPVOID)&This->PersistStreamVtbl;
IDirectMusicStyle8Impl_IPersistStream_AddRef ((LPPERSISTSTREAM)&This->PersistStreamVtbl);
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicStyle8Impl_AddRef (LPDIRECTMUSICSTYLE8 iface)
{
ICOM_THIS(IDirectMusicStyle8Impl,iface);
ULONG WINAPI IDirectMusicStyle8Impl_IUnknown_AddRef (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicStyle8Impl, UnknownVtbl, iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicStyle8Impl_Release (LPDIRECTMUSICSTYLE8 iface)
{
ICOM_THIS(IDirectMusicStyle8Impl,iface);
ULONG WINAPI IDirectMusicStyle8Impl_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicStyle8Impl, UnknownVtbl, iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
@ -64,350 +67,553 @@ ULONG WINAPI IDirectMusicStyle8Impl_Release (LPDIRECTMUSICSTYLE8 iface)
return ref;
}
/* IDirectMusicStyle8 IDirectMusicStyle part: */
HRESULT WINAPI IDirectMusicStyle8Impl_GetBand (LPDIRECTMUSICSTYLE8 iface, WCHAR* pwszName, IDirectMusicBand** ppBand)
{
ICOM_THIS(IDirectMusicStyle8Impl,iface);
ICOM_VTABLE(IUnknown) DirectMusicStyle8_Unknown_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicStyle8Impl_IUnknown_QueryInterface,
IDirectMusicStyle8Impl_IUnknown_AddRef,
IDirectMusicStyle8Impl_IUnknown_Release
};
/* IDirectMusicStyle8Impl IDirectMusicStyle8 part: */
HRESULT WINAPI IDirectMusicStyle8Impl_IDirectMusicStyle8_QueryInterface (LPDIRECTMUSICSTYLE8 iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicStyle8Impl, StyleVtbl, iface);
return IDirectMusicStyle8Impl_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicStyle8Impl_IDirectMusicStyle8_AddRef (LPDIRECTMUSICSTYLE8 iface) {
ICOM_THIS_MULTI(IDirectMusicStyle8Impl, StyleVtbl, iface);
return IDirectMusicStyle8Impl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicStyle8Impl_IDirectMusicStyle8_Release (LPDIRECTMUSICSTYLE8 iface) {
ICOM_THIS_MULTI(IDirectMusicStyle8Impl, StyleVtbl, iface);
return IDirectMusicStyle8Impl_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
/* IDirectMusicStyle8Impl IDirectMusicStyle(8) part: */
HRESULT WINAPI IDirectMusicStyle8Impl_IDirectMusicStyle8_GetBand (LPDIRECTMUSICSTYLE8 iface, WCHAR* pwszName, IDirectMusicBand** ppBand) {
ICOM_THIS_MULTI(IDirectMusicStyle8Impl, StyleVtbl, iface);
FIXME("(%p, %p, %p): stub\n", This, pwszName, ppBand);
return S_OK;
}
HRESULT WINAPI IDirectMusicStyle8Impl_EnumBand (LPDIRECTMUSICSTYLE8 iface, DWORD dwIndex, WCHAR* pwszName)
{
ICOM_THIS(IDirectMusicStyle8Impl,iface);
HRESULT WINAPI IDirectMusicStyle8Impl_IDirectMusicStyle8_EnumBand (LPDIRECTMUSICSTYLE8 iface, DWORD dwIndex, WCHAR* pwszName) {
ICOM_THIS_MULTI(IDirectMusicStyle8Impl, StyleVtbl, iface);
FIXME("(%p, %ld, %p): stub\n", This, dwIndex, pwszName);
return S_OK;
}
HRESULT WINAPI IDirectMusicStyle8Impl_GetDefaultBand (LPDIRECTMUSICSTYLE8 iface, IDirectMusicBand** ppBand)
{
ICOM_THIS(IDirectMusicStyle8Impl,iface);
HRESULT WINAPI IDirectMusicStyle8Impl_IDirectMusicStyle8_GetDefaultBand (LPDIRECTMUSICSTYLE8 iface, IDirectMusicBand** ppBand) {
ICOM_THIS_MULTI(IDirectMusicStyle8Impl, StyleVtbl, iface);
FIXME("(%p, %p): stub\n", This, ppBand);
return S_OK;
}
HRESULT WINAPI IDirectMusicStyle8Impl_EnumMotif (LPDIRECTMUSICSTYLE8 iface, DWORD dwIndex, WCHAR* pwszName)
{
ICOM_THIS(IDirectMusicStyle8Impl,iface);
HRESULT WINAPI IDirectMusicStyle8Impl_IDirectMusicStyle8_EnumMotif (LPDIRECTMUSICSTYLE8 iface, DWORD dwIndex, WCHAR* pwszName) {
ICOM_THIS_MULTI(IDirectMusicStyle8Impl, StyleVtbl, iface);
FIXME("(%p, %ld, %p): stub\n", This, dwIndex, pwszName);
return S_OK;
}
HRESULT WINAPI IDirectMusicStyle8Impl_GetMotif (LPDIRECTMUSICSTYLE8 iface, WCHAR* pwszName, IDirectMusicSegment** ppSegment)
{
ICOM_THIS(IDirectMusicStyle8Impl,iface);
HRESULT WINAPI IDirectMusicStyle8Impl_IDirectMusicStyle8_GetMotif (LPDIRECTMUSICSTYLE8 iface, WCHAR* pwszName, IDirectMusicSegment** ppSegment) {
ICOM_THIS_MULTI(IDirectMusicStyle8Impl, StyleVtbl, iface);
FIXME("(%p, %p, %p): stub\n", This, pwszName, ppSegment);
return S_OK;
}
HRESULT WINAPI IDirectMusicStyle8Impl_GetDefaultChordMap (LPDIRECTMUSICSTYLE8 iface, IDirectMusicChordMap** ppChordMap)
{
ICOM_THIS(IDirectMusicStyle8Impl,iface);
HRESULT WINAPI IDirectMusicStyle8Impl_IDirectMusicStyle8_GetDefaultChordMap (LPDIRECTMUSICSTYLE8 iface, IDirectMusicChordMap** ppChordMap) {
ICOM_THIS_MULTI(IDirectMusicStyle8Impl, StyleVtbl, iface);
FIXME("(%p, %p): stub\n", This, ppChordMap);
return S_OK;
}
HRESULT WINAPI IDirectMusicStyle8Impl_EnumChordMap (LPDIRECTMUSICSTYLE8 iface, DWORD dwIndex, WCHAR* pwszName)
{
ICOM_THIS(IDirectMusicStyle8Impl,iface);
HRESULT WINAPI IDirectMusicStyle8Impl_IDirectMusicStyle8_EnumChordMap (LPDIRECTMUSICSTYLE8 iface, DWORD dwIndex, WCHAR* pwszName) {
ICOM_THIS_MULTI(IDirectMusicStyle8Impl, StyleVtbl, iface);
FIXME("(%p, %ld, %p): stub\n", This, dwIndex, pwszName);
return S_OK;
}
HRESULT WINAPI IDirectMusicStyle8Impl_GetChordMap (LPDIRECTMUSICSTYLE8 iface, WCHAR* pwszName, IDirectMusicChordMap** ppChordMap)
{
ICOM_THIS(IDirectMusicStyle8Impl,iface);
HRESULT WINAPI IDirectMusicStyle8Impl_IDirectMusicStyle8_GetChordMap (LPDIRECTMUSICSTYLE8 iface, WCHAR* pwszName, IDirectMusicChordMap** ppChordMap) {
ICOM_THIS_MULTI(IDirectMusicStyle8Impl, StyleVtbl, iface);
FIXME("(%p, %p, %p): stub\n", This, pwszName, ppChordMap);
return S_OK;
}
HRESULT WINAPI IDirectMusicStyle8Impl_GetTimeSignature (LPDIRECTMUSICSTYLE8 iface, DMUS_TIMESIGNATURE* pTimeSig)
{
ICOM_THIS(IDirectMusicStyle8Impl,iface);
HRESULT WINAPI IDirectMusicStyle8Impl_IDirectMusicStyle8_GetTimeSignature (LPDIRECTMUSICSTYLE8 iface, DMUS_TIMESIGNATURE* pTimeSig) {
ICOM_THIS_MULTI(IDirectMusicStyle8Impl, StyleVtbl, iface);
FIXME("(%p, %p): stub\n", This, pTimeSig);
return S_OK;
}
HRESULT WINAPI IDirectMusicStyle8Impl_GetEmbellishmentLength (LPDIRECTMUSICSTYLE8 iface, DWORD dwType, DWORD dwLevel, DWORD* pdwMin, DWORD* pdwMax)
{
ICOM_THIS(IDirectMusicStyle8Impl,iface);
HRESULT WINAPI IDirectMusicStyle8Impl_IDirectMusicStyle8_GetEmbellishmentLength (LPDIRECTMUSICSTYLE8 iface, DWORD dwType, DWORD dwLevel, DWORD* pdwMin, DWORD* pdwMax) {
ICOM_THIS_MULTI(IDirectMusicStyle8Impl, StyleVtbl, iface);
FIXME("(%p, %ld, %ld, %p, %p): stub\n", This, dwType, dwLevel, pdwMin, pdwMax);
return S_OK;
}
HRESULT WINAPI IDirectMusicStyle8Impl_GetTempo (LPDIRECTMUSICSTYLE8 iface, double* pTempo)
{
ICOM_THIS(IDirectMusicStyle8Impl,iface);
HRESULT WINAPI IDirectMusicStyle8Impl_IDirectMusicStyle8_GetTempo (LPDIRECTMUSICSTYLE8 iface, double* pTempo) {
ICOM_THIS_MULTI(IDirectMusicStyle8Impl, StyleVtbl, iface);
FIXME("(%p, %p): stub\n", This, pTempo);
return S_OK;
}
/* IDirectMusicStyle8 IDirectMusicStyle8 part: */
HRESULT WINAPI IDirectMusicStyle8ImplEnumPattern (LPDIRECTMUSICSTYLE8 iface, DWORD dwIndex, DWORD dwPatternType, WCHAR* pwszName)
{
ICOM_THIS(IDirectMusicStyle8Impl,iface);
HRESULT WINAPI IDirectMusicStyle8Impl_IDirectMusicStyle8_EnumPattern (LPDIRECTMUSICSTYLE8 iface, DWORD dwIndex, DWORD dwPatternType, WCHAR* pwszName) {
ICOM_THIS_MULTI(IDirectMusicStyle8Impl, StyleVtbl, iface);
FIXME("(%p, %ld, %ld, %p): stub\n", This, dwIndex, dwPatternType, pwszName);
return S_OK;
}
ICOM_VTABLE(IDirectMusicStyle8) DirectMusicStyle8_Style_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicStyle8Impl_IDirectMusicStyle8_QueryInterface,
IDirectMusicStyle8Impl_IDirectMusicStyle8_AddRef,
IDirectMusicStyle8Impl_IDirectMusicStyle8_Release,
IDirectMusicStyle8Impl_IDirectMusicStyle8_GetBand,
IDirectMusicStyle8Impl_IDirectMusicStyle8_EnumBand,
IDirectMusicStyle8Impl_IDirectMusicStyle8_GetDefaultBand,
IDirectMusicStyle8Impl_IDirectMusicStyle8_EnumMotif,
IDirectMusicStyle8Impl_IDirectMusicStyle8_GetMotif,
IDirectMusicStyle8Impl_IDirectMusicStyle8_GetDefaultChordMap,
IDirectMusicStyle8Impl_IDirectMusicStyle8_EnumChordMap,
IDirectMusicStyle8Impl_IDirectMusicStyle8_GetChordMap,
IDirectMusicStyle8Impl_IDirectMusicStyle8_GetTimeSignature,
IDirectMusicStyle8Impl_IDirectMusicStyle8_GetEmbellishmentLength,
IDirectMusicStyle8Impl_IDirectMusicStyle8_GetTempo,
IDirectMusicStyle8Impl_IDirectMusicStyle8_EnumPattern
};
/* IDirectMusicStyle8Impl IDirectMusicObject part: */
HRESULT WINAPI IDirectMusicStyle8Impl_IDirectMusicObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicStyle8Impl, ObjectVtbl, iface);
return IDirectMusicStyle8Impl_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicStyle8Impl_IDirectMusicObject_AddRef (LPDIRECTMUSICOBJECT iface) {
ICOM_THIS_MULTI(IDirectMusicStyle8Impl, ObjectVtbl, iface);
return IDirectMusicStyle8Impl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicStyle8Impl_IDirectMusicObject_Release (LPDIRECTMUSICOBJECT iface) {
ICOM_THIS_MULTI(IDirectMusicStyle8Impl, ObjectVtbl, iface);
return IDirectMusicStyle8Impl_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicStyle8Impl_IDirectMusicObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc) {
ICOM_THIS_MULTI(IDirectMusicStyle8Impl, ObjectVtbl, iface);
TRACE("(%p, %p)\n", This, pDesc);
/* I think we shouldn't return pointer here since then values can be changed; it'd be a mess */
memcpy (pDesc, This->pDesc, This->pDesc->dwSize);
return S_OK;
}
HRESULT WINAPI IDirectMusicStyle8Impl_IDirectMusicObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc) {
ICOM_THIS_MULTI(IDirectMusicStyle8Impl, ObjectVtbl, iface);
TRACE("(%p, %p): setting descriptor:\n", This, pDesc);
if (TRACE_ON(dmstyle)) {
DMUSIC_dump_DMUS_OBJECTDESC (pDesc);
}
/* According to MSDN, we should copy only given values, not whole struct */
if (pDesc->dwValidData & DMUS_OBJ_OBJECT)
memcpy (&This->pDesc->guidObject, &pDesc->guidObject, sizeof (pDesc->guidObject));
if (pDesc->dwValidData & DMUS_OBJ_CLASS)
memcpy (&This->pDesc->guidClass, &pDesc->guidClass, sizeof (pDesc->guidClass));
if (pDesc->dwValidData & DMUS_OBJ_NAME)
strncpyW (This->pDesc->wszName, pDesc->wszName, DMUS_MAX_NAME);
if (pDesc->dwValidData & DMUS_OBJ_CATEGORY)
strncpyW (This->pDesc->wszCategory, pDesc->wszCategory, DMUS_MAX_CATEGORY);
if (pDesc->dwValidData & DMUS_OBJ_FILENAME)
strncpyW (This->pDesc->wszFileName, pDesc->wszFileName, DMUS_MAX_FILENAME);
if (pDesc->dwValidData & DMUS_OBJ_VERSION)
memcpy (&This->pDesc->vVersion, &pDesc->vVersion, sizeof (pDesc->vVersion));
if (pDesc->dwValidData & DMUS_OBJ_DATE)
memcpy (&This->pDesc->ftDate, &pDesc->ftDate, sizeof (pDesc->ftDate));
if (pDesc->dwValidData & DMUS_OBJ_MEMORY) {
memcpy (&This->pDesc->llMemLength, &pDesc->llMemLength, sizeof (pDesc->llMemLength));
memcpy (This->pDesc->pbMemData, pDesc->pbMemData, sizeof (pDesc->pbMemData));
}
if (pDesc->dwValidData & DMUS_OBJ_STREAM) {
/* according to MSDN, we copy the stream */
IStream_Clone (pDesc->pStream, &This->pDesc->pStream);
}
/* add new flags */
This->pDesc->dwValidData |= pDesc->dwValidData;
return S_OK;
}
ICOM_VTABLE(IDirectMusicStyle8) DirectMusicStyle8_Vtbl =
{
HRESULT WINAPI IDirectMusicStyle8Impl_IDirectMusicObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc) {
ICOM_THIS_MULTI(IDirectMusicStyle8Impl, ObjectVtbl, iface);
DMUS_PRIVATE_CHUNK Chunk;
DWORD StreamSize, StreamCount, ListSize[1], ListCount[1];
LARGE_INTEGER liMove; /* used when skipping chunks */
TRACE("(%p, %p, %p)\n", This, pStream, pDesc);
/* FIXME: should this be determined from stream? */
pDesc->dwValidData |= DMUS_OBJ_CLASS;
memcpy (&pDesc->guidClass, &CLSID_DirectMusicBand, sizeof(CLSID));
IStream_Read (pStream, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
TRACE_(dmfile)(": %s chunk (size = 0x%04lx)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
switch (Chunk.fccID) {
case FOURCC_RIFF: {
IStream_Read (pStream, &Chunk.fccID, sizeof(FOURCC), NULL);
TRACE_(dmfile)(": RIFF chunk of type %s", debugstr_fourcc(Chunk.fccID));
StreamSize = Chunk.dwSize - sizeof(FOURCC);
StreamCount = 0;
if (Chunk.fccID == DMUS_FOURCC_BAND_FORM) {
TRACE_(dmfile)(": band form\n");
do {
IStream_Read (pStream, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
StreamCount += sizeof(FOURCC) + sizeof(DWORD) + Chunk.dwSize;
TRACE_(dmfile)(": %s chunk (size = 0x%04lx)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
switch (Chunk.fccID) {
case DMUS_FOURCC_GUID_CHUNK: {
TRACE_(dmfile)(": GUID chunk\n");
pDesc->dwValidData |= DMUS_OBJ_OBJECT;
IStream_Read (pStream, &pDesc->guidObject, Chunk.dwSize, NULL);
break;
}
case DMUS_FOURCC_VERSION_CHUNK: {
TRACE_(dmfile)(": version chunk\n");
pDesc->dwValidData |= DMUS_OBJ_VERSION;
IStream_Read (pStream, &pDesc->vVersion, Chunk.dwSize, NULL);
break;
}
case DMUS_FOURCC_CATEGORY_CHUNK: {
TRACE_(dmfile)(": category chunk\n");
pDesc->dwValidData |= DMUS_OBJ_CATEGORY;
IStream_Read (pStream, pDesc->wszCategory, Chunk.dwSize, NULL);
break;
}
case FOURCC_LIST: {
IStream_Read (pStream, &Chunk.fccID, sizeof(FOURCC), NULL);
TRACE_(dmfile)(": LIST chunk of type %s", debugstr_fourcc(Chunk.fccID));
ListSize[0] = Chunk.dwSize - sizeof(FOURCC);
ListCount[0] = 0;
switch (Chunk.fccID) {
/* evil M$ UNFO list, which can (!?) contain INFO elements */
case DMUS_FOURCC_UNFO_LIST: {
TRACE_(dmfile)(": UNFO list\n");
do {
IStream_Read (pStream, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
ListCount[0] += sizeof(FOURCC) + sizeof(DWORD) + Chunk.dwSize;
TRACE_(dmfile)(": %s chunk (size = 0x%04lx)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
switch (Chunk.fccID) {
/* don't ask me why, but M$ puts INFO elements in UNFO list sometimes
(though strings seem to be valid unicode) */
case mmioFOURCC('I','N','A','M'):
case DMUS_FOURCC_UNAM_CHUNK: {
TRACE_(dmfile)(": name chunk\n");
pDesc->dwValidData |= DMUS_OBJ_NAME;
IStream_Read (pStream, pDesc->wszName, Chunk.dwSize, NULL);
break;
}
case mmioFOURCC('I','A','R','T'):
case DMUS_FOURCC_UART_CHUNK: {
TRACE_(dmfile)(": artist chunk (ignored)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','C','O','P'):
case DMUS_FOURCC_UCOP_CHUNK: {
TRACE_(dmfile)(": copyright chunk (ignored)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','S','B','J'):
case DMUS_FOURCC_USBJ_CHUNK: {
TRACE_(dmfile)(": subject chunk (ignored)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','C','M','T'):
case DMUS_FOURCC_UCMT_CHUNK: {
TRACE_(dmfile)(": comment chunk (ignored)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (irrevelant & skipping)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
TRACE_(dmfile)(": ListCount[0] = %ld < ListSize[0] = %ld\n", ListCount[0], ListSize[0]);
} while (ListCount[0] < ListSize[0]);
break;
}
default: {
TRACE_(dmfile)(": unknown (skipping)\n");
liMove.QuadPart = Chunk.dwSize - sizeof(FOURCC);
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (irrevelant & skipping)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
TRACE_(dmfile)(": StreamCount[0] = %ld < StreamSize[0] = %ld\n", StreamCount, StreamSize);
} while (StreamCount < StreamSize);
break;
} else {
TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
liMove.QuadPart = StreamSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */
return E_FAIL;
}
TRACE_(dmfile)(": reading finished\n");
break;
}
default: {
TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */
return DMUS_E_INVALIDFILE;
}
}
TRACE(": returning descriptor:\n");
if (TRACE_ON(dmstyle)) {
DMUSIC_dump_DMUS_OBJECTDESC (pDesc);
}
return S_OK;
}
ICOM_VTABLE(IDirectMusicObject) DirectMusicStyle8_Object_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicStyle8Impl_QueryInterface,
IDirectMusicStyle8Impl_AddRef,
IDirectMusicStyle8Impl_Release,
IDirectMusicStyle8Impl_GetBand,
IDirectMusicStyle8Impl_EnumBand,
IDirectMusicStyle8Impl_GetDefaultBand,
IDirectMusicStyle8Impl_EnumMotif,
IDirectMusicStyle8Impl_GetMotif,
IDirectMusicStyle8Impl_GetDefaultChordMap,
IDirectMusicStyle8Impl_EnumChordMap,
IDirectMusicStyle8Impl_GetChordMap,
IDirectMusicStyle8Impl_GetTimeSignature,
IDirectMusicStyle8Impl_GetEmbellishmentLength,
IDirectMusicStyle8Impl_GetTempo,
IDirectMusicStyle8ImplEnumPattern
IDirectMusicStyle8Impl_IDirectMusicObject_QueryInterface,
IDirectMusicStyle8Impl_IDirectMusicObject_AddRef,
IDirectMusicStyle8Impl_IDirectMusicObject_Release,
IDirectMusicStyle8Impl_IDirectMusicObject_GetDescriptor,
IDirectMusicStyle8Impl_IDirectMusicObject_SetDescriptor,
IDirectMusicStyle8Impl_IDirectMusicObject_ParseDescriptor
};
/* IDirectMusicStyle8Impl IPersistStream part: */
HRESULT WINAPI IDirectMusicStyle8Impl_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicStyle8Impl, PersistStreamVtbl, iface);
return IDirectMusicStyle8Impl_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicStyle8Impl_IPersistStream_AddRef (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicStyle8Impl, PersistStreamVtbl, iface);
return IDirectMusicStyle8Impl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicStyle8Impl_IPersistStream_Release (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicStyle8Impl, PersistStreamVtbl, iface);
return IDirectMusicStyle8Impl_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicStyle8Impl_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicStyle8Impl_IPersistStream_IsDirty (LPPERSISTSTREAM iface) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicStyle8Impl_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm) {
ICOM_THIS_MULTI(IDirectMusicStyle8Impl, PersistStreamVtbl, iface);
FOURCC chunkID;
DWORD chunkSize, StreamSize, StreamCount, ListSize[3], ListCount[3];
LARGE_INTEGER liMove; /* used when skipping chunks */
FIXME("(%p, %p): Loading not implemented yet\n", This, pStm);
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
IStream_Read (pStm, &chunkSize, sizeof(DWORD), NULL);
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (chunkID), chunkSize);
switch (chunkID) {
case FOURCC_RIFF: {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
TRACE_(dmfile)(": RIFF chunk of type %s", debugstr_fourcc(chunkID));
StreamSize = chunkSize - sizeof(FOURCC);
StreamCount = 0;
switch (chunkID) {
case DMUS_FOURCC_STYLE_FORM: {
TRACE_(dmfile)(": style form\n");
do {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
IStream_Read (pStm, &chunkSize, sizeof(FOURCC), NULL);
StreamCount += sizeof(FOURCC) + sizeof(DWORD) + chunkSize;
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (chunkID), chunkSize);
switch (chunkID) {
case DMUS_FOURCC_GUID_CHUNK: {
TRACE_(dmfile)(": GUID chunk\n");
This->pDesc->dwValidData |= DMUS_OBJ_OBJECT;
IStream_Read (pStm, &This->pDesc->guidObject, chunkSize, NULL);
break;
}
case DMUS_FOURCC_VERSION_CHUNK: {
TRACE_(dmfile)(": version chunk\n");
This->pDesc->dwValidData |= DMUS_OBJ_VERSION;
IStream_Read (pStm, &This->pDesc->vVersion, chunkSize, NULL);
break;
}
case DMUS_FOURCC_CATEGORY_CHUNK: {
TRACE_(dmfile)(": category chunk\n");
This->pDesc->dwValidData |= DMUS_OBJ_CATEGORY;
IStream_Read (pStm, This->pDesc->wszCategory, chunkSize, NULL);
break;
}
case FOURCC_LIST: {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
TRACE_(dmfile)(": LIST chunk of type %s", debugstr_fourcc(chunkID));
ListSize[0] = chunkSize - sizeof(FOURCC);
ListCount[0] = 0;
switch (chunkID) {
case DMUS_FOURCC_UNFO_LIST: {
TRACE_(dmfile)(": UNFO list\n");
do {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
IStream_Read (pStm, &chunkSize, sizeof(FOURCC), NULL);
ListCount[0] += sizeof(FOURCC) + sizeof(DWORD) + chunkSize;
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (chunkID), chunkSize);
switch (chunkID) {
/* don't ask me why, but M$ puts INFO elements in UNFO list sometimes
(though strings seem to be valid unicode) */
case mmioFOURCC('I','N','A','M'):
case DMUS_FOURCC_UNAM_CHUNK: {
TRACE_(dmfile)(": name chunk\n");
This->pDesc->dwValidData |= DMUS_OBJ_NAME;
IStream_Read (pStm, This->pDesc->wszName, chunkSize, NULL);
break;
}
case mmioFOURCC('I','A','R','T'):
case DMUS_FOURCC_UART_CHUNK: {
TRACE_(dmfile)(": artist chunk (ignored)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','C','O','P'):
case DMUS_FOURCC_UCOP_CHUNK: {
TRACE_(dmfile)(": copyright chunk (ignored)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','S','B','J'):
case DMUS_FOURCC_USBJ_CHUNK: {
TRACE_(dmfile)(": subject chunk (ignored)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','C','M','T'):
case DMUS_FOURCC_UCMT_CHUNK: {
TRACE_(dmfile)(": comment chunk (ignored)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (irrevelant & skipping)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
TRACE_(dmfile)(": ListCount[0] = %ld < ListSize[0] = %ld\n", ListCount[0], ListSize[0]);
} while (ListCount[0] < ListSize[0]);
break;
}
default: {
TRACE_(dmfile)(": unknown (skipping)\n");
liMove.QuadPart = chunkSize - sizeof(FOURCC);
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (irrevelant & skipping)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
TRACE_(dmfile)(": StreamCount[0] = %ld < StreamSize[0] = %ld\n", StreamCount, StreamSize);
} while (StreamCount < StreamSize);
break;
}
default: {
TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
liMove.QuadPart = StreamSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */
return E_FAIL;
}
}
TRACE_(dmfile)(": reading finished\n");
break;
}
default: {
TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */
return E_FAIL;
}
}
return S_OK;
}
HRESULT WINAPI IDirectMusicStyle8Impl_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicStyle8Impl_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) {
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicStyle8_PersistStream_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicStyle8Impl_IPersistStream_QueryInterface,
IDirectMusicStyle8Impl_IPersistStream_AddRef,
IDirectMusicStyle8Impl_IPersistStream_Release,
IDirectMusicStyle8Impl_IPersistStream_GetClassID,
IDirectMusicStyle8Impl_IPersistStream_IsDirty,
IDirectMusicStyle8Impl_IPersistStream_Load,
IDirectMusicStyle8Impl_IPersistStream_Save,
IDirectMusicStyle8Impl_IPersistStream_GetSizeMax
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicStyle (LPCGUID lpcGUID, LPDIRECTMUSICSTYLE8* ppDMStyle, LPUNKNOWN pUnkOuter)
{
IDirectMusicStyle8Impl* dmstlye;
HRESULT WINAPI DMUSIC_CreateDirectMusicStyleImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) {
IDirectMusicStyle8Impl* obj;
if (IsEqualIID (lpcGUID, &IID_IDirectMusicStyle)
|| IsEqualIID (lpcGUID, &IID_IDirectMusicStyle8)) {
dmstlye = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicStyle8Impl));
if (NULL == dmstlye) {
*ppDMStyle = (LPDIRECTMUSICSTYLE8) NULL;
return E_OUTOFMEMORY;
}
dmstlye->lpVtbl = &DirectMusicStyle8_Vtbl;
dmstlye->ref = 1;
*ppDMStyle = (LPDIRECTMUSICSTYLE8) dmstlye;
return S_OK;
obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicStyle8Impl));
if (NULL == obj) {
*ppobj = (LPVOID) NULL;
return E_OUTOFMEMORY;
}
obj->UnknownVtbl = &DirectMusicStyle8_Unknown_Vtbl;
obj->StyleVtbl = &DirectMusicStyle8_Style_Vtbl;
obj->ObjectVtbl = &DirectMusicStyle8_Object_Vtbl;
obj->PersistStreamVtbl = &DirectMusicStyle8_PersistStream_Vtbl;
obj->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC));
DM_STRUCT_INIT(obj->pDesc);
obj->pDesc->dwValidData |= DMUS_OBJ_CLASS;
memcpy (&obj->pDesc->guidClass, &CLSID_DirectMusicStyle, sizeof (CLSID));
obj->ref = 0; /* will be inited by QueryInterface */
WARN("No interface found\n");
return E_NOINTERFACE;
return IDirectMusicStyle8Impl_IUnknown_QueryInterface ((LPUNKNOWN)&obj->UnknownVtbl, lpcGUID, ppobj);
}
/*****************************************************************************
* IDirectMusicStyleObject implementation
*/
/* IDirectMusicStyleObject IUnknown part: */
HRESULT WINAPI IDirectMusicStyleObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicStyleObject,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IDirectMusicObject)) {
IDirectMusicStyleObject_AddRef(iface);
*ppobj = This;
return S_OK;
} else if (IsEqualIID (riid, &IID_IPersistStream)) {
IPersistStream_AddRef ((LPPERSISTSTREAM)This->pStream);
*ppobj = (LPPERSISTSTREAM)This->pStream;
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicStyle)
|| IsEqualIID (riid, &IID_IDirectMusicStyle8)) {
IDirectMusicStyle8_AddRef ((LPDIRECTMUSICSTYLE8)This->pStyle);
*ppobj = (LPDIRECTMUSICSTYLE8)This->pStyle;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicStyleObject_AddRef (LPDIRECTMUSICOBJECT iface)
{
ICOM_THIS(IDirectMusicStyleObject,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicStyleObject_Release (LPDIRECTMUSICOBJECT iface)
{
ICOM_THIS(IDirectMusicStyleObject,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicStyleObject IDirectMusicObject part: */
HRESULT WINAPI IDirectMusicStyleObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicStyleObject,iface);
TRACE("(%p, %p)\n", This, pDesc);
pDesc = This->pDesc;
return S_OK;
}
HRESULT WINAPI IDirectMusicStyleObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicStyleObject,iface);
TRACE("(%p, %p)\n", This, pDesc);
This->pDesc = pDesc;
return S_OK;
}
HRESULT WINAPI IDirectMusicStyleObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicStyleObject,iface);
FIXME("(%p, %p, %p): stub\n", This, pStream, pDesc);
return S_OK;
}
ICOM_VTABLE(IDirectMusicObject) DirectMusicStyleObject_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicStyleObject_QueryInterface,
IDirectMusicStyleObject_AddRef,
IDirectMusicStyleObject_Release,
IDirectMusicStyleObject_GetDescriptor,
IDirectMusicStyleObject_SetDescriptor,
IDirectMusicStyleObject_ParseDescriptor
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicStyleObject (LPCGUID lpcGUID, LPDIRECTMUSICOBJECT* ppObject, LPUNKNOWN pUnkOuter)
{
IDirectMusicStyleObject *obj;
TRACE("(%p,%p,%p)\n", lpcGUID, ppObject, pUnkOuter);
if (IsEqualIID (lpcGUID, &IID_IDirectMusicObject)) {
obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicStyleObject));
if (NULL == obj) {
*ppObject = (LPDIRECTMUSICOBJECT) NULL;
return E_OUTOFMEMORY;
}
obj->lpVtbl = &DirectMusicStyleObject_Vtbl;
obj->ref = 1;
/* prepare IPersistStream */
obj->pStream = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(IDirectMusicStyleObjectStream));
obj->pStream->lpVtbl = &DirectMusicStyleObjectStream_Vtbl;
obj->pStream->ref = 1;
obj->pStream->pParentObject = obj;
/* prepare IDirectMusicStyle */
DMUSIC_CreateDirectMusicStyle (&IID_IDirectMusicStyle8, (LPDIRECTMUSICSTYLE8*)&obj->pStyle, NULL);
obj->pStyle->pObject = obj;
*ppObject = (LPDIRECTMUSICOBJECT) obj;
return S_OK;
}
WARN("No interface found\n");
return E_NOINTERFACE;
}
/*****************************************************************************
* IDirectMusicStyleObjectStream implementation
*/
/* IDirectMusicStyleObjectStream IUnknown part: */
HRESULT WINAPI IDirectMusicStyleObjectStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicStyleObjectStream,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicStyleObjectStream_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicStyleObjectStream_AddRef (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicStyleObjectStream,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicStyleObjectStream_Release (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicStyleObjectStream,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicStyleObjectStream IPersist part: */
HRESULT WINAPI IDirectMusicStyleObjectStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID)
{
return E_NOTIMPL;
}
/* IDirectMusicStyleObjectStream IPersistStream part: */
HRESULT WINAPI IDirectMusicStyleObjectStream_IsDirty (LPPERSISTSTREAM iface)
{
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicStyleObjectStream_Load (LPPERSISTSTREAM iface, IStream* pStm)
{
FIXME(": Loading not implemented yet\n");
return S_OK;
}
HRESULT WINAPI IDirectMusicStyleObjectStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty)
{
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicStyleObjectStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize)
{
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicStyleObjectStream_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicStyleObjectStream_QueryInterface,
IDirectMusicStyleObjectStream_AddRef,
IDirectMusicStyleObjectStream_Release,
IDirectMusicStyleObjectStream_GetClassID,
IDirectMusicStyleObjectStream_IsDirty,
IDirectMusicStyleObjectStream_Load,
IDirectMusicStyleObjectStream_Save,
IDirectMusicStyleObjectStream_GetSizeMax
};

View File

@ -1,6 +1,6 @@
/* IDirectMusicStyleTrack Implementation
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -17,14 +17,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "dmstyle_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmstyle);
@ -34,19 +26,21 @@ WINE_DECLARE_DEBUG_CHANNEL(dmfile);
* IDirectMusicStyleTrack implementation
*/
/* IDirectMusicStyleTrack IUnknown part: */
HRESULT WINAPI IDirectMusicStyleTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicStyleTrack,iface);
HRESULT WINAPI IDirectMusicStyleTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicStyleTrack, UnknownVtbl, iface);
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IDirectMusicTrack) ||
IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
IDirectMusicStyleTrack_AddRef(iface);
*ppobj = This;
if (IsEqualIID (riid, &IID_IUnknown)) {
*ppobj = (LPUNKNOWN)&This->UnknownVtbl;
IDirectMusicStyleTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicTrack)
|| IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
*ppobj = (LPDIRECTMUSICTRACK8)&This->TrackVtbl;
IDirectMusicStyleTrack_IDirectMusicTrack_AddRef ((LPDIRECTMUSICTRACK8)&This->TrackVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicStyleTrackStream_AddRef ((LPPERSISTSTREAM)This->pStream);
*ppobj = This->pStream;
*ppobj = (LPPERSISTSTREAM)&This->PersistStreamVtbl;
IDirectMusicStyleTrack_IPersistStream_AddRef ((LPPERSISTSTREAM)&This->PersistStreamVtbl);
return S_OK;
}
@ -54,16 +48,14 @@ HRESULT WINAPI IDirectMusicStyleTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface,
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicStyleTrack_AddRef (LPDIRECTMUSICTRACK8 iface)
{
ICOM_THIS(IDirectMusicStyleTrack,iface);
ULONG WINAPI IDirectMusicStyleTrack_IUnknown_AddRef (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicStyleTrack, UnknownVtbl, iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicStyleTrack_Release (LPDIRECTMUSICTRACK8 iface)
{
ICOM_THIS(IDirectMusicStyleTrack,iface);
ULONG WINAPI IDirectMusicStyleTrack_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicStyleTrack, UnknownVtbl, iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
@ -72,64 +64,71 @@ ULONG WINAPI IDirectMusicStyleTrack_Release (LPDIRECTMUSICTRACK8 iface)
return ref;
}
/* IDirectMusicStyleTrack IDirectMusicTrack part: */
HRESULT WINAPI IDirectMusicStyleTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment)
{
ICOM_THIS(IDirectMusicStyleTrack,iface);
ICOM_VTABLE(IUnknown) DirectMusicStyleTrack_Unknown_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicStyleTrack_IUnknown_QueryInterface,
IDirectMusicStyleTrack_IUnknown_AddRef,
IDirectMusicStyleTrack_IUnknown_Release
};
/* IDirectMusicStyleTrack IDirectMusicTrack8 part: */
HRESULT WINAPI IDirectMusicStyleTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicStyleTrack, TrackVtbl, iface);
return IDirectMusicStyleTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicStyleTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface) {
ICOM_THIS_MULTI(IDirectMusicStyleTrack, TrackVtbl, iface);
return IDirectMusicStyleTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicStyleTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface) {
ICOM_THIS_MULTI(IDirectMusicStyleTrack, TrackVtbl, iface);
return IDirectMusicStyleTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicStyleTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment)
{
ICOM_THIS_MULTI(IDirectMusicStyleTrack, TrackVtbl, iface);
FIXME("(%p, %p): stub\n", This, pSegment);
return S_OK;
}
HRESULT WINAPI IDirectMusicStyleTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags)
HRESULT WINAPI IDirectMusicStyleTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicStyleTrack,iface);
ICOM_THIS_MULTI(IDirectMusicStyleTrack, TrackVtbl, iface);
FIXME("(%p, %p, %p, %p, %ld, %ld): stub\n", This, pSegmentState, pPerformance, ppStateData, dwVirtualTrack8ID, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicStyleTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData)
HRESULT WINAPI IDirectMusicStyleTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData)
{
ICOM_THIS(IDirectMusicStyleTrack,iface);
ICOM_THIS_MULTI(IDirectMusicStyleTrack, TrackVtbl, iface);
FIXME("(%p, %p): stub\n", This, pStateData);
return S_OK;
}
HRESULT WINAPI IDirectMusicStyleTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
HRESULT WINAPI IDirectMusicStyleTrack_IDirectMusicTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
{
ICOM_THIS(IDirectMusicStyleTrack,iface);
ICOM_THIS_MULTI(IDirectMusicStyleTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %ld, %ld, %ld, %p, %p, %ld): stub\n", This, pStateData, mtStart, mtEnd, mtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
return S_OK;
}
HRESULT WINAPI IDirectMusicStyleTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam)
{
ICOM_THIS(IDirectMusicStyleTrack,iface);
HRESULT WINAPI IDirectMusicStyleTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam) {
ICOM_THIS_MULTI(IDirectMusicStyleTrack, TrackVtbl, iface);
FIXME("(%p, %s, %ld, %p, %p): stub\n", This, debugstr_guid(rguidType), mtTime, pmtNext, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicStyleTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam)
{
ICOM_THIS(IDirectMusicStyleTrack,iface);
HRESULT WINAPI IDirectMusicStyleTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam) {
ICOM_THIS_MULTI(IDirectMusicStyleTrack, TrackVtbl, iface);
FIXME("(%p, %s, %ld, %p): stub\n", This, debugstr_guid(rguidType), mtTime, pParam);
return S_OK;
}
HRESULT WINAPI IDirectMusicStyleTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType)
{
ICOM_THIS(IDirectMusicStyleTrack,iface);
HRESULT WINAPI IDirectMusicStyleTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType) {
ICOM_THIS_MULTI(IDirectMusicStyleTrack, TrackVtbl, iface);
TRACE("(%p, %s): ", This, debugstr_guid(rguidType));
if (IsEqualGUID (rguidType, &GUID_DisableTimeSig)
@ -139,395 +138,147 @@ HRESULT WINAPI IDirectMusicStyleTrack_IsParamSupported (LPDIRECTMUSICTRACK8 ifac
|| IsEqualGUID (rguidType, &GUID_TimeSignature)) {
TRACE("param supported\n");
return S_OK;
}
}
TRACE("param unsupported\n");
return DMUS_E_TYPE_UNSUPPORTED;
}
HRESULT WINAPI IDirectMusicStyleTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType)
{
ICOM_THIS(IDirectMusicStyleTrack,iface);
HRESULT WINAPI IDirectMusicStyleTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
ICOM_THIS_MULTI(IDirectMusicStyleTrack, TrackVtbl, iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
return S_OK;
}
HRESULT WINAPI IDirectMusicStyleTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType)
{
ICOM_THIS(IDirectMusicStyleTrack,iface);
HRESULT WINAPI IDirectMusicStyleTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
ICOM_THIS_MULTI(IDirectMusicStyleTrack, TrackVtbl, iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
return S_OK;
}
HRESULT WINAPI IDirectMusicStyleTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack)
{
ICOM_THIS(IDirectMusicStyleTrack,iface);
HRESULT WINAPI IDirectMusicStyleTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack) {
ICOM_THIS_MULTI(IDirectMusicStyleTrack, TrackVtbl, iface);
FIXME("(%p, %ld, %ld, %p): stub\n", This, mtStart, mtEnd, ppTrack);
return S_OK;
}
/* IDirectMusicStyleTrack IDirectMusicTrack8 part: */
HRESULT WINAPI IDirectMusicStyleTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
{
ICOM_THIS(IDirectMusicStyleTrack,iface);
HRESULT WINAPI IDirectMusicStyleTrack_IDirectMusicTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID) {
ICOM_THIS_MULTI(IDirectMusicStyleTrack, TrackVtbl, iface);
FIXME("(%p, %p, %lli, %lli, %lli, %ld, %p, %p, %ld): stub\n", This, pStateData, rtStart, rtEnd, rtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
return S_OK;
}
HRESULT WINAPI IDirectMusicStyleTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicStyleTrack,iface);
HRESULT WINAPI IDirectMusicStyleTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicStyleTrack, TrackVtbl, iface);
FIXME("(%p, %s, %lli, %p, %p, %p, %ld): stub\n", This, debugstr_guid(rguidType), rtTime, prtNext, pParam, pStateData, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicStyleTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags)
{
ICOM_THIS(IDirectMusicStyleTrack,iface);
HRESULT WINAPI IDirectMusicStyleTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags) {
ICOM_THIS_MULTI(IDirectMusicStyleTrack, TrackVtbl, iface);
FIXME("(%p, %s, %lli, %p, %p, %ld): stub\n", This, debugstr_guid(rguidType), rtTime, pParam, pStateData, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicStyleTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack)
{
ICOM_THIS(IDirectMusicStyleTrack,iface);
HRESULT WINAPI IDirectMusicStyleTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
ICOM_THIS_MULTI(IDirectMusicStyleTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %p): stub\n", This, pContext, dwTrackGroup, ppResultTrack);
return S_OK;
}
HRESULT WINAPI IDirectMusicStyleTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack)
{
ICOM_THIS(IDirectMusicStyleTrack,iface);
HRESULT WINAPI IDirectMusicStyleTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
ICOM_THIS_MULTI(IDirectMusicStyleTrack, TrackVtbl, iface);
FIXME("(%p, %p, %ld, %p, %ld, %p): stub\n", This, pNewTrack, mtJoin, pContext, dwTrackGroup, ppResultTrack);
return S_OK;
}
ICOM_VTABLE(IDirectMusicTrack8) DirectMusicStyleTrack_Vtbl =
{
ICOM_VTABLE(IDirectMusicTrack8) DirectMusicStyleTrack_Track_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicStyleTrack_QueryInterface,
IDirectMusicStyleTrack_AddRef,
IDirectMusicStyleTrack_Release,
IDirectMusicStyleTrack_Init,
IDirectMusicStyleTrack_InitPlay,
IDirectMusicStyleTrack_EndPlay,
IDirectMusicStyleTrack_Play,
IDirectMusicStyleTrack_GetParam,
IDirectMusicStyleTrack_SetParam,
IDirectMusicStyleTrack_IsParamSupported,
IDirectMusicStyleTrack_AddNotificationType,
IDirectMusicStyleTrack_RemoveNotificationType,
IDirectMusicStyleTrack_Clone,
IDirectMusicStyleTrack_PlayEx,
IDirectMusicStyleTrack_GetParamEx,
IDirectMusicStyleTrack_SetParamEx,
IDirectMusicStyleTrack_Compose,
IDirectMusicStyleTrack_Join
IDirectMusicStyleTrack_IDirectMusicTrack_QueryInterface,
IDirectMusicStyleTrack_IDirectMusicTrack_AddRef,
IDirectMusicStyleTrack_IDirectMusicTrack_Release,
IDirectMusicStyleTrack_IDirectMusicTrack_Init,
IDirectMusicStyleTrack_IDirectMusicTrack_InitPlay,
IDirectMusicStyleTrack_IDirectMusicTrack_EndPlay,
IDirectMusicStyleTrack_IDirectMusicTrack_Play,
IDirectMusicStyleTrack_IDirectMusicTrack_GetParam,
IDirectMusicStyleTrack_IDirectMusicTrack_SetParam,
IDirectMusicStyleTrack_IDirectMusicTrack_IsParamSupported,
IDirectMusicStyleTrack_IDirectMusicTrack_AddNotificationType,
IDirectMusicStyleTrack_IDirectMusicTrack_RemoveNotificationType,
IDirectMusicStyleTrack_IDirectMusicTrack_Clone,
IDirectMusicStyleTrack_IDirectMusicTrack_PlayEx,
IDirectMusicStyleTrack_IDirectMusicTrack_GetParamEx,
IDirectMusicStyleTrack_IDirectMusicTrack_SetParamEx,
IDirectMusicStyleTrack_IDirectMusicTrack_Compose,
IDirectMusicStyleTrack_IDirectMusicTrack_Join
};
/* IDirectMusicStyleTrack IPersistStream part: */
HRESULT WINAPI IDirectMusicStyleTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicStyleTrack, PersistStreamVtbl, iface);
return IDirectMusicStyleTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicStyleTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicStyleTrack, PersistStreamVtbl, iface);
return IDirectMusicStyleTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicStyleTrack_IPersistStream_Release (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicStyleTrack, PersistStreamVtbl, iface);
return IDirectMusicStyleTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicStyleTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicStyleTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicStyleTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm) {
FIXME(": Loading not implemented yet\n");
return S_OK;
}
HRESULT WINAPI IDirectMusicStyleTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicStyleTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) {
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicStyleTrack_PersistStream_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicStyleTrack_IPersistStream_QueryInterface,
IDirectMusicStyleTrack_IPersistStream_AddRef,
IDirectMusicStyleTrack_IPersistStream_Release,
IDirectMusicStyleTrack_IPersistStream_GetClassID,
IDirectMusicStyleTrack_IPersistStream_IsDirty,
IDirectMusicStyleTrack_IPersistStream_Load,
IDirectMusicStyleTrack_IPersistStream_Save,
IDirectMusicStyleTrack_IPersistStream_GetSizeMax
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicStyleTrack (LPCGUID lpcGUID, LPDIRECTMUSICTRACK8 *ppTrack, LPUNKNOWN pUnkOuter)
{
HRESULT WINAPI DMUSIC_CreateDirectMusicStyleTrack (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) {
IDirectMusicStyleTrack* track;
if (IsEqualIID (lpcGUID, &IID_IDirectMusicTrack)
|| IsEqualIID (lpcGUID, &IID_IDirectMusicTrack8)) {
track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicStyleTrack));
if (NULL == track) {
*ppTrack = (LPDIRECTMUSICTRACK8) NULL;
return E_OUTOFMEMORY;
}
track->lpVtbl = &DirectMusicStyleTrack_Vtbl;
track->ref = 1;
track->pStream = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(IDirectMusicStyleTrackStream));
track->pStream->lpVtbl = &DirectMusicStyleTrackStream_Vtbl;
track->pStream->ref = 1;
track->pStream->pParentTrack = track;
*ppTrack = (LPDIRECTMUSICTRACK8) track;
return S_OK;
track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicStyleTrack));
if (NULL == track) {
*ppobj = (LPVOID) NULL;
return E_OUTOFMEMORY;
}
WARN("No interface found\n");
track->UnknownVtbl = &DirectMusicStyleTrack_Unknown_Vtbl;
track->TrackVtbl = &DirectMusicStyleTrack_Track_Vtbl;
track->PersistStreamVtbl = &DirectMusicStyleTrack_PersistStream_Vtbl;
track->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC));
DM_STRUCT_INIT(track->pDesc);
track->pDesc->dwValidData |= DMUS_OBJ_CLASS;
memcpy (&track->pDesc->guidClass, &CLSID_DirectMusicStyleTrack, sizeof (CLSID));
track->ref = 0; /* will be inited by QueryInterface */
return E_NOINTERFACE;
return IDirectMusicStyleTrack_IUnknown_QueryInterface ((LPUNKNOWN)&track->UnknownVtbl, lpcGUID, ppobj);
}
/*****************************************************************************
* IDirectMusicStyleTrackStream implementation
*/
/* IDirectMusicStyleTrackStream IUnknown part follow: */
HRESULT WINAPI IDirectMusicStyleTrackStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicStyleTrackStream,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicStyleTrackStream_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicStyleTrackStream_AddRef (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicStyleTrackStream,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicStyleTrackStream_Release (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicStyleTrackStream,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicStyleTrackStream IPersist part: */
HRESULT WINAPI IDirectMusicStyleTrackStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID)
{
return E_NOTIMPL;
}
/* IDirectMusicStyleTrackStream IPersistStream part: */
HRESULT WINAPI IDirectMusicStyleTrackStream_IsDirty (LPPERSISTSTREAM iface)
{
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicStyleTrackStream_Load (LPPERSISTSTREAM iface, IStream* pStm)
{
ICOM_THIS(IDirectMusicStyleTrackStream,iface);
FOURCC chunkID;
DWORD chunkSize, ListSize[3], ListCount[3];
LARGE_INTEGER liMove; /* used when skipping chunks */
DMUS_IO_REFERENCE tempReferenceHeader;
DMUS_OBJECTDESC ObjDesc;
IDirectMusicStyleTrack* pTrack = This->pParentTrack; /* that's where we load data to */
LPDIRECTMUSICLOADER pLoader;
LPDIRECTMUSICGETLOADER pGetLoader;
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
IStream_Read (pStm, &chunkSize, sizeof(DWORD), NULL);
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (chunkID), chunkSize);
switch (chunkID) {
case FOURCC_LIST: {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
TRACE_(dmfile)(": LIST chunk of type %s", debugstr_fourcc(chunkID));
ListSize[0] = chunkSize - sizeof(FOURCC);
ListCount[0] = 0;
switch (chunkID) {
case DMUS_FOURCC_STYLE_TRACK_LIST: {
TRACE_(dmfile)(": style track list\n");
do {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
IStream_Read (pStm, &chunkSize, sizeof(FOURCC), NULL);
ListCount[0] += sizeof(FOURCC) + sizeof(DWORD) + chunkSize;
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (chunkID), chunkSize);
switch (chunkID) {
case FOURCC_LIST: {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
TRACE_(dmfile)(": LIST chunk of type %s", debugstr_fourcc(chunkID));
ListSize[1] = chunkSize - sizeof(FOURCC);
ListCount[1] = 0;
switch (chunkID) {
case DMUS_FOURCC_STYLE_REF_LIST: {
TRACE_(dmfile)(": style reference list\n");
do {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
IStream_Read (pStm, &chunkSize, sizeof(FOURCC), NULL);
ListCount[1] += sizeof(FOURCC) + sizeof(DWORD) + chunkSize;
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (chunkID), chunkSize);
switch (chunkID) {
case DMUS_FOURCC_TIME_STAMP_CHUNK: {
TRACE_(dmfile)(": time stamp chunk\n");
IStream_Read (pStm, &pTrack->pStampTimes[pTrack->dwStyles], sizeof(DWORD), NULL);
TRACE_(dmfile)(": (READ): time stamp = %ld\n", pTrack->pStampTimes[pTrack->dwStyles]);
break;
}
case FOURCC_LIST: {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
TRACE_(dmfile)(": LIST chunk of type %s", debugstr_fourcc(chunkID));
ListSize[2] = chunkSize - sizeof(FOURCC);
ListCount[2] = 0;
switch (chunkID) {
case DMUS_FOURCC_REF_LIST: {
TRACE_(dmfile)(": reference list\n");
ZeroMemory ((LPVOID)&ObjDesc, sizeof(DMUS_OBJECTDESC));
do {
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
IStream_Read (pStm, &chunkSize, sizeof(FOURCC), NULL);
ListCount[2] += sizeof(FOURCC) + sizeof(DWORD) + chunkSize;
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (chunkID), chunkSize);
switch (chunkID) {
case DMUS_FOURCC_REF_CHUNK: {
TRACE_(dmfile)(": reference header chunk\n");
IStream_Read (pStm, &tempReferenceHeader, chunkSize, NULL);
/* copy retrieved data to DMUS_OBJECTDESC */
ObjDesc.dwSize = sizeof(DMUS_OBJECTDESC);
ObjDesc.guidClass = tempReferenceHeader.guidClassID;
ObjDesc.dwValidData = tempReferenceHeader.dwValidData;
break;
}
case DMUS_FOURCC_GUID_CHUNK: {
TRACE_(dmfile)(": guid chunk\n");
IStream_Read (pStm, &ObjDesc.guidObject, chunkSize, NULL);
break;
}
case DMUS_FOURCC_DATE_CHUNK: {
TRACE_(dmfile)(": file date chunk\n");
IStream_Read (pStm, &ObjDesc.ftDate, chunkSize, NULL);
break;
}
case DMUS_FOURCC_NAME_CHUNK: {
TRACE_(dmfile)(": name chunk\n");
IStream_Read (pStm, &ObjDesc.wszName, chunkSize, NULL);
break;
}
case DMUS_FOURCC_FILE_CHUNK: {
TRACE_(dmfile)(": file name chunk\n");
IStream_Read (pStm, &ObjDesc.wszFileName, chunkSize, NULL);
break;
}
case DMUS_FOURCC_CATEGORY_CHUNK: {
TRACE_(dmfile)(": category chunk\n");
IStream_Read (pStm, &ObjDesc.wszCategory, chunkSize, NULL);
break;
}
case DMUS_FOURCC_VERSION_CHUNK: {
TRACE_(dmfile)(": version chunk\n");
IStream_Read (pStm, &ObjDesc.vVersion, chunkSize, NULL);
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (skipping)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); /* skip this chunk */
break;
}
}
TRACE_(dmfile)(": ListCount[2] = %ld < ListSize[2] = %ld\n", ListCount[2], ListSize[2]);
} while (ListCount[2] < ListSize[2]);
break;
}
default: {
TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
return E_FAIL;
}
}
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (skipping)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); /* skip this chunk */
break;
}
}
TRACE_(dmfile)(": ListCount[1] = %ld < ListSize[1] = %ld\n", ListCount[1], ListSize[1]);
} while (ListCount[1] < ListSize[1]);
/* let's see what we have */
TRACE_(dmfile)(": (READ): reference: dwSize = %ld; dwValidData = %ld; guidObject = %s; guidClass = %s; \
vVersion = %08lx,%08lx; wszName = %s; wszCategory = %s; wszFileName = %s\n", ObjDesc.dwSize, ObjDesc.dwValidData, debugstr_guid(&ObjDesc.guidObject), debugstr_guid(&ObjDesc.guidClass), \
ObjDesc.vVersion.dwVersionMS, ObjDesc.vVersion.dwVersionLS, debugstr_w(ObjDesc.wszName), debugstr_w(ObjDesc.wszCategory), debugstr_w(ObjDesc.wszFileName));
/* now, let's convience loader to load reference */
if (IStream_QueryInterface (pStm, &IID_IDirectMusicGetLoader, (LPVOID*)&pGetLoader) == S_OK) {
if (IDirectMusicGetLoader_GetLoader (pGetLoader, &pLoader) == S_OK) {
/* load referenced object */
IDirectMusicObject* pObject;
IDirectMusicLoader_GetObject (pLoader, &ObjDesc, &IID_IDirectMusicObject, (LPVOID*)&pObject);
/* acquire style from loaded referenced object */
IDirectMusicObject_QueryInterface (pObject, &IID_IDirectMusicStyle8, (LPVOID*)&pTrack->ppStyles[pTrack->dwStyles]);
IDirectMusicLoader_Release (pLoader);
}
IDirectMusicGetLoader_Release (pGetLoader);
} else {
ERR("Could not get IDirectMusicGetLoader... reference will not be loaded :(\n");
/* E_FAIL */
}
pTrack->dwStyles++; /* add reference count */
break;
}
default: {
TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
return E_FAIL;
}
}
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (skipping)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); /* skip this chunk */
break;
}
}
TRACE_(dmfile)(": ListCount[0] = %ld < ListSize[0] = %ld\n", ListCount[0], ListSize[0]);
} while (ListCount[0] < ListSize[0]);
break;
}
default: {
TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
liMove.QuadPart = ListSize[0];
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */
return E_FAIL;
}
}
TRACE_(dmfile)(": reading finished\n");
break;
}
default: {
TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
liMove.QuadPart = chunkSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */
return E_FAIL;
}
}
return S_OK;
}
HRESULT WINAPI IDirectMusicStyleTrackStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty)
{
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicStyleTrackStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize)
{
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicStyleTrackStream_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicStyleTrackStream_QueryInterface,
IDirectMusicStyleTrackStream_AddRef,
IDirectMusicStyleTrackStream_Release,
IDirectMusicStyleTrackStream_GetClassID,
IDirectMusicStyleTrackStream_IsDirty,
IDirectMusicStyleTrackStream_Load,
IDirectMusicStyleTrackStream_Save,
IDirectMusicStyleTrackStream_GetSizeMax
};

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 Rok Mandeljc <rok.mandeljc@gimb.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -18,10 +18,10 @@
#define WINE_FILEDESCRIPTION_STR "Wine DirectMusic Style Engine"
#define WINE_FILENAME_STR "dmstyle.dll"
#define WINE_FILEVERSION 4,8,1,881
#define WINE_FILEVERSION_STR "4.8.1.881"
#define WINE_PRODUCTVERSION 4,8,1,881
#define WINE_PRODUCTVERSION_STR "4.8"
#define WINE_FILEVERSION 4,9,0,900
#define WINE_FILEVERSION_STR "4.9.0.900"
#define WINE_PRODUCTVERSION 4,9,0,900
#define WINE_PRODUCTVERSION_STR "4.9"
#define WINE_PRODUCTNAME_STR "DirectX"
#include "wine/wine_common_ver.rc"

View File

@ -1,6 +1,6 @@
/* DirectMusicSynthesizer Main
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -21,8 +21,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(dmsynth);
typedef struct
{
typedef struct {
/* IUnknown fields */
ICOM_VFIELD(IClassFactory);
DWORD ref;
@ -31,43 +30,30 @@ typedef struct
/******************************************************************
* DirectMusicSynth ClassFactory
*/
static HRESULT WINAPI SynthCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI SynthCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI SynthCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI SynthCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI SynthCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI SynthCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI SynthCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI SynthCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualIID (riid, &IID_IDirectMusicSynth) ||
IsEqualIID (riid, &IID_IDirectMusicSynth8)) {
return DMUSIC_CreateDirectMusicSynth (riid, (LPDIRECTMUSICSYNTH8*)ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
return DMUSIC_CreateDirectMusicSynthImpl (riid, ppobj, pOuter);
}
static HRESULT WINAPI SynthCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI SynthCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -87,42 +73,30 @@ static IClassFactoryImpl Synth_CF = {&SynthCF_Vtbl, 1 };
/******************************************************************
* DirectMusicSynthSink ClassFactory
*/
static HRESULT WINAPI SynthSinkCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI SynthSinkCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI SynthSinkCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI SynthSinkCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI SynthSinkCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI SynthSinkCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI SynthSinkCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI SynthSinkCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualIID (riid, &IID_IDirectMusicSynthSink)) {
return DMUSIC_CreateDirectMusicSynthSink (riid, (LPDIRECTMUSICSYNTHSINK*)ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
return DMUSIC_CreateDirectMusicSynthSinkImpl (riid, ppobj, pOuter);
}
static HRESULT WINAPI SynthSinkCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI SynthSinkCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -144,15 +118,11 @@ static IClassFactoryImpl SynthSink_CF = {&SynthSinkCF_Vtbl, 1 };
*
*
*/
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
if (fdwReason == DLL_PROCESS_ATTACH)
{
DisableThreadLibraryCalls(hinstDLL);
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
if (fdwReason == DLL_PROCESS_ATTACH) {
DisableThreadLibraryCalls(hinstDLL);
/* FIXME: Initialisation */
}
else if (fdwReason == DLL_PROCESS_DETACH)
{
} else if (fdwReason == DLL_PROCESS_DETACH) {
/* FIXME: Cleanup */
}
@ -165,10 +135,8 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
*
*
*/
HRESULT WINAPI DMSYNTH_DllCanUnloadNow(void)
{
HRESULT WINAPI DMSYNTH_DllCanUnloadNow(void) {
FIXME("(void): stub\n");
return S_FALSE;
}
@ -178,8 +146,7 @@ HRESULT WINAPI DMSYNTH_DllCanUnloadNow(void)
*
*
*/
HRESULT WINAPI DMSYNTH_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
{
HRESULT WINAPI DMSYNTH_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) {
TRACE("(%p,%p,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
if (IsEqualCLSID (rclsid, &CLSID_DirectMusicSynth) && IsEqualIID (riid, &IID_IClassFactory)) {
*ppv = (LPVOID) &Synth_CF;

View File

@ -1,6 +1,6 @@
/* DirectMusicSynthesizer Private Include
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -23,16 +23,19 @@
#include <stdarg.h>
#include "windef.h"
#include "wine/debug.h"
#include "winbase.h"
#include "winnt.h"
#include "wingdi.h"
#include "dmusicc.h"
#include "winuser.h"
#include "wine/debug.h"
#include "wine/list.h"
#include "wine/unicode.h"
#include "winreg.h"
#include "dmusici.h"
#include "dmusics.h"
#include "dmplugin.h"
#include "dmusicf.h"
#include "dsound.h"
#include "dmusics.h"
/*****************************************************************************
* Interfaces
@ -49,20 +52,13 @@ extern ICOM_VTABLE(IDirectMusicSynthSink) DirectMusicSynthSink_Vtbl;
/*****************************************************************************
* ClassFactory
*/
/* can support IID_IDirectMusicSynth and IID_IDirectMusicSynth8
* return always an IDirectMusicSynthImpl
*/
extern HRESULT WINAPI DMUSIC_CreateDirectMusicSynth (LPCGUID lpcGUID, LPDIRECTMUSICSYNTH8* ppDMSynth, LPUNKNOWN pUnkOuter);
/* can support IID_IDirectMusicSynthSink
* return always an IDirectMusicSynthSinkImpl
*/
extern HRESULT WINAPI DMUSIC_CreateDirectMusicSynthSink (LPCGUID lpcGUID, LPDIRECTMUSICSYNTHSINK* ppDMSynthSink, LPUNKNOWN pUnkOuter);
extern HRESULT WINAPI DMUSIC_CreateDirectMusicSynthImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter);
extern HRESULT WINAPI DMUSIC_CreateDirectMusicSynthSinkImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter);
/*****************************************************************************
* IDirectMusicSynth8Impl implementation structure
*/
struct IDirectMusicSynth8Impl
{
struct IDirectMusicSynth8Impl {
/* IUnknown fields */
ICOM_VFIELD(IDirectMusicSynth8);
DWORD ref;
@ -106,8 +102,7 @@ extern HRESULT WINAPI IDirectMusicSynth8Impl_AssignChannelToBuses (LPDIRECTMUSIC
/*****************************************************************************
* IDirectMusicSynthSinkImpl implementation structure
*/
struct IDirectMusicSynthSinkImpl
{
struct IDirectMusicSynthSinkImpl {
/* IUnknown fields */
ICOM_VFIELD(IDirectMusicSynthSink);
DWORD ref;

View File

@ -18,21 +18,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdarg.h>
#include <string.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winreg.h"
#include "winerror.h"
#include "dmusics.h"
#include "dmusici.h"
#include "dmplugin.h"
#include "wine/debug.h"
#include "dmsynth_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmsynth);
@ -44,8 +30,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(dmsynth);
/***********************************************************************
* interface for self-registering
*/
struct regsvr_interface
{
struct regsvr_interface {
IID const *iid; /* NULL for end of list */
LPCSTR name; /* can be NULL to omit */
IID const *base_iid; /* can be NULL to omit */
@ -57,8 +42,7 @@ struct regsvr_interface
static HRESULT register_interfaces(struct regsvr_interface const *list);
static HRESULT unregister_interfaces(struct regsvr_interface const *list);
struct regsvr_coclass
{
struct regsvr_coclass {
CLSID const *clsid; /* NULL for end of list */
LPCSTR name; /* can be NULL to omit */
LPCSTR ips; /* can be NULL to omit */
@ -124,8 +108,7 @@ static LONG recursive_delete_keyW(HKEY base, WCHAR const *name);
/***********************************************************************
* register_interfaces
*/
static HRESULT register_interfaces(struct regsvr_interface const *list)
{
static HRESULT register_interfaces(struct regsvr_interface const *list) {
LONG res = ERROR_SUCCESS;
HKEY interface_key;
@ -194,8 +177,7 @@ error_return:
/***********************************************************************
* unregister_interfaces
*/
static HRESULT unregister_interfaces(struct regsvr_interface const *list)
{
static HRESULT unregister_interfaces(struct regsvr_interface const *list) {
LONG res = ERROR_SUCCESS;
HKEY interface_key;
@ -219,8 +201,7 @@ error_return:
/***********************************************************************
* register_coclasses
*/
static HRESULT register_coclasses(struct regsvr_coclass const *list)
{
static HRESULT register_coclasses(struct regsvr_coclass const *list) {
LONG res = ERROR_SUCCESS;
HKEY coclass_key;
@ -301,8 +282,7 @@ error_return:
/***********************************************************************
* unregister_coclasses
*/
static HRESULT unregister_coclasses(struct regsvr_coclass const *list)
{
static HRESULT unregister_coclasses(struct regsvr_coclass const *list) {
LONG res = ERROR_SUCCESS;
HKEY coclass_key;
@ -338,8 +318,7 @@ error_return:
/***********************************************************************
* regsvr_key_guid
*/
static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid)
{
static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid) {
WCHAR buf[39];
StringFromGUID2(guid, buf, 39);
@ -352,8 +331,7 @@ static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid)
static LONG register_key_defvalueW(
HKEY base,
WCHAR const *name,
WCHAR const *value)
{
WCHAR const *value) {
LONG res;
HKEY key;
@ -372,8 +350,7 @@ static LONG register_key_defvalueW(
static LONG register_key_defvalueA(
HKEY base,
WCHAR const *name,
char const *value)
{
char const *value) {
LONG res;
HKEY key;
@ -394,8 +371,7 @@ static LONG register_progid(
char const *progid,
char const *curver_progid,
char const *name,
char const *extra)
{
char const *extra) {
LONG res;
HKEY progid_key;
@ -439,8 +415,7 @@ error_close_progid_key:
/***********************************************************************
* recursive_delete_key
*/
static LONG recursive_delete_key(HKEY key)
{
static LONG recursive_delete_key(HKEY key) {
LONG res;
WCHAR subkey_name[MAX_PATH];
DWORD cName;
@ -471,8 +446,7 @@ static LONG recursive_delete_key(HKEY key)
/***********************************************************************
* recursive_delete_keyA
*/
static LONG recursive_delete_keyA(HKEY base, char const *name)
{
static LONG recursive_delete_keyA(HKEY base, char const *name) {
LONG res;
HKEY key;
@ -487,8 +461,7 @@ static LONG recursive_delete_keyA(HKEY base, char const *name)
/***********************************************************************
* recursive_delete_keyW
*/
static LONG recursive_delete_keyW(HKEY base, WCHAR const *name)
{
static LONG recursive_delete_keyW(HKEY base, WCHAR const *name) {
LONG res;
HKEY key;
@ -534,8 +507,7 @@ static struct regsvr_interface const interface_list[] = {
/***********************************************************************
* DllRegisterServer (DMSYNTH.3)
*/
HRESULT WINAPI DMSYNTH_DllRegisterServer(void)
{
HRESULT WINAPI DMSYNTH_DllRegisterServer(void) {
HRESULT hr;
TRACE("\n");
@ -549,8 +521,7 @@ HRESULT WINAPI DMSYNTH_DllRegisterServer(void)
/***********************************************************************
* DllUnregisterServer (DMSYNTH.4)
*/
HRESULT WINAPI DMSYNTH_DllUnregisterServer(void)
{
HRESULT WINAPI DMSYNTH_DllUnregisterServer(void) {
HRESULT hr;
TRACE("\n");

View File

@ -1,6 +1,6 @@
/* IDirectMusicSynth8 Implementation
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -17,22 +17,12 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "winnls.h"
#include "dmsynth_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmsynth);
/* IDirectMusicSynth8 IUnknown part: */
HRESULT WINAPI IDirectMusicSynth8Impl_QueryInterface (LPDIRECTMUSICSYNTH8 iface, REFIID riid, LPVOID *ppobj)
{
/* IDirectMusicSynth8Impl IUnknown part: */
HRESULT WINAPI IDirectMusicSynth8Impl_QueryInterface (LPDIRECTMUSICSYNTH8 iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IDirectMusicSynth8Impl,iface);
if (IsEqualIID (riid, &IID_IUnknown) ||
@ -42,20 +32,17 @@ HRESULT WINAPI IDirectMusicSynth8Impl_QueryInterface (LPDIRECTMUSICSYNTH8 iface,
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicSynth8Impl_AddRef (LPDIRECTMUSICSYNTH8 iface)
{
ULONG WINAPI IDirectMusicSynth8Impl_AddRef (LPDIRECTMUSICSYNTH8 iface) {
ICOM_THIS(IDirectMusicSynth8Impl,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicSynth8Impl_Release (LPDIRECTMUSICSYNTH8 iface)
{
ULONG WINAPI IDirectMusicSynth8Impl_Release (LPDIRECTMUSICSYNTH8 iface) {
ICOM_THIS(IDirectMusicSynth8Impl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
@ -65,213 +52,146 @@ ULONG WINAPI IDirectMusicSynth8Impl_Release (LPDIRECTMUSICSYNTH8 iface)
return ref;
}
/* IDirectMusicSynth8 IDirectMusicSynth part: */
HRESULT WINAPI IDirectMusicSynth8Impl_Open (LPDIRECTMUSICSYNTH8 iface, LPDMUS_PORTPARAMS pPortParams)
{
/* IDirectMusicSynth8Impl IDirectMusicSynth part: */
HRESULT WINAPI IDirectMusicSynth8Impl_Open (LPDIRECTMUSICSYNTH8 iface, LPDMUS_PORTPARAMS pPortParams) {
ICOM_THIS(IDirectMusicSynth8Impl,iface);
FIXME("(%p, %p): stub\n", This, pPortParams);
return S_OK;
}
HRESULT WINAPI IDirectMusicSynth8Impl_Close (LPDIRECTMUSICSYNTH8 iface)
{
HRESULT WINAPI IDirectMusicSynth8Impl_Close (LPDIRECTMUSICSYNTH8 iface) {
ICOM_THIS(IDirectMusicSynth8Impl,iface);
FIXME("(%p): stub\n", This);
return S_OK;
}
HRESULT WINAPI IDirectMusicSynth8Impl_SetNumChannelGroups (LPDIRECTMUSICSYNTH8 iface, DWORD dwGroups)
{
HRESULT WINAPI IDirectMusicSynth8Impl_SetNumChannelGroups (LPDIRECTMUSICSYNTH8 iface, DWORD dwGroups) {
ICOM_THIS(IDirectMusicSynth8Impl,iface);
FIXME("(%p, %ld): stub\n", This, dwGroups);
return S_OK;
}
HRESULT WINAPI IDirectMusicSynth8Impl_Download (LPDIRECTMUSICSYNTH8 iface, LPHANDLE phDownload, LPVOID pvData, LPBOOL pbFree)
{
HRESULT WINAPI IDirectMusicSynth8Impl_Download (LPDIRECTMUSICSYNTH8 iface, LPHANDLE phDownload, LPVOID pvData, LPBOOL pbFree) {
ICOM_THIS(IDirectMusicSynth8Impl,iface);
FIXME("(%p, %p, %p, %p): stub\n", This, phDownload, pvData, pbFree);
return S_OK;
}
HRESULT WINAPI IDirectMusicSynth8Impl_Unload (LPDIRECTMUSICSYNTH8 iface, HANDLE hDownload, HRESULT (CALLBACK* lpFreeHandle)(HANDLE,HANDLE), HANDLE hUserData)
{
HRESULT WINAPI IDirectMusicSynth8Impl_Unload (LPDIRECTMUSICSYNTH8 iface, HANDLE hDownload, HRESULT (CALLBACK* lpFreeHandle)(HANDLE,HANDLE), HANDLE hUserData) {
ICOM_THIS(IDirectMusicSynth8Impl,iface);
FIXME("(%p, %p, %p): stub\n", This, hDownload, hUserData);
return S_OK;
}
HRESULT WINAPI IDirectMusicSynth8Impl_PlayBuffer (LPDIRECTMUSICSYNTH8 iface, REFERENCE_TIME rt, LPBYTE pbBuffer, DWORD cbBuffer)
{
HRESULT WINAPI IDirectMusicSynth8Impl_PlayBuffer (LPDIRECTMUSICSYNTH8 iface, REFERENCE_TIME rt, LPBYTE pbBuffer, DWORD cbBuffer) {
ICOM_THIS(IDirectMusicSynth8Impl,iface);
FIXME("(%p, %lli, %p, %ld): stub\n", This, rt, pbBuffer, cbBuffer);
return S_OK;
}
HRESULT WINAPI IDirectMusicSynth8Impl_GetRunningStats (LPDIRECTMUSICSYNTH8 iface, LPDMUS_SYNTHSTATS pStats)
{
HRESULT WINAPI IDirectMusicSynth8Impl_GetRunningStats (LPDIRECTMUSICSYNTH8 iface, LPDMUS_SYNTHSTATS pStats) {
ICOM_THIS(IDirectMusicSynth8Impl,iface);
FIXME("(%p, %p): stub\n", This, pStats);
return S_OK;
}
HRESULT WINAPI IDirectMusicSynth8Impl_GetPortCaps (LPDIRECTMUSICSYNTH8 iface, LPDMUS_PORTCAPS pCaps)
{
HRESULT WINAPI IDirectMusicSynth8Impl_GetPortCaps (LPDIRECTMUSICSYNTH8 iface, LPDMUS_PORTCAPS pCaps) {
ICOM_THIS(IDirectMusicSynth8Impl,iface);
TRACE("(%p, %p)\n", This, pCaps);
*pCaps = This->pCaps;
return S_OK;
}
HRESULT WINAPI IDirectMusicSynth8Impl_SetMasterClock (LPDIRECTMUSICSYNTH8 iface, IReferenceClock* pClock)
{
HRESULT WINAPI IDirectMusicSynth8Impl_SetMasterClock (LPDIRECTMUSICSYNTH8 iface, IReferenceClock* pClock) {
ICOM_THIS(IDirectMusicSynth8Impl,iface);
FIXME("(%p, %p): stub\n", This, pClock);
return S_OK;
}
HRESULT WINAPI IDirectMusicSynth8Impl_GetLatencyClock (LPDIRECTMUSICSYNTH8 iface, IReferenceClock** ppClock)
{
HRESULT WINAPI IDirectMusicSynth8Impl_GetLatencyClock (LPDIRECTMUSICSYNTH8 iface, IReferenceClock** ppClock) {
ICOM_THIS(IDirectMusicSynth8Impl,iface);
TRACE("(%p, %p)\n", This, ppClock);
*ppClock = This->pLatencyClock;
return S_OK;
}
HRESULT WINAPI IDirectMusicSynth8Impl_Activate (LPDIRECTMUSICSYNTH8 iface, BOOL fEnable)
{
HRESULT WINAPI IDirectMusicSynth8Impl_Activate (LPDIRECTMUSICSYNTH8 iface, BOOL fEnable) {
ICOM_THIS(IDirectMusicSynth8Impl,iface);
TRACE("(%p, %d)\n", This, fEnable);
This->fActive = fEnable;
return S_OK;
}
HRESULT WINAPI IDirectMusicSynth8Impl_SetSynthSink (LPDIRECTMUSICSYNTH8 iface, IDirectMusicSynthSink* pSynthSink)
{
HRESULT WINAPI IDirectMusicSynth8Impl_SetSynthSink (LPDIRECTMUSICSYNTH8 iface, IDirectMusicSynthSink* pSynthSink) {
ICOM_THIS(IDirectMusicSynth8Impl,iface);
TRACE("(%p, %p)\n", This, pSynthSink);
This->pSynthSink = (IDirectMusicSynthSinkImpl*)pSynthSink;
return S_OK;
}
HRESULT WINAPI IDirectMusicSynth8Impl_Render (LPDIRECTMUSICSYNTH8 iface, short* pBuffer, DWORD dwLength, LONGLONG llPosition)
{
HRESULT WINAPI IDirectMusicSynth8Impl_Render (LPDIRECTMUSICSYNTH8 iface, short* pBuffer, DWORD dwLength, LONGLONG llPosition) {
ICOM_THIS(IDirectMusicSynth8Impl,iface);
FIXME("(%p, %p, %ld, %lli): stub\n", This, pBuffer, dwLength, llPosition);
return S_OK;
}
HRESULT WINAPI IDirectMusicSynth8Impl_SetChannelPriority (LPDIRECTMUSICSYNTH8 iface, DWORD dwChannelGroup, DWORD dwChannel, DWORD dwPriority)
{
HRESULT WINAPI IDirectMusicSynth8Impl_SetChannelPriority (LPDIRECTMUSICSYNTH8 iface, DWORD dwChannelGroup, DWORD dwChannel, DWORD dwPriority) {
/*ICOM_THIS(IDirectMusicSynth8Impl,iface); */
/* silenced because of too many messages - 1000 groups * 16 channels ;=) */
/*FIXME("(%p, %ld, %ld, %ld): stub\n", This, dwChannelGroup, dwChannel, dwPriority); */
return S_OK;
}
HRESULT WINAPI IDirectMusicSynth8Impl_GetChannelPriority (LPDIRECTMUSICSYNTH8 iface, DWORD dwChannelGroup, DWORD dwChannel, LPDWORD pdwPriority)
{
HRESULT WINAPI IDirectMusicSynth8Impl_GetChannelPriority (LPDIRECTMUSICSYNTH8 iface, DWORD dwChannelGroup, DWORD dwChannel, LPDWORD pdwPriority) {
ICOM_THIS(IDirectMusicSynth8Impl,iface);
FIXME("(%p, %ld, %ld, %p): stub\n", This, dwChannelGroup, dwChannel, pdwPriority);
return S_OK;
}
HRESULT WINAPI IDirectMusicSynth8Impl_GetFormat (LPDIRECTMUSICSYNTH8 iface, LPWAVEFORMATEX pWaveFormatEx, LPDWORD pdwWaveFormatExSiz)
{
HRESULT WINAPI IDirectMusicSynth8Impl_GetFormat (LPDIRECTMUSICSYNTH8 iface, LPWAVEFORMATEX pWaveFormatEx, LPDWORD pdwWaveFormatExSiz) {
ICOM_THIS(IDirectMusicSynth8Impl,iface);
FIXME("(%p, %p, %p): stub\n", This, pWaveFormatEx, pdwWaveFormatExSiz);
return S_OK;
}
HRESULT WINAPI IDirectMusicSynth8Impl_GetAppend (LPDIRECTMUSICSYNTH8 iface, DWORD* pdwAppend)
{
HRESULT WINAPI IDirectMusicSynth8Impl_GetAppend (LPDIRECTMUSICSYNTH8 iface, DWORD* pdwAppend) {
ICOM_THIS(IDirectMusicSynth8Impl,iface);
FIXME("(%p, %p): stub\n", This, pdwAppend);
return S_OK;
}
/* IDirectMusicSynth8 IDirectMusicSynth8 part: */
HRESULT WINAPI IDirectMusicSynth8Impl_PlayVoice (LPDIRECTMUSICSYNTH8 iface, REFERENCE_TIME rt, DWORD dwVoiceId, DWORD dwChannelGroup, DWORD dwChannel, DWORD dwDLId, long prPitch, long vrVolume, SAMPLE_TIME stVoiceStart, SAMPLE_TIME stLoopStart, SAMPLE_TIME stLoopEnd)
{
/* IDirectMusicSynth8Impl IDirectMusicSynth8 part: */
HRESULT WINAPI IDirectMusicSynth8Impl_PlayVoice (LPDIRECTMUSICSYNTH8 iface, REFERENCE_TIME rt, DWORD dwVoiceId, DWORD dwChannelGroup, DWORD dwChannel, DWORD dwDLId, long prPitch, long vrVolume, SAMPLE_TIME stVoiceStart, SAMPLE_TIME stLoopStart, SAMPLE_TIME stLoopEnd) {
ICOM_THIS(IDirectMusicSynth8Impl,iface);
FIXME("(%p, %lli, %ld, %ld, %ld, %ld, %li, %li,%lli, %lli, %lli): stub\n", This, rt, dwVoiceId, dwChannelGroup, dwChannel, dwDLId, prPitch, vrVolume, stVoiceStart, stLoopStart, stLoopEnd);
return S_OK;
}
HRESULT WINAPI IDirectMusicSynth8Impl_StopVoice (LPDIRECTMUSICSYNTH8 iface, REFERENCE_TIME rt, DWORD dwVoiceId)
{
HRESULT WINAPI IDirectMusicSynth8Impl_StopVoice (LPDIRECTMUSICSYNTH8 iface, REFERENCE_TIME rt, DWORD dwVoiceId) {
ICOM_THIS(IDirectMusicSynth8Impl,iface);
FIXME("(%p, %lli, %ld): stub\n", This, rt, dwVoiceId);
return S_OK;
}
HRESULT WINAPI IDirectMusicSynth8Impl_GetVoiceState (LPDIRECTMUSICSYNTH8 iface, DWORD dwVoice[], DWORD cbVoice, DMUS_VOICE_STATE dwVoiceState[])
{
HRESULT WINAPI IDirectMusicSynth8Impl_GetVoiceState (LPDIRECTMUSICSYNTH8 iface, DWORD dwVoice[], DWORD cbVoice, DMUS_VOICE_STATE dwVoiceState[]) {
ICOM_THIS(IDirectMusicSynth8Impl,iface);
FIXME("(%p, %p, %ld, %p): stub\n", This, dwVoice, cbVoice, dwVoiceState);
return S_OK;
}
HRESULT WINAPI IDirectMusicSynth8Impl_Refresh (LPDIRECTMUSICSYNTH8 iface, DWORD dwDownloadID, DWORD dwFlags)
{
HRESULT WINAPI IDirectMusicSynth8Impl_Refresh (LPDIRECTMUSICSYNTH8 iface, DWORD dwDownloadID, DWORD dwFlags) {
ICOM_THIS(IDirectMusicSynth8Impl,iface);
FIXME("(%p, %ld, %ld): stub\n", This, dwDownloadID, dwFlags);
return S_OK;
}
HRESULT WINAPI IDirectMusicSynth8Impl_AssignChannelToBuses (LPDIRECTMUSICSYNTH8 iface, DWORD dwChannelGroup, DWORD dwChannel, LPDWORD pdwBuses, DWORD cBuses)
{
HRESULT WINAPI IDirectMusicSynth8Impl_AssignChannelToBuses (LPDIRECTMUSICSYNTH8 iface, DWORD dwChannelGroup, DWORD dwChannel, LPDWORD pdwBuses, DWORD cBuses) {
ICOM_THIS(IDirectMusicSynth8Impl,iface);
FIXME("(%p, %ld, %ld, %p, %ld): stub\n", This, dwChannelGroup, dwChannel, pdwBuses, cBuses);
return S_OK;
}
ICOM_VTABLE(IDirectMusicSynth8) DirectMusicSynth8_Vtbl =
{
ICOM_VTABLE(IDirectMusicSynth8) DirectMusicSynth8_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicSynth8Impl_QueryInterface,
IDirectMusicSynth8Impl_AddRef,
@ -301,39 +221,31 @@ ICOM_VTABLE(IDirectMusicSynth8) DirectMusicSynth8_Vtbl =
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicSynth (LPCGUID lpcGUID, LPDIRECTMUSICSYNTH8* ppDMSynth, LPUNKNOWN pUnkOuter)
{
IDirectMusicSynth8Impl *dmsynth;
HRESULT WINAPI DMUSIC_CreateDirectMusicSynthImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) {
IDirectMusicSynth8Impl *obj;
TRACE("(%p,%p,%p)\n", lpcGUID, ppDMSynth, pUnkOuter);
if (IsEqualIID (lpcGUID, &IID_IDirectMusicSynth) ||
IsEqualIID (lpcGUID, &IID_IDirectMusicSynth8)) {
dmsynth = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicSynth8Impl));
if (NULL == dmsynth) {
*ppDMSynth = (LPDIRECTMUSICSYNTH8) NULL;
return E_OUTOFMEMORY;
}
dmsynth->lpVtbl = &DirectMusicSynth8_Vtbl;
dmsynth->ref = 1;
/* fill in caps */
dmsynth->pCaps.dwSize = sizeof(DMUS_PORTCAPS);
dmsynth->pCaps.dwFlags = DMUS_PC_DLS | DMUS_PC_SOFTWARESYNTH | DMUS_PC_DIRECTSOUND | DMUS_PC_DLS2 | DMUS_PC_AUDIOPATH | DMUS_PC_WAVE;
dmsynth->pCaps.guidPort = CLSID_DirectMusicSynth;
dmsynth->pCaps.dwClass = DMUS_PC_OUTPUTCLASS;
dmsynth->pCaps.dwType = DMUS_PORT_WINMM_DRIVER;
dmsynth->pCaps.dwMemorySize = DMUS_PC_SYSTEMMEMORY;
dmsynth->pCaps.dwMaxChannelGroups = 1000;
dmsynth->pCaps.dwMaxVoices = 1000;
dmsynth->pCaps.dwMaxAudioChannels = -1;
dmsynth->pCaps.dwEffectFlags = DMUS_EFFECT_REVERB | DMUS_EFFECT_CHORUS | DMUS_EFFECT_DELAY;
MultiByteToWideChar (CP_ACP, 0, "Microsotf Synthesizer", -1, dmsynth->pCaps.wszDescription, sizeof(dmsynth->pCaps.wszDescription)/sizeof(WCHAR));
/* assign latency clock */
/*DMUSIC_CreateReferenceClock (&IID_IReferenceClock, (LPREFERENCECLOCK*)&This->pLatencyClock, NULL); */
*ppDMSynth = (LPDIRECTMUSICSYNTH8) dmsynth;
return S_OK;
TRACE("(%p,%p,%p)\n", lpcGUID, ppobj, pUnkOuter);
obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicSynth8Impl));
if (NULL == obj) {
*ppobj = (LPDIRECTMUSICSYNTH8) NULL;
return E_OUTOFMEMORY;
}
WARN("No interface found\n");
return E_NOINTERFACE;
obj->lpVtbl = &DirectMusicSynth8_Vtbl;
obj->ref = 0;
/* fill in caps */
obj->pCaps.dwSize = sizeof(DMUS_PORTCAPS);
obj->pCaps.dwFlags = DMUS_PC_DLS | DMUS_PC_SOFTWARESYNTH | DMUS_PC_DIRECTSOUND | DMUS_PC_DLS2 | DMUS_PC_AUDIOPATH | DMUS_PC_WAVE;
obj->pCaps.guidPort = CLSID_DirectMusicSynth;
obj->pCaps.dwClass = DMUS_PC_OUTPUTCLASS;
obj->pCaps.dwType = DMUS_PORT_WINMM_DRIVER;
obj->pCaps.dwMemorySize = DMUS_PC_SYSTEMMEMORY;
obj->pCaps.dwMaxChannelGroups = 1000;
obj->pCaps.dwMaxVoices = 1000;
obj->pCaps.dwMaxAudioChannels = -1;
obj->pCaps.dwEffectFlags = DMUS_EFFECT_REVERB | DMUS_EFFECT_CHORUS | DMUS_EFFECT_DELAY;
MultiByteToWideChar (CP_ACP, 0, "Microsotf Synthesizer", -1, obj->pCaps.wszDescription, sizeof(obj->pCaps.wszDescription)/sizeof(WCHAR));
/* assign latency clock */
/*DMUSIC_CreateReferenceClockImpl (&IID_IReferenceClock, (LPVOID*)&This->pLatencyClock, NULL); */
return IDirectMusicSynth8Impl_QueryInterface ((LPDIRECTMUSICSYNTH8)obj, lpcGUID, ppobj);
}

View File

@ -1,6 +1,6 @@
/* IDirectMusicSynthSink Implementation
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -17,21 +17,12 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "dmsynth_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmsynth);
/* IDirectMusicSynthSink IUnknown part: */
HRESULT WINAPI IDirectMusicSynthSinkImpl_QueryInterface (LPDIRECTMUSICSYNTHSINK iface, REFIID riid, LPVOID *ppobj)
{
/* IDirectMusicSynthSinkImpl IUnknown part: */
HRESULT WINAPI IDirectMusicSynthSinkImpl_QueryInterface (LPDIRECTMUSICSYNTHSINK iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IDirectMusicSynthSinkImpl,iface);
if (IsEqualIID (riid, &IID_IUnknown) ||
@ -40,20 +31,17 @@ HRESULT WINAPI IDirectMusicSynthSinkImpl_QueryInterface (LPDIRECTMUSICSYNTHSINK
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicSynthSinkImpl_AddRef (LPDIRECTMUSICSYNTHSINK iface)
{
ULONG WINAPI IDirectMusicSynthSinkImpl_AddRef (LPDIRECTMUSICSYNTHSINK iface) {
ICOM_THIS(IDirectMusicSynthSinkImpl,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicSynthSinkImpl_Release (LPDIRECTMUSICSYNTHSINK iface)
{
ULONG WINAPI IDirectMusicSynthSinkImpl_Release (LPDIRECTMUSICSYNTHSINK iface) {
ICOM_THIS(IDirectMusicSynthSinkImpl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
@ -63,81 +51,56 @@ ULONG WINAPI IDirectMusicSynthSinkImpl_Release (LPDIRECTMUSICSYNTHSINK iface)
return ref;
}
/* IDirectMusicSynth IDirectMusicSynth part: */
HRESULT WINAPI IDirectMusicSynthSinkImpl_Init (LPDIRECTMUSICSYNTHSINK iface, IDirectMusicSynth* pSynth)
{
/* IDirectMusicSynthSinkImpl IDirectMusicSynthSink part: */
HRESULT WINAPI IDirectMusicSynthSinkImpl_Init (LPDIRECTMUSICSYNTHSINK iface, IDirectMusicSynth* pSynth) {
ICOM_THIS(IDirectMusicSynthSinkImpl,iface);
FIXME("(%p, %p): stub\n", This, pSynth);
return S_OK;
}
HRESULT WINAPI IDirectMusicSynthSinkImpl_SetMasterClock (LPDIRECTMUSICSYNTHSINK iface, IReferenceClock* pClock)
{
HRESULT WINAPI IDirectMusicSynthSinkImpl_SetMasterClock (LPDIRECTMUSICSYNTHSINK iface, IReferenceClock* pClock) {
ICOM_THIS(IDirectMusicSynthSinkImpl,iface);
FIXME("(%p, %p): stub\n", This, pClock);
return S_OK;
}
HRESULT WINAPI IDirectMusicSynthSinkImpl_GetLatencyClock (LPDIRECTMUSICSYNTHSINK iface, IReferenceClock** ppClock)
{
HRESULT WINAPI IDirectMusicSynthSinkImpl_GetLatencyClock (LPDIRECTMUSICSYNTHSINK iface, IReferenceClock** ppClock) {
ICOM_THIS(IDirectMusicSynthSinkImpl,iface);
FIXME("(%p, %p): stub\n", This, ppClock);
return S_OK;
}
HRESULT WINAPI IDirectMusicSynthSinkImpl_Activate (LPDIRECTMUSICSYNTHSINK iface, BOOL fEnable)
{
HRESULT WINAPI IDirectMusicSynthSinkImpl_Activate (LPDIRECTMUSICSYNTHSINK iface, BOOL fEnable) {
ICOM_THIS(IDirectMusicSynthSinkImpl,iface);
FIXME("(%p, %d): stub\n", This, fEnable);
return S_OK;
}
HRESULT WINAPI IDirectMusicSynthSinkImpl_SampleToRefTime (LPDIRECTMUSICSYNTHSINK iface, LONGLONG llSampleTime, REFERENCE_TIME* prfTime)
{
HRESULT WINAPI IDirectMusicSynthSinkImpl_SampleToRefTime (LPDIRECTMUSICSYNTHSINK iface, LONGLONG llSampleTime, REFERENCE_TIME* prfTime) {
ICOM_THIS(IDirectMusicSynthSinkImpl,iface);
FIXME("(%p, %lli, %p): stub\n", This, llSampleTime, prfTime);
return S_OK;
}
HRESULT WINAPI IDirectMusicSynthSinkImpl_RefTimeToSample (LPDIRECTMUSICSYNTHSINK iface, REFERENCE_TIME rfTime, LONGLONG* pllSampleTime)
{
HRESULT WINAPI IDirectMusicSynthSinkImpl_RefTimeToSample (LPDIRECTMUSICSYNTHSINK iface, REFERENCE_TIME rfTime, LONGLONG* pllSampleTime) {
ICOM_THIS(IDirectMusicSynthSinkImpl,iface);
FIXME("(%p, %lli, %p): stub\n", This, rfTime, pllSampleTime );
return S_OK;
}
HRESULT WINAPI IDirectMusicSynthSinkImpl_SetDirectSound (LPDIRECTMUSICSYNTHSINK iface, LPDIRECTSOUND pDirectSound, LPDIRECTSOUNDBUFFER pDirectSoundBuffer)
{
HRESULT WINAPI IDirectMusicSynthSinkImpl_SetDirectSound (LPDIRECTMUSICSYNTHSINK iface, LPDIRECTSOUND pDirectSound, LPDIRECTSOUNDBUFFER pDirectSoundBuffer) {
ICOM_THIS(IDirectMusicSynthSinkImpl,iface);
FIXME("(%p, %p, %p): stub\n", This, pDirectSound, pDirectSoundBuffer);
return S_OK;
}
HRESULT WINAPI IDirectMusicSynthSinkImpl_GetDesiredBufferSize (LPDIRECTMUSICSYNTHSINK iface, LPDWORD pdwBufferSizeInSamples)
{
HRESULT WINAPI IDirectMusicSynthSinkImpl_GetDesiredBufferSize (LPDIRECTMUSICSYNTHSINK iface, LPDWORD pdwBufferSizeInSamples) {
ICOM_THIS(IDirectMusicSynthSinkImpl,iface);
FIXME("(%p, %p): stub\n", This, pdwBufferSizeInSamples);
return S_OK;
}
ICOM_VTABLE(IDirectMusicSynthSink) DirectMusicSynthSink_Vtbl =
{
ICOM_VTABLE(IDirectMusicSynthSink) DirectMusicSynthSink_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicSynthSinkImpl_QueryInterface,
IDirectMusicSynthSinkImpl_AddRef,
@ -153,23 +116,17 @@ ICOM_VTABLE(IDirectMusicSynthSink) DirectMusicSynthSink_Vtbl =
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicSynthSink (LPCGUID lpcGUID, LPDIRECTMUSICSYNTHSINK* ppDMSynthSink, LPUNKNOWN pUnkOuter)
{
IDirectMusicSynthSinkImpl *dmsink;
HRESULT WINAPI DMUSIC_CreateDirectMusicSynthSinkImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) {
IDirectMusicSynthSinkImpl *obj;
TRACE("(%p,%p,%p)\n", lpcGUID, ppDMSynthSink, pUnkOuter);
if (IsEqualIID (lpcGUID, &IID_IDirectMusicSynthSink)) {
dmsink = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicSynthSinkImpl));
if (NULL == dmsink) {
*ppDMSynthSink = (LPDIRECTMUSICSYNTHSINK) NULL;
return E_OUTOFMEMORY;
}
dmsink->lpVtbl = &DirectMusicSynthSink_Vtbl;
dmsink->ref = 1;
*ppDMSynthSink = (LPDIRECTMUSICSYNTHSINK) dmsink;
return S_OK;
TRACE("(%p,%p,%p)\n", lpcGUID, ppobj, pUnkOuter);
obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicSynthSinkImpl));
if (NULL == obj) {
*ppobj = (LPDIRECTMUSICSYNTHSINK) NULL;
return E_OUTOFMEMORY;
}
obj->lpVtbl = &DirectMusicSynthSink_Vtbl;
obj->ref = 0;
WARN("No interface found\n");
return E_NOINTERFACE;
return IDirectMusicSynthSinkImpl_QueryInterface((LPDIRECTMUSICSYNTHSINK)obj, lpcGUID, ppobj);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 Rok Mandeljc <rok.mandeljc@gimb.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -18,10 +18,10 @@
#define WINE_FILEDESCRIPTION_STR "Wine DirectMusic Software Synthesizer"
#define WINE_FILENAME_STR "dmsynth.dll"
#define WINE_FILEVERSION 4,8,1,881
#define WINE_FILEVERSION_STR "4.8.1.881"
#define WINE_PRODUCTVERSION 4,8,1,881
#define WINE_PRODUCTVERSION_STR "4.8"
#define WINE_FILEVERSION 4,9,0,900
#define WINE_FILEVERSION_STR "4.9.0.900"
#define WINE_PRODUCTVERSION 4,9,0,900
#define WINE_PRODUCTVERSION_STR "4.9"
#define WINE_PRODUCTNAME_STR "DirectX"
#include "wine/wine_common_ver.rc"

View File

@ -1,6 +1,6 @@
/* IDirectMusicBuffer Implementation
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -17,54 +17,30 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <stdarg.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);
/* IDirectMusicBuffer IUnknown parts follow: */
HRESULT WINAPI IDirectMusicBufferImpl_QueryInterface (LPDIRECTMUSICBUFFER iface, REFIID riid, LPVOID *ppobj)
{
/* IDirectMusicBufferImpl IUnknown part: */
HRESULT WINAPI IDirectMusicBufferImpl_QueryInterface (LPDIRECTMUSICBUFFER iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IDirectMusicBufferImpl,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IDirectMusicBuffer)) {
IDirectMusicBufferImpl_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicBufferImpl_AddRef (LPDIRECTMUSICBUFFER iface)
{
ULONG WINAPI IDirectMusicBufferImpl_AddRef (LPDIRECTMUSICBUFFER iface) {
ICOM_THIS(IDirectMusicBufferImpl,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicBufferImpl_Release (LPDIRECTMUSICBUFFER iface)
{
ULONG WINAPI IDirectMusicBufferImpl_Release (LPDIRECTMUSICBUFFER iface) {
ICOM_THIS(IDirectMusicBufferImpl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
@ -74,126 +50,86 @@ ULONG WINAPI IDirectMusicBufferImpl_Release (LPDIRECTMUSICBUFFER iface)
return ref;
}
/* IDirectMusicBuffer Interface follow: */
HRESULT WINAPI IDirectMusicBufferImpl_Flush (LPDIRECTMUSICBUFFER iface)
{
/* IDirectMusicBufferImpl IDirectMusicBuffer part: */
HRESULT WINAPI IDirectMusicBufferImpl_Flush (LPDIRECTMUSICBUFFER iface) {
ICOM_THIS(IDirectMusicBufferImpl,iface);
FIXME("(%p): stub\n", This);
return S_OK;
}
HRESULT WINAPI IDirectMusicBufferImpl_TotalTime (LPDIRECTMUSICBUFFER iface, LPREFERENCE_TIME prtTime)
{
HRESULT WINAPI IDirectMusicBufferImpl_TotalTime (LPDIRECTMUSICBUFFER iface, LPREFERENCE_TIME prtTime) {
ICOM_THIS(IDirectMusicBufferImpl,iface);
FIXME("(%p, %p): stub\n", This, prtTime);
FIXME("(%p, %p): stub\n", This, prtTime);
return S_OK;
}
HRESULT WINAPI IDirectMusicBufferImpl_PackStructured (LPDIRECTMUSICBUFFER iface, REFERENCE_TIME rt, DWORD dwChannelGroup, DWORD dwChannelMessage)
{
HRESULT WINAPI IDirectMusicBufferImpl_PackStructured (LPDIRECTMUSICBUFFER iface, REFERENCE_TIME rt, DWORD dwChannelGroup, DWORD dwChannelMessage) {
ICOM_THIS(IDirectMusicBufferImpl,iface);
FIXME("(%p, %lli, %ld, %ld): stub\n", This, rt, dwChannelGroup, dwChannelMessage);
return S_OK;
}
HRESULT WINAPI IDirectMusicBufferImpl_PackUnstructured (LPDIRECTMUSICBUFFER iface, REFERENCE_TIME rt, DWORD dwChannelGroup, DWORD cb, LPBYTE lpb)
{
HRESULT WINAPI IDirectMusicBufferImpl_PackUnstructured (LPDIRECTMUSICBUFFER iface, REFERENCE_TIME rt, DWORD dwChannelGroup, DWORD cb, LPBYTE lpb) {
ICOM_THIS(IDirectMusicBufferImpl,iface);
FIXME("(%p, %lli, %ld, %ld, %p): stub\n", This, rt, dwChannelGroup, cb, lpb);
return S_OK;
}
HRESULT WINAPI IDirectMusicBufferImpl_ResetReadPtr (LPDIRECTMUSICBUFFER iface)
{
HRESULT WINAPI IDirectMusicBufferImpl_ResetReadPtr (LPDIRECTMUSICBUFFER iface) {
ICOM_THIS(IDirectMusicBufferImpl,iface);
FIXME("(%p): stub\n", This);
return S_OK;
}
HRESULT WINAPI IDirectMusicBufferImpl_GetNextEvent (LPDIRECTMUSICBUFFER iface, LPREFERENCE_TIME prt, LPDWORD pdwChannelGroup, LPDWORD pdwLength, LPBYTE* ppData)
{
HRESULT WINAPI IDirectMusicBufferImpl_GetNextEvent (LPDIRECTMUSICBUFFER iface, LPREFERENCE_TIME prt, LPDWORD pdwChannelGroup, LPDWORD pdwLength, LPBYTE* ppData) {
ICOM_THIS(IDirectMusicBufferImpl,iface);
FIXME("(%p, %p, %p, %p, %p): stub\n", This, prt, pdwChannelGroup, pdwLength, ppData);
return S_OK;
}
HRESULT WINAPI IDirectMusicBufferImpl_GetRawBufferPtr (LPDIRECTMUSICBUFFER iface, LPBYTE* ppData)
{
HRESULT WINAPI IDirectMusicBufferImpl_GetRawBufferPtr (LPDIRECTMUSICBUFFER iface, LPBYTE* ppData) {
ICOM_THIS(IDirectMusicBufferImpl,iface);
FIXME("(%p, %p): stub\n", This, ppData);
return S_OK;
}
HRESULT WINAPI IDirectMusicBufferImpl_GetStartTime (LPDIRECTMUSICBUFFER iface, LPREFERENCE_TIME prt)
{
HRESULT WINAPI IDirectMusicBufferImpl_GetStartTime (LPDIRECTMUSICBUFFER iface, LPREFERENCE_TIME prt) {
ICOM_THIS(IDirectMusicBufferImpl,iface);
FIXME("(%p, %p): stub\n", This, prt);
return S_OK;
}
HRESULT WINAPI IDirectMusicBufferImpl_GetUsedBytes (LPDIRECTMUSICBUFFER iface, LPDWORD pcb)
{
HRESULT WINAPI IDirectMusicBufferImpl_GetUsedBytes (LPDIRECTMUSICBUFFER iface, LPDWORD pcb) {
ICOM_THIS(IDirectMusicBufferImpl,iface);
FIXME("(%p, %p): stub\n", This, pcb);
return S_OK;
}
HRESULT WINAPI IDirectMusicBufferImpl_GetMaxBytes (LPDIRECTMUSICBUFFER iface, LPDWORD pcb)
{
HRESULT WINAPI IDirectMusicBufferImpl_GetMaxBytes (LPDIRECTMUSICBUFFER iface, LPDWORD pcb) {
ICOM_THIS(IDirectMusicBufferImpl,iface);
FIXME("(%p, %p): stub\n", This, pcb);
return S_OK;
}
HRESULT WINAPI IDirectMusicBufferImpl_GetBufferFormat (LPDIRECTMUSICBUFFER iface, LPGUID pGuidFormat)
{
HRESULT WINAPI IDirectMusicBufferImpl_GetBufferFormat (LPDIRECTMUSICBUFFER iface, LPGUID pGuidFormat) {
ICOM_THIS(IDirectMusicBufferImpl,iface);
FIXME("(%p, %p): stub\n", This, pGuidFormat);
return S_OK;
}
HRESULT WINAPI IDirectMusicBufferImpl_SetStartTime (LPDIRECTMUSICBUFFER iface, REFERENCE_TIME rt)
{
HRESULT WINAPI IDirectMusicBufferImpl_SetStartTime (LPDIRECTMUSICBUFFER iface, REFERENCE_TIME rt) {
ICOM_THIS(IDirectMusicBufferImpl,iface);
FIXME("(%p, %lli): stub\n", This, rt);
return S_OK;
}
HRESULT WINAPI IDirectMusicBufferImpl_SetUsedBytes (LPDIRECTMUSICBUFFER iface, DWORD cb)
{
HRESULT WINAPI IDirectMusicBufferImpl_SetUsedBytes (LPDIRECTMUSICBUFFER iface, DWORD cb) {
ICOM_THIS(IDirectMusicBufferImpl,iface);
FIXME("(%p, %ld): stub\n", This, cb);
return S_OK;
}
ICOM_VTABLE(IDirectMusicBuffer) DirectMusicBuffer_Vtbl =
{
ICOM_VTABLE(IDirectMusicBuffer) DirectMusicBuffer_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicBufferImpl_QueryInterface,
IDirectMusicBufferImpl_AddRef,
@ -214,13 +150,16 @@ ICOM_VTABLE(IDirectMusicBuffer) DirectMusicBuffer_Vtbl =
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicBuffer (LPCGUID lpcGUID, LPDIRECTMUSICBUFFER* ppDMBuff, LPUNKNOWN pUnkOuter)
{
if (IsEqualIID (lpcGUID, &IID_IDirectMusicBuffer)) {
FIXME("Not yet\n");
return E_NOINTERFACE;
}
HRESULT WINAPI DMUSIC_CreateDirectMusicBufferImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) {
IDirectMusicBufferImpl* dmbuff;
WARN("No interface found\n");
return E_NOINTERFACE;
dmbuff = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicBufferImpl));
if (NULL == dmbuff) {
*ppobj = (LPVOID) NULL;
return E_OUTOFMEMORY;
}
dmbuff->lpVtbl = &DirectMusicBuffer_Vtbl;
dmbuff->ref = 0; /* will be inited by QueryInterface */
return IDirectMusicBufferImpl_QueryInterface ((LPDIRECTMUSICBUFFER)dmbuff, lpcGUID, ppobj);
}

View File

@ -1,6 +1,6 @@
/* IReferenceClock Implementation
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -17,21 +17,12 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "dmusic_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
/* IReferenceClock IUnknown parts follow: */
HRESULT WINAPI IReferenceClockImpl_QueryInterface (IReferenceClock *iface, REFIID riid, LPVOID *ppobj)
{
/* IReferenceClockImpl IUnknown part: */
HRESULT WINAPI IReferenceClockImpl_QueryInterface (IReferenceClock *iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IReferenceClockImpl,iface);
if (IsEqualIID (riid, &IID_IUnknown) ||
@ -40,20 +31,17 @@ HRESULT WINAPI IReferenceClockImpl_QueryInterface (IReferenceClock *iface, REFII
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IReferenceClockImpl_AddRef (IReferenceClock *iface)
{
ULONG WINAPI IReferenceClockImpl_AddRef (IReferenceClock *iface) {
ICOM_THIS(IReferenceClockImpl,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IReferenceClockImpl_Release (IReferenceClock *iface)
{
ULONG WINAPI IReferenceClockImpl_Release (IReferenceClock *iface) {
ICOM_THIS(IReferenceClockImpl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
@ -63,46 +51,33 @@ ULONG WINAPI IReferenceClockImpl_Release (IReferenceClock *iface)
return ref;
}
/* IReferenceClock Interface follow: */
HRESULT WINAPI IReferenceClockImpl_GetTime (IReferenceClock *iface, REFERENCE_TIME* pTime)
{
/* IReferenceClockImpl IReferenceClock part: */
HRESULT WINAPI IReferenceClockImpl_GetTime (IReferenceClock *iface, REFERENCE_TIME* pTime) {
ICOM_THIS(IReferenceClockImpl,iface);
TRACE("(%p, %p)\n", This, pTime);
*pTime = This->rtTime;
return S_OK;
}
HRESULT WINAPI IReferenceClockImpl_AdviseTime (IReferenceClock *iface, REFERENCE_TIME baseTime, REFERENCE_TIME streamTime, HANDLE hEvent, DWORD* pdwAdviseCookie)
{
HRESULT WINAPI IReferenceClockImpl_AdviseTime (IReferenceClock *iface, REFERENCE_TIME baseTime, REFERENCE_TIME streamTime, HANDLE hEvent, DWORD* pdwAdviseCookie) {
ICOM_THIS(IReferenceClockImpl,iface);
FIXME("(%p, %lli, %lli, %p, %p): stub\n", This, baseTime, streamTime, hEvent, pdwAdviseCookie);
return S_OK;
}
HRESULT WINAPI IReferenceClockImpl_AdvisePeriodic (IReferenceClock *iface, REFERENCE_TIME startTime, REFERENCE_TIME periodTime, HANDLE hSemaphore, DWORD* pdwAdviseCookie)
{
HRESULT WINAPI IReferenceClockImpl_AdvisePeriodic (IReferenceClock *iface, REFERENCE_TIME startTime, REFERENCE_TIME periodTime, HANDLE hSemaphore, DWORD* pdwAdviseCookie) {
ICOM_THIS(IReferenceClockImpl,iface);
FIXME("(%p, %lli, %lli, %p, %p): stub\n", This, startTime, periodTime, hSemaphore, pdwAdviseCookie);
return S_OK;
}
HRESULT WINAPI IReferenceClockImpl_Unadvise (IReferenceClock *iface, DWORD dwAdviseCookie)
{
HRESULT WINAPI IReferenceClockImpl_Unadvise (IReferenceClock *iface, DWORD dwAdviseCookie) {
ICOM_THIS(IReferenceClockImpl,iface);
FIXME("(%p, %ld): stub\n", This, dwAdviseCookie);
return S_OK;
}
ICOM_VTABLE(IReferenceClock) ReferenceClock_Vtbl =
{
ICOM_VTABLE(IReferenceClock) ReferenceClock_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IReferenceClockImpl_QueryInterface,
IReferenceClockImpl_AddRef,
@ -114,26 +89,18 @@ ICOM_VTABLE(IReferenceClock) ReferenceClock_Vtbl =
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateReferenceClock (LPCGUID lpcGUID, IReferenceClock** ppRC, LPUNKNOWN pUnkOuter)
{
HRESULT WINAPI DMUSIC_CreateReferenceClockImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) {
IReferenceClockImpl* clock;
if (IsEqualIID (lpcGUID, &IID_IReferenceClock))
{
clock = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IReferenceClockImpl));
if (NULL == clock) {
*ppRC = NULL;
return E_OUTOFMEMORY;
}
clock->lpVtbl = &ReferenceClock_Vtbl;
clock->ref = 1;
clock->rtTime = 0;
clock->pClockInfo.dwSize = sizeof (DMUS_CLOCKINFO);
*ppRC = (IReferenceClock *) clock;
return S_OK;
clock = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IReferenceClockImpl));
if (NULL == clock) {
*ppobj = NULL;
return E_OUTOFMEMORY;
}
WARN("No interface found\n");
return E_NOINTERFACE;
clock->lpVtbl = &ReferenceClock_Vtbl;
clock->ref = 0; /* will be inited by QueryInterface */
clock->rtTime = 0;
clock->pClockInfo.dwSize = sizeof (DMUS_CLOCKINFO);
return IReferenceClockImpl_QueryInterface ((IReferenceClock *)clock, lpcGUID, ppobj);
}

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
/* IDirectMusic8 Implementation
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -16,33 +16,16 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "winuser.h"
#include "wingdi.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);
/* IDirectMusic8 IUnknown parts follow: */
HRESULT WINAPI IDirectMusic8Impl_QueryInterface (LPDIRECTMUSIC8 iface, REFIID riid, LPVOID *ppobj)
{
/* IDirectMusic8Impl IUnknown part: */
HRESULT WINAPI IDirectMusic8Impl_QueryInterface (LPDIRECTMUSIC8 iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IDirectMusic8Impl,iface);
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IDirectMusic) ||
IsEqualIID (riid, &IID_IDirectMusic2) ||
IsEqualIID (riid, &IID_IDirectMusic8)) {
IDirectMusic8Impl_AddRef(iface);
@ -54,15 +37,13 @@ HRESULT WINAPI IDirectMusic8Impl_QueryInterface (LPDIRECTMUSIC8 iface, REFIID ri
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusic8Impl_AddRef (LPDIRECTMUSIC8 iface)
{
ULONG WINAPI IDirectMusic8Impl_AddRef (LPDIRECTMUSIC8 iface) {
ICOM_THIS(IDirectMusic8Impl,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusic8Impl_Release (LPDIRECTMUSIC8 iface)
{
ULONG WINAPI IDirectMusic8Impl_Release (LPDIRECTMUSIC8 iface) {
ICOM_THIS(IDirectMusic8Impl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
@ -72,9 +53,8 @@ ULONG WINAPI IDirectMusic8Impl_Release (LPDIRECTMUSIC8 iface)
return ref;
}
/* IDirectMusic8 Interface follow: */
HRESULT WINAPI IDirectMusic8Impl_EnumPort(LPDIRECTMUSIC8 iface, DWORD dwIndex, LPDMUS_PORTCAPS pPortCaps)
{
/* IDirectMusic8Impl IDirectMusic part: */
HRESULT WINAPI IDirectMusic8Impl_EnumPort(LPDIRECTMUSIC8 iface, DWORD dwIndex, LPDMUS_PORTCAPS pPortCaps) {
ICOM_THIS(IDirectMusic8Impl,iface);
TRACE("(%p, %ld, %p)\n", This, dwIndex, pPortCaps);
@ -115,17 +95,13 @@ HRESULT WINAPI IDirectMusic8Impl_EnumPort(LPDIRECTMUSIC8 iface, DWORD dwIndex, L
return S_FALSE;
}
HRESULT WINAPI IDirectMusic8Impl_CreateMusicBuffer (LPDIRECTMUSIC8 iface, LPDMUS_BUFFERDESC pBufferDesc, LPDIRECTMUSICBUFFER** ppBuffer, LPUNKNOWN pUnkOuter)
{
HRESULT WINAPI IDirectMusic8Impl_CreateMusicBuffer (LPDIRECTMUSIC8 iface, LPDMUS_BUFFERDESC pBufferDesc, LPDIRECTMUSICBUFFER** ppBuffer, LPUNKNOWN pUnkOuter) {
ICOM_THIS(IDirectMusic8Impl,iface);
FIXME("(%p, %p, %p, %p): stub\n", This, pBufferDesc, ppBuffer, pUnkOuter);
return S_OK;
}
HRESULT WINAPI IDirectMusic8Impl_CreatePort (LPDIRECTMUSIC8 iface, REFCLSID rclsidPort, LPDMUS_PORTPARAMS pPortParams, LPDIRECTMUSICPORT* ppPort, LPUNKNOWN pUnkOuter)
{
HRESULT WINAPI IDirectMusic8Impl_CreatePort (LPDIRECTMUSIC8 iface, REFCLSID rclsidPort, LPDMUS_PORTPARAMS pPortParams, LPDIRECTMUSICPORT* ppPort, LPUNKNOWN pUnkOuter) {
ICOM_THIS(IDirectMusic8Impl,iface);
int i/*, j*/;
DMUS_PORTCAPS PortCaps;
@ -145,7 +121,7 @@ HRESULT WINAPI IDirectMusic8Impl_CreatePort (LPDIRECTMUSIC8 iface, REFCLSID rcls
This->ppPorts[This->nrofports]->pCaps = &PortCaps;
This->ppPorts[This->nrofports]->pParams = pPortParams; /* this one is here just because there's a funct. which retrieves it back */
This->ppPorts[This->nrofports]->pDirectSound = NULL;
DMUSIC_CreateReferenceClock (&IID_IReferenceClock, (IReferenceClock**)&This->ppPorts[This->nrofports]->pLatencyClock, NULL);
DMUSIC_CreateReferenceClockImpl (&IID_IReferenceClock, (LPVOID*)&This->ppPorts[This->nrofports]->pLatencyClock, NULL);
#if 0
if (pPortParams->dwValidParams & DMUS_PORTPARAMS_CHANNELGROUPS) {
@ -181,17 +157,13 @@ HRESULT WINAPI IDirectMusic8Impl_CreatePort (LPDIRECTMUSIC8 iface, REFCLSID rcls
return E_NOINTERFACE;
}
HRESULT WINAPI IDirectMusic8Impl_EnumMasterClock (LPDIRECTMUSIC8 iface, DWORD dwIndex, LPDMUS_CLOCKINFO lpClockInfo)
{
HRESULT WINAPI IDirectMusic8Impl_EnumMasterClock (LPDIRECTMUSIC8 iface, DWORD dwIndex, LPDMUS_CLOCKINFO lpClockInfo) {
ICOM_THIS(IDirectMusic8Impl,iface);
FIXME("(%p, %ld, %p): stub\n", This, dwIndex, lpClockInfo);
return S_FALSE;
}
HRESULT WINAPI IDirectMusic8Impl_GetMasterClock (LPDIRECTMUSIC8 iface, LPGUID pguidClock, IReferenceClock** ppReferenceClock)
{
HRESULT WINAPI IDirectMusic8Impl_GetMasterClock (LPDIRECTMUSIC8 iface, LPGUID pguidClock, IReferenceClock** ppReferenceClock) {
ICOM_THIS(IDirectMusic8Impl,iface);
TRACE("(%p, %p, %p)\n", This, pguidClock, ppReferenceClock);
@ -203,31 +175,25 @@ HRESULT WINAPI IDirectMusic8Impl_GetMasterClock (LPDIRECTMUSIC8 iface, LPGUID pg
return S_OK;
}
HRESULT WINAPI IDirectMusic8Impl_SetMasterClock (LPDIRECTMUSIC8 iface, REFGUID rguidClock)
{
HRESULT WINAPI IDirectMusic8Impl_SetMasterClock (LPDIRECTMUSIC8 iface, REFGUID rguidClock) {
ICOM_THIS(IDirectMusic8Impl,iface);
FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidClock));
return S_OK;
}
HRESULT WINAPI IDirectMusic8Impl_Activate (LPDIRECTMUSIC8 iface, BOOL fEnable)
{
HRESULT WINAPI IDirectMusic8Impl_Activate (LPDIRECTMUSIC8 iface, BOOL fEnable) {
ICOM_THIS(IDirectMusic8Impl,iface);
int i;
FIXME("(%p, %d): stub\n", This, fEnable);
for (i = 0; i < This->nrofports; i++)
{
for (i = 0; i < This->nrofports; i++) {
This->ppPorts[i]->fActive = fEnable;
}
return S_OK;
}
HRESULT WINAPI IDirectMusic8Impl_GetDefaultPort (LPDIRECTMUSIC8 iface, LPGUID pguidPort)
{
HRESULT WINAPI IDirectMusic8Impl_GetDefaultPort (LPDIRECTMUSIC8 iface, LPGUID pguidPort) {
ICOM_THIS(IDirectMusic8Impl,iface);
HKEY hkGUID;
DWORD returnTypeGUID, sizeOfReturnBuffer = 50;
@ -251,26 +217,19 @@ HRESULT WINAPI IDirectMusic8Impl_GetDefaultPort (LPDIRECTMUSIC8 iface, LPGUID pg
return S_OK;
}
HRESULT WINAPI IDirectMusic8Impl_SetDirectSound (LPDIRECTMUSIC8 iface, LPDIRECTSOUND pDirectSound, HWND hWnd)
{
HRESULT WINAPI IDirectMusic8Impl_SetDirectSound (LPDIRECTMUSIC8 iface, LPDIRECTSOUND pDirectSound, HWND hWnd) {
ICOM_THIS(IDirectMusic8Impl,iface);
FIXME("(%p, %p, %p): stub\n", This, pDirectSound, hWnd);
return S_OK;
}
HRESULT WINAPI IDirectMusic8Impl_SetExternalMasterClock (LPDIRECTMUSIC8 iface, IReferenceClock* pClock)
{
HRESULT WINAPI IDirectMusic8Impl_SetExternalMasterClock (LPDIRECTMUSIC8 iface, IReferenceClock* pClock) {
ICOM_THIS(IDirectMusic8Impl,iface);
FIXME("(%p, %p): stub\n", This, pClock);
return S_OK;
}
ICOM_VTABLE(IDirectMusic8) DirectMusic8_Vtbl =
{
ICOM_VTABLE(IDirectMusic8) DirectMusic8_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusic8Impl_QueryInterface,
IDirectMusic8Impl_AddRef,
@ -288,8 +247,7 @@ ICOM_VTABLE(IDirectMusic8) DirectMusic8_Vtbl =
};
/* helper stuff */
void register_waveport (LPGUID lpGUID, LPCSTR lpszDesc, LPCSTR lpszDrvName, LPVOID lpContext)
{
void register_waveport (LPGUID lpGUID, LPCSTR lpszDesc, LPCSTR lpszDrvName, LPVOID lpContext) {
LPDMUS_PORTCAPS pPortCaps = (LPDMUS_PORTCAPS)lpContext;
pPortCaps->dwSize = sizeof(DMUS_PORTCAPS);
@ -306,30 +264,22 @@ void register_waveport (LPGUID lpGUID, LPCSTR lpszDesc, LPCSTR lpszDrvName, LPVO
}
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusic (LPCGUID lpcGUID, LPDIRECTMUSIC8 *ppDM, LPUNKNOWN pUnkOuter)
{
HRESULT WINAPI DMUSIC_CreateDirectMusicImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) {
IDirectMusic8Impl *dmusic;
TRACE("(%p,%p,%p)\n",lpcGUID, ppDM, pUnkOuter);
if (IsEqualIID (lpcGUID, &IID_IDirectMusic) ||
IsEqualIID (lpcGUID, &IID_IDirectMusic2) ||
IsEqualIID (lpcGUID, &IID_IDirectMusic8)) {
dmusic = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusic8Impl));
if (NULL == dmusic) {
*ppDM = (LPDIRECTMUSIC8) NULL;
return E_OUTOFMEMORY;
}
dmusic->lpVtbl = &DirectMusic8_Vtbl;
dmusic->ref = 1;
dmusic->pMasterClock = NULL;
dmusic->ppPorts = NULL;
dmusic->nrofports = 0;
DMUSIC_CreateReferenceClock (&IID_IReferenceClock, (IReferenceClock**)&dmusic->pMasterClock, NULL);
*ppDM = (LPDIRECTMUSIC8) dmusic;
return S_OK;
TRACE("(%p,%p,%p)\n",lpcGUID, ppobj, pUnkOuter);
dmusic = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusic8Impl));
if (NULL == dmusic) {
*ppobj = (LPDIRECTMUSIC8) NULL;
return E_OUTOFMEMORY;
}
dmusic->lpVtbl = &DirectMusic8_Vtbl;
dmusic->ref = 0; /* will be inited with QueryInterface */
dmusic->pMasterClock = NULL;
dmusic->ppPorts = NULL;
dmusic->nrofports = 0;
DMUSIC_CreateReferenceClockImpl (&IID_IReferenceClock, (LPVOID*)&dmusic->pMasterClock, NULL);
WARN("No interface found\n");
return E_NOINTERFACE;
return IDirectMusic8Impl_QueryInterface ((LPDIRECTMUSIC8)dmusic, lpcGUID, ppobj);
}

View File

@ -1,6 +1,6 @@
/* DirectMusic Main
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -21,8 +21,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
typedef struct
{
typedef struct {
/* IUnknown fields */
ICOM_VFIELD(IClassFactory);
DWORD ref;
@ -31,44 +30,30 @@ typedef struct
/******************************************************************
* DirectMusic ClassFactory
*/
static HRESULT WINAPI DirectMusicCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI DirectMusicCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI DirectMusicCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI DirectMusicCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI DirectMusicCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI DirectMusicCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI DirectMusicCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI DirectMusicCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualIID (riid, &IID_IDirectMusic) ||
IsEqualIID (riid, &IID_IDirectMusic2) ||
IsEqualIID (riid, &IID_IDirectMusic8)) {
return DMUSIC_CreateDirectMusic (riid, (LPDIRECTMUSIC8*) ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
return DMUSIC_CreateDirectMusicImpl (riid, (LPVOID*) ppobj, pOuter);
}
static HRESULT WINAPI DirectMusicCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI DirectMusicCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -88,44 +73,30 @@ static IClassFactoryImpl DirectMusic_CF = {&DirectMusicCF_Vtbl, 1 };
/******************************************************************
* DirectMusicCollection ClassFactory
*/
static HRESULT WINAPI CollectionCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
static HRESULT WINAPI CollectionCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI CollectionCF_AddRef(LPCLASSFACTORY iface)
{
static ULONG WINAPI CollectionCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI CollectionCF_Release(LPCLASSFACTORY iface)
{
static ULONG WINAPI CollectionCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI CollectionCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
static HRESULT WINAPI CollectionCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualIID (riid, &IID_IDirectMusicCollection)) {
return DMUSIC_CreateDirectMusicCollection (riid, (LPDIRECTMUSICCOLLECTION*)ppobj, pOuter);
} else if (IsEqualIID (riid, &IID_IDirectMusicObject)) {
return DMUSIC_CreateDirectMusicCollectionObject (riid, (LPDIRECTMUSICOBJECT*)ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
return DMUSIC_CreateDirectMusicCollectionImpl (riid, ppobj, pOuter);
}
static HRESULT WINAPI CollectionCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
static HRESULT WINAPI CollectionCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
@ -147,15 +118,11 @@ static IClassFactoryImpl Collection_CF = {&CollectionCF_Vtbl, 1 };
*
*
*/
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
if (fdwReason == DLL_PROCESS_ATTACH)
{
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
if (fdwReason == DLL_PROCESS_ATTACH) {
DisableThreadLibraryCalls(hinstDLL);
/* FIXME: Initialisation */
}
else if (fdwReason == DLL_PROCESS_DETACH)
{
} else if (fdwReason == DLL_PROCESS_DETACH) {
/* FIXME: Cleanup */
}
@ -168,10 +135,8 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
*
*
*/
HRESULT WINAPI DMUSIC_DllCanUnloadNow(void)
{
HRESULT WINAPI DMUSIC_DllCanUnloadNow(void) {
FIXME("(void): stub\n");
return S_FALSE;
}
@ -181,8 +146,7 @@ HRESULT WINAPI DMUSIC_DllCanUnloadNow(void)
*
*
*/
HRESULT WINAPI DMUSIC_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
{
HRESULT WINAPI DMUSIC_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) {
TRACE("(%p,%p,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
if (IsEqualCLSID (rclsid, &CLSID_DirectMusic) && IsEqualIID (riid, &IID_IClassFactory)) {
*ppv = (LPVOID) &DirectMusic_CF;

View File

@ -1,6 +1,6 @@
/* DirectMusic Private Include
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -23,50 +23,55 @@
#include <stdarg.h>
#include "windef.h"
#include "wine/debug.h"
#include "winbase.h"
#include "winnt.h"
#include "wingdi.h"
#include "dmusicc.h"
#include "winuser.h"
#include "wine/debug.h"
#include "wine/list.h"
#include "wine/unicode.h"
#include "winreg.h"
#include "dmusici.h"
#include "dmusics.h"
#include "dmplugin.h"
#include "dmusicf.h"
#include "dsound.h"
#include "dmusics.h"
/*****************************************************************************
* Interfaces
*/
typedef struct IDirectMusic8Impl IDirectMusic8Impl;
typedef struct IDirectMusicBufferImpl IDirectMusicBufferImpl;
typedef struct IDirectMusicInstrumentImpl IDirectMusicInstrumentImpl;
typedef struct IDirectMusicDownloadedInstrumentImpl IDirectMusicDownloadedInstrumentImpl;
typedef struct IDirectMusicCollectionImpl IDirectMusicCollectionImpl;
typedef struct IDirectMusicDownloadImpl IDirectMusicDownloadImpl;
typedef struct IDirectMusicPortDownloadImpl IDirectMusicPortDownloadImpl;
typedef struct IDirectMusicPortImpl IDirectMusicPortImpl;
typedef struct IDirectMusicThruImpl IDirectMusicThruImpl;
typedef struct IReferenceClockImpl IReferenceClockImpl;
typedef struct IDirectMusicCollectionObject IDirectMusicCollectionObject;
typedef struct IDirectMusicCollectionObjectStream IDirectMusicCollectionObjectStream;
typedef struct IDirectMusicCollectionImpl IDirectMusicCollectionImpl;
typedef struct IDirectMusicInstrumentImpl IDirectMusicInstrumentImpl;
/*****************************************************************************
* Predeclare the interface implementation structures
*/
extern ICOM_VTABLE(IDirectMusic8) DirectMusic8_Vtbl;
extern ICOM_VTABLE(IDirectMusicBuffer) DirectMusicBuffer_Vtbl;
extern ICOM_VTABLE(IDirectMusicInstrument) DirectMusicInstrument_Vtbl;
extern ICOM_VTABLE(IDirectMusicDownloadedInstrument) DirectMusicDownloadedInstrument_Vtbl;
extern ICOM_VTABLE(IDirectMusicCollection) DirectMusicCollection_Vtbl;
extern ICOM_VTABLE(IDirectMusicDownload) DirectMusicDownload_Vtbl;
extern ICOM_VTABLE(IDirectMusicPortDownload) DirectMusicPortDownload_Vtbl;
extern ICOM_VTABLE(IDirectMusicPort) DirectMusicPort_Vtbl;
extern ICOM_VTABLE(IDirectMusicThru) DirectMusicThru_Vtbl;
extern ICOM_VTABLE(IReferenceClock) ReferenceClock_Vtbl;
extern ICOM_VTABLE(IDirectMusicObject) DirectMusicCollectionObject_Vtbl;
extern ICOM_VTABLE(IPersistStream) DirectMusicCollectionObjectStream_Vtbl;
extern ICOM_VTABLE(IUnknown) DirectMusicCollection_Unknown_Vtbl;
extern ICOM_VTABLE(IDirectMusicCollection) DirectMusicCollection_Collection_Vtbl;
extern ICOM_VTABLE(IDirectMusicObject) DirectMusicCollection_Object_Vtbl;
extern ICOM_VTABLE(IPersistStream) DirectMusicCollection_PersistStream_Vtbl;
extern ICOM_VTABLE(IUnknown) DirectMusicInstrument_Unknown_Vtbl;
extern ICOM_VTABLE(IDirectMusicInstrument) DirectMusicInstrument_Instrument_Vtbl;
/*****************************************************************************
* Some stuff to make my life easier :=)
@ -74,179 +79,32 @@ extern ICOM_VTABLE(IPersistStream) DirectMusicCollectionObjectStream_Vtbl;
/* some sort of aux. midi channel: big fake at the moment; accepts only priority
changes... more coming soon */
typedef struct DMUSIC_PRIVATE_MCHANNEL_
{
typedef struct DMUSIC_PRIVATE_MCHANNEL_ {
DWORD priority;
} DMUSIC_PRIVATE_MCHANNEL, *LPDMUSIC_PRIVATE_MCHANNEL;
/* some sort of aux. channel group: collection of 16 midi channels */
typedef struct DMUSIC_PRIVATE_CHANNEL_GROUP_
{
typedef struct DMUSIC_PRIVATE_CHANNEL_GROUP_ {
DMUSIC_PRIVATE_MCHANNEL channel[16]; /* 16 channels in a group */
} DMUSIC_PRIVATE_CHANNEL_GROUP, *LPDMUSIC_PRIVATE_CHANNEL_GROUP;
/* used for loading chunks of data from files */
typedef struct _rawChunk
{
FOURCC id; /* FOURCC */
DWORD size; /* size of chunk_riff */
/* BYTE* data; */ /* chunk_riff data */
} rawChunk;
/* struct in which UNFO data is stored */
typedef struct _UNFO_List
{
WCHAR* name;
WCHAR* artist;
WCHAR* copyright;
WCHAR* version;
WCHAR* subject;
WCHAR* comment;
} UNFO_List;
typedef struct _ChordData
{
DMUS_IO_CHORD chord;
DWORD nrofsubchords;
DMUS_IO_SUBCHORD *subchord;
} ChordData;
typedef struct _Reference
{
DMUS_IO_REFERENCE header;
GUID guid;
FILETIME date;
WCHAR* name;
WCHAR* file;
WCHAR* category;
DMUS_IO_VERSION version;
} Reference;
typedef struct _BandTrack
{
DMUS_IO_BAND_TRACK_HEADER header;
GUID guid;
DMUS_IO_VERSION version;
UNFO_List UNFO;
DMUS_IO_BAND_ITEM_HEADER header1;
DMUS_IO_BAND_ITEM_HEADER2 header2;
/* IDirectMusicBandImpl **band; */
} BandTrack;
typedef struct _Part
{
DMUS_IO_STYLEPART header;
UNFO_List UNFO;
DWORD nrofnotes;
DMUS_IO_STYLENOTE* notes;
DWORD nrofcurves;
DMUS_IO_STYLECURVE* curves;
DWORD nrofmarkers;
DMUS_IO_STYLEMARKER* markers;
DWORD nrofresolutions;
DMUS_IO_STYLERESOLUTION* resolutions;
DWORD nrofanticipations;
DMUS_IO_STYLE_ANTICIPATION* anticipations;
} Part;
typedef struct _Pattern
{
DMUS_IO_PATTERN header;
DWORD nrofrhytms;
DWORD* rhytms;
UNFO_List UNFO;
DMUS_IO_MOTIFSETTINGS motsettings;
/* IDirectMusicBandImpl band */
DWORD nrofpartrefs;
/* FIXME: only in singular form for now */
UNFO_List partrefUNFO;
DMUS_IO_PARTREF partref;
} Pattern;
typedef struct _WaveTrack
{
DMUS_IO_WAVE_TRACK_HEADER header;
/* FIXME: only in singular form now */
DMUS_IO_WAVE_PART_HEADER partHeader;
DMUS_IO_WAVE_ITEM_HEADER itemHeader;
Reference reference;
} WaveTrack;
typedef struct _SegTriggerTrack
{
DMUS_IO_SEGMENT_TRACK_HEADER header;
/* FIXME: only in singular form now */
DMUS_IO_SEGMENT_ITEM_HEADER itemHeader;
Reference reference;
WCHAR* motifName;
} SegTriggerTrack;
typedef struct _TimeSigTrack {
DWORD nrofitems;
DMUS_IO_TIMESIGNATURE_ITEM* items;
} TimeSigTrack;
typedef struct _ScriptEvent {
DMUS_IO_SCRIPTTRACK_EVENTHEADER header;
Reference reference;
WCHAR* name;
} ScriptEvent;
/*****************************************************************************
* ClassFactory
*/
/* can support IID_IDirectMusic, IID_IDirectMusic2 and IID_IDirectMusic8
* return always an IDirectMusic8Impl
*/
extern HRESULT WINAPI DMUSIC_CreateDirectMusic (LPCGUID lpcGUID, LPDIRECTMUSIC8* ppDM, LPUNKNOWN pUnkOuter);
/* can support IID_IDirectMusicBuffer
* return always an IDirectMusicBufferImpl
*/
extern HRESULT WINAPI DMUSIC_CreateDirectMusicBuffer (LPCGUID lpcGUID, LPDIRECTMUSICBUFFER* ppDMBuff, LPUNKNOWN pUnkOuter);
/* can support IID_IDirectMusicInstrument
* return always an IDirectMusicInstrumentImpl
*/
extern HRESULT WINAPI DMUSIC_CreateDirectMusicInstrument (LPCGUID lpcGUID, LPDIRECTMUSICINSTRUMENT* ppDMInstr, LPUNKNOWN pUnkOuter);
/* can support IID_IDirectMusicDownloadedInstrument
* return always an IDirectMusicDownloadedInstrumentImpl
*/
extern HRESULT WINAPI DMUSIC_CreateDirectMusicDownloadedInstrument (LPCGUID lpcGUID, LPDIRECTMUSICDOWNLOADEDINSTRUMENT* ppDMDLInstrument, LPUNKNOWN pUnkOuter);
/* can support IID_IDirectMusicCollection
* return always an IDirectMusicCollectionImpl
*/
extern HRESULT WINAPI DMUSIC_CreateDirectMusicCollection (LPCGUID lpcGUID, LPDIRECTMUSICCOLLECTION* ppDMColl, LPUNKNOWN pUnkOuter);
/* can support IID_IDirectMusicDownload
* return always an IDirectMusicDownload
*/
extern HRESULT WINAPI DMUSIC_CreateDirectMusicDownload (LPCGUID lpcGUID, LPDIRECTMUSICDOWNLOAD* ppDMDL, LPUNKNOWN pUnkOuter);
/* can support IID_IDirectMusicPortDownload
* return always an IDirectMusicPortDownload
*/
extern HRESULT WINAPI DMUSIC_CreateDirectMusicPortDownload (LPCGUID lpcGUID, LPDIRECTMUSICPORTDOWNLOAD* ppDMPortDL, LPUNKNOWN pUnkOuter);
/* can support IID_IDirectMusicPort
* return always an IDirectMusicPortImpl
*/
extern HRESULT WINAPI DMUSIC_CreateDirectMusicPort (LPCGUID lpcGUID, LPDIRECTMUSICPORT* ppDMPort, LPUNKNOWN pUnkOuter);
/* can support IID_IDirectMusicThru
* return always an IDirectMusicThruImpl
*/
extern HRESULT WINAPI DMUSIC_CreateDirectMusicThru (LPCGUID lpcGUID, LPDIRECTMUSICTHRU* ppDMThru, LPUNKNOWN pUnkOuter);
/* can support IID_IDirectMusicObject
* return always an IDirectMusicObjectImpl
*/
extern HRESULT WINAPI DMUSIC_CreateDirectMusicImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter);
extern HRESULT WINAPI DMUSIC_CreateDirectMusicBufferImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter);
extern HRESULT WINAPI DMUSIC_CreateDirectMusicDownloadedInstrumentImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter);
extern HRESULT WINAPI DMUSIC_CreateDirectMusicDownloadImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter);
extern HRESULT WINAPI DMUSIC_CreateReferenceClockImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter);
extern HRESULT WINAPI DMUSIC_CreateReferenceClock (LPCGUID lpcGUID, IReferenceClock** ppDM, LPUNKNOWN pUnkOuter);
extern HRESULT WINAPI DMUSIC_CreateDirectMusicCollectionObject (LPCGUID lpcGUID, LPDIRECTMUSICOBJECT* ppObject, LPUNKNOWN pUnkOuter);
extern HRESULT WINAPI DMUSIC_CreateDirectMusicCollectionImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter);
extern HRESULT WINAPI DMUSIC_CreateDirectMusicInstrumentImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter);
/*****************************************************************************
* IDirectMusic8Impl implementation structure
*/
struct IDirectMusic8Impl
{
struct IDirectMusic8Impl {
/* IUnknown fields */
ICOM_VFIELD(IDirectMusic8);
DWORD ref;
@ -277,8 +135,7 @@ extern HRESULT WINAPI IDirectMusic8Impl_SetExternalMasterClock (LPDIRECTMUSIC8 i
/*****************************************************************************
* IDirectMusicBufferImpl implementation structure
*/
struct IDirectMusicBufferImpl
{
struct IDirectMusicBufferImpl {
/* IUnknown fields */
ICOM_VFIELD(IDirectMusicBuffer);
DWORD ref;
@ -305,33 +162,11 @@ extern HRESULT WINAPI IDirectMusicBufferImpl_GetBufferFormat (LPDIRECTMUSICBUFFE
extern HRESULT WINAPI IDirectMusicBufferImpl_SetStartTime (LPDIRECTMUSICBUFFER iface, REFERENCE_TIME rt);
extern HRESULT WINAPI IDirectMusicBufferImpl_SetUsedBytes (LPDIRECTMUSICBUFFER iface, DWORD cb);
/*****************************************************************************
* IDirectMusicInstrumentImpl implementation structure
*/
struct IDirectMusicInstrumentImpl
{
/* IUnknown fields */
ICOM_VFIELD(IDirectMusicInstrument);
DWORD ref;
/* IDirectMusicInstrumentImpl fields */
DWORD dwPatch;
LPWSTR pwszName;
};
/* IUnknown: */
extern HRESULT WINAPI IDirectMusicInstrumentImpl_QueryInterface (LPDIRECTMUSICINSTRUMENT iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicInstrumentImpl_AddRef (LPDIRECTMUSICINSTRUMENT iface);
extern ULONG WINAPI IDirectMusicInstrumentImpl_Release (LPDIRECTMUSICINSTRUMENT iface);
/* IDirectMusicInstrumentImpl: */
extern HRESULT WINAPI IDirectMusicInstrumentImpl_GetPatch (LPDIRECTMUSICINSTRUMENT iface, DWORD* pdwPatch);
extern HRESULT WINAPI IDirectMusicInstrumentImpl_SetPatch (LPDIRECTMUSICINSTRUMENT iface, DWORD dwPatch);
/*****************************************************************************
* IDirectMusicDownloadedInstrumentImpl implementation structure
*/
struct IDirectMusicDownloadedInstrumentImpl
{
struct IDirectMusicDownloadedInstrumentImpl {
/* IUnknown fields */
ICOM_VFIELD(IDirectMusicDownloadedInstrument);
DWORD ref;
@ -346,34 +181,11 @@ extern ULONG WINAPI IDirectMusicDownloadedInstrumentImpl_Release (LPDIRECTMUSI
/* IDirectMusicDownloadedInstrumentImpl: */
/* none yet */
/*****************************************************************************
* IDirectMusicCollectionImpl implementation structure
*/
struct IDirectMusicCollectionImpl
{
/* IUnknown fields */
ICOM_VFIELD(IDirectMusicCollection);
DWORD ref;
/* IDirectMusicCollectionImpl fields */
IDirectMusicCollectionObject* pObject;
DWORD nrofinstruments;
IDirectMusicInstrumentImpl** ppInstruments;
};
/* IUnknown: */
extern HRESULT WINAPI IDirectMusicCollectionImpl_QueryInterface (LPDIRECTMUSICCOLLECTION iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicCollectionImpl_AddRef (LPDIRECTMUSICCOLLECTION iface);
extern ULONG WINAPI IDirectMusicCollectionImpl_Release (LPDIRECTMUSICCOLLECTION iface);
/* IDirectMusicImpl: */
HRESULT WINAPI IDirectMusicCollectionImpl_GetInstrument (LPDIRECTMUSICCOLLECTION iface, DWORD dwPatch, IDirectMusicInstrument** ppInstrument);
HRESULT WINAPI IDirectMusicCollectionImpl_EnumInstrument (LPDIRECTMUSICCOLLECTION iface, DWORD dwIndex, DWORD* pdwPatch, LPWSTR pwszName, DWORD dwNameLen);
/*****************************************************************************
* IDirectMusicDownloadImpl implementation structure
*/
struct IDirectMusicDownloadImpl
{
struct IDirectMusicDownloadImpl {
/* IUnknown fields */
ICOM_VFIELD(IDirectMusicDownload);
DWORD ref;
@ -392,8 +204,7 @@ extern HRESULT WINAPI IDirectMusicDownloadImpl_GetBuffer (LPDIRECTMUSICDOWNLOAD
/*****************************************************************************
* IDirectMusicPortDownloadImpl implementation structure
*/
struct IDirectMusicPortDownloadImpl
{
struct IDirectMusicPortDownloadImpl {
/* IUnknown fields */
ICOM_VFIELD(IDirectMusicPortDownload);
DWORD ref;
@ -416,8 +227,7 @@ extern HRESULT WINAPI IDirectMusicPortDownloadImpl_Unload (LPDIRECTMUSICPORTDOWN
/*****************************************************************************
* IDirectMusicPortImpl implementation structure
*/
struct IDirectMusicPortImpl
{
struct IDirectMusicPortImpl {
/* IUnknown fields */
ICOM_VFIELD(IDirectMusicPort);
DWORD ref;
@ -444,6 +254,7 @@ extern HRESULT WINAPI IDirectMusicPortImpl_DownloadInstrument (LPDIRECTMUSICPORT
extern HRESULT WINAPI IDirectMusicPortImpl_UnloadInstrument (LPDIRECTMUSICPORT iface, IDirectMusicDownloadedInstrument *pDownloadedInstrument);
extern HRESULT WINAPI IDirectMusicPortImpl_GetLatencyClock (LPDIRECTMUSICPORT iface, IReferenceClock** ppClock);
extern HRESULT WINAPI IDirectMusicPortImpl_GetRunningStats (LPDIRECTMUSICPORT iface, LPDMUS_SYNTHSTATS pStats);
extern HRESULT WINAPI IDirectMusicPortImpl_Compact (LPDIRECTMUSICPORT iface);
extern HRESULT WINAPI IDirectMusicPortImpl_GetCaps (LPDIRECTMUSICPORT iface, LPDMUS_PORTCAPS pPortCaps);
extern HRESULT WINAPI IDirectMusicPortImpl_DeviceIoControl (LPDIRECTMUSICPORT iface, DWORD dwIoControlCode, LPVOID lpInBuffer, DWORD nInBufferSize, LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped);
extern HRESULT WINAPI IDirectMusicPortImpl_SetNumChannelGroups (LPDIRECTMUSICPORT iface, DWORD dwChannelGroups);
@ -457,8 +268,7 @@ extern HRESULT WINAPI IDirectMusicPortImpl_GetFormat (LPDIRECTMUSICPORT iface, L
/*****************************************************************************
* IDirectMusicThruImpl implementation structure
*/
struct IDirectMusicThruImpl
{
struct IDirectMusicThruImpl {
/* IUnknown fields */
ICOM_VFIELD(IDirectMusicThru);
DWORD ref;
@ -476,8 +286,7 @@ extern HRESULT WINAPI ThruChannel (LPDIRECTMUSICTHRU iface, DWORD dwSourceChanne
/*****************************************************************************
* IReferenceClockImpl implementation structure
*/
struct IReferenceClockImpl
{
struct IReferenceClockImpl {
/* IUnknown fields */
ICOM_VFIELD(IReferenceClock);
DWORD ref;
@ -498,54 +307,97 @@ extern HRESULT WINAPI IReferenceClockImpl_AdvisePeriodic (IReferenceClock *iface
extern HRESULT WINAPI IReferenceClockImpl_Unadvise (IReferenceClock *iface, DWORD dwAdviseCookie);
typedef struct _DMUS_PRIVATE_INSTRUMENT_ENTRY {
struct list entry; /* for listing elements */
IDirectMusicInstrument* pInstrument;
} DMUS_PRIVATE_INSTRUMENTENTRY, *LPDMUS_PRIVATE_INSTRUMENTENTRY;
typedef struct _DMUS_PRIVATE_POOLCUE {
struct list entry; /* for listing elements */
} DMUS_PRIVATE_POOLCUE, *LPDMUS_PRIVATE_POOLCUE;
/*****************************************************************************
* IDirectMusicCollectionObject implementation structure
* IDirectMusicCollectionImpl implementation structure
*/
struct IDirectMusicCollectionObject
{
struct IDirectMusicCollectionImpl {
/* IUnknown fields */
ICOM_VFIELD (IDirectMusicObject);
ICOM_VTABLE(IUnknown) *UnknownVtbl;
ICOM_VTABLE(IDirectMusicCollection) *CollectionVtbl;
ICOM_VTABLE(IDirectMusicObject) *ObjectVtbl;
ICOM_VTABLE(IPersistStream) *PersistStreamVtbl;
DWORD ref;
/* IDirectMusicObjectImpl fields */
/* IDirectMusicCollectionImpl fields */
IStream *pStm; /* stream from which we load collection and later instruments */
LARGE_INTEGER liCollectionPosition; /* offset in a stream where collection was loaded from */
LARGE_INTEGER liWavePoolTablePosition; /* offset in a stream where wave pool table can be found */
LPDMUS_OBJECTDESC pDesc;
IDirectMusicCollectionObjectStream* pStream;
IDirectMusicCollectionImpl* pCollection;
CHAR* szCopyright; /* FIXME: should probably placed somewhere else */
LPDLSHEADER pHeader;
/* pool table */
LPPOOLTABLE pPoolTable;
LPPOOLCUE pPoolCues;
/* instruments */
struct list Instruments;
};
/* IUnknown: */
extern HRESULT WINAPI IDirectMusicCollectionObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicCollectionObject_AddRef (LPDIRECTMUSICOBJECT iface);
extern ULONG WINAPI IDirectMusicCollectionObject_Release (LPDIRECTMUSICOBJECT iface);
extern HRESULT WINAPI IDirectMusicCollectionImpl_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicCollectionImpl_IUnknown_AddRef (LPUNKNOWN iface);
extern ULONG WINAPI IDirectMusicCollectionImpl_IUnknown_Release (LPUNKNOWN iface);
/* IDirectMusicCollection: */
extern HRESULT WINAPI IDirectMusicCollectionImpl_IDirectMusicCollection_QueryInterface (LPDIRECTMUSICCOLLECTION iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicCollectionImpl_IDirectMusicCollection_AddRef (LPDIRECTMUSICCOLLECTION iface);
extern ULONG WINAPI IDirectMusicCollectionImpl_IDirectMusicCollection_Release (LPDIRECTMUSICCOLLECTION iface);
extern HRESULT WINAPI IDirectMusicCollectionImpl_IDirectMusicCollection_GetInstrument (LPDIRECTMUSICCOLLECTION iface, DWORD dwPatch, IDirectMusicInstrument** ppInstrument);
extern HRESULT WINAPI IDirectMusicCollectionImpl_IDirectMusicCollection_EnumInstrument (LPDIRECTMUSICCOLLECTION iface, DWORD dwIndex, DWORD* pdwPatch, LPWSTR pwszName, DWORD dwNameLen);
/* IDirectMusicObject: */
extern HRESULT WINAPI IDirectMusicCollectionObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc);
extern HRESULT WINAPI IDirectMusicCollectionObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc);
extern HRESULT WINAPI IDirectMusicCollectionObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc);
extern HRESULT WINAPI IDirectMusicCollectionImpl_IDirectMusicObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicCollectionImpl_IDirectMusicObject_AddRef (LPDIRECTMUSICOBJECT iface);
extern ULONG WINAPI IDirectMusicCollectionImpl_IDirectMusicObject_Release (LPDIRECTMUSICOBJECT iface);
extern HRESULT WINAPI IDirectMusicCollectionImpl_IDirectMusicObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc);
extern HRESULT WINAPI IDirectMusicCollectionImpl_IDirectMusicObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc);
extern HRESULT WINAPI IDirectMusicCollectionImpl_IDirectMusicObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc);
/* IPersistStream: */
extern HRESULT WINAPI IDirectMusicCollectionImpl_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject);
extern ULONG WINAPI IDirectMusicCollectionImpl_IPersistStream_AddRef (LPPERSISTSTREAM iface);
extern ULONG WINAPI IDirectMusicCollectionImpl_IPersistStream_Release (LPPERSISTSTREAM iface);
extern HRESULT WINAPI IDirectMusicCollectionImpl_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID);
extern HRESULT WINAPI IDirectMusicCollectionImpl_IPersistStream_IsDirty (LPPERSISTSTREAM iface);
extern HRESULT WINAPI IDirectMusicCollectionImpl_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm);
extern HRESULT WINAPI IDirectMusicCollectionImpl_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty);
extern HRESULT WINAPI IDirectMusicCollectionImpl_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize);
/*****************************************************************************
* IDirectMusicCollectionObjectStream implementation structure
* IDirectMusicInstrumentImpl implementation structure
*/
struct IDirectMusicCollectionObjectStream
{
struct IDirectMusicInstrumentImpl {
/* IUnknown fields */
ICOM_VFIELD (IPersistStream);
ICOM_VTABLE(IUnknown) *UnknownVtbl;
ICOM_VTABLE(IDirectMusicInstrument) *InstrumentVtbl;
DWORD ref;
/* IPersistStreamImpl fields */
IDirectMusicCollectionObject* pParentObject;
/* IDirectMusicInstrumentImpl fields */
LARGE_INTEGER liInstrumentPosition; /* offset in a stream where instrument chunk can be found */
LPGUID pInstrumentID;
LPINSTHEADER pHeader;
WCHAR wszName[DMUS_MAX_NAME];
/* instrument data */
};
/* IUnknown: */
extern HRESULT WINAPI IDirectMusicCollectionObjectStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject);
extern ULONG WINAPI IDirectMusicCollectionObjectStream_AddRef (LPPERSISTSTREAM iface);
extern ULONG WINAPI IDirectMusicCollectionObjectStream_Release (LPPERSISTSTREAM iface);
/* IPersist: */
extern HRESULT WINAPI IDirectMusicCollectionObjectStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID);
/* IPersistStream: */
extern HRESULT WINAPI IDirectMusicCollectionObjectStream_IsDirty (LPPERSISTSTREAM iface);
extern HRESULT WINAPI IDirectMusicCollectionObjectStream_Load (LPPERSISTSTREAM iface, IStream* pStm);
extern HRESULT WINAPI IDirectMusicCollectionObjectStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty);
extern HRESULT WINAPI IDirectMusicCollectionObjectStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize);
extern HRESULT WINAPI IDirectMusicInstrumentImpl_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicInstrumentImpl_IUnknown_AddRef (LPUNKNOWN iface);
extern ULONG WINAPI IDirectMusicInstrumentImpl_IUnknown_Release (LPUNKNOWN iface);
/* IDirectMusicInstrumentImpl: */
extern HRESULT WINAPI IDirectMusicInstrumentImpl_IDirectMusicInstrument_QueryInterface (LPDIRECTMUSICINSTRUMENT iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicInstrumentImpl_IDirectMusicInstrument_AddRef (LPDIRECTMUSICINSTRUMENT iface);
extern ULONG WINAPI IDirectMusicInstrumentImpl_IDirectMusicInstrument_Release (LPDIRECTMUSICINSTRUMENT iface);
extern HRESULT WINAPI IDirectMusicInstrumentImpl_IDirectMusicInstrument_GetPatch (LPDIRECTMUSICINSTRUMENT iface, DWORD* pdwPatch);
extern HRESULT WINAPI IDirectMusicInstrumentImpl_IDirectMusicInstrument_SetPatch (LPDIRECTMUSICINSTRUMENT iface, DWORD dwPatch);
/* custom :) */
extern HRESULT WINAPI IDirectMusicInstrumentImpl_Custom_Load (LPDIRECTMUSICINSTRUMENT iface, LPSTREAM pStm);
/*****************************************************************************
@ -553,4 +405,126 @@ extern HRESULT WINAPI IDirectMusicCollectionObjectStream_GetSizeMax (LPPERSISTST
*/
void register_waveport (LPGUID lpGUID, LPCSTR lpszDesc, LPCSTR lpszDrvName, LPVOID lpContext);
/*****************************************************************************
* Misc.
*/
/* my custom ICOM stuff */
#define ICOM_NAME(impl,iface,name) impl* const name=(impl*)(iface)
#define ICOM_NAME_MULTI(impl,field,iface,name) impl* const name=(impl*)((char*)(iface) - offsetof(impl,field))
/* for simpler reading */
typedef struct _DMUS_PRIVATE_CHUNK {
FOURCC fccID; /* FOURCC ID of the chunk */
DWORD dwSize; /* size of the chunk */
} DMUS_PRIVATE_CHUNK, *LPDMUS_PRIVATE_CHUNK;
/* check whether the given DWORD is even (return 0) or odd (return 1) */
static inline int even_or_odd (DWORD number) {
return (number & 0x1); /* basically, check if bit 0 is set ;) */
}
/* FOURCC to string conversion for debug messages */
static inline const char *debugstr_fourcc (DWORD fourcc) {
if (!fourcc) return "'null'";
return wine_dbg_sprintf ("\'%c%c%c%c\'",
(char)(fourcc), (char)(fourcc >> 8),
(char)(fourcc >> 16), (char)(fourcc >> 24));
}
/* DMUS_VERSION struct to string conversion for debug messages */
static inline const char *debugstr_dmversion (LPDMUS_VERSION version) {
if (!version) return "'null'";
return wine_dbg_sprintf ("\'%i,%i,%i,%i\'",
(int)((version->dwVersionMS && 0xFFFF0000) >> 8), (int)(version->dwVersionMS && 0x0000FFFF),
(int)((version->dwVersionLS && 0xFFFF0000) >> 8), (int)(version->dwVersionLS && 0x0000FFFF));
}
/* dwPatch from MIDILOCALE */
static inline DWORD MIDILOCALE2Patch (LPMIDILOCALE pLocale) {
DWORD dwPatch = 0;
if (!pLocale) return 0;
dwPatch |= (pLocale->ulBank & F_INSTRUMENT_DRUMS); /* set drum bit */
dwPatch |= ((pLocale->ulBank & 0x00007F7F) << 8); /* set MIDI bank location */
dwPatch |= (pLocale->ulInstrument & 0x0000007F); /* set PC value */
return dwPatch;
}
/* MIDILOCALE from dwPatch */
static inline void Patch2MIDILOCALE (DWORD dwPatch, LPMIDILOCALE pLocale) {
memset (pLocale, 0, sizeof(MIDILOCALE));
pLocale->ulInstrument = (dwPatch & 0x7F); /* get PC value */
pLocale->ulBank = ((dwPatch & 0x007F7F00) >> 8); /* get MIDI bank location */
pLocale->ulBank |= (dwPatch & F_INSTRUMENT_DRUMS); /* get drum bit */
}
/* used for initialising structs (primarily for DMUS_OBJECTDESC) */
#define DM_STRUCT_INIT(x) \
do { \
memset((x), 0, sizeof(*(x))); \
(x)->dwSize = sizeof(*x); \
} while (0)
/* used for generic dumping (copied from ddraw) */
typedef struct {
DWORD val;
const char* name;
} flag_info;
#define FE(x) { x, #x }
#define DMUSIC_dump_flags(flags,names,num_names) DMUSIC_dump_flags_(flags, names, num_names, 1)
/* generic dump function */
static inline void DMUSIC_dump_flags_ (DWORD flags, const flag_info* names, size_t num_names, int newline) {
unsigned int i;
for (i=0; i < num_names; i++) {
if ((flags & names[i].val) || /* standard flag value */
((!flags) && (!names[i].val))) /* zero value only */
DPRINTF("%s ", names[i].name);
}
if (newline) DPRINTF("\n");
}
static inline void DMUSIC_dump_DMUS_OBJ_FLAGS (DWORD flagmask) {
static const flag_info flags[] = {
FE(DMUS_OBJ_OBJECT),
FE(DMUS_OBJ_CLASS),
FE(DMUS_OBJ_NAME),
FE(DMUS_OBJ_CATEGORY),
FE(DMUS_OBJ_FILENAME),
FE(DMUS_OBJ_FULLPATH),
FE(DMUS_OBJ_URL),
FE(DMUS_OBJ_VERSION),
FE(DMUS_OBJ_DATE),
FE(DMUS_OBJ_LOADED),
FE(DMUS_OBJ_MEMORY),
FE(DMUS_OBJ_STREAM)
};
DMUSIC_dump_flags(flagmask, flags, sizeof(flags)/sizeof(flags[0]));
}
static inline void DMUSIC_dump_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) {
if (pDesc) {
DPRINTF("DMUS_OBJECTDESC (%p)\n", pDesc);
DPRINTF(" - dwSize = %ld\n", pDesc->dwSize);
DPRINTF(" - dwValidData = ");
DMUSIC_dump_DMUS_OBJ_FLAGS (pDesc->dwValidData);
if (pDesc->dwValidData & DMUS_OBJ_CLASS) DPRINTF(" - guidClass = %s\n", debugstr_guid(&pDesc->guidClass));
if (pDesc->dwValidData & DMUS_OBJ_OBJECT) DPRINTF(" - guidObject = %s\n", debugstr_guid(&pDesc->guidObject));
if (pDesc->dwValidData & DMUS_OBJ_DATE) DPRINTF(" - ftDate = FIXME\n");
if (pDesc->dwValidData & DMUS_OBJ_VERSION) DPRINTF(" - vVersion = %s\n", debugstr_dmversion(&pDesc->vVersion));
if (pDesc->dwValidData & DMUS_OBJ_NAME) DPRINTF(" - wszName = %s\n", debugstr_w(pDesc->wszName));
if (pDesc->dwValidData & DMUS_OBJ_CATEGORY) DPRINTF(" - wszCategory = %s\n", debugstr_w(pDesc->wszCategory));
if (pDesc->dwValidData & DMUS_OBJ_FILENAME) DPRINTF(" - wszFileName = %s\n", debugstr_w(pDesc->wszFileName));
if (pDesc->dwValidData & DMUS_OBJ_MEMORY) DPRINTF(" - llMemLength = %lli\n - pbMemData = %p\n", pDesc->llMemLength, pDesc->pbMemData);
if (pDesc->dwValidData & DMUS_OBJ_STREAM) DPRINTF(" - pStream = %p\n", pDesc->pStream);
} else {
DPRINTF("(NULL)\n");
}
}
#endif /* __WINE_DMUSIC_PRIVATE_H */

View File

@ -1,6 +1,6 @@
/* IDirectMusicDownload Implementation
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -17,30 +17,12 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdarg.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);
/* IDirectMusicDownload IUnknown parts follow: */
HRESULT WINAPI IDirectMusicDownloadImpl_QueryInterface (LPDIRECTMUSICDOWNLOAD iface, REFIID riid, LPVOID *ppobj)
{
/* IDirectMusicDownloadImpl IUnknown part: */
HRESULT WINAPI IDirectMusicDownloadImpl_QueryInterface (LPDIRECTMUSICDOWNLOAD iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IDirectMusicDownloadImpl,iface);
if (IsEqualIID (riid, &IID_IUnknown)
@ -49,20 +31,17 @@ HRESULT WINAPI IDirectMusicDownloadImpl_QueryInterface (LPDIRECTMUSICDOWNLOAD if
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicDownloadImpl_AddRef (LPDIRECTMUSICDOWNLOAD iface)
{
ULONG WINAPI IDirectMusicDownloadImpl_AddRef (LPDIRECTMUSICDOWNLOAD iface) {
ICOM_THIS(IDirectMusicDownloadImpl,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicDownloadImpl_Release (LPDIRECTMUSICDOWNLOAD iface)
{
ULONG WINAPI IDirectMusicDownloadImpl_Release (LPDIRECTMUSICDOWNLOAD iface) {
ICOM_THIS(IDirectMusicDownloadImpl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
@ -72,18 +51,14 @@ ULONG WINAPI IDirectMusicDownloadImpl_Release (LPDIRECTMUSICDOWNLOAD iface)
return ref;
}
/* IDirectMusicDownload Interface follow: */
HRESULT WINAPI IDirectMusicDownloadImpl_GetBuffer (LPDIRECTMUSICDOWNLOAD iface, void** ppvBuffer, DWORD* pdwSize)
{
/* IDirectMusicDownloadImpl IDirectMusicDownload part: */
HRESULT WINAPI IDirectMusicDownloadImpl_GetBuffer (LPDIRECTMUSICDOWNLOAD iface, void** ppvBuffer, DWORD* pdwSize) {
ICOM_THIS(IDirectMusicDownloadImpl,iface);
FIXME("(%p,%p, %p): stub\n", This, ppvBuffer, pdwSize);
return S_OK;
}
ICOM_VTABLE(IDirectMusicDownload) DirectMusicDownload_Vtbl =
{
ICOM_VTABLE(IDirectMusicDownload) DirectMusicDownload_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicDownloadImpl_QueryInterface,
IDirectMusicDownloadImpl_AddRef,
@ -92,13 +67,16 @@ ICOM_VTABLE(IDirectMusicDownload) DirectMusicDownload_Vtbl =
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicDownload (LPCGUID lpcGUID, LPDIRECTMUSICDOWNLOAD* ppDMDL, LPUNKNOWN pUnkOuter)
{
if (IsEqualIID (lpcGUID, &IID_IDirectMusicDownload)) {
FIXME("Not yet\n");
return E_NOINTERFACE;
}
HRESULT WINAPI DMUSIC_CreateDirectMusicDownloadImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) {
IDirectMusicDownloadImpl* dmdl;
WARN("No interface found\n");
return E_NOINTERFACE;
dmdl = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicDownloadImpl));
if (NULL == dmdl) {
*ppobj = (LPVOID) NULL;
return E_OUTOFMEMORY;
}
dmdl->lpVtbl = &DirectMusicDownload_Vtbl;
dmdl->ref = 0; /* will be inited by QueryInterface */
return IDirectMusicDownloadImpl_QueryInterface ((LPDIRECTMUSICDOWNLOAD)dmdl, lpcGUID, ppobj);
}

View File

@ -1,6 +1,6 @@
/* IDirectMusicDownloadedInstrument Implementation
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -17,21 +17,12 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "dmusic_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
/* IDirectMusicDownloadedInstrument IUnknown parts follow: */
HRESULT WINAPI IDirectMusicDownloadedInstrumentImpl_QueryInterface (LPDIRECTMUSICDOWNLOADEDINSTRUMENT iface, REFIID riid, LPVOID *ppobj)
{
/* IDirectMusicDownloadedInstrumentImpl IUnknown part: */
HRESULT WINAPI IDirectMusicDownloadedInstrumentImpl_QueryInterface (LPDIRECTMUSICDOWNLOADEDINSTRUMENT iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IDirectMusicDownloadedInstrumentImpl,iface);
if (IsEqualIID (riid, &IID_IUnknown)
@ -40,20 +31,17 @@ HRESULT WINAPI IDirectMusicDownloadedInstrumentImpl_QueryInterface (LPDIRECTMUSI
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicDownloadedInstrumentImpl_AddRef (LPDIRECTMUSICDOWNLOADEDINSTRUMENT iface)
{
ULONG WINAPI IDirectMusicDownloadedInstrumentImpl_AddRef (LPDIRECTMUSICDOWNLOADEDINSTRUMENT iface) {
ICOM_THIS(IDirectMusicDownloadedInstrumentImpl,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicDownloadedInstrumentImpl_Release (LPDIRECTMUSICDOWNLOADEDINSTRUMENT iface)
{
ULONG WINAPI IDirectMusicDownloadedInstrumentImpl_Release (LPDIRECTMUSICDOWNLOADEDINSTRUMENT iface) {
ICOM_THIS(IDirectMusicDownloadedInstrumentImpl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
@ -63,11 +51,10 @@ ULONG WINAPI IDirectMusicDownloadedInstrumentImpl_Release (LPDIRECTMUSICDOWNLOAD
return ref;
}
/* IDirectMusicDownloadedInstrument Interface follow: */
/* IDirectMusicDownloadedInstrumentImpl IDirectMusicDownloadedInstrument part: */
/* none at this time */
ICOM_VTABLE(IDirectMusicDownloadedInstrument) DirectMusicDownloadedInstrument_Vtbl =
{
ICOM_VTABLE(IDirectMusicDownloadedInstrument) DirectMusicDownloadedInstrument_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicDownloadedInstrumentImpl_QueryInterface,
IDirectMusicDownloadedInstrumentImpl_AddRef,
@ -75,13 +62,16 @@ ICOM_VTABLE(IDirectMusicDownloadedInstrument) DirectMusicDownloadedInstrument_Vt
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicDownloadedInstrument (LPCGUID lpcGUID, LPDIRECTMUSICDOWNLOADEDINSTRUMENT* ppDMDLInstrument, LPUNKNOWN pUnkOuter)
{
if (IsEqualIID (lpcGUID, &IID_IDirectMusicDownloadedInstrument)) {
FIXME("Not yet\n");
return E_NOINTERFACE;
HRESULT WINAPI DMUSIC_CreateDirectMusicDownloadedInstrumentImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) {
IDirectMusicDownloadedInstrumentImpl* dmdlinst;
dmdlinst = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicDownloadedInstrumentImpl));
if (NULL == dmdlinst) {
*ppobj = (LPVOID) NULL;
return E_OUTOFMEMORY;
}
WARN("No interface found\n");
return E_NOINTERFACE;
dmdlinst->lpVtbl = &DirectMusicDownloadedInstrument_Vtbl;
dmdlinst->ref = 0; /* will be inited by QueryInterface */
return IDirectMusicDownloadedInstrumentImpl_QueryInterface ((LPDIRECTMUSICDOWNLOADEDINSTRUMENT)dmdlinst, lpcGUID, ppobj);
}

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
/* IDirectMusicInstrument Implementation
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -17,44 +17,48 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "dmusic_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
WINE_DECLARE_DEBUG_CHANNEL(dmfile);
/* IDirectMusicInstrument IUnknown parts follow: */
HRESULT WINAPI IDirectMusicInstrumentImpl_QueryInterface (LPDIRECTMUSICINSTRUMENT iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicInstrumentImpl,iface);
const GUID IID_IDirectMusicInstrumentPRIVATE = {0xbcb20080,0xa40c,0x11d1,{0x86,0xbc,0x00,0xc0,0x4f,0xbf,0x8f,0xef}};
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IDirectMusicInstrument)) {
IDirectMusicInstrumentImpl_AddRef(iface);
*ppobj = This;
/* IDirectMusicInstrument IUnknown part: */
HRESULT WINAPI IDirectMusicInstrumentImpl_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicInstrumentImpl, UnknownVtbl, iface);
if (IsEqualIID (riid, &IID_IUnknown)) {
*ppobj = (LPVOID)&This->UnknownVtbl;
IDirectMusicInstrumentImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicInstrument)) {
*ppobj = (LPVOID)&This->InstrumentVtbl;
IDirectMusicInstrumentImpl_IDirectMusicInstrument_AddRef ((LPDIRECTMUSICINSTRUMENT)&This->InstrumentVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicInstrumentPRIVATE)) {
/* it seems to me that this interface is only basic IUnknown, without any
other inherited functions... *sigh* this is the worst scenario, since it means
that whoever calls it knows the layout of original implementation table and therefore
tries to get data by direct access... expect crashes */
FIXME("*sigh*... requested private/unspecified interface\n");
*ppobj = (LPVOID)&This->UnknownVtbl;
IDirectMusicInstrumentImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicInstrumentImpl_AddRef (LPDIRECTMUSICINSTRUMENT iface)
{
ICOM_THIS(IDirectMusicInstrumentImpl,iface);
ULONG WINAPI IDirectMusicInstrumentImpl_IUnknown_AddRef (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicInstrumentImpl, UnknownVtbl, iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicInstrumentImpl_Release (LPDIRECTMUSICINSTRUMENT iface)
{
ICOM_THIS(IDirectMusicInstrumentImpl,iface);
ULONG WINAPI IDirectMusicInstrumentImpl_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicInstrumentImpl, UnknownVtbl, iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
@ -63,45 +67,351 @@ ULONG WINAPI IDirectMusicInstrumentImpl_Release (LPDIRECTMUSICINSTRUMENT iface)
return ref;
}
/* IDirectMusicInstrument Interface follow: */
HRESULT WINAPI IDirectMusicInstrumentImpl_GetPatch (LPDIRECTMUSICINSTRUMENT iface, DWORD* pdwPatch)
{
ICOM_THIS(IDirectMusicInstrumentImpl,iface);
TRACE("(%p, %p)\n", This, pdwPatch);
*pdwPatch = This->dwPatch;
return S_OK;
}
HRESULT WINAPI IDirectMusicInstrumentImpl_SetPatch (LPDIRECTMUSICINSTRUMENT iface, DWORD dwPatch)
{
ICOM_THIS(IDirectMusicInstrumentImpl,iface);
TRACE("(%p, %ld)\n", This, dwPatch);
This->dwPatch = dwPatch;
return S_OK;
}
ICOM_VTABLE(IDirectMusicInstrument) DirectMusicInstrument_Vtbl =
{
ICOM_VTABLE(IUnknown) DirectMusicInstrument_Unknown_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicInstrumentImpl_QueryInterface,
IDirectMusicInstrumentImpl_AddRef,
IDirectMusicInstrumentImpl_Release,
IDirectMusicInstrumentImpl_GetPatch,
IDirectMusicInstrumentImpl_SetPatch
IDirectMusicInstrumentImpl_IUnknown_QueryInterface,
IDirectMusicInstrumentImpl_IUnknown_AddRef,
IDirectMusicInstrumentImpl_IUnknown_Release
};
/* IDirectMusicInstrumentImpl IDirectMusicInstrument part: */
HRESULT WINAPI IDirectMusicInstrumentImpl_IDirectMusicInstrument_QueryInterface (LPDIRECTMUSICINSTRUMENT iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicInstrumentImpl, InstrumentVtbl, iface);
return IDirectMusicInstrumentImpl_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicInstrumentImpl_IDirectMusicInstrument_AddRef (LPDIRECTMUSICINSTRUMENT iface) {
ICOM_THIS_MULTI(IDirectMusicInstrumentImpl, InstrumentVtbl, iface);
return IDirectMusicInstrumentImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicInstrumentImpl_IDirectMusicInstrument_Release (LPDIRECTMUSICINSTRUMENT iface) {
ICOM_THIS_MULTI(IDirectMusicInstrumentImpl, InstrumentVtbl, iface);
return IDirectMusicInstrumentImpl_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicInstrumentImpl_IDirectMusicInstrument_GetPatch (LPDIRECTMUSICINSTRUMENT iface, DWORD* pdwPatch) {
ICOM_THIS_MULTI(IDirectMusicInstrumentImpl, InstrumentVtbl, iface);
TRACE("(%p, %p)\n", This, pdwPatch);
*pdwPatch = MIDILOCALE2Patch(&This->pHeader->Locale);
return S_OK;
}
HRESULT WINAPI IDirectMusicInstrumentImpl_IDirectMusicInstrument_SetPatch (LPDIRECTMUSICINSTRUMENT iface, DWORD dwPatch) {
ICOM_THIS_MULTI(IDirectMusicInstrumentImpl, InstrumentVtbl, iface);
TRACE("(%p, %ld): stub\n", This, dwPatch);
Patch2MIDILOCALE(dwPatch, &This->pHeader->Locale);
return S_OK;
}
ICOM_VTABLE(IDirectMusicInstrument) DirectMusicInstrument_Instrument_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicInstrumentImpl_IDirectMusicInstrument_QueryInterface,
IDirectMusicInstrumentImpl_IDirectMusicInstrument_AddRef,
IDirectMusicInstrumentImpl_IDirectMusicInstrument_Release,
IDirectMusicInstrumentImpl_IDirectMusicInstrument_GetPatch,
IDirectMusicInstrumentImpl_IDirectMusicInstrument_SetPatch
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicInstrument (LPCGUID lpcGUID, LPDIRECTMUSICINSTRUMENT* ppDMInstr, LPUNKNOWN pUnkOuter)
{
if (IsEqualIID (lpcGUID, &IID_IDirectMusicInstrument)) {
FIXME("Not yet\n");
return E_NOINTERFACE;
HRESULT WINAPI DMUSIC_CreateDirectMusicInstrumentImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) {
IDirectMusicInstrumentImpl* dminst;
dminst = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicInstrumentImpl));
if (NULL == dminst) {
*ppobj = (LPVOID) NULL;
return E_OUTOFMEMORY;
}
WARN("No interface found\n");
return E_NOINTERFACE;
dminst->UnknownVtbl = &DirectMusicInstrument_Unknown_Vtbl;
dminst->InstrumentVtbl = &DirectMusicInstrument_Instrument_Vtbl;
dminst->ref = 0; /* will be inited by QueryInterface */
return IDirectMusicInstrumentImpl_IUnknown_QueryInterface ((LPUNKNOWN)&dminst->UnknownVtbl, lpcGUID, ppobj);
}
/* aux. function that completely loads instrument; my tests indicate that it's
called somewhere around IDirectMusicCollection_GetInstrument */
HRESULT WINAPI IDirectMusicInstrumentImpl_Custom_Load (LPDIRECTMUSICINSTRUMENT iface, LPSTREAM pStm) {
ICOM_THIS_MULTI(IDirectMusicInstrumentImpl, InstrumentVtbl, iface);
DMUS_PRIVATE_CHUNK Chunk;
DWORD ListSize[4], ListCount[4];
LARGE_INTEGER liMove; /* used when skipping chunks */
TRACE("(%p, %p, offset = 0x%04llx)\n", This, pStm, This->liInstrumentPosition.QuadPart);
/* goto the beginning of chunk */
IStream_Seek (pStm, This->liInstrumentPosition, STREAM_SEEK_SET, NULL);
IStream_Read (pStm, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
TRACE_(dmfile)(": %s chunk (size = 0x%04lx)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
switch (Chunk.fccID) {
case FOURCC_LIST: {
IStream_Read (pStm, &Chunk.fccID, sizeof(FOURCC), NULL);
TRACE_(dmfile)(": LIST chunk of type %s", debugstr_fourcc(Chunk.fccID));
ListSize[0] = Chunk.dwSize - sizeof(FOURCC);
ListCount[0] = 0;
switch (Chunk.fccID) {
case FOURCC_INS: {
TRACE_(dmfile)(": instrument list\n");
do {
IStream_Read (pStm, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
ListCount[0] += sizeof(FOURCC) + sizeof(DWORD) + Chunk.dwSize;
TRACE_(dmfile)(": %s chunk (size = 0x%04lx)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
switch (Chunk.fccID) {
case FOURCC_INSH: {
TRACE_(dmfile)(": instrument header chunk\n");
/* should be already initialised */
IStream_Read (pStm, This->pHeader, Chunk.dwSize, NULL);
break;
}
case FOURCC_DLID: {
TRACE_(dmfile)(": DLID (GUID) chunk\n");
/* should be already initialised */
IStream_Read (pStm, This->pInstrumentID, Chunk.dwSize, NULL);
break;
}
case FOURCC_LIST: {
IStream_Read (pStm, &Chunk.fccID, sizeof(FOURCC), NULL);
TRACE_(dmfile)(": LIST chunk of type %s", debugstr_fourcc(Chunk.fccID));
ListSize[1] = Chunk.dwSize - sizeof(FOURCC);
ListCount[1] = 0;
switch (Chunk.fccID) {
case FOURCC_LRGN: {
TRACE_(dmfile)(": regions list\n");
do {
IStream_Read (pStm, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
ListCount[1] += sizeof(FOURCC) + sizeof(DWORD) + Chunk.dwSize;
TRACE_(dmfile)(": %s chunk (size = 0x%04lx)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
switch (Chunk.fccID) {
case FOURCC_LIST: {
IStream_Read (pStm, &Chunk.fccID, sizeof(FOURCC), NULL);
TRACE_(dmfile)(": LIST chunk of type %s", debugstr_fourcc(Chunk.fccID));
ListSize[2] = Chunk.dwSize - sizeof(FOURCC);
ListCount[2] = 0;
switch (Chunk.fccID) {
case FOURCC_RGN: {
/* temporary structures */
RGNHEADER tmpRegionHeader;
WSMPL tmpWaveSample;
WLOOP tmpWaveLoop;
WAVELINK tmpWaveLink;
TRACE_(dmfile)(": region list\n");
do {
IStream_Read (pStm, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
ListCount[2] += sizeof(FOURCC) + sizeof(DWORD) + Chunk.dwSize;
TRACE_(dmfile)(": %s chunk (size = 0x%04lx)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
switch (Chunk.fccID) {
case FOURCC_RGNH: {
TRACE_(dmfile)(": region header chunk\n");
memset (&tmpRegionHeader, 0, sizeof(RGNHEADER)); /* reset */
IStream_Read (pStm, &tmpRegionHeader, Chunk.dwSize, NULL);
break;
}
case FOURCC_WSMP: {
TRACE_(dmfile)(": wave sample chunk\n");
memset (&tmpWaveSample, 0, sizeof(WSMPL)); /* reset */
memset (&tmpWaveLoop, 0, sizeof(WLOOP)); /* reset */
if (Chunk.dwSize != (sizeof(WSMPL) + sizeof(WLOOP))) ERR(": incorrect chunk size\n");
IStream_Read (pStm, &tmpWaveSample, sizeof(WSMPL), NULL);
IStream_Read (pStm, &tmpWaveLoop, sizeof(WLOOP), NULL);
break;
}
case FOURCC_WLNK: {
TRACE_(dmfile)(": wave link chunk\n");
memset (&tmpWaveLink, 0, sizeof(WAVELINK)); /* reset */
IStream_Read (pStm, &tmpWaveLink, Chunk.dwSize, NULL);
break;
}
default: {
TRACE_(dmfile)(": unknown (skipping)\n");
liMove.QuadPart = Chunk.dwSize - sizeof(FOURCC);
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
TRACE_(dmfile)(": ListCount[2] = %ld < ListSize[2] = %ld\n", ListCount[2], ListSize[2]);
} while (ListCount[2] < ListSize[2]);
FIXME(": need to write temporary data to instrument data\n");
break;
}
default: {
TRACE_(dmfile)(": unknown (skipping)\n");
liMove.QuadPart = Chunk.dwSize - sizeof(FOURCC);
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (irrevelant & skipping)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
TRACE_(dmfile)(": ListCount[1] = %ld < ListSize[1] = %ld\n", ListCount[1], ListSize[1]);
} while (ListCount[1] < ListSize[1]);
break;
}
case FOURCC_LART: {
TRACE_(dmfile)(": articulators list\n");
do {
IStream_Read (pStm, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
ListCount[1] += sizeof(FOURCC) + sizeof(DWORD) + Chunk.dwSize;
TRACE_(dmfile)(": %s chunk (size = 0x%04lx)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
switch (Chunk.fccID) {
case FOURCC_ART1: {
/* temporary structures */
CONNECTIONLIST tmpConnectionList;
LPCONNECTION tmpConnections;
TRACE_(dmfile)(": level 1 articulator chunk\n");
memset (&tmpConnectionList, 0, sizeof(CONNECTIONLIST)); /* reset */
tmpConnections = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(CONNECTION)*tmpConnectionList.cConnections);
if (Chunk.dwSize != (sizeof(CONNECTIONLIST) + sizeof(CONNECTION)*tmpConnectionList.cConnections)) ERR(": incorrect chunk size\n");
IStream_Read (pStm, &tmpConnectionList, sizeof(CONNECTIONLIST), NULL);
IStream_Read (pStm, tmpConnections, sizeof(CONNECTION)*tmpConnectionList.cConnections, NULL);
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (irrevelant & skipping)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
TRACE_(dmfile)(": ListCount[1] = %ld < ListSize[1] = %ld\n", ListCount[1], ListSize[1]);
} while (ListCount[1] < ListSize[1]);
break;
}
case mmioFOURCC('I','N','F','O'): {
TRACE_(dmfile)(": INFO list\n");
do {
IStream_Read (pStm, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
ListCount[1] += sizeof(FOURCC) + sizeof(DWORD) + Chunk.dwSize;
TRACE_(dmfile)(": %s chunk (size = 0x%04lx)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
switch (Chunk.fccID) {
case mmioFOURCC('I','N','A','M'): {
TRACE_(dmfile)(": name chunk (ignored)\n");
if (even_or_odd(Chunk.dwSize)) {
ListCount[1] ++;
Chunk.dwSize++;
}
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','A','R','T'): {
TRACE_(dmfile)(": artist chunk (ignored)\n");
if (even_or_odd(Chunk.dwSize)) {
ListCount[1] ++;
Chunk.dwSize++;
}
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','C','O','P'): {
/* temporary structures */
CHAR tmpCopyright[DMUS_MAX_NAME];
TRACE_(dmfile)(": copyright chunk\n");
IStream_Read (pStm, tmpCopyright, Chunk.dwSize, NULL);
if (even_or_odd(Chunk.dwSize)) {
ListCount[1] ++;
liMove.QuadPart = 1;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
}
break;
}
case mmioFOURCC('I','S','B','J'): {
TRACE_(dmfile)(": subject chunk (ignored)\n");
if (even_or_odd(Chunk.dwSize)) {
ListCount[1] ++;
Chunk.dwSize++;
}
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','C','M','T'): {
TRACE_(dmfile)(": comment chunk (ignored)\n");
if (even_or_odd(Chunk.dwSize)) {
ListCount[1] ++;
Chunk.dwSize++;
}
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (irrevelant & skipping)\n");
if (even_or_odd(Chunk.dwSize)) {
ListCount[1] ++;
Chunk.dwSize++;
}
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
TRACE_(dmfile)(": ListCount[1] = %ld < ListSize[1] = %ld\n", ListCount[1], ListSize[1]);
} while (ListCount[1] < ListSize[1]);
break;
}
default: {
TRACE_(dmfile)(": unknown (skipping)\n");
liMove.QuadPart = Chunk.dwSize - sizeof(FOURCC);
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (irrevelant & skipping)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
TRACE_(dmfile)(": ListCount[0] = %ld < ListSize[0] = %ld\n", ListCount[0], ListSize[0]);
} while (ListCount[0] < ListSize[0]);
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (irrevelant & skipping)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
break;
}
default: {
TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */
return E_FAIL;
}
}
/* DEBUG: dumps whole instrument object tree: */
/* if (TRACE_ON(dmusic)) {
TRACE("*** IDirectMusicInstrument (%p) ***\n", This);
if (This->pInstrumentID)
TRACE(" - GUID = %s\n", debugstr_guid(This->pInstrumentID));
TRACE(" - Instrument header:\n");
TRACE(" - cRegions: %ld\n", This->pHeader->cRegions);
TRACE(" - Locale:\n");
TRACE(" - ulBank: %ld\n", This->pHeader->Locale.ulBank);
TRACE(" - ulInstrument: %ld\n", This->pHeader->Locale.ulInstrument);
TRACE(" => dwPatch: %ld\n", MIDILOCALE2Patch(&This->pHeader->Locale));
}*/
return S_OK;
}

View File

@ -1,6 +1,6 @@
/* IDirectMusicPort Implementation
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -17,21 +17,12 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "dmusic_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
/* IDirectMusicPort IUnknown parts follow: */
HRESULT WINAPI IDirectMusicPortImpl_QueryInterface (LPDIRECTMUSICPORT iface, REFIID riid, LPVOID *ppobj)
{
/* IDirectMusicPortImpl IUnknown part: */
HRESULT WINAPI IDirectMusicPortImpl_QueryInterface (LPDIRECTMUSICPORT iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IDirectMusicPortImpl,iface);
if (IsEqualIID (riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicPort)) {
@ -39,20 +30,17 @@ HRESULT WINAPI IDirectMusicPortImpl_QueryInterface (LPDIRECTMUSICPORT iface, REF
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicPortImpl_AddRef (LPDIRECTMUSICPORT iface)
{
ULONG WINAPI IDirectMusicPortImpl_AddRef (LPDIRECTMUSICPORT iface) {
ICOM_THIS(IDirectMusicPortImpl,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicPortImpl_Release (LPDIRECTMUSICPORT iface)
{
ULONG WINAPI IDirectMusicPortImpl_Release (LPDIRECTMUSICPORT iface) {
ICOM_THIS(IDirectMusicPortImpl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
@ -62,166 +50,121 @@ ULONG WINAPI IDirectMusicPortImpl_Release (LPDIRECTMUSICPORT iface)
return ref;
}
/* IDirectMusicPort Interface follow: */
HRESULT WINAPI IDirectMusicPortImpl_PlayBuffer (LPDIRECTMUSICPORT iface, LPDIRECTMUSICBUFFER pBuffer)
{
/* IDirectMusicPortImpl IDirectMusicPort part: */
HRESULT WINAPI IDirectMusicPortImpl_PlayBuffer (LPDIRECTMUSICPORT iface, LPDIRECTMUSICBUFFER pBuffer) {
ICOM_THIS(IDirectMusicPortImpl,iface);
FIXME("(%p, %p): stub\n", This, pBuffer);
return S_OK;
}
HRESULT WINAPI IDirectMusicPortImpl_SetReadNotificationHandle (LPDIRECTMUSICPORT iface, HANDLE hEvent)
{
HRESULT WINAPI IDirectMusicPortImpl_SetReadNotificationHandle (LPDIRECTMUSICPORT iface, HANDLE hEvent) {
ICOM_THIS(IDirectMusicPortImpl,iface);
FIXME("(%p, %p): stub\n", This, hEvent);
return S_OK;
}
HRESULT WINAPI IDirectMusicPortImpl_Read (LPDIRECTMUSICPORT iface, LPDIRECTMUSICBUFFER pBuffer)
{
HRESULT WINAPI IDirectMusicPortImpl_Read (LPDIRECTMUSICPORT iface, LPDIRECTMUSICBUFFER pBuffer) {
ICOM_THIS(IDirectMusicPortImpl,iface);
FIXME("(%p, %p): stub\n", This, pBuffer);
return S_OK;
}
HRESULT WINAPI IDirectMusicPortImpl_DownloadInstrument (LPDIRECTMUSICPORT iface, IDirectMusicInstrument* pInstrument, IDirectMusicDownloadedInstrument** ppDownloadedInstrument, DMUS_NOTERANGE* pNoteRanges, DWORD dwNumNoteRanges)
{
HRESULT WINAPI IDirectMusicPortImpl_DownloadInstrument (LPDIRECTMUSICPORT iface, IDirectMusicInstrument* pInstrument, IDirectMusicDownloadedInstrument** ppDownloadedInstrument, DMUS_NOTERANGE* pNoteRanges, DWORD dwNumNoteRanges) {
ICOM_THIS(IDirectMusicPortImpl,iface);
FIXME("(%p, %p, %p, %p, %ld): stub\n", This, pInstrument, ppDownloadedInstrument, pNoteRanges, dwNumNoteRanges);
return S_OK;
}
HRESULT WINAPI IDirectMusicPortImpl_UnloadInstrument (LPDIRECTMUSICPORT iface, IDirectMusicDownloadedInstrument *pDownloadedInstrument)
{
HRESULT WINAPI IDirectMusicPortImpl_UnloadInstrument (LPDIRECTMUSICPORT iface, IDirectMusicDownloadedInstrument *pDownloadedInstrument) {
ICOM_THIS(IDirectMusicPortImpl,iface);
FIXME("(%p, %p): stub\n", This, pDownloadedInstrument);
return S_OK;
}
HRESULT WINAPI IDirectMusicPortImpl_GetLatencyClock (LPDIRECTMUSICPORT iface, IReferenceClock** ppClock)
{
HRESULT WINAPI IDirectMusicPortImpl_GetLatencyClock (LPDIRECTMUSICPORT iface, IReferenceClock** ppClock) {
ICOM_THIS(IDirectMusicPortImpl,iface);
TRACE("(%p, %p)\n", This, ppClock);
*ppClock = This->pLatencyClock;
IReferenceClock_AddRef (*ppClock);
return S_OK;
}
HRESULT WINAPI IDirectMusicPortImpl_GetRunningStats (LPDIRECTMUSICPORT iface, LPDMUS_SYNTHSTATS pStats)
{
HRESULT WINAPI IDirectMusicPortImpl_GetRunningStats (LPDIRECTMUSICPORT iface, LPDMUS_SYNTHSTATS pStats) {
ICOM_THIS(IDirectMusicPortImpl,iface);
FIXME("(%p, %p): stub\n", This, pStats);
return S_OK;
}
HRESULT WINAPI IDirectMusicPortImpl_GetCaps (LPDIRECTMUSICPORT iface, LPDMUS_PORTCAPS pPortCaps)
{
HRESULT WINAPI IDirectMusicPortImpl_Compact (LPDIRECTMUSICPORT iface) {
ICOM_THIS(IDirectMusicPortImpl,iface);
FIXME("(%p): stub\n", This);
return S_OK;
}
HRESULT WINAPI IDirectMusicPortImpl_GetCaps (LPDIRECTMUSICPORT iface, LPDMUS_PORTCAPS pPortCaps) {
ICOM_THIS(IDirectMusicPortImpl,iface);
TRACE("(%p, %p)\n", This, pPortCaps);
pPortCaps = This->pCaps;
pPortCaps = This->pCaps;
return S_OK;
}
HRESULT WINAPI IDirectMusicPortImpl_DeviceIoControl (LPDIRECTMUSICPORT iface, DWORD dwIoControlCode, LPVOID lpInBuffer, DWORD nInBufferSize, LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped)
{
HRESULT WINAPI IDirectMusicPortImpl_DeviceIoControl (LPDIRECTMUSICPORT iface, DWORD dwIoControlCode, LPVOID lpInBuffer, DWORD nInBufferSize, LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped) {
ICOM_THIS(IDirectMusicPortImpl,iface);
FIXME("(%p, %ld, %p, %ld, %p, %ld, %p, %p): stub\n", This, dwIoControlCode, lpInBuffer, nInBufferSize, lpOutBuffer, nOutBufferSize, lpBytesReturned, lpOverlapped);
return S_OK;
}
HRESULT WINAPI IDirectMusicPortImpl_SetNumChannelGroups (LPDIRECTMUSICPORT iface, DWORD dwChannelGroups)
{
HRESULT WINAPI IDirectMusicPortImpl_SetNumChannelGroups (LPDIRECTMUSICPORT iface, DWORD dwChannelGroups) {
ICOM_THIS(IDirectMusicPortImpl,iface);
FIXME("(%p, %ld): semi-stub\n", This, dwChannelGroups);
This->nrofgroups = dwChannelGroups;
return S_OK;
}
HRESULT WINAPI IDirectMusicPortImpl_GetNumChannelGroups (LPDIRECTMUSICPORT iface, LPDWORD pdwChannelGroups)
{
HRESULT WINAPI IDirectMusicPortImpl_GetNumChannelGroups (LPDIRECTMUSICPORT iface, LPDWORD pdwChannelGroups) {
ICOM_THIS(IDirectMusicPortImpl,iface);
TRACE("(%p, %p)\n", This, pdwChannelGroups);
*pdwChannelGroups = This->nrofgroups;
return S_OK;
}
HRESULT WINAPI IDirectMusicPortImpl_Activate (LPDIRECTMUSICPORT iface, BOOL fActive)
{
HRESULT WINAPI IDirectMusicPortImpl_Activate (LPDIRECTMUSICPORT iface, BOOL fActive) {
ICOM_THIS(IDirectMusicPortImpl,iface);
TRACE("(%p, %d)\n", This, fActive);
This->fActive = fActive;
return S_OK;
}
HRESULT WINAPI IDirectMusicPortImpl_SetChannelPriority (LPDIRECTMUSICPORT iface, DWORD dwChannelGroup, DWORD dwChannel, DWORD dwPriority)
{
HRESULT WINAPI IDirectMusicPortImpl_SetChannelPriority (LPDIRECTMUSICPORT iface, DWORD dwChannelGroup, DWORD dwChannel, DWORD dwPriority) {
ICOM_THIS(IDirectMusicPortImpl,iface);
FIXME("(%p, %ld, %ld, %ld): semi-stub\n", This, dwChannelGroup, dwChannel, dwPriority);
if (dwChannel > 16)
{
if (dwChannel > 16) {
WARN("isn't there supposed to be 16 channels (no. %ld requested)?! (faking as it is ok)\n", dwChannel);
/*return E_INVALIDARG;*/
}
return S_OK;
}
HRESULT WINAPI IDirectMusicPortImpl_GetChannelPriority (LPDIRECTMUSICPORT iface, DWORD dwChannelGroup, DWORD dwChannel, LPDWORD pdwPriority)
{
HRESULT WINAPI IDirectMusicPortImpl_GetChannelPriority (LPDIRECTMUSICPORT iface, DWORD dwChannelGroup, DWORD dwChannel, LPDWORD pdwPriority) {
ICOM_THIS(IDirectMusicPortImpl,iface);
TRACE("(%p, %ld, %ld, %p)\n", This, dwChannelGroup, dwChannel, pdwPriority);
*pdwPriority = This->group[dwChannelGroup-1].channel[dwChannel].priority;
return S_OK;
}
HRESULT WINAPI IDirectMusicPortImpl_SetDirectSound (LPDIRECTMUSICPORT iface, LPDIRECTSOUND pDirectSound, LPDIRECTSOUNDBUFFER pDirectSoundBuffer)
{
HRESULT WINAPI IDirectMusicPortImpl_SetDirectSound (LPDIRECTMUSICPORT iface, LPDIRECTSOUND pDirectSound, LPDIRECTSOUNDBUFFER pDirectSoundBuffer) {
ICOM_THIS(IDirectMusicPortImpl,iface);
FIXME("(%p, %p, %p): stub\n", This, pDirectSound, pDirectSoundBuffer);
return S_OK;
}
HRESULT WINAPI IDirectMusicPortImpl_GetFormat (LPDIRECTMUSICPORT iface, LPWAVEFORMATEX pWaveFormatEx, LPDWORD pdwWaveFormatExSize, LPDWORD pdwBufferSize)
{
HRESULT WINAPI IDirectMusicPortImpl_GetFormat (LPDIRECTMUSICPORT iface, LPWAVEFORMATEX pWaveFormatEx, LPDWORD pdwWaveFormatExSize, LPDWORD pdwBufferSize) {
ICOM_THIS(IDirectMusicPortImpl,iface);
FIXME("(%p, %p, %p, %p): stub\n", This, pWaveFormatEx, pdwWaveFormatExSize, pdwBufferSize);
return S_OK;
}
ICOM_VTABLE(IDirectMusicPort) DirectMusicPort_Vtbl =
{
ICOM_VTABLE(IDirectMusicPort) DirectMusicPort_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicPortImpl_QueryInterface,
IDirectMusicPortImpl_AddRef,
@ -233,6 +176,7 @@ ICOM_VTABLE(IDirectMusicPort) DirectMusicPort_Vtbl =
IDirectMusicPortImpl_UnloadInstrument,
IDirectMusicPortImpl_GetLatencyClock,
IDirectMusicPortImpl_GetRunningStats,
IDirectMusicPortImpl_Compact,
IDirectMusicPortImpl_GetCaps,
IDirectMusicPortImpl_DeviceIoControl,
IDirectMusicPortImpl_SetNumChannelGroups,
@ -243,16 +187,3 @@ ICOM_VTABLE(IDirectMusicPort) DirectMusicPort_Vtbl =
IDirectMusicPortImpl_SetDirectSound,
IDirectMusicPortImpl_GetFormat
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicPort (LPCGUID lpcGUID, LPDIRECTMUSICPORT* ppDMPort, LPUNKNOWN pUnkOuter)
{
if (IsEqualIID (lpcGUID, &IID_IDirectMusicPort))
{
FIXME("Not yet\n");
return E_NOINTERFACE;
}
WARN("No interface found\n");
return E_NOINTERFACE;
}

View File

@ -1,6 +1,6 @@
/* IDirectMusicPortDownloadImpl Implementation
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -17,21 +17,12 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "dmusic_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
/* IDirectMusicPortDownload IUnknown parts follow: */
HRESULT WINAPI IDirectMusicPortDownloadImpl_QueryInterface (LPDIRECTMUSICPORTDOWNLOAD iface, REFIID riid, LPVOID *ppobj)
{
HRESULT WINAPI IDirectMusicPortDownloadImpl_QueryInterface (LPDIRECTMUSICPORTDOWNLOAD iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IDirectMusicPortDownloadImpl,iface);
if (IsEqualIID (riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicPortDownload)) {
@ -39,20 +30,17 @@ HRESULT WINAPI IDirectMusicPortDownloadImpl_QueryInterface (LPDIRECTMUSICPORTDOW
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicPortDownloadImpl_AddRef (LPDIRECTMUSICPORTDOWNLOAD iface)
{
ULONG WINAPI IDirectMusicPortDownloadImpl_AddRef (LPDIRECTMUSICPORTDOWNLOAD iface) {
ICOM_THIS(IDirectMusicPortDownloadImpl,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicPortDownloadImpl_Release (LPDIRECTMUSICPORTDOWNLOAD iface)
{
ULONG WINAPI IDirectMusicPortDownloadImpl_Release (LPDIRECTMUSICPORTDOWNLOAD iface) {
ICOM_THIS(IDirectMusicPortDownloadImpl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
@ -63,62 +51,43 @@ ULONG WINAPI IDirectMusicPortDownloadImpl_Release (LPDIRECTMUSICPORTDOWNLOAD ifa
}
/* IDirectMusicPortDownload Interface follow: */
HRESULT WINAPI IDirectMusicPortDownloadImpl_GetBuffer (LPDIRECTMUSICPORTDOWNLOAD iface, DWORD dwDLId, IDirectMusicDownload** ppIDMDownload)
{
HRESULT WINAPI IDirectMusicPortDownloadImpl_GetBuffer (LPDIRECTMUSICPORTDOWNLOAD iface, DWORD dwDLId, IDirectMusicDownload** ppIDMDownload) {
ICOM_THIS(IDirectMusicPortDownloadImpl,iface);
FIXME("(%p, %ld, %p): stub\n", This, dwDLId, ppIDMDownload);
return S_OK;
}
HRESULT WINAPI IDirectMusicPortDownloadImpl_AllocateBuffer (LPDIRECTMUSICPORTDOWNLOAD iface, DWORD dwSize, IDirectMusicDownload** ppIDMDownload)
{
HRESULT WINAPI IDirectMusicPortDownloadImpl_AllocateBuffer (LPDIRECTMUSICPORTDOWNLOAD iface, DWORD dwSize, IDirectMusicDownload** ppIDMDownload) {
ICOM_THIS(IDirectMusicPortDownloadImpl,iface);
FIXME("(%p, %ld, %p): stub\n", This, dwSize, ppIDMDownload);
return S_OK;
}
HRESULT WINAPI IDirectMusicPortDownloadImpl_GetDLId (LPDIRECTMUSICPORTDOWNLOAD iface, DWORD* pdwStartDLId, DWORD dwCount)
{
HRESULT WINAPI IDirectMusicPortDownloadImpl_GetDLId (LPDIRECTMUSICPORTDOWNLOAD iface, DWORD* pdwStartDLId, DWORD dwCount) {
ICOM_THIS(IDirectMusicPortDownloadImpl,iface);
FIXME("(%p, %p, %ld): stub\n", This, pdwStartDLId, dwCount);
return S_OK;
}
HRESULT WINAPI IDirectMusicPortDownloadImpl_GetAppend (LPDIRECTMUSICPORTDOWNLOAD iface, DWORD* pdwAppend)
{
HRESULT WINAPI IDirectMusicPortDownloadImpl_GetAppend (LPDIRECTMUSICPORTDOWNLOAD iface, DWORD* pdwAppend) {
ICOM_THIS(IDirectMusicPortDownloadImpl,iface);
FIXME("(%p, %p): stub\n", This, pdwAppend);
return S_OK;
}
HRESULT WINAPI IDirectMusicPortDownloadImpl_Download (LPDIRECTMUSICPORTDOWNLOAD iface, IDirectMusicDownload* pIDMDownload)
{
HRESULT WINAPI IDirectMusicPortDownloadImpl_Download (LPDIRECTMUSICPORTDOWNLOAD iface, IDirectMusicDownload* pIDMDownload) {
ICOM_THIS(IDirectMusicPortDownloadImpl,iface);
FIXME("(%p, %p): stub\n", This, pIDMDownload);
return S_OK;
}
HRESULT WINAPI IDirectMusicPortDownloadImpl_Unload (LPDIRECTMUSICPORTDOWNLOAD iface, IDirectMusicDownload* pIDMDownload)
{
HRESULT WINAPI IDirectMusicPortDownloadImpl_Unload (LPDIRECTMUSICPORTDOWNLOAD iface, IDirectMusicDownload* pIDMDownload) {
ICOM_THIS(IDirectMusicPortDownloadImpl,iface);
FIXME("(%p, %p): stub\n", This, pIDMDownload);
return S_OK;
}
ICOM_VTABLE(IDirectMusicPortDownload) DirectMusicPortDownload_Vtbl =
{
ICOM_VTABLE(IDirectMusicPortDownload) DirectMusicPortDownload_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicPortDownloadImpl_QueryInterface,
IDirectMusicPortDownloadImpl_AddRef,
@ -130,16 +99,3 @@ ICOM_VTABLE(IDirectMusicPortDownload) DirectMusicPortDownload_Vtbl =
IDirectMusicPortDownloadImpl_Download,
IDirectMusicPortDownloadImpl_Unload
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicPortDownload (LPCGUID lpcGUID, LPDIRECTMUSICPORTDOWNLOAD* ppDMPortDL, LPUNKNOWN pUnkOuter)
{
if (IsEqualIID (lpcGUID, &IID_IDirectMusicPortDownload))
{
FIXME("Not yet\n");
return E_NOINTERFACE;
}
WARN("No interface found\n");
return E_NOINTERFACE;
}

View File

@ -18,21 +18,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdarg.h>
#include <string.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winreg.h"
#include "winerror.h"
#include "dmusics.h"
#include "dmusici.h"
#include "dmplugin.h"
#include "wine/debug.h"
#include "dmusic_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
@ -44,8 +30,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
/***********************************************************************
* interface for self-registering
*/
struct regsvr_interface
{
struct regsvr_interface {
IID const *iid; /* NULL for end of list */
LPCSTR name; /* can be NULL to omit */
IID const *base_iid; /* can be NULL to omit */
@ -57,8 +42,7 @@ struct regsvr_interface
static HRESULT register_interfaces(struct regsvr_interface const *list);
static HRESULT unregister_interfaces(struct regsvr_interface const *list);
struct regsvr_coclass
{
struct regsvr_coclass {
CLSID const *clsid; /* NULL for end of list */
LPCSTR name; /* can be NULL to omit */
LPCSTR ips; /* can be NULL to omit */
@ -124,8 +108,7 @@ static LONG recursive_delete_keyW(HKEY base, WCHAR const *name);
/***********************************************************************
* register_interfaces
*/
static HRESULT register_interfaces(struct regsvr_interface const *list)
{
static HRESULT register_interfaces(struct regsvr_interface const *list) {
LONG res = ERROR_SUCCESS;
HKEY interface_key;
@ -194,8 +177,7 @@ error_return:
/***********************************************************************
* unregister_interfaces
*/
static HRESULT unregister_interfaces(struct regsvr_interface const *list)
{
static HRESULT unregister_interfaces(struct regsvr_interface const *list) {
LONG res = ERROR_SUCCESS;
HKEY interface_key;
@ -219,8 +201,7 @@ error_return:
/***********************************************************************
* register_coclasses
*/
static HRESULT register_coclasses(struct regsvr_coclass const *list)
{
static HRESULT register_coclasses(struct regsvr_coclass const *list) {
LONG res = ERROR_SUCCESS;
HKEY coclass_key;
@ -301,8 +282,7 @@ error_return:
/***********************************************************************
* unregister_coclasses
*/
static HRESULT unregister_coclasses(struct regsvr_coclass const *list)
{
static HRESULT unregister_coclasses(struct regsvr_coclass const *list) {
LONG res = ERROR_SUCCESS;
HKEY coclass_key;
@ -338,8 +318,7 @@ error_return:
/***********************************************************************
* regsvr_key_guid
*/
static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid)
{
static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid) {
WCHAR buf[39];
StringFromGUID2(guid, buf, 39);
@ -352,8 +331,7 @@ static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid)
static LONG register_key_defvalueW(
HKEY base,
WCHAR const *name,
WCHAR const *value)
{
WCHAR const *value) {
LONG res;
HKEY key;
@ -372,8 +350,7 @@ static LONG register_key_defvalueW(
static LONG register_key_defvalueA(
HKEY base,
WCHAR const *name,
char const *value)
{
char const *value) {
LONG res;
HKEY key;
@ -394,8 +371,7 @@ static LONG register_progid(
char const *progid,
char const *curver_progid,
char const *name,
char const *extra)
{
char const *extra) {
LONG res;
HKEY progid_key;
@ -439,8 +415,7 @@ error_close_progid_key:
/***********************************************************************
* recursive_delete_key
*/
static LONG recursive_delete_key(HKEY key)
{
static LONG recursive_delete_key(HKEY key) {
LONG res;
WCHAR subkey_name[MAX_PATH];
DWORD cName;
@ -471,8 +446,7 @@ static LONG recursive_delete_key(HKEY key)
/***********************************************************************
* recursive_delete_keyA
*/
static LONG recursive_delete_keyA(HKEY base, char const *name)
{
static LONG recursive_delete_keyA(HKEY base, char const *name) {
LONG res;
HKEY key;
@ -487,8 +461,7 @@ static LONG recursive_delete_keyA(HKEY base, char const *name)
/***********************************************************************
* recursive_delete_keyW
*/
static LONG recursive_delete_keyW(HKEY base, WCHAR const *name)
{
static LONG recursive_delete_keyW(HKEY base, WCHAR const *name) {
LONG res;
HKEY key;
@ -534,8 +507,7 @@ static struct regsvr_interface const interface_list[] = {
/***********************************************************************
* DllRegisterServer (DMUSIC.3)
*/
HRESULT WINAPI DMUSIC_DllRegisterServer(void)
{
HRESULT WINAPI DMUSIC_DllRegisterServer(void) {
HRESULT hr;
TRACE("\n");
@ -549,8 +521,7 @@ HRESULT WINAPI DMUSIC_DllRegisterServer(void)
/***********************************************************************
* DllUnregisterServer (DMUSIC.4)
*/
HRESULT WINAPI DMUSIC_DllUnregisterServer(void)
{
HRESULT WINAPI DMUSIC_DllUnregisterServer(void) {
HRESULT hr;
TRACE("\n");

View File

@ -1,6 +1,6 @@
/* IDirectMusicThru Implementation
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -17,21 +17,12 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "dmusic_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
/* IDirectMusicThru IUnknown parts follow: */
HRESULT WINAPI IDirectMusicThruImpl_QueryInterface (LPDIRECTMUSICTHRU iface, REFIID riid, LPVOID *ppobj)
{
HRESULT WINAPI IDirectMusicThruImpl_QueryInterface (LPDIRECTMUSICTHRU iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IDirectMusicThruImpl,iface);
if (IsEqualIID (riid, &IID_IUnknown) ||
@ -40,20 +31,17 @@ HRESULT WINAPI IDirectMusicThruImpl_QueryInterface (LPDIRECTMUSICTHRU iface, REF
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicThruImpl_AddRef (LPDIRECTMUSICTHRU iface)
{
ULONG WINAPI IDirectMusicThruImpl_AddRef (LPDIRECTMUSICTHRU iface) {
ICOM_THIS(IDirectMusicThruImpl,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicThruImpl_Release (LPDIRECTMUSICTHRU iface)
{
ULONG WINAPI IDirectMusicThruImpl_Release (LPDIRECTMUSICTHRU iface) {
ICOM_THIS(IDirectMusicThruImpl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
@ -64,33 +52,16 @@ ULONG WINAPI IDirectMusicThruImpl_Release (LPDIRECTMUSICTHRU iface)
}
/* IDirectMusicThru Interface follow: */
HRESULT WINAPI IDirectMusicThruImpl_ThruChannel (LPDIRECTMUSICTHRU iface, DWORD dwSourceChannelGroup, DWORD dwSourceChannel, DWORD dwDestinationChannelGroup, DWORD dwDestinationChannel, LPDIRECTMUSICPORT pDestinationPort)
{
HRESULT WINAPI IDirectMusicThruImpl_ThruChannel (LPDIRECTMUSICTHRU iface, DWORD dwSourceChannelGroup, DWORD dwSourceChannel, DWORD dwDestinationChannelGroup, DWORD dwDestinationChannel, LPDIRECTMUSICPORT pDestinationPort) {
ICOM_THIS(IDirectMusicThruImpl,iface);
FIXME("(%p, %ld, %ld, %ld, %ld, %p): stub\n", This, dwSourceChannelGroup, dwSourceChannel, dwDestinationChannelGroup, dwDestinationChannel, pDestinationPort);
return S_OK;
}
ICOM_VTABLE(IDirectMusicThru) DirectMusicThru_Vtbl =
{
ICOM_VTABLE(IDirectMusicThru) DirectMusicThru_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicThruImpl_QueryInterface,
IDirectMusicThruImpl_AddRef,
IDirectMusicThruImpl_Release,
IDirectMusicThruImpl_ThruChannel
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicThru (LPCGUID lpcGUID, LPDIRECTMUSICTHRU* ppDMThru, LPUNKNOWN pUnkOuter)
{
if (IsEqualIID (lpcGUID, &IID_IDirectMusicThru))
{
FIXME("Not yet\n");
return E_NOINTERFACE;
}
WARN("No interface found\n");
return E_NOINTERFACE;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2001 Ove Kaaven
* Copyright (C) 2003-2004 Rok Mandeljc <rok.mandeljc@gimb.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -19,10 +19,10 @@
#define WINE_OLESELFREGISTER
#define WINE_FILEDESCRIPTION_STR "Wine DirectMusic"
#define WINE_FILENAME_STR "dmusic.dll"
#define WINE_FILEVERSION 4,8,1,881
#define WINE_FILEVERSION_STR "4.8.1.881"
#define WINE_PRODUCTVERSION 4,8,1,881
#define WINE_PRODUCTVERSION_STR "4.8"
#define WINE_FILEVERSION 4,9,0,900
#define WINE_FILEVERSION_STR "4.9.0.900"
#define WINE_PRODUCTVERSION 4,9,0,900
#define WINE_PRODUCTVERSION_STR "4.9"
#define WINE_PRODUCTNAME_STR "DirectX"
#include "wine/wine_common_ver.rc"

View File

@ -1,6 +1,6 @@
/* DirectMusic32 Main
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -20,11 +20,21 @@
#include <stdarg.h>
#include "windef.h"
#include "wine/debug.h"
#include "winbase.h"
#include "winnt.h"
#include "wingdi.h"
#include "winuser.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
#include "wine/debug.h"
#include "wine/list.h"
#include "wine/unicode.h"
#include "winreg.h"
#include "dmusici.h"
#include "dmusicf.h"
#include "dmusics.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic32);
HRESULT WINAPI DMUSIC32_CreateCDirectMusicEmulatePort (LPVOID ptr1, LPVOID ptr2, LPVOID ptr3)
{

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 Rok Mandeljc <rok.mandeljc@gimb.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -18,10 +18,10 @@
#define WINE_FILEDESCRIPTION_STR "Wine DirectMusic Legacy Port"
#define WINE_FILENAME_STR "dmusic32.dll"
#define WINE_FILEVERSION 4,8,1,881
#define WINE_FILEVERSION_STR "4.8.1.881"
#define WINE_PRODUCTVERSION 4,8,1,881
#define WINE_PRODUCTVERSION_STR "4.8"
#define WINE_FILEVERSION 4,9,0,900
#define WINE_FILEVERSION_STR "4.9.0.900"
#define WINE_PRODUCTVERSION 4,9,0,900
#define WINE_PRODUCTVERSION_STR "4.9"
#define WINE_PRODUCTNAME_STR "DirectX"
#include "wine/wine_common_ver.rc"

5
dlls/dswave/.cvsignore Normal file
View File

@ -0,0 +1,5 @@
Makefile
dswave.dll.dbg.c
dswave.spec.c
dswave.spec.def
version.res

18
dlls/dswave/Makefile.in Normal file
View File

@ -0,0 +1,18 @@
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = dswave.dll
IMPORTS = msacm32 ole32 user32 advapi32 kernel32
EXTRALIBS = $(LIBUUID)
C_SRCS = \
dswave.c \
dswave_main.c \
regsvr.c
RC_SRCS = version.rc
@MAKE_DLL_RULES@
### Dependencies:

365
dlls/dswave/dswave.c Normal file
View File

@ -0,0 +1,365 @@
/* IDirectMusicWave Implementation
*
* Copyright (C) 2003-2004 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 "dswave_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dswave);
WINE_DECLARE_DEBUG_CHANNEL(dmfile);
/*****************************************************************************
* IDirectMusicWaveImpl implementation
*/
/* IDirectMusicWaveImpl IUnknown part: */
HRESULT WINAPI IDirectMusicWaveImpl_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicWaveImpl, UnknownVtbl, iface);
if (IsEqualIID (riid, &IID_IUnknown)) {
*ppobj = (LPVOID)&This->UnknownVtbl;
IDirectMusicWaveImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicObject)) {
*ppobj = (LPVOID)&This->ObjectVtbl;
IDirectMusicWaveImpl_IDirectMusicObject_AddRef ((LPDIRECTMUSICOBJECT)&This->ObjectVtbl);
return S_OK;
} else if (IsEqualIID (riid, &IID_IPersistStream)) {
*ppobj = (LPVOID)&This->PersistStreamVtbl;
IDirectMusicWaveImpl_IPersistStream_AddRef ((LPPERSISTSTREAM)&This->PersistStreamVtbl);
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicWaveImpl_IUnknown_AddRef (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicWaveImpl, UnknownVtbl, iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicWaveImpl_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI(IDirectMusicWaveImpl, UnknownVtbl, iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
ICOM_VTABLE(IUnknown) DirectMusicWave_Unknown_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicWaveImpl_IUnknown_QueryInterface,
IDirectMusicWaveImpl_IUnknown_AddRef,
IDirectMusicWaveImpl_IUnknown_Release
};
/* IDirectMusicWaveImpl IDirectMusicObject part: */
HRESULT WINAPI IDirectMusicWaveImpl_IDirectMusicObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicWaveImpl, ObjectVtbl, iface);
return IDirectMusicWaveImpl_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicWaveImpl_IDirectMusicObject_AddRef (LPDIRECTMUSICOBJECT iface) {
ICOM_THIS_MULTI(IDirectMusicWaveImpl, ObjectVtbl, iface);
return IDirectMusicWaveImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicWaveImpl_IDirectMusicObject_Release (LPDIRECTMUSICOBJECT iface) {
ICOM_THIS_MULTI(IDirectMusicWaveImpl, ObjectVtbl, iface);
return IDirectMusicWaveImpl_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicWaveImpl_IDirectMusicObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc) {
ICOM_THIS_MULTI(IDirectMusicWaveImpl, ObjectVtbl, iface);
TRACE("(%p, %p)\n", This, pDesc);
/* I think we shouldn't return pointer here since then values can be changed; it'd be a mess */
memcpy (pDesc, This->pDesc, This->pDesc->dwSize);
return S_OK;
}
HRESULT WINAPI IDirectMusicWaveImpl_IDirectMusicObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc) {
ICOM_THIS_MULTI(IDirectMusicWaveImpl, ObjectVtbl, iface);
TRACE("(%p, %p): setting descriptor:\n", This, pDesc);
if (TRACE_ON(dswave)) {
DMUSIC_dump_DMUS_OBJECTDESC (pDesc);
}
/* According to MSDN, we should copy only given values, not whole struct */
if (pDesc->dwValidData & DMUS_OBJ_OBJECT)
memcpy (&This->pDesc->guidObject, &pDesc->guidObject, sizeof (pDesc->guidObject));
if (pDesc->dwValidData & DMUS_OBJ_CLASS)
memcpy (&This->pDesc->guidClass, &pDesc->guidClass, sizeof (pDesc->guidClass));
if (pDesc->dwValidData & DMUS_OBJ_NAME)
strncpyW (This->pDesc->wszName, pDesc->wszName, DMUS_MAX_NAME);
if (pDesc->dwValidData & DMUS_OBJ_CATEGORY)
strncpyW (This->pDesc->wszCategory, pDesc->wszCategory, DMUS_MAX_CATEGORY);
if (pDesc->dwValidData & DMUS_OBJ_FILENAME)
strncpyW (This->pDesc->wszFileName, pDesc->wszFileName, DMUS_MAX_FILENAME);
if (pDesc->dwValidData & DMUS_OBJ_VERSION)
memcpy (&This->pDesc->vVersion, &pDesc->vVersion, sizeof (pDesc->vVersion));
if (pDesc->dwValidData & DMUS_OBJ_DATE)
memcpy (&This->pDesc->ftDate, &pDesc->ftDate, sizeof (pDesc->ftDate));
if (pDesc->dwValidData & DMUS_OBJ_MEMORY) {
memcpy (&This->pDesc->llMemLength, &pDesc->llMemLength, sizeof (pDesc->llMemLength));
memcpy (This->pDesc->pbMemData, pDesc->pbMemData, sizeof (pDesc->pbMemData));
}
if (pDesc->dwValidData & DMUS_OBJ_STREAM) {
/* according to MSDN, we copy the stream */
IStream_Clone (pDesc->pStream, &This->pDesc->pStream);
}
/* add new flags */
This->pDesc->dwValidData |= pDesc->dwValidData;
return S_OK;
}
HRESULT WINAPI IDirectMusicWaveImpl_IDirectMusicObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc) {
DMUS_PRIVATE_CHUNK Chunk;
DWORD StreamSize, StreamCount, ListSize[1], ListCount[1];
LARGE_INTEGER liMove; /* used when skipping chunks */
TRACE("(%p, %p)\n", pStream, pDesc);
/* FIXME: should this be determined from stream? */
pDesc->dwValidData |= DMUS_OBJ_CLASS;
memcpy (&pDesc->guidClass, &CLSID_DirectMusicSegment, sizeof(CLSID));
IStream_Read (pStream, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
TRACE_(dmfile)(": %s chunk (size = 0x%04lx)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
switch (Chunk.fccID) {
case FOURCC_RIFF: {
IStream_Read (pStream, &Chunk.fccID, sizeof(FOURCC), NULL);
TRACE_(dmfile)(": RIFF chunk of type %s", debugstr_fourcc(Chunk.fccID));
StreamSize = Chunk.dwSize - sizeof(FOURCC);
StreamCount = 0;
if (Chunk.fccID == mmioFOURCC('W','A','V','E')) {
TRACE_(dmfile)(": wave form\n");
do {
IStream_Read (pStream, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
StreamCount += sizeof(FOURCC) + sizeof(DWORD) + Chunk.dwSize;
TRACE_(dmfile)(": %s chunk (size = 0x%04lx)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
switch (Chunk.fccID) {
case DMUS_FOURCC_GUID_CHUNK: {
TRACE_(dmfile)(": GUID chunk\n");
pDesc->dwValidData |= DMUS_OBJ_OBJECT;
IStream_Read (pStream, &pDesc->guidObject, Chunk.dwSize, NULL);
break;
}
case DMUS_FOURCC_VERSION_CHUNK: {
TRACE_(dmfile)(": version chunk\n");
pDesc->dwValidData |= DMUS_OBJ_VERSION;
IStream_Read (pStream, &pDesc->vVersion, Chunk.dwSize, NULL);
break;
}
case DMUS_FOURCC_CATEGORY_CHUNK: {
TRACE_(dmfile)(": category chunk\n");
pDesc->dwValidData |= DMUS_OBJ_CATEGORY;
IStream_Read (pStream, pDesc->wszCategory, Chunk.dwSize, NULL);
break;
}
case FOURCC_LIST: {
IStream_Read (pStream, &Chunk.fccID, sizeof(FOURCC), NULL);
TRACE_(dmfile)(": LIST chunk of type %s", debugstr_fourcc(Chunk.fccID));
ListSize[0] = Chunk.dwSize - sizeof(FOURCC);
ListCount[0] = 0;
switch (Chunk.fccID) {
/* evil M$ UNFO list, which can (!?) contain INFO elements */
case DMUS_FOURCC_UNFO_LIST: {
TRACE_(dmfile)(": UNFO list\n");
do {
IStream_Read (pStream, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
ListCount[0] += sizeof(FOURCC) + sizeof(DWORD) + Chunk.dwSize;
TRACE_(dmfile)(": %s chunk (size = 0x%04lx)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
switch (Chunk.fccID) {
/* don't ask me why, but M$ puts INFO elements in UNFO list sometimes
(though strings seem to be valid unicode) */
case mmioFOURCC('I','N','A','M'):
case DMUS_FOURCC_UNAM_CHUNK: {
TRACE_(dmfile)(": name chunk\n");
pDesc->dwValidData |= DMUS_OBJ_NAME;
IStream_Read (pStream, pDesc->wszName, Chunk.dwSize, NULL);
break;
}
case mmioFOURCC('I','A','R','T'):
case DMUS_FOURCC_UART_CHUNK: {
TRACE_(dmfile)(": artist chunk (ignored)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','C','O','P'):
case DMUS_FOURCC_UCOP_CHUNK: {
TRACE_(dmfile)(": copyright chunk (ignored)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','S','B','J'):
case DMUS_FOURCC_USBJ_CHUNK: {
TRACE_(dmfile)(": subject chunk (ignored)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','C','M','T'):
case DMUS_FOURCC_UCMT_CHUNK: {
TRACE_(dmfile)(": comment chunk (ignored)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (irrevelant & skipping)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
TRACE_(dmfile)(": ListCount[0] = %ld < ListSize[0] = %ld\n", ListCount[0], ListSize[0]);
} while (ListCount[0] < ListSize[0]);
break;
}
default: {
TRACE_(dmfile)(": unknown (skipping)\n");
liMove.QuadPart = Chunk.dwSize - sizeof(FOURCC);
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (irrevelant & skipping)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
TRACE_(dmfile)(": StreamCount[0] = %ld < StreamSize[0] = %ld\n", StreamCount, StreamSize);
} while (StreamCount < StreamSize);
break;
} else {
TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
liMove.QuadPart = StreamSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */
return E_FAIL;
}
TRACE_(dmfile)(": reading finished\n");
break;
}
default: {
TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */
return DMUS_E_INVALIDFILE;
}
}
TRACE(": returning descriptor:\n");
if (TRACE_ON(dswave)) {
DMUSIC_dump_DMUS_OBJECTDESC (pDesc);
}
return S_OK;
}
ICOM_VTABLE(IDirectMusicObject) DirectMusicWave_Object_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicWaveImpl_IDirectMusicObject_QueryInterface,
IDirectMusicWaveImpl_IDirectMusicObject_AddRef,
IDirectMusicWaveImpl_IDirectMusicObject_Release,
IDirectMusicWaveImpl_IDirectMusicObject_GetDescriptor,
IDirectMusicWaveImpl_IDirectMusicObject_SetDescriptor,
IDirectMusicWaveImpl_IDirectMusicObject_ParseDescriptor
};
/* IDirectMusicWaveImpl IPersistStream part: */
HRESULT WINAPI IDirectMusicWaveImpl_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj) {
ICOM_THIS_MULTI(IDirectMusicWaveImpl, PersistStreamVtbl, iface);
return IDirectMusicWaveImpl_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
}
ULONG WINAPI IDirectMusicWaveImpl_IPersistStream_AddRef (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicWaveImpl, PersistStreamVtbl, iface);
return IDirectMusicWaveImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
}
ULONG WINAPI IDirectMusicWaveImpl_IPersistStream_Release (LPPERSISTSTREAM iface) {
ICOM_THIS_MULTI(IDirectMusicWaveImpl, PersistStreamVtbl, iface);
return IDirectMusicWaveImpl_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicWaveImpl_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicWaveImpl_IPersistStream_IsDirty (LPPERSISTSTREAM iface) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicWaveImpl_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm) {
ICOM_THIS_MULTI(IDirectMusicWaveImpl, PersistStreamVtbl, iface);
FIXME("(%p, %p): loading not implemented yet\n", This, pStm);
return S_OK;
}
HRESULT WINAPI IDirectMusicWaveImpl_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) {
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicWaveImpl_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) {
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicWave_PersistStream_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicWaveImpl_IPersistStream_QueryInterface,
IDirectMusicWaveImpl_IPersistStream_AddRef,
IDirectMusicWaveImpl_IPersistStream_Release,
IDirectMusicWaveImpl_IPersistStream_GetClassID,
IDirectMusicWaveImpl_IPersistStream_IsDirty,
IDirectMusicWaveImpl_IPersistStream_Load,
IDirectMusicWaveImpl_IPersistStream_Save,
IDirectMusicWaveImpl_IPersistStream_GetSizeMax
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicWaveImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) {
IDirectMusicWaveImpl* obj;
obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicWaveImpl));
if (NULL == obj) {
*ppobj = (LPVOID) NULL;
return E_OUTOFMEMORY;
}
obj->UnknownVtbl = &DirectMusicWave_Unknown_Vtbl;
obj->ObjectVtbl = &DirectMusicWave_Object_Vtbl;
obj->PersistStreamVtbl = &DirectMusicWave_PersistStream_Vtbl;
obj->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC));
DM_STRUCT_INIT(obj->pDesc);
obj->pDesc->dwValidData |= DMUS_OBJ_CLASS;
memcpy (&obj->pDesc->guidClass, &CLSID_DirectMusicSegment, sizeof (CLSID)); /* shown by tests */
obj->ref = 0; /* will be inited by QueryInterface */
return IDirectMusicWaveImpl_IUnknown_QueryInterface ((LPUNKNOWN)&obj->UnknownVtbl, lpcGUID, ppobj);
}

4
dlls/dswave/dswave.spec Normal file
View File

@ -0,0 +1,4 @@
@ stdcall -private DllCanUnloadNow() DSWAVE_DllCanUnloadNow
@ stdcall -private DllGetClassObject(ptr ptr ptr) DSWAVE_DllGetClassObject
@ stdcall -private DllRegisterServer() DSWAVE_DllRegisterServer
@ stdcall -private DllUnregisterServer() DSWAVE_DllUnregisterServer

116
dlls/dswave/dswave_main.c Normal file
View File

@ -0,0 +1,116 @@
/* DirectMusic Wave Main
*
* Copyright (C) 2003-2004 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 "dswave_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dswave);
typedef struct {
/* IUnknown fields */
ICOM_VFIELD(IClassFactory);
DWORD ref;
} IClassFactoryImpl;
/******************************************************************
* DirectMusicWave ClassFactory
*/
static HRESULT WINAPI WaveCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI WaveCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI WaveCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI WaveCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
return DMUSIC_CreateDirectMusicWaveImpl (riid, ppobj, pOuter);
}
static HRESULT WINAPI WaveCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
}
static ICOM_VTABLE(IClassFactory) WaveCF_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
WaveCF_QueryInterface,
WaveCF_AddRef,
WaveCF_Release,
WaveCF_CreateInstance,
WaveCF_LockServer
};
static IClassFactoryImpl Wave_CF = {&WaveCF_Vtbl, 1 };
/******************************************************************
* DllMain
*
*
*/
BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
if (fdwReason == DLL_PROCESS_ATTACH) {
DisableThreadLibraryCalls(hinstDLL);
/* FIXME: Initialisation */
} else if (fdwReason == DLL_PROCESS_DETACH) {
/* FIXME: Cleanup */
}
return TRUE;
}
/******************************************************************
* DllCanUnloadNow (DSWAVE.1)
*
*
*/
HRESULT WINAPI DSWAVE_DllCanUnloadNow(void) {
FIXME("(void): stub\n");
return S_FALSE;
}
/******************************************************************
* DllGetClassObject (DSWAVE.2)
*
*
*/
HRESULT WINAPI DSWAVE_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) {
TRACE("(%p,%p,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
if (IsEqualCLSID (rclsid, &CLSID_DirectSoundWave) && IsEqualIID (riid, &IID_IClassFactory)) {
*ppv = (LPVOID) &Wave_CF;
IClassFactory_AddRef((IClassFactory*)*ppv);
return S_OK;
}
WARN("(%p,%p,%p): no interface found.\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
return CLASS_E_CLASSNOTAVAILABLE;
}

View File

@ -0,0 +1,195 @@
/* DirectMusic Wave Private Include
*
* Copyright (C) 2003-2004 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.
*/
#ifndef __WINE_DSWAVE_PRIVATE_H
#define __WINE_DSWAVE_PRIVATE_H
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winnt.h"
#include "wingdi.h"
#include "winuser.h"
#include "wine/debug.h"
#include "wine/list.h"
#include "wine/unicode.h"
#include "winreg.h"
#include "dmusici.h"
#include "dmusicf.h"
#include "dmusics.h"
/*****************************************************************************
* Interfaces
*/
typedef struct IDirectMusicWaveImpl IDirectMusicWaveImpl;
/*****************************************************************************
* Predeclare the interface implementation structures
*/
extern ICOM_VTABLE(IUnknown) DirectMusicWave_Unknown_Vtbl;
extern ICOM_VTABLE(IDirectMusicObject) DirectMusicWave_Object_Vtbl;
extern ICOM_VTABLE(IPersistStream) DirectMusicWave_PersistStream_Vtbl;
/*****************************************************************************
* ClassFactory
*/
extern HRESULT WINAPI DMUSIC_CreateDirectMusicWaveImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter);
/*****************************************************************************
* IDirectMusicWaveImpl implementation structure
*/
struct IDirectMusicWaveImpl {
/* IUnknown fields */
ICOM_VTABLE(IUnknown) *UnknownVtbl;
ICOM_VTABLE(IDirectMusicObject) *ObjectVtbl;
ICOM_VTABLE(IPersistStream) *PersistStreamVtbl;
DWORD ref;
/* IDirectMusicWaveImpl fields */
LPDMUS_OBJECTDESC pDesc;
};
/* IUnknown: */
extern HRESULT WINAPI IDirectMusicWaveImpl_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicWaveImpl_IUnknown_AddRef (LPUNKNOWN iface);
extern ULONG WINAPI IDirectMusicWaveImpl_IUnknown_Release (LPUNKNOWN iface);
/* IDirectMusicObject: */
extern HRESULT WINAPI IDirectMusicWaveImpl_IDirectMusicObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicWaveImpl_IDirectMusicObject_AddRef (LPDIRECTMUSICOBJECT iface);
extern ULONG WINAPI IDirectMusicWaveImpl_IDirectMusicObject_Release (LPDIRECTMUSICOBJECT iface);
extern HRESULT WINAPI IDirectMusicWaveImpl_IDirectMusicObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc);
extern HRESULT WINAPI IDirectMusicWaveImpl_IDirectMusicObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc);
extern HRESULT WINAPI IDirectMusicWaveImpl_IDirectMusicObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc);
/* IPersistStream: */
extern HRESULT WINAPI IDirectMusicWaveImpl_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject);
extern ULONG WINAPI IDirectMusicWaveImpl_IPersistStream_AddRef (LPPERSISTSTREAM iface);
extern ULONG WINAPI IDirectMusicWaveImpl_IPersistStream_Release (LPPERSISTSTREAM iface);
extern HRESULT WINAPI IDirectMusicWaveImpl_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID);
extern HRESULT WINAPI IDirectMusicWaveImpl_IPersistStream_IsDirty (LPPERSISTSTREAM iface);
extern HRESULT WINAPI IDirectMusicWaveImpl_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm);
extern HRESULT WINAPI IDirectMusicWaveImpl_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty);
extern HRESULT WINAPI IDirectMusicWaveImpl_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize);
/*****************************************************************************
* Misc.
*/
/* for simpler reading */
typedef struct _DMUS_PRIVATE_CHUNK {
FOURCC fccID; /* FOURCC ID of the chunk */
DWORD dwSize; /* size of the chunk */
} DMUS_PRIVATE_CHUNK, *LPDMUS_PRIVATE_CHUNK;
/* check whether the given DWORD is even (return 0) or odd (return 1) */
static inline int even_or_odd (DWORD number) {
return (number & 0x1); /* basically, check if bit 0 is set ;) */
}
/* FOURCC to string conversion for debug messages */
static inline const char *debugstr_fourcc (DWORD fourcc) {
if (!fourcc) return "'null'";
return wine_dbg_sprintf ("\'%c%c%c%c\'",
(char)(fourcc), (char)(fourcc >> 8),
(char)(fourcc >> 16), (char)(fourcc >> 24));
}
/* DMUS_VERSION struct to string conversion for debug messages */
static inline const char *debugstr_dmversion (LPDMUS_VERSION version) {
if (!version) return "'null'";
return wine_dbg_sprintf ("\'%i,%i,%i,%i\'",
(int)((version->dwVersionMS && 0xFFFF0000) >> 8), (int)(version->dwVersionMS && 0x0000FFFF),
(int)((version->dwVersionLS && 0xFFFF0000) >> 8), (int)(version->dwVersionLS && 0x0000FFFF));
}
/* used for initialising structs (primarily for DMUS_OBJECTDESC) */
#define DM_STRUCT_INIT(x) \
do { \
memset((x), 0, sizeof(*(x))); \
(x)->dwSize = sizeof(*x); \
} while (0)
/* used for generic dumping (copied from ddraw) */
typedef struct {
DWORD val;
const char* name;
} flag_info;
#define FE(x) { x, #x }
#define DMUSIC_dump_flags(flags,names,num_names) DMUSIC_dump_flags_(flags, names, num_names, 1)
/* generic dump function */
static inline void DMUSIC_dump_flags_ (DWORD flags, const flag_info* names, size_t num_names, int newline) {
unsigned int i;
for (i=0; i < num_names; i++) {
if ((flags & names[i].val) || /* standard flag value */
((!flags) && (!names[i].val))) /* zero value only */
DPRINTF("%s ", names[i].name);
}
if (newline) DPRINTF("\n");
}
static inline void DMUSIC_dump_DMUS_OBJ_FLAGS (DWORD flagmask) {
static const flag_info flags[] = {
FE(DMUS_OBJ_OBJECT),
FE(DMUS_OBJ_CLASS),
FE(DMUS_OBJ_NAME),
FE(DMUS_OBJ_CATEGORY),
FE(DMUS_OBJ_FILENAME),
FE(DMUS_OBJ_FULLPATH),
FE(DMUS_OBJ_URL),
FE(DMUS_OBJ_VERSION),
FE(DMUS_OBJ_DATE),
FE(DMUS_OBJ_LOADED),
FE(DMUS_OBJ_MEMORY),
FE(DMUS_OBJ_STREAM)
};
DMUSIC_dump_flags(flagmask, flags, sizeof(flags)/sizeof(flags[0]));
}
static inline void DMUSIC_dump_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) {
if (pDesc) {
DPRINTF("DMUS_OBJECTDESC (%p)\n", pDesc);
DPRINTF(" - dwSize = %ld\n", pDesc->dwSize);
DPRINTF(" - dwValidData = ");
DMUSIC_dump_DMUS_OBJ_FLAGS (pDesc->dwValidData);
if (pDesc->dwValidData & DMUS_OBJ_CLASS) DPRINTF(" - guidClass = %s\n", debugstr_guid(&pDesc->guidClass));
if (pDesc->dwValidData & DMUS_OBJ_OBJECT) DPRINTF(" - guidObject = %s\n", debugstr_guid(&pDesc->guidObject));
if (pDesc->dwValidData & DMUS_OBJ_DATE) DPRINTF(" - ftDate = FIXME\n");
if (pDesc->dwValidData & DMUS_OBJ_VERSION) DPRINTF(" - vVersion = %s\n", debugstr_dmversion(&pDesc->vVersion));
if (pDesc->dwValidData & DMUS_OBJ_NAME) DPRINTF(" - wszName = %s\n", debugstr_w(pDesc->wszName));
if (pDesc->dwValidData & DMUS_OBJ_CATEGORY) DPRINTF(" - wszCategory = %s\n", debugstr_w(pDesc->wszCategory));
if (pDesc->dwValidData & DMUS_OBJ_FILENAME) DPRINTF(" - wszFileName = %s\n", debugstr_w(pDesc->wszFileName));
if (pDesc->dwValidData & DMUS_OBJ_MEMORY) DPRINTF(" - llMemLength = %lli\n - pbMemData = %p\n", pDesc->llMemLength, pDesc->pbMemData);
if (pDesc->dwValidData & DMUS_OBJ_STREAM) DPRINTF(" - pStream = %p\n", pDesc->pStream);
} else {
DPRINTF("(NULL)\n");
}
}
#endif /* __WINE_DSWAVE_PRIVATE_H */

525
dlls/dswave/regsvr.c Normal file
View File

@ -0,0 +1,525 @@
/*
* self-registerable dll functions for dmusic.dll
*
* Copyright (C) 2003 John K. Hohm
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "dswave_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dswave);
/*
* Near the bottom of this file are the exported DllRegisterServer and
* DllUnregisterServer, which make all this worthwhile.
*/
/***********************************************************************
* interface for self-registering
*/
struct regsvr_interface {
IID const *iid; /* NULL for end of list */
LPCSTR name; /* can be NULL to omit */
IID const *base_iid; /* can be NULL to omit */
int num_methods; /* can be <0 to omit */
CLSID const *ps_clsid; /* can be NULL to omit */
CLSID const *ps_clsid32; /* can be NULL to omit */
};
static HRESULT register_interfaces(struct regsvr_interface const *list);
static HRESULT unregister_interfaces(struct regsvr_interface const *list);
struct regsvr_coclass {
CLSID const *clsid; /* NULL for end of list */
LPCSTR name; /* can be NULL to omit */
LPCSTR ips; /* can be NULL to omit */
LPCSTR ips32; /* can be NULL to omit */
LPCSTR ips32_tmodel; /* can be NULL to omit */
LPCSTR progid; /* can be NULL to omit */
LPCSTR viprogid; /* can be NULL to omit */
LPCSTR progid_extra; /* can be NULL to omit */
};
static HRESULT register_coclasses(struct regsvr_coclass const *list);
static HRESULT unregister_coclasses(struct regsvr_coclass const *list);
/***********************************************************************
* static string constants
*/
static WCHAR const interface_keyname[10] = {
'I', 'n', 't', 'e', 'r', 'f', 'a', 'c', 'e', 0 };
static WCHAR const base_ifa_keyname[14] = {
'B', 'a', 's', 'e', 'I', 'n', 't', 'e', 'r', 'f', 'a', 'c',
'e', 0 };
static WCHAR const num_methods_keyname[11] = {
'N', 'u', 'm', 'M', 'e', 't', 'h', 'o', 'd', 's', 0 };
static WCHAR const ps_clsid_keyname[15] = {
'P', 'r', 'o', 'x', 'y', 'S', 't', 'u', 'b', 'C', 'l', 's',
'i', 'd', 0 };
static WCHAR const ps_clsid32_keyname[17] = {
'P', 'r', 'o', 'x', 'y', 'S', 't', 'u', 'b', 'C', 'l', 's',
'i', 'd', '3', '2', 0 };
static WCHAR const clsid_keyname[6] = {
'C', 'L', 'S', 'I', 'D', 0 };
static WCHAR const curver_keyname[7] = {
'C', 'u', 'r', 'V', 'e', 'r', 0 };
static WCHAR const ips_keyname[13] = {
'I', 'n', 'P', 'r', 'o', 'c', 'S', 'e', 'r', 'v', 'e', 'r',
0 };
static WCHAR const ips32_keyname[15] = {
'I', 'n', 'P', 'r', 'o', 'c', 'S', 'e', 'r', 'v', 'e', 'r',
'3', '2', 0 };
static WCHAR const progid_keyname[7] = {
'P', 'r', 'o', 'g', 'I', 'D', 0 };
static WCHAR const viprogid_keyname[25] = {
'V', 'e', 'r', 's', 'i', 'o', 'n', 'I', 'n', 'd', 'e', 'p',
'e', 'n', 'd', 'e', 'n', 't', 'P', 'r', 'o', 'g', 'I', 'D',
0 };
static char const tmodel_valuename[] = "ThreadingModel";
/***********************************************************************
* static helper functions
*/
static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid);
static LONG register_key_defvalueW(HKEY base, WCHAR const *name,
WCHAR const *value);
static LONG register_key_defvalueA(HKEY base, WCHAR const *name,
char const *value);
static LONG register_progid(WCHAR const *clsid,
char const *progid, char const *curver_progid,
char const *name, char const *extra);
static LONG recursive_delete_key(HKEY key);
static LONG recursive_delete_keyA(HKEY base, char const *name);
static LONG recursive_delete_keyW(HKEY base, WCHAR const *name);
/***********************************************************************
* register_interfaces
*/
static HRESULT register_interfaces(struct regsvr_interface const *list) {
LONG res = ERROR_SUCCESS;
HKEY interface_key;
res = RegCreateKeyExW(HKEY_CLASSES_ROOT, interface_keyname, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &interface_key, NULL);
if (res != ERROR_SUCCESS) goto error_return;
for (; res == ERROR_SUCCESS && list->iid; ++list) {
WCHAR buf[39];
HKEY iid_key;
StringFromGUID2(list->iid, buf, 39);
res = RegCreateKeyExW(interface_key, buf, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &iid_key, NULL);
if (res != ERROR_SUCCESS) goto error_close_interface_key;
if (list->name) {
res = RegSetValueExA(iid_key, NULL, 0, REG_SZ,
(CONST BYTE*)(list->name),
strlen(list->name) + 1);
if (res != ERROR_SUCCESS) goto error_close_iid_key;
}
if (list->base_iid) {
register_key_guid(iid_key, base_ifa_keyname, list->base_iid);
if (res != ERROR_SUCCESS) goto error_close_iid_key;
}
if (0 <= list->num_methods) {
static WCHAR const fmt[3] = { '%', 'd', 0 };
HKEY key;
res = RegCreateKeyExW(iid_key, num_methods_keyname, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &key, NULL);
if (res != ERROR_SUCCESS) goto error_close_iid_key;
wsprintfW(buf, fmt, list->num_methods);
res = RegSetValueExW(key, NULL, 0, REG_SZ,
(CONST BYTE*)buf,
(lstrlenW(buf) + 1) * sizeof(WCHAR));
RegCloseKey(key);
if (res != ERROR_SUCCESS) goto error_close_iid_key;
}
if (list->ps_clsid) {
register_key_guid(iid_key, ps_clsid_keyname, list->ps_clsid);
if (res != ERROR_SUCCESS) goto error_close_iid_key;
}
if (list->ps_clsid32) {
register_key_guid(iid_key, ps_clsid32_keyname, list->ps_clsid32);
if (res != ERROR_SUCCESS) goto error_close_iid_key;
}
error_close_iid_key:
RegCloseKey(iid_key);
}
error_close_interface_key:
RegCloseKey(interface_key);
error_return:
return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
}
/***********************************************************************
* unregister_interfaces
*/
static HRESULT unregister_interfaces(struct regsvr_interface const *list) {
LONG res = ERROR_SUCCESS;
HKEY interface_key;
res = RegOpenKeyExW(HKEY_CLASSES_ROOT, interface_keyname, 0,
KEY_READ | KEY_WRITE, &interface_key);
if (res == ERROR_FILE_NOT_FOUND) return S_OK;
if (res != ERROR_SUCCESS) goto error_return;
for (; res == ERROR_SUCCESS && list->iid; ++list) {
WCHAR buf[39];
StringFromGUID2(list->iid, buf, 39);
res = recursive_delete_keyW(interface_key, buf);
}
RegCloseKey(interface_key);
error_return:
return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
}
/***********************************************************************
* register_coclasses
*/
static HRESULT register_coclasses(struct regsvr_coclass const *list) {
LONG res = ERROR_SUCCESS;
HKEY coclass_key;
res = RegCreateKeyExW(HKEY_CLASSES_ROOT, clsid_keyname, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &coclass_key, NULL);
if (res != ERROR_SUCCESS) goto error_return;
for (; res == ERROR_SUCCESS && list->clsid; ++list) {
WCHAR buf[39];
HKEY clsid_key;
StringFromGUID2(list->clsid, buf, 39);
res = RegCreateKeyExW(coclass_key, buf, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &clsid_key, NULL);
if (res != ERROR_SUCCESS) goto error_close_coclass_key;
if (list->name) {
res = RegSetValueExA(clsid_key, NULL, 0, REG_SZ,
(CONST BYTE*)(list->name),
strlen(list->name) + 1);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
}
if (list->ips) {
res = register_key_defvalueA(clsid_key, ips_keyname, list->ips);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
}
if (list->ips32) {
HKEY ips32_key;
res = RegCreateKeyExW(clsid_key, ips32_keyname, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL,
&ips32_key, NULL);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
res = RegSetValueExA(ips32_key, NULL, 0, REG_SZ,
(CONST BYTE*)list->ips32,
lstrlenA(list->ips32) + 1);
if (res == ERROR_SUCCESS && list->ips32_tmodel)
res = RegSetValueExA(ips32_key, tmodel_valuename, 0, REG_SZ,
(CONST BYTE*)list->ips32_tmodel,
strlen(list->ips32_tmodel) + 1);
RegCloseKey(ips32_key);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
}
if (list->progid) {
res = register_key_defvalueA(clsid_key, progid_keyname,
list->progid);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
res = register_progid(buf, list->progid, NULL,
list->name, list->progid_extra);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
}
if (list->viprogid) {
res = register_key_defvalueA(clsid_key, viprogid_keyname,
list->viprogid);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
res = register_progid(buf, list->viprogid, list->progid,
list->name, list->progid_extra);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
}
error_close_clsid_key:
RegCloseKey(clsid_key);
}
error_close_coclass_key:
RegCloseKey(coclass_key);
error_return:
return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
}
/***********************************************************************
* unregister_coclasses
*/
static HRESULT unregister_coclasses(struct regsvr_coclass const *list) {
LONG res = ERROR_SUCCESS;
HKEY coclass_key;
res = RegOpenKeyExW(HKEY_CLASSES_ROOT, clsid_keyname, 0,
KEY_READ | KEY_WRITE, &coclass_key);
if (res == ERROR_FILE_NOT_FOUND) return S_OK;
if (res != ERROR_SUCCESS) goto error_return;
for (; res == ERROR_SUCCESS && list->clsid; ++list) {
WCHAR buf[39];
StringFromGUID2(list->clsid, buf, 39);
res = recursive_delete_keyW(coclass_key, buf);
if (res != ERROR_SUCCESS) goto error_close_coclass_key;
if (list->progid) {
res = recursive_delete_keyA(HKEY_CLASSES_ROOT, list->progid);
if (res != ERROR_SUCCESS) goto error_close_coclass_key;
}
if (list->viprogid) {
res = recursive_delete_keyA(HKEY_CLASSES_ROOT, list->viprogid);
if (res != ERROR_SUCCESS) goto error_close_coclass_key;
}
}
error_close_coclass_key:
RegCloseKey(coclass_key);
error_return:
return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
}
/***********************************************************************
* regsvr_key_guid
*/
static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid) {
WCHAR buf[39];
StringFromGUID2(guid, buf, 39);
return register_key_defvalueW(base, name, buf);
}
/***********************************************************************
* regsvr_key_defvalueW
*/
static LONG register_key_defvalueW(
HKEY base,
WCHAR const *name,
WCHAR const *value) {
LONG res;
HKEY key;
res = RegCreateKeyExW(base, name, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &key, NULL);
if (res != ERROR_SUCCESS) return res;
res = RegSetValueExW(key, NULL, 0, REG_SZ, (CONST BYTE*)value,
(lstrlenW(value) + 1) * sizeof(WCHAR));
RegCloseKey(key);
return res;
}
/***********************************************************************
* regsvr_key_defvalueA
*/
static LONG register_key_defvalueA(
HKEY base,
WCHAR const *name,
char const *value) {
LONG res;
HKEY key;
res = RegCreateKeyExW(base, name, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &key, NULL);
if (res != ERROR_SUCCESS) return res;
res = RegSetValueExA(key, NULL, 0, REG_SZ, (CONST BYTE*)value,
lstrlenA(value) + 1);
RegCloseKey(key);
return res;
}
/***********************************************************************
* regsvr_progid
*/
static LONG register_progid(
WCHAR const *clsid,
char const *progid,
char const *curver_progid,
char const *name,
char const *extra) {
LONG res;
HKEY progid_key;
res = RegCreateKeyExA(HKEY_CLASSES_ROOT, progid, 0,
NULL, 0, KEY_READ | KEY_WRITE, NULL,
&progid_key, NULL);
if (res != ERROR_SUCCESS) return res;
if (name) {
res = RegSetValueExA(progid_key, NULL, 0, REG_SZ,
(CONST BYTE*)name, strlen(name) + 1);
if (res != ERROR_SUCCESS) goto error_close_progid_key;
}
if (clsid) {
res = register_key_defvalueW(progid_key, clsid_keyname, clsid);
if (res != ERROR_SUCCESS) goto error_close_progid_key;
}
if (curver_progid) {
res = register_key_defvalueA(progid_key, curver_keyname,
curver_progid);
if (res != ERROR_SUCCESS) goto error_close_progid_key;
}
if (extra) {
HKEY extra_key;
res = RegCreateKeyExA(progid_key, extra, 0,
NULL, 0, KEY_READ | KEY_WRITE, NULL,
&extra_key, NULL);
if (res == ERROR_SUCCESS)
RegCloseKey(extra_key);
}
error_close_progid_key:
RegCloseKey(progid_key);
return res;
}
/***********************************************************************
* recursive_delete_key
*/
static LONG recursive_delete_key(HKEY key) {
LONG res;
WCHAR subkey_name[MAX_PATH];
DWORD cName;
HKEY subkey;
for (;;) {
cName = sizeof(subkey_name) / sizeof(WCHAR);
res = RegEnumKeyExW(key, 0, subkey_name, &cName,
NULL, NULL, NULL, NULL);
if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA) {
res = ERROR_SUCCESS; /* presumably we're done enumerating */
break;
}
res = RegOpenKeyExW(key, subkey_name, 0,
KEY_READ | KEY_WRITE, &subkey);
if (res == ERROR_FILE_NOT_FOUND) continue;
if (res != ERROR_SUCCESS) break;
res = recursive_delete_key(subkey);
RegCloseKey(subkey);
if (res != ERROR_SUCCESS) break;
}
if (res == ERROR_SUCCESS) res = RegDeleteKeyW(key, 0);
return res;
}
/***********************************************************************
* recursive_delete_keyA
*/
static LONG recursive_delete_keyA(HKEY base, char const *name) {
LONG res;
HKEY key;
res = RegOpenKeyExA(base, name, 0, KEY_READ | KEY_WRITE, &key);
if (res == ERROR_FILE_NOT_FOUND) return ERROR_SUCCESS;
if (res != ERROR_SUCCESS) return res;
res = recursive_delete_key(key);
RegCloseKey(key);
return res;
}
/***********************************************************************
* recursive_delete_keyW
*/
static LONG recursive_delete_keyW(HKEY base, WCHAR const *name) {
LONG res;
HKEY key;
res = RegOpenKeyExW(base, name, 0, KEY_READ | KEY_WRITE, &key);
if (res == ERROR_FILE_NOT_FOUND) return ERROR_SUCCESS;
if (res != ERROR_SUCCESS) return res;
res = recursive_delete_key(key);
RegCloseKey(key);
return res;
}
/***********************************************************************
* coclass list
*/
static struct regsvr_coclass const coclass_list[] = {
{ &CLSID_DirectSoundWave,
"Microsoft DirectSound Wave",
NULL,
"dswave.dll",
"Both",
"Microsoft.DirectSoundWave.1",
"Microsoft.DirectSoundWave"
},
{ NULL } /* list terminator */
};
/***********************************************************************
* interface list
*/
static struct regsvr_interface const interface_list[] = {
{ NULL } /* list terminator */
};
/***********************************************************************
* DllRegisterServer (DSWAVE.3)
*/
HRESULT WINAPI DSWAVE_DllRegisterServer(void) {
HRESULT hr;
TRACE("\n");
hr = register_coclasses(coclass_list);
if (SUCCEEDED(hr))
hr = register_interfaces(interface_list);
return hr;
}
/***********************************************************************
* DllUnregisterServer (DSWAVE.4)
*/
HRESULT WINAPI DSWAVE_DllUnregisterServer(void) {
HRESULT hr;
TRACE("\n");
hr = unregister_coclasses(coclass_list);
if (SUCCEEDED(hr))
hr = unregister_interfaces(interface_list);
return hr;
}

28
dlls/dswave/version.rc Normal file
View File

@ -0,0 +1,28 @@
/*
* Copyright (C) 2003-2004 Rok Mandeljc <rok.mandeljc@gimb.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#define WINE_OLESELFREGISTER
#define WINE_FILEDESCRIPTION_STR "Wine DirectMusic Wave"
#define WINE_FILENAME_STR "dswave.dll"
#define WINE_FILEVERSION 4,9,0,900
#define WINE_FILEVERSION_STR "4.9.0.900"
#define WINE_PRODUCTVERSION 4,9,0,900
#define WINE_PRODUCTVERSION_STR "4.9"
#define WINE_PRODUCTNAME_STR "DirectX"
#include "wine/wine_common_ver.rc"

View File

@ -63,6 +63,7 @@ WINDOWS_INCLUDES = \
dispdib.h \
dlgs.h \
dls1.h \
dls2.h \
dmdls.h \
dmerror.h \
dmo.h \

View File

@ -1,6 +1,6 @@
/* Defines and Structures for Instrument Collection Form RIFF DLS
/* Defines and Structures for Instrument Collection Form RIFF DLS1
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -16,12 +16,12 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __WINE_INCLUDE_DLS1_H
#define __WINE_INCLUDE_DLS1_H
/*****************************************************************************
* FOURCC's
* FOURCCs
*/
#define FOURCC_DLS mmioFOURCC('D','L','S',' ')
#define FOURCC_DLID mmioFOURCC('d','l','i','d')
@ -43,149 +43,160 @@
#define FOURCC_VERS mmioFOURCC('v','e','r','s')
/*****************************************************************************
* Definitions
* Flags
*/
#define CONN_SRC_NONE 0x0000
#define CONN_SRC_LFO 0x0001
#define CONN_SRC_KEYONVELOCITY 0x0002
#define CONN_SRC_KEYNUMBER 0x0003
#define CONN_SRC_EG1 0x0004
#define CONN_SRC_EG2 0x0005
#define CONN_SRC_PITCHWHEEL 0x0006
#define CONN_SRC_CC1 0x0081
#define CONN_SRC_CC7 0x0087
#define CONN_SRC_CC10 0x008a
#define CONN_SRC_CC11 0x008b
#define CONN_DST_NONE 0x0000
#define CONN_DST_ATTENUATION 0x0001
#define CONN_DST_PITCH 0x0003
#define CONN_DST_PAN 0x0004
#define CONN_DST_LFO_FREQUENCY 0x0104
#define CONN_DST_LFO_STARTDELAY 0x0105
#define CONN_DST_EG1_ATTACKTIME 0x0206
#define CONN_DST_EG1_DECAYTIME 0x0207
#define CONN_DST_EG1_RELEASETIME 0x0209
#define CONN_DST_EG1_SUSTAINLEVEL 0x020a
#define CONN_DST_EG2_ATTACKTIME 0x030a
#define CONN_DST_EG2_DECAYTIME 0x030b
#define CONN_DST_EG2_RELEASETIME 0x030d
#define CONN_DST_EG2_SUSTAINLEVEL 0x030e
#define CONN_DST_NONE 0x000
#define CONN_DST_ATTENUATION 0x001
#define CONN_DST_PITCH 0x003
#define CONN_DST_PAN 0x004
#define CONN_TRN_NONE 0x0000
#define CONN_TRN_CONCAVE 0x0001
#define CONN_DST_LFO_FREQUENCY 0x104
#define CONN_DST_LFO_STARTDELAY 0x105
#define F_INSTRUMENT_DRUMS 0x80000000
#define F_RGN_OPTION_SELFNONEXCLUSIVE 0x0001
#define CONN_DST_EG1_ATTACKTIME 0x206
#define CONN_DST_EG1_DECAYTIME 0x207
#define CONN_DST_EG1_RELEASETIME 0x209
#define CONN_DST_EG1_SUSTAINLEVEL 0x20A
#define WAVELINK_CHANNEL_LEFT 0x0001l
#define WAVELINK_CHANNEL_RIGHT 0x0002l
#define CONN_DST_EG2_ATTACKTIME 0x30A
#define CONN_DST_EG2_DECAYTIME 0x30B
#define CONN_DST_EG2_RELEASETIME 0x30D
#define CONN_DST_EG2_SUSTAINLEVEL 0x30E
#define F_WAVELINK_PHASE_MASTER 0x0001
#define POOL_CUE_NULL 0xffffffffl
#define CONN_SRC_NONE 0x000
#define CONN_SRC_LFO 0x001
#define CONN_SRC_KEYONVELOCITY 0x002
#define CONN_SRC_KEYNUMBER 0x003
#define CONN_SRC_EG1 0x004
#define CONN_SRC_EG2 0x005
#define CONN_SRC_PITCHWHEEL 0x006
#define F_WSMP_NO_TRUNCATION 0x0001l
#define F_WSMP_NO_COMPRESSION 0x0002l
#define WLOOP_TYPE_FORWARD 0
#define CONN_SRC_CC1 0x081
#define CONN_SRC_CC7 0x087
#define CONN_SRC_CC10 0x08A
#define CONN_SRC_CC11 0x08B
#define CONN_TRN_NONE 0x000
#define CONN_TRN_CONCAVE 0x001
#define F_INSTRUMENT_DRUMS 0x80000000
#define F_RGN_OPTION_SELFNONEXCLUSIVE 0x1
#define F_WAVELINK_PHASE_MASTER 0x1
#define F_WSMP_NO_TRUNCATION 0x1
#define F_WSMP_NO_COMPRESSION 0x2
#define POOL_CUE_NULL 0xFFFFFFFF
#define WAVELINK_CHANNEL_LEFT 0x1
#define WAVELINK_CHANNEL_RIGHT 0x2
#define WLOOP_TYPE_FORWARD 0x0
/*****************************************************************************
* Structures
*/
typedef struct _DLSID
{
ULONG ulData1;
USHORT usData2;
USHORT usData3;
BYTE abData4[8];
} DLSID, *LPDLSID;
/* typedef definitions */
typedef struct _DLSID DLSID, *LPDLSID;
typedef struct _DLSVERSION DLSVERSION, *LPDLSVERSION;
typedef struct _CONNECTION CONNECTION, *LPCONNECTION;
typedef struct _CONNECTIONLIST CONNECTIONLIST, *LPCONNECTIONLIST;
typedef struct _RGNRANGE RGNRANGE, *LPRGNRANGE;
typedef struct _MIDILOCALE MIDILOCALE, *LPMIDILOCALE;
typedef struct _RGNHEADER RGNHEADER, *LPRGNHEADER;
typedef struct _INSTHEADER INSTHEADER, *LPINSTHEADER;
typedef struct _DLSHEADER DLSHEADER, *LPDLSHEADER;
typedef struct _WAVELINK WAVELINK, *LPWAVELINK;
typedef struct _POOLCUE POOLCUE, *LPPOOLCUE;
typedef struct _POOLTABLE POOLTABLE, *LPPOOLTABLE;
typedef struct _rwsmp WSMPL, *LPWSMPL;
typedef struct _rloop WLOOP, *LPWLOOP;
typedef struct _DLSVERSION
{ DWORD dwVersionMS;
DWORD dwVersionLS;
} DLSVERSION, *LPDLSVERSION;
typedef struct _CONNECTION
{
USHORT usSource;
USHORT usControl;
USHORT usDestination;
USHORT usTransform;
LONG lScale;
} CONNECTION, *LPCONNECTION;
/* actual structures */
struct _DLSID {
ULONG ulData1;
USHORT usData2;
USHORT usData3;
BYTE abData4[8];
};
typedef struct _CONNECTIONLIST
{
ULONG cbSize;
ULONG cConnections;
} CONNECTIONLIST, *LPCONNECTIONLIST;
struct _DLSVERSION {
DWORD dwVersionMS;
DWORD dwVersionLS;
};
typedef struct _RGNRANGE
{
USHORT usLow;
USHORT usHigh;
} RGNRANGE, *LPRGNRANGE;
struct _CONNECTION {
USHORT usSource;
USHORT usControl;
USHORT usDestination;
USHORT usTransform;
LONG lScale;
};
typedef struct _MIDILOCALE
{
ULONG ulBank;
ULONG ulInstrument;
} MIDILOCALE, *LPMIDILOCALE;
struct _CONNECTIONLIST {
ULONG cbSize;
ULONG cConnections;
};
typedef struct _RGNHEADER
{
RGNRANGE RangeKey;
RGNRANGE RangeVelocity;
USHORT fusOptions;
USHORT usKeyGroup;
} RGNHEADER, *LPRGNHEADER;
struct _RGNRANGE {
USHORT usLow;
USHORT usHigh;
};
typedef struct _INSTHEADER
{
ULONG cRegions;
MIDILOCALE Locale;
} INSTHEADER, *LPINSTHEADER;
struct _MIDILOCALE {
ULONG ulBank;
ULONG ulInstrument;
};
typedef struct _DLSHEADER
{
ULONG cInstruments;
} DLSHEADER, *LPDLSHEADER;
struct _RGNHEADER {
RGNRANGE RangeKey;
RGNRANGE RangeVelocity;
USHORT fusOptions;
USHORT usKeyGroup;
};
typedef struct _WAVELINK
{
USHORT fusOptions;
USHORT usPhaseGroup;
ULONG ulChannel;
ULONG ulTableIndex;
} WAVELINK, *LPWAVELINK;
struct _INSTHEADER {
ULONG cRegions;
MIDILOCALE Locale;
};
typedef struct _POOLCUE
{
ULONG ulOffset;
} POOLCUE, *LPPOOLCUE;
struct _DLSHEADER {
ULONG cInstruments;
};
typedef struct _POOLTABLE
{
ULONG cbSize;
ULONG cCues;
} POOLTABLE, *LPPOOLTABLE;
struct _WAVELINK {
USHORT fusOptions;
USHORT usPhaseGroup;
ULONG ulChannel;
ULONG ulTableIndex;
};
typedef struct _rwsmp
{
ULONG cbSize;
USHORT usUnityNote;
SHORT sFineTune;
LONG lAttenuation;
ULONG fulOptions;
ULONG cSampleLoops;
} WSMPL, *LPWSMPL;
struct _POOLCUE {
ULONG ulOffset;
};
typedef struct _rloop
{
ULONG cbSize;
ULONG ulType;
ULONG ulStart;
ULONG ulLength;
} WLOOP, *LPWLOOP;
struct _POOLTABLE {
ULONG cbSize;
ULONG cCues;
};
struct _rwsmp {
ULONG cbSize;
USHORT usUnityNote;
SHORT sFineTune;
LONG lAttenuation;
ULONG fulOptions;
ULONG cSampleLoops;
};
struct _rloop {
ULONG cbSize;
ULONG ulType;
ULONG ulStart;
ULONG ulLength;
};
#endif /* __WINE_INCLUDE_DLS1_H */

107
include/dls2.h Normal file
View File

@ -0,0 +1,107 @@
/* Defines and Structures for Instrument Collection Form RIFF DLS2
*
* Copyright (C) 2003-2004 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.
*/
#ifndef __WINE_INCLUDE_DLS2_H
#define __WINE_INCLUDE_DLS2_H
/*****************************************************************************
* DLSIDs - property set
*/
DEFINE_GUID(DLSID_GMInHardware, 0x178f2f24,0xc364,0x11d1,0xa7,0x60,0x00,0x00,0xf8,0x75,0xac,0x12);
DEFINE_GUID(DLSID_GSInHardware, 0x178f2f25,0xc364,0x11d1,0xa7,0x60,0x00,0x00,0xf8,0x75,0xac,0x12);
DEFINE_GUID(DLSID_ManufacturersID, 0xb03e1181,0x8095,0x11d2,0xa1,0xef,0x00,0x60,0x08,0x33,0xdb,0xd8);
DEFINE_GUID(DLSID_ProductID, 0xb03e1182,0x8095,0x11d2,0xa1,0xef,0x00,0x60,0x08,0x33,0xdb,0xd8);
DEFINE_GUID(DLSID_SampleMemorySize, 0x178f2f28,0xc364,0x11d1,0xa7,0x60,0x00,0x00,0xf8,0x75,0xac,0x12);
DEFINE_GUID(DLSID_SupportsDLS1, 0x178f2f27,0xc364,0x11d1,0xa7,0x60,0x00,0x00,0xf8,0x75,0xac,0x12);
DEFINE_GUID(DLSID_SupportsDLS2, 0xf14599e5,0x4689,0x11d2,0xaf,0xa6,0x00,0xaa,0x00,0x24,0xd8,0xb6);
DEFINE_GUID(DLSID_SamplePlaybackRate, 0x2a91f713,0xa4bf,0x11d2,0xbb,0xdf,0x00,0x60,0x08,0x33,0xdb,0xd8);
DEFINE_GUID(DLSID_XGInHardware, 0x178f2f26,0xc364,0x11d1,0xa7,0x60,0x00,0x00,0xf8,0x75,0xac,0x12);
/*****************************************************************************
* FOURCCs
*/
#define FOURCC_RGN2 mmioFOURCC('r','g','n','2')
#define FOURCC_LAR2 mmioFOURCC('l','a','r','2')
#define FOURCC_ART2 mmioFOURCC('a','r','t','2')
#define FOURCC_CDL mmioFOURCC('c','d','l',' ')
#define FOURCC_DLID mmioFOURCC('d','l','i','d')
/*****************************************************************************
* Flags
*/
#define CONN_DST_GAIN 0x001
#define CONN_DST_KEYNUMBER 0x005
#define CONN_DST_LEFT 0x010
#define CONN_DST_RIGHT 0x011
#define CONN_DST_CENTER 0x012
#define CONN_DST_LEFTREAR 0x013
#define CONN_DST_RIGHTREAR 0x014
#define CONN_DST_LFE_CHANNEL 0x015
#define CONN_DST_CHORUS 0x080
#define CONN_DST_REVERB 0x081
#define CONN_DST_VIB_FREQUENCY 0x114
#define CONN_DST_VIB_STARTDELAY 0x115
#define CONN_DST_EG1_DELAYTIME 0x20B
#define CONN_DST_EG1_HOLDTIME 0x20C
#define CONN_DST_EG1_SHUTDOWNTIME 0x20D
#define CONN_DST_EG2_DELAYTIME 0x30F
#define CONN_DST_EG2_HOLDTIME 0x310
#define CONN_DST_FILTER_CUTOFF 0x500
#define CONN_DST_FILTER_Q 0x501
#define CONN_SRC_POLYPRESSURE 0x007
#define CONN_SRC_CHANNELPRESSURE 0x008
#define CONN_SRC_VIBRATO 0x009
#define CONN_SRC_MONOPRESSURE 0x00A
#define CONN_SRC_CC91 0x0DB
#define CONN_SRC_CC93 0x0DD
#define CONN_TRN_CONVEX 0x002
#define CONN_TRN_SWITCH 0x003
#define DLS_CDL_AND 0x01
#define DLS_CDL_OR 0x02
#define DLS_CDL_XOR 0x03
#define DLS_CDL_ADD 0x04
#define DLS_CDL_SUBTRACT 0x05
#define DLS_CDL_MULTIPLY 0x06
#define DLS_CDL_DIVIDE 0x07
#define DLS_CDL_LOGICAL_AND 0x08
#define DLS_CDL_LOGICAL_OR 0x09
#define DLS_CDL_LT 0x0A
#define DLS_CDL_LE 0x0B
#define DLS_CDL_GT 0x0C
#define DLS_CDL_GE 0x0D
#define DLS_CDL_EQ 0x0E
#define DLS_CDL_NOT 0x0F
#define DLS_CDL_CONST 0x10
#define DLS_CDL_QUERY 0x11
#define DLS_CDL_QUERYSUPPORTED 0x12
#define F_WAVELINK_MULTICHANNEL 0x2
#define WLOOP_TYPE_RELEASE 0x1
#endif /* __WINE_INCLUDE_DLS2_H */

View File

@ -1,6 +1,6 @@
/* DirectMusic DLS Download Definitions
*
* Copyright (C) 2003 Rok Mandeljc
* Copyright (C) 2003-2004 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
@ -16,182 +16,194 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __WINE_DMUSIC_DLS_H
#define __WINE_DMUSIC_DLS_H
#include <dls1.h>
typedef long PCENT, GCENT, TCENT, PERCENT;
/*****************************************************************************
* Typedef definitions
*/
typedef long GCENT;
typedef long PCENT;
typedef long PERCENT;
typedef long TCENT;
typedef LONGLONG REFERENCE_TIME, *LPREFERENCE_TIME;
/*
#ifndef MAKE_FOURCC
#define MAKEFOURCC(ch0, ch1, ch2, ch3) \
((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \
((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))
typedef DWORD FOURCC;
#endif*/
/*****************************************************************************
* Definitions
* FOURCC definition
*/
#define DMUS_DOWNLOADINFO_INSTRUMENT 1
#define DMUS_DOWNLOADINFO_WAVE 2
#define DMUS_DOWNLOADINFO_INSTRUMENT2 3
#define DMUS_DOWNLOADINFO_WAVEARTICULATION 4
#define DMUS_DOWNLOADINFO_STREAMINGWAVE 5
#define DMUS_DOWNLOADINFO_ONESHOTWAVE 6
#ifndef mmioFOURCC
typedef DWORD FOURCC;
#define mmioFOURCC(ch0,ch1,ch2,ch3) \
((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \
((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))
#endif
#define DMUS_DEFAULT_SIZE_OFFSETTABLE 1
#define DMUS_INSTRUMENT_GM_INSTRUMENT (1 << 0)
/*****************************************************************************
* Flags
*/
#define DMUS_DEFAULT_SIZE_OFFSETTABLE 0x1
#define DMUS_MIN_DATA_SIZE 4
#define DMUS_DOWNLOADINFO_INSTRUMENT 0x1
#define DMUS_DOWNLOADINFO_WAVE 0x2
#define DMUS_DOWNLOADINFO_INSTRUMENT2 0x3
#define DMUS_DOWNLOADINFO_WAVEARTICULATION 0x4
#define DMUS_DOWNLOADINFO_STREAMINGWAVE 0x5
#define DMUS_DOWNLOADINFO_ONESHOTWAVE 0x6
#define DMUS_INSTRUMENT_GM_INSTRUMENT 0x1
#define DMUS_MIN_DATA_SIZE 0x4
/*****************************************************************************
* Structures
*/
typedef struct _DMUS_DOWNLOADINFO
{
DWORD dwDLType;
DWORD dwDLId;
DWORD dwNumOffsetTableEntries;
DWORD cbSize;
} DMUS_DOWNLOADINFO;
/* typedef definitions */
typedef struct _DMUS_DOWNLOADINFO DMUS_DOWNLOADINFO, *LPDMUS_DOWNLOADINFO;
typedef struct _DMUS_OFFSETTABLE DMUS_OFFSETTABLE, *LPDMUS_OFFSETTABLE;
typedef struct _DMUS_INSTRUMENT DMUS_INSTRUMENT, *LPDMUS_INSTRUMENT;
typedef struct _DMUS_REGION DMUS_REGION, *LPDMUS_REGION;
typedef struct _DMUS_LFOPARAMS DMUS_LFOPARAMS, *LPDMUS_LFOPARAMS;
typedef struct _DMUS_VEGPARAMS DMUS_VEGPARAMS, *LPDMUS_VEGPARAMS;
typedef struct _DMUS_PEGPARAMS DMUS_PEGPARAMS, *LPDMUS_PEGPARAMS;
typedef struct _DMUS_MSCPARAMS DMUS_MSCPARAMS, *LPDMUS_MSCPARAMS;
typedef struct _DMUS_ARTICPARAMS DMUS_ARTICPARAMS, *LPDMUS_ARTICPARAMS;
typedef struct _DMUS_ARTICULATION DMUS_ARTICULATION, *LPDMUS_ARTICULATION;
typedef struct _DMUS_ARTICULATION2 DMUS_ARTICULATION2, *LPDMUS_ARTICULATION2;
typedef struct _DMUS_EXTENSIONCHUNK DMUS_EXTENSIONCHUNK, *LPDMUS_EXTENSIONCHUNK;
typedef struct _DMUS_COPYRIGHT DMUS_COPYRIGHT, *LPDMUS_COPYRIGHT;
typedef struct _DMUS_WAVEDATA DMUS_WAVEDATA, *LPDMUS_WAVEDATA;
typedef struct _DMUS_WAVE DMUS_WAVE, *LPDMUS_WAVE;
typedef struct _DMUS_NOTERANGE DMUS_NOTERANGE, *LPDMUS_NOTERANGE;
typedef struct _DMUS_WAVEARTDL DMUS_WAVEARTDL, *LPDMUS_WAVEARTDL;
typedef struct _DMUS_WAVEDL DMUS_WAVEDL, *LPDMUS_WAVEDL;
typedef struct _DMUS_OFFSETTABLE
{
ULONG ulOffsetTable[DMUS_DEFAULT_SIZE_OFFSETTABLE];
} DMUS_OFFSETTABLE;
/* actual structures */
struct _DMUS_DOWNLOADINFO {
DWORD dwDLType;
DWORD dwDLId;
DWORD dwNumOffsetTableEntries;
DWORD cbSize;
};
typedef struct _DMUS_INSTRUMENT
{
ULONG ulPatch;
ULONG ulFirstRegionIdx;
ULONG ulGlobalArtIdx;
ULONG ulFirstExtCkIdx;
ULONG ulCopyrightIdx;
ULONG ulFlags;
} DMUS_INSTRUMENT;
struct _DMUS_OFFSETTABLE {
ULONG ulOffsetTable[DMUS_DEFAULT_SIZE_OFFSETTABLE];
};
typedef struct _DMUS_REGION
{
RGNRANGE RangeKey;
RGNRANGE RangeVelocity;
USHORT fusOptions;
USHORT usKeyGroup;
ULONG ulRegionArtIdx;
ULONG ulNextRegionIdx;
ULONG ulFirstExtCkIdx;
WAVELINK WaveLink;
WSMPL WSMP;
WLOOP WLOOP[1];
} DMUS_REGION;
struct _DMUS_INSTRUMENT {
ULONG ulPatch;
ULONG ulFirstRegionIdx;
ULONG ulGlobalArtIdx;
ULONG ulFirstExtCkIdx;
ULONG ulCopyrightIdx;
ULONG ulFlags;
};
typedef struct _DMUS_LFOPARAMS
{
PCENT pcFrequency;
TCENT tcDelay;
GCENT gcVolumeScale;
PCENT pcPitchScale;
GCENT gcMWToVolume;
PCENT pcMWToPitch;
} DMUS_LFOPARAMS;
struct _DMUS_REGION {
RGNRANGE RangeKey;
RGNRANGE RangeVelocity;
USHORT fusOptions;
USHORT usKeyGroup;
ULONG ulRegionArtIdx;
ULONG ulNextRegionIdx;
ULONG ulFirstExtCkIdx;
WAVELINK WaveLink;
WSMPL WSMP;
WLOOP WLOOP[1];
};
typedef struct _DMUS_VEGPARAMS
{
TCENT tcAttack;
TCENT tcDecay;
PERCENT ptSustain;
TCENT tcRelease;
TCENT tcVel2Attack;
TCENT tcKey2Decay;
} DMUS_VEGPARAMS;
struct _DMUS_LFOPARAMS {
PCENT pcFrequency;
TCENT tcDelay;
GCENT gcVolumeScale;
PCENT pcPitchScale;
GCENT gcMWToVolume;
PCENT pcMWToPitch;
};
typedef struct _DMUS_PEGPARAMS
{
TCENT tcAttack;
TCENT tcDecay;
PERCENT ptSustain;
TCENT tcRelease;
TCENT tcVel2Attack;
TCENT tcKey2Decay;
PCENT pcRange;
} DMUS_PEGPARAMS;
struct _DMUS_VEGPARAMS {
TCENT tcAttack;
TCENT tcDecay;
PERCENT ptSustain;
TCENT tcRelease;
TCENT tcVel2Attack;
TCENT tcKey2Decay;
};
typedef struct _DMUS_MSCPARAMS
{
PERCENT ptDefaultPan;
} DMUS_MSCPARAMS;
struct _DMUS_PEGPARAMS {
TCENT tcAttack;
TCENT tcDecay;
PERCENT ptSustain;
TCENT tcRelease;
TCENT tcVel2Attack;
TCENT tcKey2Decay;
PCENT pcRange;
};
typedef struct _DMUS_ARTICPARAMS
{
DMUS_LFOPARAMS LFO;
DMUS_VEGPARAMS VolEG;
DMUS_PEGPARAMS PitchEG;
DMUS_MSCPARAMS Misc;
} DMUS_ARTICPARAMS;
struct _DMUS_MSCPARAMS {
PERCENT ptDefaultPan;
};
typedef struct _DMUS_ARTICULATION
{
ULONG ulArt1Idx;
ULONG ulFirstExtCkIdx;
} DMUS_ARTICULATION;
struct _DMUS_ARTICPARAMS {
DMUS_LFOPARAMS LFO;
DMUS_VEGPARAMS VolEG;
DMUS_PEGPARAMS PitchEG;
DMUS_MSCPARAMS Misc;
};
typedef struct _DMUS_ARTICULATION2
{
ULONG ulArtIdx;
ULONG ulFirstExtCkIdx;
ULONG ulNextArtIdx;
} DMUS_ARTICULATION2;
struct _DMUS_ARTICULATION {
ULONG ulArt1Idx;
ULONG ulFirstExtCkIdx;
};
typedef struct _DMUS_EXTENSIONCHUNK
{
ULONG cbSize;
ULONG ulNextExtCkIdx;
FOURCC ExtCkID;
BYTE byExtCk[DMUS_MIN_DATA_SIZE];
} DMUS_EXTENSIONCHUNK;
struct _DMUS_ARTICULATION2 {
ULONG ulArtIdx;
ULONG ulFirstExtCkIdx;
ULONG ulNextArtIdx;
};
struct _DMUS_EXTENSIONCHUNK {
ULONG cbSize;
ULONG ulNextExtCkIdx;
FOURCC ExtCkID;
BYTE byExtCk[DMUS_MIN_DATA_SIZE];
};
typedef struct _DMUS_COPYRIGHT
{
ULONG cbSize;
BYTE byCopyright[DMUS_MIN_DATA_SIZE];
} DMUS_COPYRIGHT;
struct _DMUS_COPYRIGHT {
ULONG cbSize;
BYTE byCopyright[DMUS_MIN_DATA_SIZE];
};
typedef struct _DMUS_WAVEDATA
{
ULONG cbSize;
BYTE byData[DMUS_MIN_DATA_SIZE];
} DMUS_WAVEDATA;
struct _DMUS_WAVEDATA {
ULONG cbSize;
BYTE byData[DMUS_MIN_DATA_SIZE];
};
typedef struct _DMUS_WAVE
{
ULONG ulFirstExtCkIdx;
ULONG ulCopyrightIdx;
ULONG ulWaveDataIdx;
WAVEFORMATEX WaveformatEx;
} DMUS_WAVE;
struct _DMUS_WAVE {
ULONG ulFirstExtCkIdx;
ULONG ulCopyrightIdx;
ULONG ulWaveDataIdx;
WAVEFORMATEX WaveformatEx;
};
typedef struct _DMUS_NOTERANGE
{
DWORD dwLowNote;
DWORD dwHighNote;
} DMUS_NOTERANGE, *LPDMUS_NOTERANGE;
struct _DMUS_NOTERANGE {
DWORD dwLowNote;
DWORD dwHighNote;
};
typedef struct _DMUS_WAVEARTDL
{
ULONG ulDownloadIdIdx;
ULONG ulBus;
ULONG ulBuffers;
ULONG ulMasterDLId;
USHORT usOptions;
} DMUS_WAVEARTDL, *LPDMUS_WAVEARTDL;
struct _DMUS_WAVEARTDL {
ULONG ulDownloadIdIdx;
ULONG ulBus;
ULONG ulBuffers;
ULONG ulMasterDLId;
USHORT usOptions;
};
typedef struct _DMUS_WAVEDL
{
ULONG cbWaveData;
} DMUS_WAVEDL, *LPDMUS_WAVEDL;
struct _DMUS_WAVEDL {
ULONG cbWaveData;
};
#endif /* __WINE_DMUSIC_DLS_H */

Some files were not shown because too many files have changed in this diff Show More