diff --git a/configure b/configure index 313c7af5dbb..3d9c2094ae3 100755 --- a/configure +++ b/configure @@ -19070,7 +19070,7 @@ MAKE_LIB_RULES=libs/Makelib.rules MAKE_PROG_RULES=programs/Makeprog.rules - ac_config_files="$ac_config_files Make.rules dlls/Makedll.rules dlls/Maketest.rules libs/Makelib.rules programs/Makeprog.rules Makefile dlls/Makefile dlls/advapi32/Makefile dlls/advapi32/tests/Makefile dlls/avicap32/Makefile dlls/avifil32/Makefile dlls/cabinet/Makefile dlls/capi2032/Makefile dlls/cfgmgr32/Makefile dlls/comcat/Makefile dlls/comctl32/Makefile dlls/comctl32/tests/Makefile dlls/commdlg/Makefile dlls/crtdll/Makefile dlls/crypt32/Makefile dlls/ctl3d/Makefile dlls/wined3d/Makefile dlls/d3d8/Makefile dlls/d3d9/Makefile dlls/d3dim/Makefile dlls/d3dx8/Makefile dlls/dciman32/Makefile dlls/ddraw/Makefile dlls/ddraw/tests/Makefile dlls/devenum/Makefile dlls/dinput/Makefile dlls/dinput8/Makefile dlls/dmband/Makefile dlls/dmcompos/Makefile dlls/dmime/Makefile dlls/dmloader/Makefile dlls/dmscript/Makefile dlls/dmstyle/Makefile dlls/dmsynth/Makefile dlls/dmusic/Makefile dlls/dmusic32/Makefile dlls/dplay/Makefile dlls/dplayx/Makefile dlls/dpnhpast/Makefile dlls/dsound/Makefile dlls/dsound/tests/Makefile dlls/gdi/Makefile dlls/gdi/tests/Makefile dlls/glu32/Makefile dlls/glut32/Makefile dlls/iccvid/Makefile dlls/icmp/Makefile dlls/imagehlp/Makefile dlls/imm32/Makefile dlls/iphlpapi/Makefile dlls/iphlpapi/tests/Makefile dlls/kernel/Makefile dlls/kernel/tests/Makefile dlls/lzexpand/Makefile dlls/mapi32/Makefile dlls/mpr/Makefile dlls/msacm/Makefile dlls/msacm/imaadp32/Makefile dlls/msacm/msadp32/Makefile dlls/msacm/msg711/Makefile dlls/msacm/winemp3/Makefile dlls/msdmo/Makefile dlls/mshtml/Makefile dlls/msi/Makefile dlls/msimg32/Makefile dlls/msisys/Makefile dlls/msnet32/Makefile dlls/msvcrt/Makefile dlls/msvcrt/tests/Makefile dlls/msvcrt20/Makefile dlls/msvcrt40/Makefile dlls/msvcrtd/Makefile dlls/msvideo/Makefile dlls/msvideo/msrle32/Makefile dlls/mswsock/Makefile dlls/netapi32/Makefile dlls/netapi32/tests/Makefile dlls/newdev/Makefile dlls/ntdll/Makefile dlls/ntdll/tests/Makefile dlls/odbc32/Makefile dlls/ole32/Makefile dlls/oleacc/Makefile dlls/oleaut32/Makefile dlls/oleaut32/tests/Makefile dlls/olecli/Makefile dlls/oledlg/Makefile dlls/olepro32/Makefile dlls/olesvr/Makefile dlls/opengl32/Makefile dlls/psapi/Makefile dlls/qcap/Makefile dlls/quartz/Makefile dlls/rasapi32/Makefile dlls/richedit/Makefile dlls/rpcrt4/Makefile dlls/rpcrt4/tests/Makefile dlls/serialui/Makefile dlls/setupapi/Makefile dlls/shdocvw/Makefile dlls/shell32/Makefile dlls/shell32/tests/Makefile dlls/shfolder/Makefile dlls/shlwapi/Makefile dlls/shlwapi/tests/Makefile dlls/snmpapi/Makefile dlls/sti/Makefile dlls/tapi32/Makefile dlls/ttydrv/Makefile dlls/twain/Makefile dlls/unicows/Makefile dlls/url/Makefile dlls/urlmon/Makefile dlls/urlmon/tests/Makefile dlls/user/Makefile dlls/user/tests/Makefile dlls/uxtheme/Makefile dlls/version/Makefile dlls/win32s/Makefile dlls/winaspi/Makefile dlls/winedos/Makefile dlls/wineps/Makefile dlls/wininet/Makefile dlls/wininet/tests/Makefile dlls/winmm/Makefile dlls/winmm/joystick/Makefile dlls/winmm/mcianim/Makefile dlls/winmm/mciavi/Makefile dlls/winmm/mcicda/Makefile dlls/winmm/mciseq/Makefile dlls/winmm/mciwave/Makefile dlls/winmm/midimap/Makefile dlls/winmm/tests/Makefile dlls/winmm/wavemap/Makefile dlls/winmm/winealsa/Makefile dlls/winmm/winearts/Makefile dlls/winmm/wineaudioio/Makefile dlls/winmm/winenas/Makefile dlls/winmm/winejack/Makefile dlls/winmm/wineoss/Makefile dlls/winnls/Makefile dlls/winsock/Makefile dlls/winsock/tests/Makefile dlls/winspool/Makefile dlls/winspool/tests/Makefile dlls/wintab32/Makefile dlls/wintrust/Makefile dlls/wow32/Makefile dlls/wsock32/Makefile dlls/x11drv/Makefile documentation/Makefile include/Makefile libs/Makefile libs/port/Makefile libs/unicode/Makefile libs/uuid/Makefile libs/wine/Makefile libs/wpp/Makefile loader/Makefile programs/Makefile programs/avitools/Makefile programs/clock/Makefile programs/cmdlgtst/Makefile programs/control/Makefile programs/expand/Makefile programs/notepad/Makefile programs/progman/Makefile programs/regedit/Makefile programs/regsvr32/Makefile programs/rpcss/Makefile programs/rundll32/Makefile programs/start/Makefile programs/uninstaller/Makefile programs/view/Makefile programs/wcmd/Makefile programs/wineboot/Makefile programs/winebrowser/Makefile programs/winecfg/Makefile programs/wineconsole/Makefile programs/winedbg/Makefile programs/winefile/Makefile programs/winemenubuilder/Makefile programs/winemine/Makefile programs/winepath/Makefile programs/winetest/Makefile programs/winevdm/Makefile programs/winhelp/Makefile programs/winver/Makefile server/Makefile tools/Makefile tools/widl/Makefile tools/winapi/Makefile tools/winebuild/Makefile tools/winedump/Makefile tools/winegcc/Makefile tools/wmc/Makefile tools/wrc/Makefile" + ac_config_files="$ac_config_files Make.rules dlls/Makedll.rules dlls/Maketest.rules libs/Makelib.rules programs/Makeprog.rules Makefile dlls/Makefile dlls/advapi32/Makefile dlls/advapi32/tests/Makefile dlls/avicap32/Makefile dlls/avifil32/Makefile dlls/cabinet/Makefile dlls/capi2032/Makefile dlls/cfgmgr32/Makefile dlls/comcat/Makefile dlls/comctl32/Makefile dlls/comctl32/tests/Makefile dlls/commdlg/Makefile dlls/crtdll/Makefile dlls/crypt32/Makefile dlls/ctl3d/Makefile dlls/wined3d/Makefile dlls/d3d8/Makefile dlls/d3d9/Makefile dlls/d3dim/Makefile dlls/d3dx8/Makefile dlls/dciman32/Makefile dlls/ddraw/Makefile dlls/ddraw/tests/Makefile dlls/devenum/Makefile dlls/dinput/Makefile dlls/dinput8/Makefile dlls/dmband/Makefile dlls/dmcompos/Makefile dlls/dmime/Makefile dlls/dmloader/Makefile dlls/dmscript/Makefile dlls/dmstyle/Makefile dlls/dmsynth/Makefile dlls/dmusic/Makefile dlls/dmusic32/Makefile dlls/dplay/Makefile 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 dlls/glut32/Makefile dlls/iccvid/Makefile dlls/icmp/Makefile dlls/imagehlp/Makefile dlls/imm32/Makefile dlls/iphlpapi/Makefile dlls/iphlpapi/tests/Makefile dlls/kernel/Makefile dlls/kernel/tests/Makefile dlls/lzexpand/Makefile dlls/mapi32/Makefile dlls/mpr/Makefile dlls/msacm/Makefile dlls/msacm/imaadp32/Makefile dlls/msacm/msadp32/Makefile dlls/msacm/msg711/Makefile dlls/msacm/winemp3/Makefile dlls/msdmo/Makefile dlls/mshtml/Makefile dlls/msi/Makefile dlls/msimg32/Makefile dlls/msisys/Makefile dlls/msnet32/Makefile dlls/msvcrt/Makefile dlls/msvcrt/tests/Makefile dlls/msvcrt20/Makefile dlls/msvcrt40/Makefile dlls/msvcrtd/Makefile dlls/msvideo/Makefile dlls/msvideo/msrle32/Makefile dlls/mswsock/Makefile dlls/netapi32/Makefile dlls/netapi32/tests/Makefile dlls/newdev/Makefile dlls/ntdll/Makefile dlls/ntdll/tests/Makefile dlls/odbc32/Makefile dlls/ole32/Makefile dlls/oleacc/Makefile dlls/oleaut32/Makefile dlls/oleaut32/tests/Makefile dlls/olecli/Makefile dlls/oledlg/Makefile dlls/olepro32/Makefile dlls/olesvr/Makefile dlls/opengl32/Makefile dlls/psapi/Makefile dlls/qcap/Makefile dlls/quartz/Makefile dlls/rasapi32/Makefile dlls/richedit/Makefile dlls/rpcrt4/Makefile dlls/rpcrt4/tests/Makefile dlls/serialui/Makefile dlls/setupapi/Makefile dlls/shdocvw/Makefile dlls/shell32/Makefile dlls/shell32/tests/Makefile dlls/shfolder/Makefile dlls/shlwapi/Makefile dlls/shlwapi/tests/Makefile dlls/snmpapi/Makefile dlls/sti/Makefile dlls/tapi32/Makefile dlls/ttydrv/Makefile dlls/twain/Makefile dlls/unicows/Makefile dlls/url/Makefile dlls/urlmon/Makefile dlls/urlmon/tests/Makefile dlls/user/Makefile dlls/user/tests/Makefile dlls/uxtheme/Makefile dlls/version/Makefile dlls/win32s/Makefile dlls/winaspi/Makefile dlls/winedos/Makefile dlls/wineps/Makefile dlls/wininet/Makefile dlls/wininet/tests/Makefile dlls/winmm/Makefile dlls/winmm/joystick/Makefile dlls/winmm/mcianim/Makefile dlls/winmm/mciavi/Makefile dlls/winmm/mcicda/Makefile dlls/winmm/mciseq/Makefile dlls/winmm/mciwave/Makefile dlls/winmm/midimap/Makefile dlls/winmm/tests/Makefile dlls/winmm/wavemap/Makefile dlls/winmm/winealsa/Makefile dlls/winmm/winearts/Makefile dlls/winmm/wineaudioio/Makefile dlls/winmm/winenas/Makefile dlls/winmm/winejack/Makefile dlls/winmm/wineoss/Makefile dlls/winnls/Makefile dlls/winsock/Makefile dlls/winsock/tests/Makefile dlls/winspool/Makefile dlls/winspool/tests/Makefile dlls/wintab32/Makefile dlls/wintrust/Makefile dlls/wow32/Makefile dlls/wsock32/Makefile dlls/x11drv/Makefile documentation/Makefile include/Makefile libs/Makefile libs/port/Makefile libs/unicode/Makefile libs/uuid/Makefile libs/wine/Makefile libs/wpp/Makefile loader/Makefile programs/Makefile programs/avitools/Makefile programs/clock/Makefile programs/cmdlgtst/Makefile programs/control/Makefile programs/expand/Makefile programs/notepad/Makefile programs/progman/Makefile programs/regedit/Makefile programs/regsvr32/Makefile programs/rpcss/Makefile programs/rundll32/Makefile programs/start/Makefile programs/uninstaller/Makefile programs/view/Makefile programs/wcmd/Makefile programs/wineboot/Makefile programs/winebrowser/Makefile programs/winecfg/Makefile programs/wineconsole/Makefile programs/winedbg/Makefile programs/winefile/Makefile programs/winemenubuilder/Makefile programs/winemine/Makefile programs/winepath/Makefile programs/winetest/Makefile programs/winevdm/Makefile programs/winhelp/Makefile programs/winver/Makefile server/Makefile tools/Makefile tools/widl/Makefile tools/winapi/Makefile tools/winebuild/Makefile tools/winedump/Makefile tools/winegcc/Makefile tools/wmc/Makefile tools/wrc/Makefile" cat >confcache <<\_ACEOF @@ -19647,6 +19647,7 @@ do "dlls/dpnhpast/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/dpnhpast/Makefile" ;; "dlls/dsound/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/dsound/Makefile" ;; "dlls/dsound/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/dsound/tests/Makefile" ;; + "dlls/dswave/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/dswave/Makefile" ;; "dlls/gdi/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/gdi/Makefile" ;; "dlls/gdi/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/gdi/tests/Makefile" ;; "dlls/glu32/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/glu32/Makefile" ;; diff --git a/configure.ac b/configure.ac index ccebdb70d14..181e37931b2 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/dlls/Makefile.in b/dlls/Makefile.in index 5c58a49838d..aea4045efbc 100644 --- a/dlls/Makefile.in +++ b/dlls/Makefile.in @@ -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 diff --git a/dlls/dmband/band.c b/dlls/dmband/band.c index a503e29e903..b4b13b7b5f3 100644 --- a/dlls/dmband/band.c +++ b/dlls/dmband/band.c @@ -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 - -#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); +} diff --git a/dlls/dmband/bandtrack.c b/dlls/dmband/bandtrack.c index 11edaf51aa3..d094accd38f 100644 --- a/dlls/dmband/bandtrack.c +++ b/dlls/dmband/bandtrack.c @@ -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 - -#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 -}; diff --git a/dlls/dmband/dmband_main.c b/dlls/dmband/dmband_main.c index 09ba2e42f53..e1bedf12a4f 100644 --- a/dlls/dmband/dmband_main.c +++ b/dlls/dmband/dmband_main.c @@ -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)) { diff --git a/dlls/dmband/dmband_private.h b/dlls/dmband/dmband_private.h index 9f56f47dc0b..53ea1caad4f 100644 --- a/dlls/dmband/dmband_private.h +++ b/dlls/dmband/dmband_private.h @@ -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 #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 */ diff --git a/dlls/dmband/regsvr.c b/dlls/dmband/regsvr.c index 277e178635c..8afc220618a 100644 --- a/dlls/dmband/regsvr.c +++ b/dlls/dmband/regsvr.c @@ -18,21 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include - -#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"); diff --git a/dlls/dmband/version.rc b/dlls/dmband/version.rc index 71c948a5965..cae25ce1bf2 100644 --- a/dlls/dmband/version.rc +++ b/dlls/dmband/version.rc @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003 Rok Mandeljc + * Copyright (C) 2003-2004 Rok Mandeljc * * 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" diff --git a/dlls/dmcompos/chordmap.c b/dlls/dmcompos/chordmap.c index 66c0d6dc791..537c11dbb46 100644 --- a/dlls/dmcompos/chordmap.c +++ b/dlls/dmcompos/chordmap.c @@ -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 - -#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 -}; diff --git a/dlls/dmcompos/chordmaptrack.c b/dlls/dmcompos/chordmaptrack.c index 8a95ce486fd..efeb0787cbc 100644 --- a/dlls/dmcompos/chordmaptrack.c +++ b/dlls/dmcompos/chordmaptrack.c @@ -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 - -#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 -}; diff --git a/dlls/dmcompos/composer.c b/dlls/dmcompos/composer.c index 8c50d7bdd51..13e8cd591ed 100644 --- a/dlls/dmcompos/composer.c +++ b/dlls/dmcompos/composer.c @@ -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 - -#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); } diff --git a/dlls/dmcompos/dmcompos_main.c b/dlls/dmcompos/dmcompos_main.c index 75bf4ca7283..7597174bff1 100644 --- a/dlls/dmcompos/dmcompos_main.c +++ b/dlls/dmcompos/dmcompos_main.c @@ -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; diff --git a/dlls/dmcompos/dmcompos_private.h b/dlls/dmcompos/dmcompos_private.h index 86ab6caf4c4..32ec55b0bc3 100644 --- a/dlls/dmcompos/dmcompos_private.h +++ b/dlls/dmcompos/dmcompos_private.h @@ -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 #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 */ diff --git a/dlls/dmcompos/regsvr.c b/dlls/dmcompos/regsvr.c index 76cc768a3b4..16f8b372144 100644 --- a/dlls/dmcompos/regsvr.c +++ b/dlls/dmcompos/regsvr.c @@ -18,21 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include - -#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"); diff --git a/dlls/dmcompos/signposttrack.c b/dlls/dmcompos/signposttrack.c index d508cf25593..22196230ceb 100644 --- a/dlls/dmcompos/signposttrack.c +++ b/dlls/dmcompos/signposttrack.c @@ -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 - -#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 -}; diff --git a/dlls/dmcompos/version.rc b/dlls/dmcompos/version.rc index 162e6f8fbe0..c095d320768 100644 --- a/dlls/dmcompos/version.rc +++ b/dlls/dmcompos/version.rc @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003 Rok Mandeljc + * Copyright (C) 2003-2004 Rok Mandeljc * * 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" diff --git a/dlls/dmime/Makefile.in b/dlls/dmime/Makefile.in index 2d102ce6349..3af42a06813 100644 --- a/dlls/dmime/Makefile.in +++ b/dlls/dmime/Makefile.in @@ -20,7 +20,6 @@ C_SRCS = \ segmentstate.c \ segtriggertrack.c \ seqtrack.c \ - song.c \ sysextrack.c \ tempotrack.c \ timesigtrack.c \ diff --git a/dlls/dmime/audiopath.c b/dlls/dmime/audiopath.c index e6f1decde4f..c540f324c51 100644 --- a/dlls/dmime/audiopath.c +++ b/dlls/dmime/audiopath.c @@ -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 - -#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 -}; diff --git a/dlls/dmime/dmime_main.c b/dlls/dmime/dmime_main.c index edb5f022ee2..79163c173aa 100644 --- a/dlls/dmime/dmime_main.c +++ b/dlls/dmime/dmime_main.c @@ -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); diff --git a/dlls/dmime/dmime_private.h b/dlls/dmime/dmime_private.h index dd6d06d82c0..f025883864e 100644 --- a/dlls/dmime/dmime_private.h +++ b/dlls/dmime/dmime_private.h @@ -1,6 +1,6 @@ /* DirectMusicInteractiveEngine 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 #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 @@ -41,146 +44,119 @@ typedef struct IDirectMusicPerformance8Impl IDirectMusicPerformance8Impl; typedef struct IDirectMusicSegment8Impl IDirectMusicSegment8Impl; typedef struct IDirectMusicSegmentState8Impl IDirectMusicSegmentState8Impl; typedef struct IDirectMusicGraphImpl IDirectMusicGraphImpl; -typedef struct IDirectMusicSongImpl IDirectMusicSongImpl; typedef struct IDirectMusicAudioPathImpl IDirectMusicAudioPathImpl; typedef struct IDirectMusicTool8Impl IDirectMusicTool8Impl; typedef struct IDirectMusicPatternTrackImpl IDirectMusicPatternTrackImpl; -typedef struct IDirectMusicSegmentObject IDirectMusicSegmentObject; -typedef struct IDirectMusicSegmentObjectStream IDirectMusicSegmentObjectStream; -typedef struct IDirectMusicSongObject IDirectMusicSongObject; -typedef struct IDirectMusicSongObjectStream IDirectMusicSongObjectStream; -typedef struct IDirectMusicAudioPathObject IDirectMusicAudioPathObject; -typedef struct IDirectMusicAudioPathObjectStream IDirectMusicAudioPathObjectStream; -typedef struct IDirectMusicGraphObject IDirectMusicGraphObject; -typedef struct IDirectMusicGraphObjectStream IDirectMusicGraphObjectStream; - typedef struct IDirectMusicLyricsTrack IDirectMusicLyricsTrack; -typedef struct IDirectMusicLyricsTrackStream IDirectMusicLyricsTrackStream; typedef struct IDirectMusicMarkerTrack IDirectMusicMarkerTrack; -typedef struct IDirectMusicMarkerTrackStream IDirectMusicMarkerTrackStream; typedef struct IDirectMusicParamControlTrack IDirectMusicParamControlTrack; -typedef struct IDirectMusicParamControlTrackStream IDirectMusicParamControlTrackStream; typedef struct IDirectMusicSegTriggerTrack IDirectMusicSegTriggerTrack; -typedef struct IDirectMusicSegTriggerTrackStream IDirectMusicSegTriggerTrackStream; typedef struct IDirectMusicSeqTrack IDirectMusicSeqTrack; -typedef struct IDirectMusicSeqTrackStream IDirectMusicSeqTrackStream; typedef struct IDirectMusicSysExTrack IDirectMusicSysExTrack; -typedef struct IDirectMusicSysExTrackStream IDirectMusicSysExTrackStream; typedef struct IDirectMusicTempoTrack IDirectMusicTempoTrack; -typedef struct IDirectMusicTempoTrackStream IDirectMusicTempoTrackStream; typedef struct IDirectMusicTimeSigTrack IDirectMusicTimeSigTrack; -typedef struct IDirectMusicTimeSigTrackStream IDirectMusicTimeSigTrackStream; typedef struct IDirectMusicWaveTrack IDirectMusicWaveTrack; -typedef struct IDirectMusicWaveTrackStream IDirectMusicWaveTrackStream; /***************************************************************************** * Predeclare the interface implementation structures */ extern ICOM_VTABLE(IDirectMusicPerformance8) DirectMusicPerformance8_Vtbl; -extern ICOM_VTABLE(IDirectMusicSegment8) DirectMusicSegment8_Vtbl; + +extern ICOM_VTABLE(IUnknown) DirectMusicSegment8_Unknown_Vtbl; +extern ICOM_VTABLE(IDirectMusicSegment8) DirectMusicSegment8_Segment_Vtbl; +extern ICOM_VTABLE(IDirectMusicObject) DirectMusicSegment8_Object_Vtbl; +extern ICOM_VTABLE(IPersistStream) DirectMusicSegment8_PersistStream_Vtbl; + extern ICOM_VTABLE(IDirectMusicSegmentState8) DirectMusicSegmentState8_Vtbl; -extern ICOM_VTABLE(IDirectMusicGraph) DirectMusicGraph_Vtbl; -extern ICOM_VTABLE(IDirectMusicSong) DirectMusicSong_Vtbl; -extern ICOM_VTABLE(IDirectMusicAudioPath) DirectMusicAudioPath_Vtbl; -extern ICOM_VTABLE(IDirectMusicTool8) DirectMusicTool8_Vtbl; -extern ICOM_VTABLE(IDirectMusicPatternTrack) DirectMusicPatternTrack_Vtbl; -extern ICOM_VTABLE(IDirectMusicObject) DirectMusicSegmentObject_Vtbl; -extern ICOM_VTABLE(IPersistStream) DirectMusicSegmentObjectStream_Vtbl; -extern ICOM_VTABLE(IDirectMusicObject) DirectMusicSongObject_Vtbl; -extern ICOM_VTABLE(IPersistStream) DirectMusicSongObjectStream_Vtbl; -extern ICOM_VTABLE(IDirectMusicObject) DirectMusicAudioPathObject_Vtbl; -extern ICOM_VTABLE(IPersistStream) DirectMusicAudioPathObjectStream_Vtbl; -extern ICOM_VTABLE(IDirectMusicObject) DirectMusicGraphObject_Vtbl; -extern ICOM_VTABLE(IPersistStream) DirectMusicGraphObjectStream_Vtbl; +extern ICOM_VTABLE(IUnknown) DirectMusicGraph_Unknown_Vtbl; +extern ICOM_VTABLE(IDirectMusicGraph) DirectMusicGraph_Gtaph_Vtbl; +extern ICOM_VTABLE(IDirectMusicObject) DirectMusicGraph_Object_Vtbl; +extern ICOM_VTABLE(IPersistStream) DirectMusicGraph_PersistStream_Vtbl; -extern ICOM_VTABLE(IDirectMusicTrack8) DirectMusicLyricsTrack_Vtbl; -extern ICOM_VTABLE(IPersistStream) DirectMusicLyricsTrackStream_Vtbl; -extern ICOM_VTABLE(IDirectMusicTrack8) DirectMusicMarkerTrack_Vtbl; -extern ICOM_VTABLE(IPersistStream) DirectMusicMarkerTrackStream_Vtbl; -extern ICOM_VTABLE(IDirectMusicTrack8) DirectMusicParamControlTrack_Vtbl; -extern ICOM_VTABLE(IPersistStream) DirectMusicParamControlTrackStream_Vtbl; -extern ICOM_VTABLE(IDirectMusicTrack8) DirectMusicSegTriggerTrack_Vtbl; -extern ICOM_VTABLE(IPersistStream) DirectMusicSegTriggerTrackStream_Vtbl; -extern ICOM_VTABLE(IDirectMusicTrack8) DirectMusicSeqTrack_Vtbl; -extern ICOM_VTABLE(IPersistStream) DirectMusicSeqTrackStream_Vtbl; -extern ICOM_VTABLE(IDirectMusicTrack8) DirectMusicSysExTrack_Vtbl; -extern ICOM_VTABLE(IPersistStream) DirectMusicSysExTrackStream_Vtbl; -extern ICOM_VTABLE(IDirectMusicTrack8) DirectMusicTempoTrack_Vtbl; -extern ICOM_VTABLE(IPersistStream) DirectMusicTempoTrackStream_Vtbl; -extern ICOM_VTABLE(IDirectMusicTrack8) DirectMusicTimeSigTrack_Vtbl; -extern ICOM_VTABLE(IPersistStream) DirectMusicTimeSigTrackStream_Vtbl; -extern ICOM_VTABLE(IDirectMusicTrack8) DirectMusicWaveTrack_Vtbl; -extern ICOM_VTABLE(IPersistStream) DirectMusicWaveTrackStream_Vtbl; +extern ICOM_VTABLE(IUnknown) DirectMusicAudioPath_Unknown_Vtbl; +extern ICOM_VTABLE(IDirectMusicAudioPath) DirectMusicAudioPath_AudioPath_Vtbl; +extern ICOM_VTABLE(IDirectMusicObject) DirectMusicAudioPath_Object_Vtbl; +extern ICOM_VTABLE(IPersistStream) DirectMusicAudioPath_Persist_Stream_Vtbl; + +extern ICOM_VTABLE(IDirectMusicTool8) DirectMusicTool8_Vtbl; + +extern ICOM_VTABLE(IDirectMusicPatternTrack) DirectMusicPatternTrack_Vtbl; + +extern ICOM_VTABLE(IUnknown) DirectMusicLyricsTrack_Unknown_Vtbl; +extern ICOM_VTABLE(IDirectMusicTrack8) DirectMusicLyricsTrack_Track_Vtbl; +extern ICOM_VTABLE(IPersistStream) DirectMusicLyricsTrack_PersistStream_Vtbl; + +extern ICOM_VTABLE(IUnknown) DirectMusicMarkerTrack_Unknown_Vtbl; +extern ICOM_VTABLE(IDirectMusicTrack8) DirectMusicMarkerTrack_Track_Vtbl; +extern ICOM_VTABLE(IPersistStream) DirectMusicMarkerTrack_PersistStream_Vtbl; + +extern ICOM_VTABLE(IUnknown) DirectMusicParamControlTrack_Unknown_Vtbl; +extern ICOM_VTABLE(IDirectMusicTrack8) DirectMusicParamControlTrack_Track_Vtbl; +extern ICOM_VTABLE(IPersistStream) DirectMusicParamControlTrack_PersistStream_Vtbl; + +extern ICOM_VTABLE(IUnknown) DirectMusicSegTriggerTrack_Unknown_Vtbl; +extern ICOM_VTABLE(IDirectMusicTrack8) DirectMusicSegTriggerTrack_Track_Vtbl; +extern ICOM_VTABLE(IPersistStream) DirectMusicSegTriggerTrack_PersistStream_Vtbl; + +extern ICOM_VTABLE(IUnknown) DirectMusicSeqTrack_Unknown_Vtbl; +extern ICOM_VTABLE(IDirectMusicTrack8) DirectMusicSeqTrack_Track_Vtbl; +extern ICOM_VTABLE(IPersistStream) DirectMusicSeqTrack_PersistStream_Vtbl; + +extern ICOM_VTABLE(IUnknown) DirectMusicSysExTrack_Unknown_Vtbl; +extern ICOM_VTABLE(IDirectMusicTrack8) DirectMusicSysExTrack_Track_Vtbl; +extern ICOM_VTABLE(IPersistStream) DirectMusicSysExTrack_PersistStream_Vtbl; + +extern ICOM_VTABLE(IUnknown) DirectMusicTempoTrack_Unknown_Vtbl; +extern ICOM_VTABLE(IDirectMusicTrack8) DirectMusicTempoTrack_Track_Vtbl; +extern ICOM_VTABLE(IPersistStream) DirectMusicTempoTrack_PersistStream_Vtbl; + +extern ICOM_VTABLE(IUnknown) DirectMusicTimeSigTrack_Unknown_Vtbl; +extern ICOM_VTABLE(IDirectMusicTrack8) DirectMusicTimeSigTrack_Track_Vtbl; +extern ICOM_VTABLE(IPersistStream) DirectMusicTimeSigTrack_PersistStream_Vtbl; + +extern ICOM_VTABLE(IUnknown) DirectMusicWaveTrack_Unknown_Vtbl; +extern ICOM_VTABLE(IDirectMusicTrack8) DirectMusicWaveTrack_Track_Vtbl; +extern ICOM_VTABLE(IPersistStream) DirectMusicWaveTrack_PersistStream_Vtbl; /***************************************************************************** * ClassFactory */ -/* can support IID_IDirectMusicPerformance and IID_IDirectMusicPerformance8 - * return always an IDirectMusicPerformance8Impl - */ -extern HRESULT WINAPI DMUSIC_CreateDirectMusicPerformance (LPCGUID lpcGUID, LPDIRECTMUSICPERFORMANCE8 *ppDMPerf, LPUNKNOWN pUnkOuter); -/* can support IID_IDirectMusicSegment and IID_IDirectMusicSegment8 - * return always an IDirectMusicSegment8Impl - */ -extern HRESULT WINAPI DMUSIC_CreateDirectMusicSegment (LPCGUID lpcGUID, LPDIRECTMUSICSEGMENT8 *ppDMSeg, LPUNKNOWN pUnkOuter); -/* can support IID_IDirectMusicSegmentState and IID_IDirectMusicSegmentState8 - * return always an IDirectMusicSegmentState8Impl - */ -extern HRESULT WINAPI DMUSIC_CreateDirectMusicSegmentState (LPCGUID lpcGUID, LPDIRECTMUSICSEGMENTSTATE8 *ppDMSeg, LPUNKNOWN pUnkOuter); -/* can support IID_IDirectMusicSegmentgraph - * return always an IDirectMusicGraphImpl - */ -extern HRESULT WINAPI DMUSIC_CreateDirectMusicGraph (LPCGUID lpcGUID, LPDIRECTMUSICGRAPH *ppDMGrph, LPUNKNOWN pUnkOuter); -/* can support IID_IDirectMusicSong - * return always an IDirectMusicSong - */ -extern HRESULT WINAPI DMUSIC_CreateDirectMusicSong (LPCGUID lpcGUID, LPDIRECTMUSICSONG *ppDMSng, LPUNKNOWN pUnkOuter); -/* can support IID_IDirectMusicAudioPath - * return always an IDirectMusicAudioPathImpl - */ -extern HRESULT WINAPI DMUSIC_CreateDirectMusicAudioPath (LPCGUID lpcGUID, LPDIRECTMUSICAUDIOPATH *ppDMApath, LPUNKNOWN pUnkOuter); -/* can support IID_IDirectMusicTool and IID_IDirectMusicTool8 - * return always an IDirectMusicTool8Impl - */ -extern HRESULT WINAPI DMUSIC_CreateDirectMusicTool (LPCGUID lpcGUID, LPDIRECTMUSICTOOL8 *ppDMTool, LPUNKNOWN pUnkOuter); -/* can support IID_IDirectMusicPatternTrack - * return always an IDirectMusicPatternTrackImpl - */ -extern HRESULT WINAPI DMUSIC_CreateDirectMusicPatternTrack (LPCGUID lpcGUID, LPDIRECTMUSICPATTERNTRACK *ppDMPtrnTrack, LPUNKNOWN pUnkOuter); +extern HRESULT WINAPI DMUSIC_CreateDirectMusicPerformanceImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter); +extern HRESULT WINAPI DMUSIC_CreateDirectMusicSegmentImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter); +extern HRESULT WINAPI DMUSIC_CreateDirectMusicSegmentStateImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter); +extern HRESULT WINAPI DMUSIC_CreateDirectMusicGraphImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter); +extern HRESULT WINAPI DMUSIC_CreateDirectMusicAudioPathImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter); +extern HRESULT WINAPI DMUSIC_CreateDirectMusicToolImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter); +extern HRESULT WINAPI DMUSIC_CreateDirectMusicPatternTrackImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter); -extern HRESULT WINAPI DMUSIC_CreateDirectMusicSegmentObject (LPCGUID lpcGUID, LPDIRECTMUSICOBJECT *ppObject, LPUNKNOWN pUnkOuter); -extern HRESULT WINAPI DMUSIC_CreateDirectMusicSongObject (LPCGUID lpcGUID, LPDIRECTMUSICOBJECT *ppObject, LPUNKNOWN pUnkOuter); -extern HRESULT WINAPI DMUSIC_CreateDirectMusicAudioPathObject (LPCGUID lpcGUID, LPDIRECTMUSICOBJECT *ppObject, LPUNKNOWN pUnkOuter); -extern HRESULT WINAPI DMUSIC_CreateDirectMusicGraphObject (LPCGUID lpcGUID, LPDIRECTMUSICOBJECT *ppObject, LPUNKNOWN pUnkOuter); +extern HRESULT WINAPI DMUSIC_CreateDirectMusicLyricsTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter); +extern HRESULT WINAPI DMUSIC_CreateDirectMusicMarkerTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter); +extern HRESULT WINAPI DMUSIC_CreateDirectMusicParamControlTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter); +extern HRESULT WINAPI DMUSIC_CreateDirectMusicSegTriggerTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter); +extern HRESULT WINAPI DMUSIC_CreateDirectMusicSeqTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter); +extern HRESULT WINAPI DMUSIC_CreateDirectMusicSysExTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter); +extern HRESULT WINAPI DMUSIC_CreateDirectMusicTempoTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter); +extern HRESULT WINAPI DMUSIC_CreateDirectMusicTimeSigTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter); +extern HRESULT WINAPI DMUSIC_CreateDirectMusicWaveTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter); -extern HRESULT WINAPI DMUSIC_CreateDirectMusicLyricsTrack (LPCGUID lpcGUID, LPDIRECTMUSICTRACK8* ppTrack, LPUNKNOWN pUnkOuter); -extern HRESULT WINAPI DMUSIC_CreateDirectMusicMarkerTrack (LPCGUID lpcGUID, LPDIRECTMUSICTRACK8* ppTrack, LPUNKNOWN pUnkOuter); -extern HRESULT WINAPI DMUSIC_CreateDirectMusicParamControlTrack (LPCGUID lpcGUID, LPDIRECTMUSICTRACK8* ppTrack, LPUNKNOWN pUnkOuter); -extern HRESULT WINAPI DMUSIC_CreateDirectMusicSegTriggerTrack (LPCGUID lpcGUID, LPDIRECTMUSICTRACK8* ppTrack, LPUNKNOWN pUnkOuter); -extern HRESULT WINAPI DMUSIC_CreateDirectMusicSeqTrack (LPCGUID lpcGUID, LPDIRECTMUSICTRACK8* ppTrack, LPUNKNOWN pUnkOuter); -extern HRESULT WINAPI DMUSIC_CreateDirectMusicSysExTrack (LPCGUID lpcGUID, LPDIRECTMUSICTRACK8* ppTrack, LPUNKNOWN pUnkOuter); -extern HRESULT WINAPI DMUSIC_CreateDirectMusicTempoTrack (LPCGUID lpcGUID, LPDIRECTMUSICTRACK8* ppTrack, LPUNKNOWN pUnkOuter); -extern HRESULT WINAPI DMUSIC_CreateDirectMusicTimeSigTrack (LPCGUID lpcGUID, LPDIRECTMUSICTRACK8* ppTrack, LPUNKNOWN pUnkOuter); -extern HRESULT WINAPI DMUSIC_CreateDirectMusicWaveTrack (LPCGUID lpcGUID, LPDIRECTMUSICTRACK8* ppTrack, LPUNKNOWN pUnkOuter); /* some sort of aux. performance channel: as far as i can understand, these are used to represent a particular midi channel in particular group at particular group; so all we need to do is to fill it with parent port, group and midi channel ? */ -typedef struct DMUSIC_PRIVATE_PCHANNEL_ -{ +typedef struct DMUSIC_PRIVATE_PCHANNEL_ { DWORD channel; /* map to this channel... */ DWORD group; /* ... in this group ... */ IDirectMusicPort *port; /* ... at this port */ } DMUSIC_PRIVATE_PCHANNEL, *LPDMUSIC_PRIVATE_PCHANNEL; + /***************************************************************************** * IDirectMusicPerformance8Impl implementation structure */ -struct IDirectMusicPerformance8Impl -{ +struct IDirectMusicPerformance8Impl { /* IUnknown fields */ ICOM_VFIELD(IDirectMusicPerformance8); DWORD ref; @@ -260,75 +236,79 @@ extern HRESULT WINAPI IDirectMusicPerformance8ImplCreateStandardAudioPath (LPDIR extern HRESULT WINAPI IDirectMusicPerformance8ImplSetDefaultAudioPath (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicAudioPath* pAudioPath); extern HRESULT WINAPI IDirectMusicPerformance8ImplGetDefaultAudioPath (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicAudioPath** ppAudioPath); extern HRESULT WINAPI IDirectMusicPerformance8ImplGetParamEx (LPDIRECTMUSICPERFORMANCE8 iface, REFGUID rguidType, DWORD dwTrackID, DWORD dwGroupBits, DWORD dwIndex, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam); -/* ClassFactory */ -extern HRESULT WINAPI DMUSIC_CreateDirectMusicPerformance8 (LPCGUID lpcGUID, LPDIRECTMUSICPERFORMANCE8 *ppDMPerf8, LPUNKNOWN pUnkOuter); /***************************************************************************** * IDirectMusicSegment8Impl implementation structure */ -struct IDirectMusicSegment8Impl -{ +struct IDirectMusicSegment8Impl { /* IUnknown fields */ - ICOM_VFIELD(IDirectMusicSegment8); + ICOM_VTABLE(IUnknown) *UnknownVtbl; + ICOM_VTABLE(IDirectMusicSegment8) *SegmentVtbl; + ICOM_VTABLE(IDirectMusicObject) *ObjectVtbl; + ICOM_VTABLE(IPersistStream) *PersistStreamVtbl; DWORD ref; /* IDirectMusicSegment8Impl fields */ - IDirectMusicSegmentObject* pObject; - - DMUS_IO_SEGMENT_HEADER segHeader; /* header */ - GUID guidID; /* unique id */ - DMUS_IO_VERSION vVersion; /* version */ - /* info from UNFO list */ - WCHAR* wszName; - WCHAR* wszArtist; - WCHAR* wszCopyright; - WCHAR* wszSubject; - WCHAR* wszComment; - /* tracks */ - DWORD dwTracks; - LPDIRECTMUSICTRACK8 ppTracks[255]; + LPDMUS_OBJECTDESC pDesc; }; /* IUnknown: */ -extern HRESULT WINAPI IDirectMusicSegment8Impl_QueryInterface (LPDIRECTMUSICSEGMENT8 iface, REFIID riid, LPVOID *ppobj); -extern ULONG WINAPI IDirectMusicSegment8Impl_AddRef (LPDIRECTMUSICSEGMENT8 iface); -extern ULONG WINAPI IDirectMusicSegment8Impl_Release (LPDIRECTMUSICSEGMENT8 iface); -/* IDirectMusicSegment: */ -extern HRESULT WINAPI IDirectMusicSegment8Impl_GetLength (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME* pmtLength); -extern HRESULT WINAPI IDirectMusicSegment8Impl_SetLength (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME mtLength); -extern HRESULT WINAPI IDirectMusicSegment8Impl_GetRepeats (LPDIRECTMUSICSEGMENT8 iface, DWORD* pdwRepeats); -extern HRESULT WINAPI IDirectMusicSegment8Impl_SetRepeats (LPDIRECTMUSICSEGMENT8 iface, DWORD dwRepeats); -extern HRESULT WINAPI IDirectMusicSegment8Impl_GetDefaultResolution (LPDIRECTMUSICSEGMENT8 iface, DWORD* pdwResolution); -extern HRESULT WINAPI IDirectMusicSegment8Impl_SetDefaultResolution (LPDIRECTMUSICSEGMENT8 iface, DWORD dwResolution); -extern HRESULT WINAPI IDirectMusicSegment8Impl_GetTrack (LPDIRECTMUSICSEGMENT8 iface, REFGUID rguidType, DWORD dwGroupBits, DWORD dwIndex, IDirectMusicTrack** ppTrack); -extern HRESULT WINAPI IDirectMusicSegment8Impl_GetTrackGroup (LPDIRECTMUSICSEGMENT8 iface, IDirectMusicTrack* pTrack, DWORD* pdwGroupBits); -extern HRESULT WINAPI IDirectMusicSegment8Impl_InsertTrack (LPDIRECTMUSICSEGMENT8 iface, IDirectMusicTrack* pTrack, DWORD dwGroupBits); -extern HRESULT WINAPI IDirectMusicSegment8Impl_RemoveTrack (LPDIRECTMUSICSEGMENT8 iface, IDirectMusicTrack* pTrack); -extern HRESULT WINAPI IDirectMusicSegment8Impl_InitPlay (LPDIRECTMUSICSEGMENT8 iface, IDirectMusicSegmentState** ppSegState, IDirectMusicPerformance* pPerformance, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicSegment8Impl_GetGraph (LPDIRECTMUSICSEGMENT8 iface, IDirectMusicGraph** ppGraph); -extern HRESULT WINAPI IDirectMusicSegment8Impl_SetGraph (LPDIRECTMUSICSEGMENT8 iface, IDirectMusicGraph* pGraph); -extern HRESULT WINAPI IDirectMusicSegment8Impl_AddNotificationType (LPDIRECTMUSICSEGMENT8 iface, REFGUID rguidNotificationType); -extern HRESULT WINAPI IDirectMusicSegment8Impl_RemoveNotificationType (LPDIRECTMUSICSEGMENT8 iface, REFGUID rguidNotificationType); -extern HRESULT WINAPI IDirectMusicSegment8Impl_GetParam (LPDIRECTMUSICSEGMENT8 iface, REFGUID rguidType, DWORD dwGroupBits, DWORD dwIndex, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam); -extern HRESULT WINAPI IDirectMusicSegment8Impl_SetParam (LPDIRECTMUSICSEGMENT8 iface, REFGUID rguidType, DWORD dwGroupBits, DWORD dwIndex, MUSIC_TIME mtTime, void* pParam); -extern HRESULT WINAPI IDirectMusicSegment8Impl_Clone (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicSegment** ppSegment); -extern HRESULT WINAPI IDirectMusicSegment8Impl_SetStartPoint (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME mtStart); -extern HRESULT WINAPI IDirectMusicSegment8Impl_GetStartPoint (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME* pmtStart); -extern HRESULT WINAPI IDirectMusicSegment8Impl_SetLoopPoints (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd); -extern HRESULT WINAPI IDirectMusicSegment8Impl_GetLoopPoints (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME* pmtStart, MUSIC_TIME* pmtEnd); -extern HRESULT WINAPI IDirectMusicSegment8Impl_SetPChannelsUsed (LPDIRECTMUSICSEGMENT8 iface, DWORD dwNumPChannels, DWORD* paPChannels); -/* IDirectMusicSegment8: */ -extern HRESULT WINAPI IDirectMusicSegment8Impl_SetTrackConfig (LPDIRECTMUSICSEGMENT8 iface, REFGUID rguidTrackClassID, DWORD dwGroupBits, DWORD dwIndex, DWORD dwFlagsOn, DWORD dwFlagsOff); -extern HRESULT WINAPI IDirectMusicSegment8Impl_GetAudioPathConfig (LPDIRECTMUSICSEGMENT8 iface, IUnknown** ppAudioPathConfig); -extern HRESULT WINAPI IDirectMusicSegment8Impl_Compose (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME mtTime, IDirectMusicSegment* pFromSegment, IDirectMusicSegment* pToSegment, IDirectMusicSegment** ppComposedSegment); -extern HRESULT WINAPI IDirectMusicSegment8Impl_Download (LPDIRECTMUSICSEGMENT8 iface, IUnknown *pAudioPath); -extern HRESULT WINAPI IDirectMusicSegment8Impl_Unload (LPDIRECTMUSICSEGMENT8 iface, IUnknown *pAudioPath); - +extern HRESULT WINAPI IDirectMusicSegment8Impl_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicSegment8Impl_IUnknown_AddRef (LPUNKNOWN iface); +extern ULONG WINAPI IDirectMusicSegment8Impl_IUnknown_Release (LPUNKNOWN iface); +/* IDirectMusicSegment(8): */ +extern HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_QueryInterface (LPDIRECTMUSICSEGMENT8 iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_AddRef (LPDIRECTMUSICSEGMENT8 iface); +extern ULONG WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_Release (LPDIRECTMUSICSEGMENT8 iface); +extern HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_GetLength (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME* pmtLength); +extern HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_SetLength (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME mtLength); +extern HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_GetRepeats (LPDIRECTMUSICSEGMENT8 iface, DWORD* pdwRepeats); +extern HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_SetRepeats (LPDIRECTMUSICSEGMENT8 iface, DWORD dwRepeats); +extern HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_GetDefaultResolution (LPDIRECTMUSICSEGMENT8 iface, DWORD* pdwResolution); +extern HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_SetDefaultResolution (LPDIRECTMUSICSEGMENT8 iface, DWORD dwResolution); +extern HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_GetTrack (LPDIRECTMUSICSEGMENT8 iface, REFGUID rguidType, DWORD dwGroupBits, DWORD dwIndex, IDirectMusicTrack** ppTrack); +extern HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_GetTrackGroup (LPDIRECTMUSICSEGMENT8 iface, IDirectMusicTrack* pTrack, DWORD* pdwGroupBits); +extern HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_InsertTrack (LPDIRECTMUSICSEGMENT8 iface, IDirectMusicTrack* pTrack, DWORD dwGroupBits); +extern HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_RemoveTrack (LPDIRECTMUSICSEGMENT8 iface, IDirectMusicTrack* pTrack); +extern HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_InitPlay (LPDIRECTMUSICSEGMENT8 iface, IDirectMusicSegmentState** ppSegState, IDirectMusicPerformance* pPerformance, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_GetGraph (LPDIRECTMUSICSEGMENT8 iface, IDirectMusicGraph** ppGraph); +extern HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_SetGraph (LPDIRECTMUSICSEGMENT8 iface, IDirectMusicGraph* pGraph); +extern HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_AddNotificationType (LPDIRECTMUSICSEGMENT8 iface, REFGUID rguidNotificationType); +extern HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_RemoveNotificationType (LPDIRECTMUSICSEGMENT8 iface, REFGUID rguidNotificationType); +extern HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_GetParam (LPDIRECTMUSICSEGMENT8 iface, REFGUID rguidType, DWORD dwGroupBits, DWORD dwIndex, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam); +extern HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_SetParam (LPDIRECTMUSICSEGMENT8 iface, REFGUID rguidType, DWORD dwGroupBits, DWORD dwIndex, MUSIC_TIME mtTime, void* pParam); +extern HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_Clone (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicSegment** ppSegment); +extern HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_SetStartPoint (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME mtStart); +extern HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_GetStartPoint (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME* pmtStart); +extern HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_SetLoopPoints (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd); +extern HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_GetLoopPoints (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME* pmtStart, MUSIC_TIME* pmtEnd); +extern HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_SetPChannelsUsed (LPDIRECTMUSICSEGMENT8 iface, DWORD dwNumPChannels, DWORD* paPChannels); +extern HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_SetTrackConfig (LPDIRECTMUSICSEGMENT8 iface, REFGUID rguidTrackClassID, DWORD dwGroupBits, DWORD dwIndex, DWORD dwFlagsOn, DWORD dwFlagsOff); +extern HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_GetAudioPathConfig (LPDIRECTMUSICSEGMENT8 iface, IUnknown** ppAudioPathConfig); +extern HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_Compose (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME mtTime, IDirectMusicSegment* pFromSegment, IDirectMusicSegment* pToSegment, IDirectMusicSegment** ppComposedSegment); +extern HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_Download (LPDIRECTMUSICSEGMENT8 iface, IUnknown *pAudioPath); +extern HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_Unload (LPDIRECTMUSICSEGMENT8 iface, IUnknown *pAudioPath); +/* IDirectMusicObject: */ +extern HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicSegment8Impl_IDirectMusicObject_AddRef (LPDIRECTMUSICOBJECT iface); +extern ULONG WINAPI IDirectMusicSegment8Impl_IDirectMusicObject_Release (LPDIRECTMUSICOBJECT iface); +extern HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc); +extern HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc); +extern HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc); +/* IPersistStream: */ +extern HRESULT WINAPI IDirectMusicSegment8Impl_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject); +extern ULONG WINAPI IDirectMusicSegment8Impl_IPersistStream_AddRef (LPPERSISTSTREAM iface); +extern ULONG WINAPI IDirectMusicSegment8Impl_IPersistStream_Release (LPPERSISTSTREAM iface); +extern HRESULT WINAPI IDirectMusicSegment8Impl_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID); +extern HRESULT WINAPI IDirectMusicSegment8Impl_IPersistStream_IsDirty (LPPERSISTSTREAM iface); +extern HRESULT WINAPI IDirectMusicSegment8Impl_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm); +extern HRESULT WINAPI IDirectMusicSegment8Impl_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty); +extern HRESULT WINAPI IDirectMusicSegment8Impl_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize); + /***************************************************************************** * IDirectMusicSegmentState8Impl implementation structure */ -struct IDirectMusicSegmentState8Impl -{ +struct IDirectMusicSegmentState8Impl { /* IUnknown fields */ ICOM_VFIELD(IDirectMusicSegmentState8); DWORD ref; @@ -340,79 +320,74 @@ struct IDirectMusicSegmentState8Impl extern HRESULT WINAPI IDirectMusicSegmentState8Impl_QueryInterface (LPDIRECTMUSICSEGMENTSTATE8 iface, REFIID riid, LPVOID *ppobj); extern ULONG WINAPI IDirectMusicSegmentState8Impl_AddRef (LPDIRECTMUSICSEGMENTSTATE8 iface); extern ULONG WINAPI IDirectMusicSegmentState8Impl_Release (LPDIRECTMUSICSEGMENTSTATE8 iface); -/* IDirectMusicSegmentState: */ +/* IDirectMusicSegmentState(8): */ extern HRESULT WINAPI IDirectMusicSegmentState8Impl_GetRepeats (LPDIRECTMUSICSEGMENTSTATE8 iface, DWORD* pdwRepeats); extern HRESULT WINAPI IDirectMusicSegmentState8Impl_GetSegment (LPDIRECTMUSICSEGMENTSTATE8 iface, IDirectMusicSegment** ppSegment); extern HRESULT WINAPI IDirectMusicSegmentState8Impl_GetStartTime (LPDIRECTMUSICSEGMENTSTATE8 iface, MUSIC_TIME* pmtStart); extern HRESULT WINAPI IDirectMusicSegmentState8Impl_GetSeek (LPDIRECTMUSICSEGMENTSTATE8 iface, MUSIC_TIME* pmtSeek); extern HRESULT WINAPI IDirectMusicSegmentState8Impl_GetStartPoint (LPDIRECTMUSICSEGMENTSTATE8 iface, MUSIC_TIME* pmtStart); -/* IDirectMusicSegmentState8: */ extern HRESULT WINAPI IDirectMusicSegmentState8Impl_SetTrackConfig (LPDIRECTMUSICSEGMENTSTATE8 iface, REFGUID rguidTrackClassID, DWORD dwGroupBits, DWORD dwIndex, DWORD dwFlagsOn, DWORD dwFlagsOff); extern HRESULT WINAPI IDirectMusicSegmentState8Impl_GetObjectInPath (LPDIRECTMUSICSEGMENTSTATE8 iface, DWORD dwPChannel, DWORD dwStage, DWORD dwBuffer, REFGUID guidObject, DWORD dwIndex, REFGUID iidInterface, void** ppObject); /***************************************************************************** * IDirectMusicGraphImpl implementation structure */ -struct IDirectMusicGraphImpl -{ +struct IDirectMusicGraphImpl { /* IUnknown fields */ - ICOM_VFIELD(IDirectMusicGraph); + ICOM_VTABLE(IUnknown) *UnknownVtbl; + ICOM_VTABLE(IDirectMusicGraph) *GraphVtbl; + ICOM_VTABLE(IDirectMusicObject) *ObjectVtbl; + ICOM_VTABLE(IPersistStream) *PersistStreamVtbl; DWORD ref; /* IDirectMusicGraphImpl fields */ - IDirectMusicGraphObject* pObject; + LPDMUS_OBJECTDESC pDesc; IDirectMusicTool8Impl* pFirst; IDirectMusicTool8Impl* pLast; WORD num_tools; }; /* IUnknown: */ -extern HRESULT WINAPI IDirectMusicGraphImpl_QueryInterface (LPDIRECTMUSICGRAPH iface, REFIID riid, LPVOID *ppobj); -extern ULONG WINAPI IDirectMusicGraphImpl_AddRef (LPDIRECTMUSICGRAPH iface); -extern ULONG WINAPI IDirectMusicGraphImpl_Release (LPDIRECTMUSICGRAPH iface); +extern HRESULT WINAPI IDirectMusicGraphImpl_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicGraphImpl_IUnknown_AddRef (LPUNKNOWN iface); +extern ULONG WINAPI IDirectMusicGraphImpl_IUnknown_Release (LPUNKNOWN iface); /* IDirectMusicGraph: */ -extern HRESULT WINAPI IDirectMusicGraphImpl_StampPMsg (LPDIRECTMUSICGRAPH iface, DMUS_PMSG* pPMSG); -extern HRESULT WINAPI IDirectMusicGraphImpl_InsertTool (LPDIRECTMUSICGRAPH iface, IDirectMusicTool* pTool, DWORD* pdwPChannels, DWORD cPChannels, LONG lIndex); -extern HRESULT WINAPI IDirectMusicGraphImpl_GetTool (LPDIRECTMUSICGRAPH iface, DWORD dwIndex, IDirectMusicTool** ppTool); -extern HRESULT WINAPI IDirectMusicGraphImpl_RemoveTool (LPDIRECTMUSICGRAPH iface, IDirectMusicTool* pTool); - -/***************************************************************************** - * IDirectMusicSongImpl implementation structure - */ -struct IDirectMusicSongImpl -{ - /* IUnknown fields */ - ICOM_VFIELD(IDirectMusicSong); - DWORD ref; - - /* IDirectMusicSongImpl fields */ - IDirectMusicSongObject* pObject; -}; - -/* IUnknown: */ -extern HRESULT WINAPI IDirectMusicSongImpl_QueryInterface (LPDIRECTMUSICSONG iface, REFIID riid, LPVOID *ppobj); -extern ULONG WINAPI IDirectMusicSongImpl_AddRef (LPDIRECTMUSICSONG iface); -extern ULONG WINAPI IDirectMusicSongImpll_Release (LPDIRECTMUSICSONG iface); -/* IDirectMusicContainer: */ -extern HRESULT WINAPI IDirectMusicSongImpl_Compose (LPDIRECTMUSICSONG iface); -extern HRESULT WINAPI IDirectMusicSongImpl_GetParam (LPDIRECTMUSICSONG iface, REFGUID rguidType, DWORD dwGroupBits, DWORD dwIndex, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam); -extern HRESULT WINAPI IDirectMusicSongImpl_GetSegment (LPDIRECTMUSICSONG iface, WCHAR* pwzName, IDirectMusicSegment** ppSegment); -extern HRESULT WINAPI IDirectMusicSongImpl_GetAudioPathConfig (LPDIRECTMUSICSONG iface, IUnknown** ppAudioPathConfig); -extern HRESULT WINAPI IDirectMusicSongImpl_Download (LPDIRECTMUSICSONG iface, IUnknown* pAudioPath); -extern HRESULT WINAPI IDirectMusicSongImpl_Unload (LPDIRECTMUSICSONG iface, IUnknown* pAudioPath); -extern HRESULT WINAPI IDirectMusicSongImpl_EnumSegment (LPDIRECTMUSICSONG iface, DWORD dwIndex, IDirectMusicSegment** ppSegment); +extern HRESULT WINAPI IDirectMusicGraphImpl_IDirectMusicGraph_QueryInterface (LPDIRECTMUSICGRAPH iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicGraphImpl_IDirectMusicGraph_AddRef (LPDIRECTMUSICGRAPH iface); +extern ULONG WINAPI IDirectMusicGraphImpl_IDirectMusicGraph_Release (LPDIRECTMUSICGRAPH iface);extern HRESULT WINAPI IDirectMusicGraphImpl_StampPMsg (LPDIRECTMUSICGRAPH iface, DMUS_PMSG* pPMSG); +extern HRESULT WINAPI IDirectMusicGraphImpl_IDirectMusicGraph_InsertTool (LPDIRECTMUSICGRAPH iface, IDirectMusicTool* pTool, DWORD* pdwPChannels, DWORD cPChannels, LONG lIndex); +extern HRESULT WINAPI IDirectMusicGraphImpl_IDirectMusicGraph_GetTool (LPDIRECTMUSICGRAPH iface, DWORD dwIndex, IDirectMusicTool** ppTool); +extern HRESULT WINAPI IDirectMusicGraphImpl_IDirectMusicGraph_RemoveTool (LPDIRECTMUSICGRAPH iface, IDirectMusicTool* pTool); +/* IDirectMusicObject: */ +extern HRESULT WINAPI IDirectMusicGraphImpl_IDirectMusicObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicGraphImpl_IDirectMusicObject_AddRef (LPDIRECTMUSICOBJECT iface); +extern ULONG WINAPI IDirectMusicGraphImpl_IDirectMusicObject_Release (LPDIRECTMUSICOBJECT iface); +extern HRESULT WINAPI IDirectMusicGraphImpl_IDirectMusicObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc); +extern HRESULT WINAPI IDirectMusicGraphImpl_IDirectMusicObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc); +extern HRESULT WINAPI IDirectMusicGraphImpl_IDirectMusicObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc); +/* IPersistStream: */ +extern HRESULT WINAPI IDirectMusicGraphImpl_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject); +extern ULONG WINAPI IDirectMusicGraphImpl_IPersistStream_AddRef (LPPERSISTSTREAM iface); +extern ULONG WINAPI IDirectMusicGraphImpl_IPersistStream_Release (LPPERSISTSTREAM iface); +extern HRESULT WINAPI IDirectMusicGraphImpl_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID); +extern HRESULT WINAPI IDirectMusicGraphImpl_IPersistStream_IsDirty (LPPERSISTSTREAM iface); +extern HRESULT WINAPI IDirectMusicGraphImpl_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm); +extern HRESULT WINAPI IDirectMusicGraphImpl_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty); +extern HRESULT WINAPI IDirectMusicGraphImpl_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize); /***************************************************************************** * IDirectMusicAudioPathImpl implementation structure */ -struct IDirectMusicAudioPathImpl -{ +struct IDirectMusicAudioPathImpl { /* IUnknown fields */ - ICOM_VFIELD(IDirectMusicAudioPath); + ICOM_VTABLE(IUnknown) *UnknownVtbl; + ICOM_VTABLE(IDirectMusicAudioPath) *AudioPathVtbl; + ICOM_VTABLE(IDirectMusicObject) *ObjectVtbl; + ICOM_VTABLE(IPersistStream) *PersistStreamVtbl; DWORD ref; /* IDirectMusicAudioPathImpl fields */ - IDirectMusicAudioPathObject* pObject; + LPDMUS_OBJECTDESC pDesc; IDirectMusicPerformance8* pPerf; IDirectMusicGraph* pToolGraph; @@ -421,20 +396,38 @@ struct IDirectMusicAudioPathImpl }; /* IUnknown: */ -extern HRESULT WINAPI IDirectMusicAudioPathImpl_QueryInterface (LPDIRECTMUSICAUDIOPATH iface, REFIID riid, LPVOID *ppobj); -extern ULONG WINAPI IDirectMusicAudioPathImpl_AddRef (LPDIRECTMUSICAUDIOPATH iface); -extern ULONG WINAPI IDirectMusicAudioPathImpl_Release (LPDIRECTMUSICAUDIOPATH iface); +extern HRESULT WINAPI IDirectMusicAudioPathImpl_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicAudioPathImpl_IUnknown_AddRef (LPUNKNOWN iface); +extern ULONG WINAPI IDirectMusicAudioPathImpl_IUnknown_Release (LPUNKNOWN iface); /* IDirectMusicAudioPath: */ -extern HRESULT WINAPI IDirectMusicAudioPathImpl_GetObjectInPath (LPDIRECTMUSICAUDIOPATH iface, DWORD dwPChannel, DWORD dwStage, DWORD dwBuffer, REFGUID guidObject, WORD dwIndex, REFGUID iidInterface, void** ppObject); -extern HRESULT WINAPI IDirectMusicAudioPathImpl_Activate (LPDIRECTMUSICAUDIOPATH iface, BOOL fActivate); -extern HRESULT WINAPI IDirectMusicAudioPathImpl_SetVolume (LPDIRECTMUSICAUDIOPATH iface, long lVolume, DWORD dwDuration); -extern HRESULT WINAPI IDirectMusicAudioPathImpl_ConvertPChannel (LPDIRECTMUSICAUDIOPATH iface, DWORD dwPChannelIn, DWORD* pdwPChannelOut); +extern HRESULT WINAPI IDirectMusicAudioPathImpl_IDirectMusicAudioPath_QueryInterface (LPDIRECTMUSICAUDIOPATH iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicAudioPathImpl_IDirectMusicAudioPath_AddRef (LPDIRECTMUSICAUDIOPATH iface); +extern ULONG WINAPI IDirectMusicAudioPathImpl_IDirectMusicAudioPath_Release (LPDIRECTMUSICAUDIOPATH iface); +extern HRESULT WINAPI IDirectMusicAudioPathImpl_IDirectMusicAudioPath_GetObjectInPath (LPDIRECTMUSICAUDIOPATH iface, DWORD dwPChannel, DWORD dwStage, DWORD dwBuffer, REFGUID guidObject, WORD dwIndex, REFGUID iidInterface, void** ppObject); +extern HRESULT WINAPI IDirectMusicAudioPathImpl_IDirectMusicAudioPath_Activate (LPDIRECTMUSICAUDIOPATH iface, BOOL fActivate); +extern HRESULT WINAPI IDirectMusicAudioPathImpl_IDirectMusicAudioPath_SetVolume (LPDIRECTMUSICAUDIOPATH iface, long lVolume, DWORD dwDuration); +extern HRESULT WINAPI IDirectMusicAudioPathImpl_IDirectMusicAudioPath_ConvertPChannel (LPDIRECTMUSICAUDIOPATH iface, DWORD dwPChannelIn, DWORD* pdwPChannelOut); +/* IDirectMusicObject: */ +extern HRESULT WINAPI IDirectMusicAudioPathImpl_IDirectMusicObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicAudioPathImpl_IDirectMusicObject_AddRef (LPDIRECTMUSICOBJECT iface); +extern ULONG WINAPI IDirectMusicAudioPathImpl_IDirectMusicObject_Release (LPDIRECTMUSICOBJECT iface); +extern HRESULT WINAPI IDirectMusicAudioPathImpl_IDirectMusicObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc); +extern HRESULT WINAPI IDirectMusicAudioPathImpl_IDirectMusicObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc); +extern HRESULT WINAPI IDirectMusicAudioPathImpl_IDirectMusicObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc); +/* IPersistStream: */ +extern HRESULT WINAPI IDirectMusicAudioPathImpl_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject); +extern ULONG WINAPI IDirectMusicAudioPathImpl_IPersistStream_AddRef (LPPERSISTSTREAM iface); +extern ULONG WINAPI IDirectMusicAudioPathImpl_IPersistStream_Release (LPPERSISTSTREAM iface); +extern HRESULT WINAPI IDirectMusicAudioPathImpl_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID); +extern HRESULT WINAPI IDirectMusicAudioPathImpl_IPersistStream_IsDirty (LPPERSISTSTREAM iface); +extern HRESULT WINAPI IDirectMusicAudioPathImpl_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm); +extern HRESULT WINAPI IDirectMusicAudioPathImpl_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty); +extern HRESULT WINAPI IDirectMusicAudioPathImpl_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize); /***************************************************************************** * IDirectMusicTool8Impl implementation structure */ -struct IDirectMusicTool8Impl -{ +struct IDirectMusicTool8Impl { /* IUnknown fields */ ICOM_VFIELD(IDirectMusicTool8); DWORD ref; @@ -448,21 +441,19 @@ struct IDirectMusicTool8Impl extern HRESULT WINAPI IDirectMusicTool8Impl_QueryInterface (LPDIRECTMUSICTOOL8 iface, REFIID riid, LPVOID *ppobj); extern ULONG WINAPI IDirectMusicTool8Impl_AddRef (LPDIRECTMUSICTOOL8 iface); extern ULONG WINAPI IDirectMusicTool8Impl_Release (LPDIRECTMUSICTOOL8 iface); -/* IDirectMusicTool8Impl: */ +/* IDirectMusicTool(8): */ extern HRESULT WINAPI IDirectMusicTool8Impl_Init (LPDIRECTMUSICTOOL8 iface, IDirectMusicGraph* pGraph); extern HRESULT WINAPI IDirectMusicTool8Impl_GetMsgDeliveryType (LPDIRECTMUSICTOOL8 iface, DWORD* pdwDeliveryType); extern HRESULT WINAPI IDirectMusicTool8Impl_GetMediaTypeArraySize (LPDIRECTMUSICTOOL8 iface, DWORD* pdwNumElements); extern HRESULT WINAPI IDirectMusicTool8Impl_GetMediaTypes (LPDIRECTMUSICTOOL8 iface, DWORD** padwMediaTypes, DWORD dwNumElements); extern HRESULT WINAPI IDirectMusicTool8Impl_ProcessPMsg (LPDIRECTMUSICTOOL8 iface, IDirectMusicPerformance* pPerf, DMUS_PMSG* pPMSG); extern HRESULT WINAPI IDirectMusicTool8Impl_Flush (LPDIRECTMUSICTOOL8 iface, IDirectMusicPerformance* pPerf, DMUS_PMSG* pPMSG, REFERENCE_TIME rtTime); -/* IDirectMusicToolImpl8: */ extern HRESULT WINAPI IDirectMusicTool8Impl_Clone (LPDIRECTMUSICTOOL8 iface, IDirectMusicTool** ppTool); /***************************************************************************** * IDirectMusicPatternTrackImpl implementation structure */ -struct IDirectMusicPatternTrackImpl -{ +struct IDirectMusicPatternTrackImpl { /* IUnknown fields */ ICOM_VFIELD(IDirectMusicPatternTrack); DWORD ref; @@ -479,751 +470,527 @@ extern HRESULT WINAPI IDirectMusicPatternTrackImpl_CreateSegment (LPDIRECTMUSICP extern HRESULT WINAPI IDirectMusicPatternTrackImpl_SetVariation (LPDIRECTMUSICPATTERNTRACK iface, IDirectMusicSegmentState* pSegState, DWORD dwVariationFlags, DWORD dwPart); extern HRESULT WINAPI IDirectMusicPatternTrackImpl_SetPatternByName (LPDIRECTMUSICPATTERNTRACK iface, IDirectMusicSegmentState* pSegState, WCHAR* wszName, IDirectMusicStyle* pStyle, DWORD dwPatternType, DWORD* pdwLength); - -/***************************************************************************** - * IDirectMusicSegmentObject implementation structure - */ -struct IDirectMusicSegmentObject -{ - /* IUnknown fields */ - ICOM_VFIELD (IDirectMusicObject); - DWORD ref; - - /* IDirectMusicObjectImpl fields */ - LPDMUS_OBJECTDESC pDesc; - IDirectMusicSegmentObjectStream* pStream; - IDirectMusicSegment8Impl* pSegment; -}; - -/* IUnknown: */ -extern HRESULT WINAPI IDirectMusicSegmentObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj); -extern ULONG WINAPI IDirectMusicSegmentObject_AddRef (LPDIRECTMUSICOBJECT iface); -extern ULONG WINAPI IDirectMusicSegmentObject_Release (LPDIRECTMUSICOBJECT iface); -/* IDirectMusicObject: */ -extern HRESULT WINAPI IDirectMusicSegmentObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc); -extern HRESULT WINAPI IDirectMusicSegmentObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc); -extern HRESULT WINAPI IDirectMusicSegmentObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc); - -/***************************************************************************** - * IDirectMusicSegmentObjectStream implementation structure - */ -struct IDirectMusicSegmentObjectStream -{ - /* IUnknown fields */ - ICOM_VFIELD (IPersistStream); - DWORD ref; - - /* IPersistStreamImpl fields */ - IDirectMusicSegmentObject* pParentObject; -}; - -/* IUnknown: */ -extern HRESULT WINAPI IDirectMusicSegmentObjectStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject); -extern ULONG WINAPI IDirectMusicSegmentObjectStream_AddRef (LPPERSISTSTREAM iface); -extern ULONG WINAPI IDirectMusicSegmentObjectStream_Release (LPPERSISTSTREAM iface); -/* IPersist: */ -extern HRESULT WINAPI IDirectMusicSegmentObjectStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID); -/* IPersistStream: */ -extern HRESULT WINAPI IDirectMusicSegmentObjectStream_IsDirty (LPPERSISTSTREAM iface); -extern HRESULT WINAPI IDirectMusicSegmentObjectStream_Load (LPPERSISTSTREAM iface, IStream* pStm); -extern HRESULT WINAPI IDirectMusicSegmentObjectStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty); -extern HRESULT WINAPI IDirectMusicSegmentObjectStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize); - - -/***************************************************************************** - * IDirectMusicSongObject implementation structure - */ -struct IDirectMusicSongObject -{ - /* IUnknown fields */ - ICOM_VFIELD (IDirectMusicObject); - DWORD ref; - - /* IDirectMusicObjectImpl fields */ - LPDMUS_OBJECTDESC pDesc; - IDirectMusicSongObjectStream* pStream; - IDirectMusicSongImpl* pSong; -}; - -/* IUnknown: */ -extern HRESULT WINAPI IDirectMusicSongObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj); -extern ULONG WINAPI IDirectMusicSongObject_AddRef (LPDIRECTMUSICOBJECT iface); -extern ULONG WINAPI IDirectMusicSongObject_Release (LPDIRECTMUSICOBJECT iface); -/* IDirectMusicObject: */ -extern HRESULT WINAPI IDirectMusicSongObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc); -extern HRESULT WINAPI IDirectMusicSongObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc); -extern HRESULT WINAPI IDirectMusicSongObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc); - -/***************************************************************************** - * IDirectMusicSongObjectStream implementation structure - */ -struct IDirectMusicSongObjectStream -{ - /* IUnknown fields */ - ICOM_VFIELD (IPersistStream); - DWORD ref; - - /* IPersistStreamImpl fields */ - IDirectMusicSongObject* pParentObject; -}; - -/* IUnknown: */ -extern HRESULT WINAPI IDirectMusicSongObjectStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject); -extern ULONG WINAPI IDirectMusicSongObjectStream_AddRef (LPPERSISTSTREAM iface); -extern ULONG WINAPI IDirectMusicSongObjectStream_Release (LPPERSISTSTREAM iface); -/* IPersist: */ -extern HRESULT WINAPI IDirectMusicSongObjectStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID); -/* IPersistStream: */ -extern HRESULT WINAPI IDirectMusicSongObjectStream_IsDirty (LPPERSISTSTREAM iface); -extern HRESULT WINAPI IDirectMusicSongObjectStream_Load (LPPERSISTSTREAM iface, IStream* pStm); -extern HRESULT WINAPI IDirectMusicSongObjectStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty); -extern HRESULT WINAPI IDirectMusicSongObjectStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize); - -/***************************************************************************** - * IDirectMusicAudioPathObject implementation structure - */ -struct IDirectMusicAudioPathObject -{ - /* IUnknown fields */ - ICOM_VFIELD (IDirectMusicObject); - DWORD ref; - - /* IDirectMusicObjectImpl fields */ - LPDMUS_OBJECTDESC pDesc; - IDirectMusicAudioPathObjectStream* pStream; - IDirectMusicAudioPathImpl* pAudioPath; -}; - -/* IUnknown: */ -extern HRESULT WINAPI IDirectMusicAudioPathObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj); -extern ULONG WINAPI IDirectMusicAudioPathObject_AddRef (LPDIRECTMUSICOBJECT iface); -extern ULONG WINAPI IDirectMusicAudioPathObject_Release (LPDIRECTMUSICOBJECT iface); -/* IDirectMusicObject: */ -extern HRESULT WINAPI IDirectMusicAudioPathObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc); -extern HRESULT WINAPI IDirectMusicAudioPathObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc); -extern HRESULT WINAPI IDirectMusicAudioPathObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc); - -/***************************************************************************** - * IDirectMusicAudioPathObjectStream implementation structure - */ -struct IDirectMusicAudioPathObjectStream -{ - /* IUnknown fields */ - ICOM_VFIELD (IPersistStream); - DWORD ref; - - /* IPersistStreamImpl fields */ - IDirectMusicAudioPathObject* pParentObject; -}; - -/* IUnknown: */ -extern HRESULT WINAPI IDirectMusicAudioPathObjectStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject); -extern ULONG WINAPI IDirectMusicAudioPathObjectStream_AddRef (LPPERSISTSTREAM iface); -extern ULONG WINAPI IDirectMusicAudioPathObjectStream_Release (LPPERSISTSTREAM iface); -/* IPersist: */ -extern HRESULT WINAPI IDirectMusicAudioPathObjectStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID); -/* IPersistStream: */ -extern HRESULT WINAPI IDirectMusicAudioPathObjectStream_IsDirty (LPPERSISTSTREAM iface); -extern HRESULT WINAPI IDirectMusicAudioPathObjectStream_Load (LPPERSISTSTREAM iface, IStream* pStm); -extern HRESULT WINAPI IDirectMusicAudioPathObjectStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty); -extern HRESULT WINAPI IDirectMusicAudioPathObjectStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize); - -/***************************************************************************** - * IDirectMusicGraphObject implementation structure - */ -struct IDirectMusicGraphObject -{ - /* IUnknown fields */ - ICOM_VFIELD (IDirectMusicObject); - DWORD ref; - - /* IDirectMusicObjectImpl fields */ - LPDMUS_OBJECTDESC pDesc; - IDirectMusicGraphObjectStream* pStream; - IDirectMusicGraphImpl* pGraph; -}; - -/* IUnknown: */ -extern HRESULT WINAPI IDirectMusicGraphObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj); -extern ULONG WINAPI IDirectMusicGraphObject_AddRef (LPDIRECTMUSICOBJECT iface); -extern ULONG WINAPI IDirectMusicGraphObject_Release (LPDIRECTMUSICOBJECT iface); -/* IDirectMusicObject: */ -extern HRESULT WINAPI IDirectMusicGraphObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc); -extern HRESULT WINAPI IDirectMusicGraphObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc); -extern HRESULT WINAPI IDirectMusicGraphObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc); - -/***************************************************************************** - * IDirectMusicGraphObjectStream implementation structure - */ -struct IDirectMusicGraphObjectStream -{ - /* IUnknown fields */ - ICOM_VFIELD (IPersistStream); - DWORD ref; - - /* IPersistStreamImpl fields */ - IDirectMusicGraphObject* pParentObject; -}; - -/* IUnknown: */ -extern HRESULT WINAPI IDirectMusicGraphObjectStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject); -extern ULONG WINAPI IDirectMusicGraphObjectStream_AddRef (LPPERSISTSTREAM iface); -extern ULONG WINAPI IDirectMusicGraphObjectStream_Release (LPPERSISTSTREAM iface); -/* IPersist: */ -extern HRESULT WINAPI IDirectMusicGraphObjectStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID); -/* IPersistStream: */ -extern HRESULT WINAPI IDirectMusicGraphObjectStream_IsDirty (LPPERSISTSTREAM iface); -extern HRESULT WINAPI IDirectMusicGraphObjectStream_Load (LPPERSISTSTREAM iface, IStream* pStm); -extern HRESULT WINAPI IDirectMusicGraphObjectStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty); -extern HRESULT WINAPI IDirectMusicGraphObjectStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize); - - /***************************************************************************** * IDirectMusicLyricsTrack implementation structure */ struct IDirectMusicLyricsTrack { /* IUnknown fields */ - ICOM_VFIELD(IDirectMusicTrack8); + ICOM_VTABLE(IUnknown) *UnknownVtbl; + ICOM_VTABLE(IDirectMusicTrack8) *TrackVtbl; + ICOM_VTABLE(IPersistStream) *PersistStreamVtbl; DWORD ref; /* IDirectMusicLyricsTrack fields */ - IDirectMusicLyricsTrackStream* pStream; + LPDMUS_OBJECTDESC pDesc; }; /* IUnknown: */ -extern HRESULT WINAPI IDirectMusicLyricsTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj); -extern ULONG WINAPI IDirectMusicLyricsTrack_AddRef (LPDIRECTMUSICTRACK8 iface); -extern ULONG WINAPI IDirectMusicLyricsTrack_Release (LPDIRECTMUSICTRACK8 iface); -/* IDirectMusicTrack: */ -extern HRESULT WINAPI IDirectMusicLyricsTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment); -extern HRESULT WINAPI IDirectMusicLyricsTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicLyricsTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData); -extern 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); -extern HRESULT WINAPI IDirectMusicLyricsTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam); -extern HRESULT WINAPI IDirectMusicLyricsTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam); -extern HRESULT WINAPI IDirectMusicLyricsTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType); -extern HRESULT WINAPI IDirectMusicLyricsTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); -extern HRESULT WINAPI IDirectMusicLyricsTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); -extern HRESULT WINAPI IDirectMusicLyricsTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack); -/* IDirectMusicTrack8: */ -extern 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); -extern HRESULT WINAPI IDirectMusicLyricsTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicLyricsTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicLyricsTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); -extern HRESULT WINAPI IDirectMusicLyricsTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); - -/***************************************************************************** - * IDirectMusicLyricsTrackStream implementation structure - */ -struct IDirectMusicLyricsTrackStream -{ - /* IUnknown fields */ - ICOM_VFIELD (IPersistStream); - DWORD ref; - - /* IPersistStreamImpl fields */ - IDirectMusicLyricsTrack* pParentTrack; -}; - -/* IUnknown: */ -extern HRESULT WINAPI IDirectMusicLyricsTrackStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject); -extern ULONG WINAPI IDirectMusicLyricsTrackStream_AddRef (LPPERSISTSTREAM iface); -extern ULONG WINAPI IDirectMusicLyricsTrackStream_Release (LPPERSISTSTREAM iface); -/* IPersist: */ -extern HRESULT WINAPI IDirectMusicLyricsTrackStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID); +extern HRESULT WINAPI IDirectMusicLyricsTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicLyricsTrack_IUnknown_AddRef (LPUNKNOWN iface); +extern ULONG WINAPI IDirectMusicLyricsTrack_IUnknown_Release (LPUNKNOWN iface); +/* IDirectMusicTrack(8): */ +extern HRESULT WINAPI IDirectMusicLyricsTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicLyricsTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface); +extern ULONG WINAPI IDirectMusicLyricsTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface); +extern HRESULT WINAPI IDirectMusicLyricsTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment); +extern HRESULT WINAPI IDirectMusicLyricsTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicLyricsTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData); +extern 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); +extern HRESULT WINAPI IDirectMusicLyricsTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam); +extern HRESULT WINAPI IDirectMusicLyricsTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam); +extern HRESULT WINAPI IDirectMusicLyricsTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType); +extern HRESULT WINAPI IDirectMusicLyricsTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); +extern HRESULT WINAPI IDirectMusicLyricsTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); +extern HRESULT WINAPI IDirectMusicLyricsTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack); +extern 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); +extern HRESULT WINAPI IDirectMusicLyricsTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicLyricsTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicLyricsTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); +extern HRESULT WINAPI IDirectMusicLyricsTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); /* IPersistStream: */ -extern HRESULT WINAPI IDirectMusicLyricsTrackStream_IsDirty (LPPERSISTSTREAM iface); -extern HRESULT WINAPI IDirectMusicLyricsTrackStream_Load (LPPERSISTSTREAM iface, IStream* pStm); -extern HRESULT WINAPI IDirectMusicLyricsTrackStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty); -extern HRESULT WINAPI IDirectMusicLyricsTrackStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize); +extern HRESULT WINAPI IDirectMusicLyricsTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject); +extern ULONG WINAPI IDirectMusicLyricsTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface); +extern ULONG WINAPI IDirectMusicLyricsTrack_IPersistStream_Release (LPPERSISTSTREAM iface); +extern HRESULT WINAPI IDirectMusicLyricsTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID); +extern HRESULT WINAPI IDirectMusicLyricsTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface); +extern HRESULT WINAPI IDirectMusicLyricsTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm); +extern HRESULT WINAPI IDirectMusicLyricsTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty); +extern HRESULT WINAPI IDirectMusicLyricsTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize); /***************************************************************************** * IDirectMusicMarkerTrack implementation structure */ -struct IDirectMusicMarkerTrack -{ +struct IDirectMusicMarkerTrack { /* IUnknown fields */ - ICOM_VFIELD(IDirectMusicTrack8); + ICOM_VTABLE(IUnknown) *UnknownVtbl; + ICOM_VTABLE(IDirectMusicTrack8) *TrackVtbl; + ICOM_VTABLE(IPersistStream) *PersistStreamVtbl; DWORD ref; /* IDirectMusicMarkerTrack fields */ - IDirectMusicMarkerTrackStream* pStream; + LPDMUS_OBJECTDESC pDesc; }; /* IUnknown: */ -extern HRESULT WINAPI IDirectMusicMarkerTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj); -extern ULONG WINAPI IDirectMusicMarkerTrack_AddRef (LPDIRECTMUSICTRACK8 iface); -extern ULONG WINAPI IDirectMusicMarkerTrack_Release (LPDIRECTMUSICTRACK8 iface); -/* IDirectMusicTrack: */ -extern HRESULT WINAPI IDirectMusicMarkerTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment); -extern HRESULT WINAPI IDirectMusicMarkerTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicMarkerTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData); -extern 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); -extern HRESULT WINAPI IDirectMusicMarkerTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam); -extern HRESULT WINAPI IDirectMusicMarkerTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam); -extern HRESULT WINAPI IDirectMusicMarkerTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType); -extern HRESULT WINAPI IDirectMusicMarkerTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); -extern HRESULT WINAPI IDirectMusicMarkerTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); -extern HRESULT WINAPI IDirectMusicMarkerTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack); -/* IDirectMusicTrack8: */ -extern 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); -extern HRESULT WINAPI IDirectMusicMarkerTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicMarkerTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicMarkerTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); -extern HRESULT WINAPI IDirectMusicMarkerTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); - -/***************************************************************************** - * IDirectMusicMarkerTrackStream implementation structure - */ -struct IDirectMusicMarkerTrackStream -{ - /* IUnknown fields */ - ICOM_VFIELD (IPersistStream); - DWORD ref; - - /* IPersistStreamImpl fields */ - IDirectMusicMarkerTrack* pParentTrack; -}; - -/* IUnknown: */ -extern HRESULT WINAPI IDirectMusicMarkerTrackStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject); -extern ULONG WINAPI IDirectMusicMarkerTrackStream_AddRef (LPPERSISTSTREAM iface); -extern ULONG WINAPI IDirectMusicMarkerTrackStream_Release (LPPERSISTSTREAM iface); -/* IPersist: */ -extern HRESULT WINAPI IDirectMusicMarkerTrackStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID); +extern HRESULT WINAPI IDirectMusicMarkerTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicMarkerTrack_IUnknown_AddRef (LPUNKNOWN iface); +extern ULONG WINAPI IDirectMusicMarkerTrack_IUnknown_Release (LPUNKNOWN iface); +/* IDirectMusicTrack(8): */ +extern HRESULT WINAPI IDirectMusicMarkerTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicMarkerTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface); +extern ULONG WINAPI IDirectMusicMarkerTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface); +extern HRESULT WINAPI IDirectMusicMarkerTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment); +extern HRESULT WINAPI IDirectMusicMarkerTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicMarkerTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData); +extern 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); +extern HRESULT WINAPI IDirectMusicMarkerTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam); +extern HRESULT WINAPI IDirectMusicMarkerTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam); +extern HRESULT WINAPI IDirectMusicMarkerTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType); +extern HRESULT WINAPI IDirectMusicMarkerTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); +extern HRESULT WINAPI IDirectMusicMarkerTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); +extern HRESULT WINAPI IDirectMusicMarkerTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack); +extern 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); +extern HRESULT WINAPI IDirectMusicMarkerTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicMarkerTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicMarkerTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); +extern HRESULT WINAPI IDirectMusicMarkerTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); /* IPersistStream: */ -extern HRESULT WINAPI IDirectMusicMarkerTrackStream_IsDirty (LPPERSISTSTREAM iface); -extern HRESULT WINAPI IDirectMusicMarkerTrackStream_Load (LPPERSISTSTREAM iface, IStream* pStm); -extern HRESULT WINAPI IDirectMusicMarkerTrackStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty); -extern HRESULT WINAPI IDirectMusicMarkerTrackStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize); +extern HRESULT WINAPI IDirectMusicMarkerTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject); +extern ULONG WINAPI IDirectMusicMarkerTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface); +extern ULONG WINAPI IDirectMusicMarkerTrack_IPersistStream_Release (LPPERSISTSTREAM iface); +extern HRESULT WINAPI IDirectMusicMarkerTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID); +extern HRESULT WINAPI IDirectMusicMarkerTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface); +extern HRESULT WINAPI IDirectMusicMarkerTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm); +extern HRESULT WINAPI IDirectMusicMarkerTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty); +extern HRESULT WINAPI IDirectMusicMarkerTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize); /***************************************************************************** * IDirectMusicParamControlTrack implementation structure */ -struct IDirectMusicParamControlTrack -{ +struct IDirectMusicParamControlTrack { /* IUnknown fields */ - ICOM_VFIELD(IDirectMusicTrack8); + ICOM_VTABLE(IUnknown) *UnknownVtbl; + ICOM_VTABLE(IDirectMusicTrack8) *TrackVtbl; + ICOM_VTABLE(IPersistStream) *PersistStreamVtbl; DWORD ref; /* IDirectMusicParamControlTrack fields */ - IDirectMusicParamControlTrackStream* pStream; + LPDMUS_OBJECTDESC pDesc; }; /* IUnknown: */ -extern HRESULT WINAPI IDirectMusicParamControlTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj); -extern ULONG WINAPI IDirectMusicParamControlTrack_AddRef (LPDIRECTMUSICTRACK8 iface); -extern ULONG WINAPI IDirectMusicParamControlTrack_Release (LPDIRECTMUSICTRACK8 iface); -/* IDirectMusicTrack: */ -extern HRESULT WINAPI IDirectMusicParamControlTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment); -extern HRESULT WINAPI IDirectMusicParamControlTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicParamControlTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData); -extern 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); -extern HRESULT WINAPI IDirectMusicParamControlTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam); -extern HRESULT WINAPI IDirectMusicParamControlTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam); -extern HRESULT WINAPI IDirectMusicParamControlTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType); -extern HRESULT WINAPI IDirectMusicParamControlTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); -extern HRESULT WINAPI IDirectMusicParamControlTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); -extern HRESULT WINAPI IDirectMusicParamControlTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack); -/* IDirectMusicTrack8: */ -extern 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); -extern HRESULT WINAPI IDirectMusicParamControlTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicParamControlTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicParamControlTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); -extern HRESULT WINAPI IDirectMusicParamControlTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); - -/***************************************************************************** - * IDirectMusicParamControlTrackStream implementation structure - */ -struct IDirectMusicParamControlTrackStream -{ - /* IUnknown fields */ - ICOM_VFIELD (IPersistStream); - DWORD ref; - - /* IPersistStreamImpl fields */ - IDirectMusicParamControlTrack* pParentTrack; -}; - -/* IUnknown: */ -extern HRESULT WINAPI IDirectMusicParamControlTrackStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject); -extern ULONG WINAPI IDirectMusicParamControlTrackStream_AddRef (LPPERSISTSTREAM iface); -extern ULONG WINAPI IDirectMusicParamControlTrackStream_Release (LPPERSISTSTREAM iface); -/* IPersist: */ -extern HRESULT WINAPI IDirectMusicParamControlTrackStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID); +extern HRESULT WINAPI IDirectMusicParamControlTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicParamControlTrack_IUnknown_AddRef (LPUNKNOWN iface); +extern ULONG WINAPI IDirectMusicParamControlTrack_IUnknown_Release (LPUNKNOWN iface); +/* IDirectMusicTrack(8): */ +extern HRESULT WINAPI IDirectMusicParamControlTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicParamControlTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface); +extern ULONG WINAPI IDirectMusicParamControlTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface); +extern HRESULT WINAPI IDirectMusicParamControlTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment); +extern HRESULT WINAPI IDirectMusicParamControlTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicParamControlTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData); +extern 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); +extern HRESULT WINAPI IDirectMusicParamControlTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam); +extern HRESULT WINAPI IDirectMusicParamControlTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam); +extern HRESULT WINAPI IDirectMusicParamControlTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType); +extern HRESULT WINAPI IDirectMusicParamControlTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); +extern HRESULT WINAPI IDirectMusicParamControlTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); +extern HRESULT WINAPI IDirectMusicParamControlTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack); +extern 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); +extern HRESULT WINAPI IDirectMusicParamControlTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicParamControlTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicParamControlTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); +extern HRESULT WINAPI IDirectMusicParamControlTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); /* IPersistStream: */ -extern HRESULT WINAPI IDirectMusicParamControlTrackStream_IsDirty (LPPERSISTSTREAM iface); -extern HRESULT WINAPI IDirectMusicParamControlTrackStream_Load (LPPERSISTSTREAM iface, IStream* pStm); -extern HRESULT WINAPI IDirectMusicParamControlTrackStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty); -extern HRESULT WINAPI IDirectMusicParamControlTrackStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize); +extern HRESULT WINAPI IDirectMusicParamControlTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject); +extern ULONG WINAPI IDirectMusicParamControlTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface); +extern ULONG WINAPI IDirectMusicParamControlTrack_IPersistStream_Release (LPPERSISTSTREAM iface); +extern HRESULT WINAPI IDirectMusicParamControlTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID); +extern HRESULT WINAPI IDirectMusicParamControlTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface); +extern HRESULT WINAPI IDirectMusicParamControlTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm); +extern HRESULT WINAPI IDirectMusicParamControlTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty); +extern HRESULT WINAPI IDirectMusicParamControlTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize); /***************************************************************************** * IDirectMusicSegTriggerTrack implementation structure */ -struct IDirectMusicSegTriggerTrack -{ +struct IDirectMusicSegTriggerTrack { /* IUnknown fields */ - ICOM_VFIELD(IDirectMusicTrack8); + ICOM_VTABLE(IUnknown) *UnknownVtbl; + ICOM_VTABLE(IDirectMusicTrack8) *TrackVtbl; + ICOM_VTABLE(IPersistStream) *PersistStreamVtbl; DWORD ref; /* IDirectMusicSegTriggerTrack fields */ - IDirectMusicSegTriggerTrackStream* pStream; + LPDMUS_OBJECTDESC pDesc; }; /* IUnknown: */ -extern HRESULT WINAPI IDirectMusicSegTriggerTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj); -extern ULONG WINAPI IDirectMusicSegTriggerTrack_AddRef (LPDIRECTMUSICTRACK8 iface); -extern ULONG WINAPI IDirectMusicSegTriggerTrack_Release (LPDIRECTMUSICTRACK8 iface); -/* IDirectMusicTrack: */ -extern HRESULT WINAPI IDirectMusicSegTriggerTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment); -extern HRESULT WINAPI IDirectMusicSegTriggerTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicSegTriggerTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData); -extern 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); -extern HRESULT WINAPI IDirectMusicSegTriggerTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam); -extern HRESULT WINAPI IDirectMusicSegTriggerTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam); -extern HRESULT WINAPI IDirectMusicSegTriggerTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType); -extern HRESULT WINAPI IDirectMusicSegTriggerTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); -extern HRESULT WINAPI IDirectMusicSegTriggerTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); -extern HRESULT WINAPI IDirectMusicSegTriggerTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack); -/* IDirectMusicTrack8: */ -extern 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); -extern HRESULT WINAPI IDirectMusicSegTriggerTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicSegTriggerTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicSegTriggerTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); -extern HRESULT WINAPI IDirectMusicSegTriggerTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); - -/***************************************************************************** - * IDirectMusicSegTriggerTrackStream implementation structure - */ -struct IDirectMusicSegTriggerTrackStream -{ - /* IUnknown fields */ - ICOM_VFIELD (IPersistStream); - DWORD ref; - - /* IPersistStreamImpl fields */ - IDirectMusicSegTriggerTrack* pParentTrack; -}; - -/* IUnknown: */ -extern HRESULT WINAPI IDirectMusicSegTriggerTrackStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject); -extern ULONG WINAPI IDirectMusicSegTriggerTrackStream_AddRef (LPPERSISTSTREAM iface); -extern ULONG WINAPI IDirectMusicSegTriggerTrackStream_Release (LPPERSISTSTREAM iface); -/* IPersist: */ -extern HRESULT WINAPI IDirectMusicSegTriggerTrackStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID); +extern HRESULT WINAPI IDirectMusicSegTriggerTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicSegTriggerTrack_IUnknown_AddRef (LPUNKNOWN iface); +extern ULONG WINAPI IDirectMusicSegTriggerTrack_IUnknown_Release (LPUNKNOWN iface); +/* IDirectMusicTrack(8): */ +extern HRESULT WINAPI IDirectMusicSegTriggerTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicSegTriggerTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface); +extern ULONG WINAPI IDirectMusicSegTriggerTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface); +extern HRESULT WINAPI IDirectMusicSegTriggerTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment); +extern HRESULT WINAPI IDirectMusicSegTriggerTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicSegTriggerTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData); +extern 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); +extern HRESULT WINAPI IDirectMusicSegTriggerTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam); +extern HRESULT WINAPI IDirectMusicSegTriggerTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam); +extern HRESULT WINAPI IDirectMusicSegTriggerTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType); +extern HRESULT WINAPI IDirectMusicSegTriggerTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); +extern HRESULT WINAPI IDirectMusicSegTriggerTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); +extern HRESULT WINAPI IDirectMusicSegTriggerTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack); +extern 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); +extern HRESULT WINAPI IDirectMusicSegTriggerTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicSegTriggerTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicSegTriggerTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); +extern HRESULT WINAPI IDirectMusicSegTriggerTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); /* IPersistStream: */ -extern HRESULT WINAPI IDirectMusicSegTriggerTrackStream_IsDirty (LPPERSISTSTREAM iface); -extern HRESULT WINAPI IDirectMusicSegTriggerTrackStream_Load (LPPERSISTSTREAM iface, IStream* pStm); -extern HRESULT WINAPI IDirectMusicSegTriggerTrackStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty); -extern HRESULT WINAPI IDirectMusicSegTriggerTrackStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize); +extern HRESULT WINAPI IDirectMusicSegTriggerTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject); +extern ULONG WINAPI IDirectMusicSegTriggerTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface); +extern ULONG WINAPI IDirectMusicSegTriggerTrack_IPersistStream_Release (LPPERSISTSTREAM iface); +extern HRESULT WINAPI IDirectMusicSegTriggerTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID); +extern HRESULT WINAPI IDirectMusicSegTriggerTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface); +extern HRESULT WINAPI IDirectMusicSegTriggerTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm); +extern HRESULT WINAPI IDirectMusicSegTriggerTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty); +extern HRESULT WINAPI IDirectMusicSegTriggerTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize); /***************************************************************************** * IDirectMusicSeqTrack implementation structure */ -struct IDirectMusicSeqTrack -{ +struct IDirectMusicSeqTrack { /* IUnknown fields */ - ICOM_VFIELD(IDirectMusicTrack8); + ICOM_VTABLE(IUnknown) *UnknownVtbl; + ICOM_VTABLE(IDirectMusicTrack8) *TrackVtbl; + ICOM_VTABLE(IPersistStream) *PersistStreamVtbl; DWORD ref; /* IDirectMusicSeqTrack fields */ - IDirectMusicSeqTrackStream* pStream; + LPDMUS_OBJECTDESC pDesc; }; /* IUnknown: */ -extern HRESULT WINAPI IDirectMusicSeqTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj); -extern ULONG WINAPI IDirectMusicSeqTrack_AddRef (LPDIRECTMUSICTRACK8 iface); -extern ULONG WINAPI IDirectMusicSeqTrack_Release (LPDIRECTMUSICTRACK8 iface); -/* IDirectMusicTrack: */ -extern HRESULT WINAPI IDirectMusicSeqTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment); -extern HRESULT WINAPI IDirectMusicSeqTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicSeqTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData); -extern 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); -extern HRESULT WINAPI IDirectMusicSeqTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam); -extern HRESULT WINAPI IDirectMusicSeqTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam); -extern HRESULT WINAPI IDirectMusicSeqTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType); -extern HRESULT WINAPI IDirectMusicSeqTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); -extern HRESULT WINAPI IDirectMusicSeqTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); -extern HRESULT WINAPI IDirectMusicSeqTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack); -/* IDirectMusicTrack8: */ -extern 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); -extern HRESULT WINAPI IDirectMusicSeqTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicSeqTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicSeqTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); -extern HRESULT WINAPI IDirectMusicSeqTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); - -/***************************************************************************** - * IDirectMusicSeqTrackStream implementation structure - */ -struct IDirectMusicSeqTrackStream -{ - /* IUnknown fields */ - ICOM_VFIELD (IPersistStream); - DWORD ref; - - /* IPersistStreamImpl fields */ - IDirectMusicSeqTrack* pParentTrack; -}; - -/* IUnknown: */ -extern HRESULT WINAPI IDirectMusicSeqTrackStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject); -extern ULONG WINAPI IDirectMusicSeqTrackStream_AddRef (LPPERSISTSTREAM iface); -extern ULONG WINAPI IDirectMusicSeqTrackStream_Release (LPPERSISTSTREAM iface); -/* IPersist: */ -extern HRESULT WINAPI IDirectMusicSeqTrackStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID); +extern HRESULT WINAPI IDirectMusicSeqTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicSeqTrack_IUnknown_AddRef (LPUNKNOWN iface); +extern ULONG WINAPI IDirectMusicSeqTrack_IUnknown_Release (LPUNKNOWN iface); +/* IDirectMusicTrack(8): */ +extern HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface); +extern ULONG WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface); +extern HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment); +extern HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData); +extern 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); +extern HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam); +extern HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam); +extern HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType); +extern HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); +extern HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); +extern HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack); +extern 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); +extern HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); +extern HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); /* IPersistStream: */ -extern HRESULT WINAPI IDirectMusicSeqTrackStream_IsDirty (LPPERSISTSTREAM iface); -extern HRESULT WINAPI IDirectMusicSeqTrackStream_Load (LPPERSISTSTREAM iface, IStream* pStm); -extern HRESULT WINAPI IDirectMusicSeqTrackStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty); -extern HRESULT WINAPI IDirectMusicSeqTrackStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize); +extern HRESULT WINAPI IDirectMusicSeqTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject); +extern ULONG WINAPI IDirectMusicSeqTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface); +extern ULONG WINAPI IDirectMusicSeqTrack_IPersistStream_Release (LPPERSISTSTREAM iface); +extern HRESULT WINAPI IDirectMusicSeqTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID); +extern HRESULT WINAPI IDirectMusicSeqTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface); +extern HRESULT WINAPI IDirectMusicSeqTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm); +extern HRESULT WINAPI IDirectMusicSeqTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty); +extern HRESULT WINAPI IDirectMusicSeqTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize); /***************************************************************************** * IDirectMusicSysExTrack implementation structure */ -struct IDirectMusicSysExTrack -{ +struct IDirectMusicSysExTrack { /* IUnknown fields */ - ICOM_VFIELD(IDirectMusicTrack8); + ICOM_VTABLE(IUnknown) *UnknownVtbl; + ICOM_VTABLE(IDirectMusicTrack8) *TrackVtbl; + ICOM_VTABLE(IPersistStream) *PersistStreamVtbl; DWORD ref; /* IDirectMusicSysExTrack fields */ - IDirectMusicSysExTrackStream* pStream; + LPDMUS_OBJECTDESC pDesc; }; /* IUnknown: */ -extern HRESULT WINAPI IDirectMusicSysExTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj); -extern ULONG WINAPI IDirectMusicSysExTrack_AddRef (LPDIRECTMUSICTRACK8 iface); -extern ULONG WINAPI IDirectMusicSysExTrack_Release (LPDIRECTMUSICTRACK8 iface); -/* IDirectMusicTrack: */ -extern HRESULT WINAPI IDirectMusicSysExTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment); -extern HRESULT WINAPI IDirectMusicSysExTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicSysExTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData); -extern 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); -extern HRESULT WINAPI IDirectMusicSysExTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam); -extern HRESULT WINAPI IDirectMusicSysExTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam); -extern HRESULT WINAPI IDirectMusicSysExTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType); -extern HRESULT WINAPI IDirectMusicSysExTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); -extern HRESULT WINAPI IDirectMusicSysExTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); -extern HRESULT WINAPI IDirectMusicSysExTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack); -/* IDirectMusicTrack8: */ -extern 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); -extern HRESULT WINAPI IDirectMusicSysExTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicSysExTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicSysExTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); -extern HRESULT WINAPI IDirectMusicSysExTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); - -/***************************************************************************** - * IDirectMusicSysExTrackStream implementation structure - */ -struct IDirectMusicSysExTrackStream -{ - /* IUnknown fields */ - ICOM_VFIELD (IPersistStream); - DWORD ref; - - /* IPersistStreamImpl fields */ - IDirectMusicSysExTrack* pParentTrack; -}; - -/* IUnknown: */ -extern HRESULT WINAPI IDirectMusicSysExTrackStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject); -extern ULONG WINAPI IDirectMusicSysExTrackStream_AddRef (LPPERSISTSTREAM iface); -extern ULONG WINAPI IDirectMusicSysExTrackStream_Release (LPPERSISTSTREAM iface); -/* IPersist: */ -extern HRESULT WINAPI IDirectMusicSysExTrackStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID); +extern HRESULT WINAPI IDirectMusicSysExTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicSysExTrack_IUnknown_AddRef (LPUNKNOWN iface); +extern ULONG WINAPI IDirectMusicSysExTrack_IUnknown_Release (LPUNKNOWN iface); +/* IDirectMusicTrack(8): */ +extern HRESULT WINAPI IDirectMusicSysExTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicSysExTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface); +extern ULONG WINAPI IDirectMusicSysExTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface); +extern HRESULT WINAPI IDirectMusicSysExTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment); +extern HRESULT WINAPI IDirectMusicSysExTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicSysExTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData); +extern 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); +extern HRESULT WINAPI IDirectMusicSysExTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam); +extern HRESULT WINAPI IDirectMusicSysExTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam); +extern HRESULT WINAPI IDirectMusicSysExTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType); +extern HRESULT WINAPI IDirectMusicSysExTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); +extern HRESULT WINAPI IDirectMusicSysExTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); +extern HRESULT WINAPI IDirectMusicSysExTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack); +extern 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); +extern HRESULT WINAPI IDirectMusicSysExTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicSysExTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicSysExTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); +extern HRESULT WINAPI IDirectMusicSysExTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); /* IPersistStream: */ -extern HRESULT WINAPI IDirectMusicSysExTrackStream_IsDirty (LPPERSISTSTREAM iface); -extern HRESULT WINAPI IDirectMusicSysExTrackStream_Load (LPPERSISTSTREAM iface, IStream* pStm); -extern HRESULT WINAPI IDirectMusicSysExTrackStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty); -extern HRESULT WINAPI IDirectMusicSysExTrackStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize); +extern HRESULT WINAPI IDirectMusicSysExTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject); +extern ULONG WINAPI IDirectMusicSysExTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface); +extern ULONG WINAPI IDirectMusicSysExTrack_IPersistStream_Release (LPPERSISTSTREAM iface); +extern HRESULT WINAPI IDirectMusicSysExTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID); +extern HRESULT WINAPI IDirectMusicSysExTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface); +extern HRESULT WINAPI IDirectMusicSysExTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm); +extern HRESULT WINAPI IDirectMusicSysExTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty); +extern HRESULT WINAPI IDirectMusicSysExTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize); /***************************************************************************** * IDirectMusicTempoTrack implementation structure */ -struct IDirectMusicTempoTrack -{ +struct IDirectMusicTempoTrack { /* IUnknown fields */ - ICOM_VFIELD(IDirectMusicTrack8); + ICOM_VTABLE(IUnknown) *UnknownVtbl; + ICOM_VTABLE(IDirectMusicTrack8) *TrackVtbl; + ICOM_VTABLE(IPersistStream) *PersistStreamVtbl; DWORD ref; /* IDirectMusicTempoTrack fields */ - IDirectMusicTempoTrackStream* pStream; + LPDMUS_OBJECTDESC pDesc; }; /* IUnknown: */ -extern HRESULT WINAPI IDirectMusicTempoTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj); -extern ULONG WINAPI IDirectMusicTempoTrack_AddRef (LPDIRECTMUSICTRACK8 iface); -extern ULONG WINAPI IDirectMusicTempoTrack_Release (LPDIRECTMUSICTRACK8 iface); -/* IDirectMusicTrack: */ -extern HRESULT WINAPI IDirectMusicTempoTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment); -extern HRESULT WINAPI IDirectMusicTempoTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicTempoTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData); -extern 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); -extern HRESULT WINAPI IDirectMusicTempoTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam); -extern HRESULT WINAPI IDirectMusicTempoTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam); -extern HRESULT WINAPI IDirectMusicTempoTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType); -extern HRESULT WINAPI IDirectMusicTempoTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); -extern HRESULT WINAPI IDirectMusicTempoTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); -extern HRESULT WINAPI IDirectMusicTempoTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack); -/* IDirectMusicTrack8: */ -extern 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); -extern HRESULT WINAPI IDirectMusicTempoTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicTempoTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicTempoTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); -extern HRESULT WINAPI IDirectMusicTempoTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); - -/***************************************************************************** - * IDirectMusicTempoTrackStream implementation structure - */ -struct IDirectMusicTempoTrackStream -{ - /* IUnknown fields */ - ICOM_VFIELD (IPersistStream); - DWORD ref; - - /* IPersistStreamImpl fields */ - IDirectMusicTempoTrack* pParentTrack; -}; - -/* IUnknown: */ -extern HRESULT WINAPI IDirectMusicTempoTrackStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject); -extern ULONG WINAPI IDirectMusicTempoTrackStream_AddRef (LPPERSISTSTREAM iface); -extern ULONG WINAPI IDirectMusicTempoTrackStream_Release (LPPERSISTSTREAM iface); -/* IPersist: */ -extern HRESULT WINAPI IDirectMusicTempoTrackStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID); +extern HRESULT WINAPI IDirectMusicTempoTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicTempoTrack_IUnknown_AddRef (LPUNKNOWN iface); +extern ULONG WINAPI IDirectMusicTempoTrack_IUnknown_Release (LPUNKNOWN iface); +/* IDirectMusicTrack(8): */ +extern HRESULT WINAPI IDirectMusicTempoTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicTempoTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface); +extern ULONG WINAPI IDirectMusicTempoTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface); +extern HRESULT WINAPI IDirectMusicTempoTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment); +extern HRESULT WINAPI IDirectMusicTempoTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicTempoTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData); +extern 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); +extern HRESULT WINAPI IDirectMusicTempoTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam); +extern HRESULT WINAPI IDirectMusicTempoTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam); +extern HRESULT WINAPI IDirectMusicTempoTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType); +extern HRESULT WINAPI IDirectMusicTempoTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); +extern HRESULT WINAPI IDirectMusicTempoTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); +extern HRESULT WINAPI IDirectMusicTempoTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack); +extern 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); +extern HRESULT WINAPI IDirectMusicTempoTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicTempoTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicTempoTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); +extern HRESULT WINAPI IDirectMusicTempoTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); /* IPersistStream: */ -extern HRESULT WINAPI IDirectMusicTempoTrackStream_IsDirty (LPPERSISTSTREAM iface); -extern HRESULT WINAPI IDirectMusicTempoTrackStream_Load (LPPERSISTSTREAM iface, IStream* pStm); -extern HRESULT WINAPI IDirectMusicTempoTrackStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty); -extern HRESULT WINAPI IDirectMusicTempoTrackStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize); +extern HRESULT WINAPI IDirectMusicTempoTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject); +extern ULONG WINAPI IDirectMusicTempoTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface); +extern ULONG WINAPI IDirectMusicTempoTrack_IPersistStream_Release (LPPERSISTSTREAM iface); +extern HRESULT WINAPI IDirectMusicTempoTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID); +extern HRESULT WINAPI IDirectMusicTempoTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface); +extern HRESULT WINAPI IDirectMusicTempoTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm); +extern HRESULT WINAPI IDirectMusicTempoTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty); +extern HRESULT WINAPI IDirectMusicTempoTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize); /***************************************************************************** * IDirectMusicTimeSigTrack implementation structure */ -struct IDirectMusicTimeSigTrack -{ +struct IDirectMusicTimeSigTrack { /* IUnknown fields */ - ICOM_VFIELD(IDirectMusicTrack8); + ICOM_VTABLE(IUnknown) *UnknownVtbl; + ICOM_VTABLE(IDirectMusicTrack8) *TrackVtbl; + ICOM_VTABLE(IPersistStream) *PersistStreamVtbl; DWORD ref; /* IDirectMusicTimeSigTrack fields */ - IDirectMusicTimeSigTrackStream* pStream; + LPDMUS_OBJECTDESC pDesc; }; /* IUnknown: */ -extern HRESULT WINAPI IDirectMusicTimeSigTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj); -extern ULONG WINAPI IDirectMusicTimeSigTrack_AddRef (LPDIRECTMUSICTRACK8 iface); -extern ULONG WINAPI IDirectMusicTimeSigTrack_Release (LPDIRECTMUSICTRACK8 iface); -/* IDirectMusicTrack: */ -extern HRESULT WINAPI IDirectMusicTimeSigTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment); -extern HRESULT WINAPI IDirectMusicTimeSigTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicTimeSigTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData); -extern 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); -extern HRESULT WINAPI IDirectMusicTimeSigTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam); -extern HRESULT WINAPI IDirectMusicTimeSigTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam); -extern HRESULT WINAPI IDirectMusicTimeSigTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType); -extern HRESULT WINAPI IDirectMusicTimeSigTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); -extern HRESULT WINAPI IDirectMusicTimeSigTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); -extern HRESULT WINAPI IDirectMusicTimeSigTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack); -/* IDirectMusicTrack8: */ -extern 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); -extern HRESULT WINAPI IDirectMusicTimeSigTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicTimeSigTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicTimeSigTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); -extern HRESULT WINAPI IDirectMusicTimeSigTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); - -/***************************************************************************** - * IDirectMusicTimeSigTrackStream implementation structure - */ -struct IDirectMusicTimeSigTrackStream -{ - /* IUnknown fields */ - ICOM_VFIELD (IPersistStream); - DWORD ref; - - /* IPersistStreamImpl fields */ - IDirectMusicTimeSigTrack* pParentTrack; -}; - -/* IUnknown: */ -extern HRESULT WINAPI IDirectMusicTimeSigTrackStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject); -extern ULONG WINAPI IDirectMusicTimeSigTrackStream_AddRef (LPPERSISTSTREAM iface); -extern ULONG WINAPI IDirectMusicTimeSigTrackStream_Release (LPPERSISTSTREAM iface); -/* IPersist: */ -extern HRESULT WINAPI IDirectMusicTimeSigTrackStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID); +extern HRESULT WINAPI IDirectMusicTimeSigTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicTimeSigTrack_IUnknown_AddRef (LPUNKNOWN iface); +extern ULONG WINAPI IDirectMusicTimeSigTrack_IUnknown_Release (LPUNKNOWN iface); +/* IDirectMusicTrack(8): */ +extern HRESULT WINAPI IDirectMusicTimeSigTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicTimeSigTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface); +extern ULONG WINAPI IDirectMusicTimeSigTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface); +extern HRESULT WINAPI IDirectMusicTimeSigTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment); +extern HRESULT WINAPI IDirectMusicTimeSigTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicTimeSigTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData); +extern 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); +extern HRESULT WINAPI IDirectMusicTimeSigTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam); +extern HRESULT WINAPI IDirectMusicTimeSigTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam); +extern HRESULT WINAPI IDirectMusicTimeSigTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType); +extern HRESULT WINAPI IDirectMusicTimeSigTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); +extern HRESULT WINAPI IDirectMusicTimeSigTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); +extern HRESULT WINAPI IDirectMusicTimeSigTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack); +extern 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); +extern HRESULT WINAPI IDirectMusicTimeSigTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicTimeSigTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicTimeSigTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); +extern HRESULT WINAPI IDirectMusicTimeSigTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); /* IPersistStream: */ -extern HRESULT WINAPI IDirectMusicTimeSigTrackStream_IsDirty (LPPERSISTSTREAM iface); -extern HRESULT WINAPI IDirectMusicTimeSigTrackStream_Load (LPPERSISTSTREAM iface, IStream* pStm); -extern HRESULT WINAPI IDirectMusicTimeSigTrackStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty); -extern HRESULT WINAPI IDirectMusicTimeSigTrackStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize); +extern HRESULT WINAPI IDirectMusicTimeSigTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject); +extern ULONG WINAPI IDirectMusicTimeSigTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface); +extern ULONG WINAPI IDirectMusicTimeSigTrack_IPersistStream_Release (LPPERSISTSTREAM iface); +extern HRESULT WINAPI IDirectMusicTimeSigTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID); +extern HRESULT WINAPI IDirectMusicTimeSigTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface); +extern HRESULT WINAPI IDirectMusicTimeSigTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm); +extern HRESULT WINAPI IDirectMusicTimeSigTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty); +extern HRESULT WINAPI IDirectMusicTimeSigTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize); /***************************************************************************** * IDirectMusicWaveTrack implementation structure */ -struct IDirectMusicWaveTrack -{ +struct IDirectMusicWaveTrack { /* IUnknown fields */ - ICOM_VFIELD(IDirectMusicTrack8); + ICOM_VTABLE(IUnknown) *UnknownVtbl; + ICOM_VTABLE(IDirectMusicTrack8) *TrackVtbl; + ICOM_VTABLE(IPersistStream) *PersistStreamVtbl; DWORD ref; /* IDirectMusicWaveTrack fields */ - IDirectMusicWaveTrackStream* pStream; + LPDMUS_OBJECTDESC pDesc; }; /* IUnknown: */ -extern HRESULT WINAPI IDirectMusicWaveTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj); -extern ULONG WINAPI IDirectMusicWaveTrack_AddRef (LPDIRECTMUSICTRACK8 iface); -extern ULONG WINAPI IDirectMusicWaveTrack_Release (LPDIRECTMUSICTRACK8 iface); -/* IDirectMusicTrack: */ -extern HRESULT WINAPI IDirectMusicWaveTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment); -extern HRESULT WINAPI IDirectMusicWaveTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicWaveTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData); -extern 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); -extern HRESULT WINAPI IDirectMusicWaveTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam); -extern HRESULT WINAPI IDirectMusicWaveTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam); -extern HRESULT WINAPI IDirectMusicWaveTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType); -extern HRESULT WINAPI IDirectMusicWaveTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); -extern HRESULT WINAPI IDirectMusicWaveTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); -extern HRESULT WINAPI IDirectMusicWaveTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack); -/* IDirectMusicTrack8: */ -extern 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); -extern HRESULT WINAPI IDirectMusicWaveTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicWaveTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicWaveTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); -extern HRESULT WINAPI IDirectMusicWaveTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); +extern HRESULT WINAPI IDirectMusicWaveTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicWaveTrack_IUnknown_AddRef (LPUNKNOWN iface); +extern ULONG WINAPI IDirectMusicWaveTrack_IUnknown_Release (LPUNKNOWN iface); +/* IDirectMusicTrack(8): */ +extern HRESULT WINAPI IDirectMusicWaveTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicWaveTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface); +extern ULONG WINAPI IDirectMusicWaveTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface); +extern HRESULT WINAPI IDirectMusicWaveTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment); +extern HRESULT WINAPI IDirectMusicWaveTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicWaveTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData); +extern 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); +extern HRESULT WINAPI IDirectMusicWaveTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam); +extern HRESULT WINAPI IDirectMusicWaveTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam); +extern HRESULT WINAPI IDirectMusicWaveTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType); +extern HRESULT WINAPI IDirectMusicWaveTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); +extern HRESULT WINAPI IDirectMusicWaveTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); +extern HRESULT WINAPI IDirectMusicWaveTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack); +extern 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); +extern HRESULT WINAPI IDirectMusicWaveTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicWaveTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicWaveTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); +extern HRESULT WINAPI IDirectMusicWaveTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); +/* IPersistStream: */ +extern HRESULT WINAPI IDirectMusicWaveTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject); +extern ULONG WINAPI IDirectMusicWaveTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface); +extern ULONG WINAPI IDirectMusicWaveTrack_IPersistStream_Release (LPPERSISTSTREAM iface); +extern HRESULT WINAPI IDirectMusicWaveTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID); +extern HRESULT WINAPI IDirectMusicWaveTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface); +extern HRESULT WINAPI IDirectMusicWaveTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm); +extern HRESULT WINAPI IDirectMusicWaveTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty); +extern HRESULT WINAPI IDirectMusicWaveTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize); + /***************************************************************************** - * IDirectMusicWaveTrackStream implementation structure + * Misc. */ -struct IDirectMusicWaveTrackStream -{ - /* 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 */ - IDirectMusicWaveTrack* 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 IDirectMusicWaveTrackStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject); -extern ULONG WINAPI IDirectMusicWaveTrackStream_AddRef (LPPERSISTSTREAM iface); -extern ULONG WINAPI IDirectMusicWaveTrackStream_Release (LPPERSISTSTREAM iface); -/* IPersist: */ -extern HRESULT WINAPI IDirectMusicWaveTrackStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID); -/* IPersistStream: */ -extern HRESULT WINAPI IDirectMusicWaveTrackStream_IsDirty (LPPERSISTSTREAM iface); -extern HRESULT WINAPI IDirectMusicWaveTrackStream_Load (LPPERSISTSTREAM iface, IStream* pStm); -extern HRESULT WINAPI IDirectMusicWaveTrackStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty); -extern HRESULT WINAPI IDirectMusicWaveTrackStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize); - -static inline const char *debugstr_fourcc( DWORD fourcc ) -{ +/* 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) ); + 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_DMIME_PRIVATE_H */ diff --git a/dlls/dmime/graph.c b/dlls/dmime/graph.c index 4842999aa60..0a1743c1ff8 100644 --- a/dlls/dmime/graph.c +++ b/dlls/dmime/graph.c @@ -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 - -#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 -}; diff --git a/dlls/dmime/lyricstrack.c b/dlls/dmime/lyricstrack.c index 11caeb254bc..0658f2e556c 100644 --- a/dlls/dmime/lyricstrack.c +++ b/dlls/dmime/lyricstrack.c @@ -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 - -#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); +} diff --git a/dlls/dmime/markertrack.c b/dlls/dmime/markertrack.c index 7985f13a280..593c00f5f08 100644 --- a/dlls/dmime/markertrack.c +++ b/dlls/dmime/markertrack.c @@ -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 - -#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); +} diff --git a/dlls/dmime/paramcontroltrack.c b/dlls/dmime/paramcontroltrack.c index ad006001a0a..4d981544464 100644 --- a/dlls/dmime/paramcontroltrack.c +++ b/dlls/dmime/paramcontroltrack.c @@ -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 - -#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); +} diff --git a/dlls/dmime/patterntrack.c b/dlls/dmime/patterntrack.c index 03fc1b4db1f..e91c4ac1dca 100644 --- a/dlls/dmime/patterntrack.c +++ b/dlls/dmime/patterntrack.c @@ -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 - -#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); } diff --git a/dlls/dmime/performance.c b/dlls/dmime/performance.c index bbb075e8645..7e01a9a5bd5 100644 --- a/dlls/dmime/performance.c +++ b/dlls/dmime/performance.c @@ -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 - -#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); } diff --git a/dlls/dmime/regsvr.c b/dlls/dmime/regsvr.c index e5e8061de45..31cf18e45b9 100644 --- a/dlls/dmime/regsvr.c +++ b/dlls/dmime/regsvr.c @@ -18,21 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include - -#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"); diff --git a/dlls/dmime/segment.c b/dlls/dmime/segment.c index 39d63262e10..8f463b2813c 100644 --- a/dlls/dmime/segment.c +++ b/dlls/dmime/segment.c @@ -1,6 +1,6 @@ /* IDirectMusicSegment8 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,32 +17,35 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include - -#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); /***************************************************************************** - * IDirectMusicSegment8Impl implementation + * IDirectMusicSegmentImpl implementation */ -/* IDirectMusicSegment8 IUnknown part: */ -HRESULT WINAPI IDirectMusicSegment8Impl_QueryInterface (LPDIRECTMUSICSEGMENT8 iface, REFIID riid, LPVOID *ppobj) -{ - ICOM_THIS(IDirectMusicSegment8Impl,iface); - - if (IsEqualIID (riid, &IID_IUnknown) || - IsEqualIID (riid, &IID_IDirectMusicSegment) || - IsEqualIID (riid, &IID_IDirectMusicSegment8)) { - IDirectMusicSegment8Impl_AddRef(iface); - *ppobj = This; +/* IDirectMusicSegment IUnknown part: */ +HRESULT WINAPI IDirectMusicSegment8Impl_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, UnknownVtbl, iface); + + if (IsEqualIID (riid, &IID_IUnknown)) { + *ppobj = (LPVOID)&This->UnknownVtbl; + IDirectMusicSegment8Impl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl); + return S_OK; + } else if (IsEqualIID (riid, &IID_IDirectMusicSegment) + || IsEqualIID (riid, &IID_IDirectMusicSegment2) + || IsEqualIID (riid, &IID_IDirectMusicSegment8)) { + *ppobj = (LPVOID)&This->SegmentVtbl; + IDirectMusicSegment8Impl_IDirectMusicSegment8_AddRef ((LPDIRECTMUSICSEGMENT8)&This->SegmentVtbl); + return S_OK; + } else if (IsEqualIID (riid, &IID_IDirectMusicObject)) { + *ppobj = (LPVOID)&This->ObjectVtbl; + IDirectMusicSegment8Impl_IDirectMusicObject_AddRef ((LPDIRECTMUSICOBJECT)&This->ObjectVtbl); + return S_OK; + } else if (IsEqualIID (riid, &IID_IPersistStream)) { + *ppobj = (LPVOID)&This->PersistStreamVtbl; + IDirectMusicSegment8Impl_IPersistStream_AddRef ((LPPERSISTSTREAM)&This->PersistStreamVtbl); return S_OK; } @@ -50,16 +53,14 @@ HRESULT WINAPI IDirectMusicSegment8Impl_QueryInterface (LPDIRECTMUSICSEGMENT8 if return E_NOINTERFACE; } -ULONG WINAPI IDirectMusicSegment8Impl_AddRef (LPDIRECTMUSICSEGMENT8 iface) -{ - ICOM_THIS(IDirectMusicSegment8Impl,iface); +ULONG WINAPI IDirectMusicSegment8Impl_IUnknown_AddRef (LPUNKNOWN iface) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, UnknownVtbl, iface); TRACE("(%p) : AddRef from %ld\n", This, This->ref); return ++(This->ref); } -ULONG WINAPI IDirectMusicSegment8Impl_Release (LPDIRECTMUSICSEGMENT8 iface) -{ - ICOM_THIS(IDirectMusicSegment8Impl,iface); +ULONG WINAPI IDirectMusicSegment8Impl_IUnknown_Release (LPUNKNOWN iface) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, UnknownVtbl, iface); ULONG ref = --This->ref; TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref); if (ref == 0) { @@ -68,542 +69,521 @@ ULONG WINAPI IDirectMusicSegment8Impl_Release (LPDIRECTMUSICSEGMENT8 iface) return ref; } -/* IDirectMusicSegment8 IDirectMusicSegment part: */ -HRESULT WINAPI IDirectMusicSegment8Impl_GetLength (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME* pmtLength) -{ - ICOM_THIS(IDirectMusicSegment8Impl,iface); +ICOM_VTABLE(IUnknown) DirectMusicSegment8_Unknown_Vtbl = { + ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE + IDirectMusicSegment8Impl_IUnknown_QueryInterface, + IDirectMusicSegment8Impl_IUnknown_AddRef, + IDirectMusicSegment8Impl_IUnknown_Release +}; - TRACE("(%p, %p)\n", This, pmtLength); - *pmtLength = This->segHeader.mtLength; +/* IDirectMusicSegmentImpl IDirectMusicSegment part: */ +HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_QueryInterface (LPDIRECTMUSICSEGMENT8 iface, REFIID riid, LPVOID *ppobj) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); + return IDirectMusicSegment8Impl_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj); +} +ULONG WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_AddRef (LPDIRECTMUSICSEGMENT8 iface) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); + return IDirectMusicSegment8Impl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl); +} + +ULONG WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_Release (LPDIRECTMUSICSEGMENT8 iface) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); + return IDirectMusicSegment8Impl_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl); +} + +HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_GetLength (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME* pmtLength) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); + FIXME("(%p, %p): stub\n", This, pmtLength); return S_OK; } -HRESULT WINAPI IDirectMusicSegment8Impl_SetLength (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME mtLength) -{ - ICOM_THIS(IDirectMusicSegment8Impl,iface); - - TRACE("(%p, %ld)\n", This, mtLength); - This->segHeader.mtLength = mtLength; - +HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_SetLength (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME mtLength) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); + FIXME("(%p, %ld): stub\n", This, mtLength); return S_OK; } -HRESULT WINAPI IDirectMusicSegment8Impl_GetRepeats (LPDIRECTMUSICSEGMENT8 iface, DWORD* pdwRepeats) -{ - ICOM_THIS(IDirectMusicSegment8Impl,iface); - - TRACE("(%p, %p)\n", This, pdwRepeats); - *pdwRepeats = This->segHeader.dwRepeats; - +HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_GetRepeats (LPDIRECTMUSICSEGMENT8 iface, DWORD* pdwRepeats) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); + FIXME("(%p, %p): stub\n", This, pdwRepeats); return S_OK; } -HRESULT WINAPI IDirectMusicSegment8Impl_SetRepeats (LPDIRECTMUSICSEGMENT8 iface, DWORD dwRepeats) -{ - ICOM_THIS(IDirectMusicSegment8Impl,iface); - - TRACE("(%p, %ld)\n", This, dwRepeats); - This->segHeader.dwRepeats = dwRepeats; - +HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_SetRepeats (LPDIRECTMUSICSEGMENT8 iface, DWORD dwRepeats) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); + FIXME("(%p, %ld): stub\n", This, dwRepeats); return S_OK; } -HRESULT WINAPI IDirectMusicSegment8Impl_GetDefaultResolution (LPDIRECTMUSICSEGMENT8 iface, DWORD* pdwResolution) -{ - ICOM_THIS(IDirectMusicSegment8Impl,iface); - - TRACE("(%p, %p)\n", This, pdwResolution); - *pdwResolution = This->segHeader.dwResolution; - +HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_GetDefaultResolution (LPDIRECTMUSICSEGMENT8 iface, DWORD* pdwResolution) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); + FIXME("(%p, %p): stub\n", This, pdwResolution); return S_OK; } -HRESULT WINAPI IDirectMusicSegment8Impl_SetDefaultResolution (LPDIRECTMUSICSEGMENT8 iface, DWORD dwResolution) -{ - ICOM_THIS(IDirectMusicSegment8Impl,iface); - - TRACE("(%p, %ld)\n", This, dwResolution); - This->segHeader.dwResolution = dwResolution; - +HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_SetDefaultResolution (LPDIRECTMUSICSEGMENT8 iface, DWORD dwResolution) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); + FIXME("(%p, %ld): stub\n", This, dwResolution); return S_OK; } -HRESULT WINAPI IDirectMusicSegment8Impl_GetTrack (LPDIRECTMUSICSEGMENT8 iface, REFGUID rguidType, DWORD dwGroupBits, DWORD dwIndex, IDirectMusicTrack** ppTrack) -{ - ICOM_THIS(IDirectMusicSegment8Impl,iface); - +HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_GetTrack (LPDIRECTMUSICSEGMENT8 iface, REFGUID rguidType, DWORD dwGroupBits, DWORD dwIndex, IDirectMusicTrack** ppTrack) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); FIXME("(%p, %s, %ld, %ld, %p): stub\n", This, debugstr_guid(rguidType), dwGroupBits, dwIndex, ppTrack); - return S_OK; } -HRESULT WINAPI IDirectMusicSegment8Impl_GetTrackGroup (LPDIRECTMUSICSEGMENT8 iface, IDirectMusicTrack* pTrack, DWORD* pdwGroupBits) -{ - ICOM_THIS(IDirectMusicSegment8Impl,iface); - +HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_GetTrackGroup (LPDIRECTMUSICSEGMENT8 iface, IDirectMusicTrack* pTrack, DWORD* pdwGroupBits) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); FIXME("(%p, %p, %p): stub\n", This, pTrack, pdwGroupBits); - return S_OK; } -HRESULT WINAPI IDirectMusicSegment8Impl_InsertTrack (LPDIRECTMUSICSEGMENT8 iface, IDirectMusicTrack* pTrack, DWORD dwGroupBits) -{ - ICOM_THIS(IDirectMusicSegment8Impl,iface); - +HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_InsertTrack (LPDIRECTMUSICSEGMENT8 iface, IDirectMusicTrack* pTrack, DWORD dwGroupBits) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); FIXME("(%p, %p, %ld): stub\n", This, pTrack, dwGroupBits); - return S_OK; } -HRESULT WINAPI IDirectMusicSegment8Impl_RemoveTrack (LPDIRECTMUSICSEGMENT8 iface, IDirectMusicTrack* pTrack) -{ - ICOM_THIS(IDirectMusicSegment8Impl,iface); - +HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_RemoveTrack (LPDIRECTMUSICSEGMENT8 iface, IDirectMusicTrack* pTrack) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); FIXME("(%p, %p): stub\n", This, pTrack); - return S_OK; } -HRESULT WINAPI IDirectMusicSegment8Impl_InitPlay (LPDIRECTMUSICSEGMENT8 iface, IDirectMusicSegmentState** ppSegState, IDirectMusicPerformance* pPerformance, DWORD dwFlags) -{ - ICOM_THIS(IDirectMusicSegment8Impl,iface); - +HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_InitPlay (LPDIRECTMUSICSEGMENT8 iface, IDirectMusicSegmentState** ppSegState, IDirectMusicPerformance* pPerformance, DWORD dwFlags) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); FIXME("(%p, %p, %p, %ld): stub\n", This, ppSegState, pPerformance, dwFlags); - return S_OK; } -HRESULT WINAPI IDirectMusicSegment8Impl_GetGraph (LPDIRECTMUSICSEGMENT8 iface, IDirectMusicGraph** ppGraph) -{ - ICOM_THIS(IDirectMusicSegment8Impl,iface); - +HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_GetGraph (LPDIRECTMUSICSEGMENT8 iface, IDirectMusicGraph** ppGraph) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); FIXME("(%p, %p): stub\n", This, ppGraph); - return S_OK; } -HRESULT WINAPI IDirectMusicSegment8Impl_SetGraph (LPDIRECTMUSICSEGMENT8 iface, IDirectMusicGraph* pGraph) -{ - ICOM_THIS(IDirectMusicSegment8Impl,iface); - +HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_SetGraph (LPDIRECTMUSICSEGMENT8 iface, IDirectMusicGraph* pGraph) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); FIXME("(%p, %p): stub\n", This, pGraph); - return S_OK; } -HRESULT WINAPI IDirectMusicSegment8Impl_AddNotificationType (LPDIRECTMUSICSEGMENT8 iface, REFGUID rguidNotificationType) -{ - ICOM_THIS(IDirectMusicSegment8Impl,iface); - +HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_AddNotificationType (LPDIRECTMUSICSEGMENT8 iface, REFGUID rguidNotificationType) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType)); - return S_OK; } -HRESULT WINAPI IDirectMusicSegment8Impl_RemoveNotificationType (LPDIRECTMUSICSEGMENT8 iface, REFGUID rguidNotificationType) -{ - ICOM_THIS(IDirectMusicSegment8Impl,iface); - +HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_RemoveNotificationType (LPDIRECTMUSICSEGMENT8 iface, REFGUID rguidNotificationType) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType)); - return S_OK; } -HRESULT WINAPI IDirectMusicSegment8Impl_GetParam (LPDIRECTMUSICSEGMENT8 iface, REFGUID rguidType, DWORD dwGroupBits, DWORD dwIndex, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam) -{ - ICOM_THIS(IDirectMusicSegment8Impl,iface); - +HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_GetParam (LPDIRECTMUSICSEGMENT8 iface, REFGUID rguidType, DWORD dwGroupBits, DWORD dwIndex, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, 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 IDirectMusicSegment8Impl_SetParam (LPDIRECTMUSICSEGMENT8 iface, REFGUID rguidType, DWORD dwGroupBits, DWORD dwIndex, MUSIC_TIME mtTime, void* pParam) -{ - ICOM_THIS(IDirectMusicSegment8Impl,iface); - +HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_SetParam (LPDIRECTMUSICSEGMENT8 iface, REFGUID rguidType, DWORD dwGroupBits, DWORD dwIndex, MUSIC_TIME mtTime, void* pParam) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); FIXME("(%p, %s, %ld, %ld, %ld, %p): stub\n", This, debugstr_guid(rguidType), dwGroupBits, dwIndex, mtTime, pParam); - return S_OK; } -HRESULT WINAPI IDirectMusicSegment8Impl_Clone (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicSegment** ppSegment) -{ - ICOM_THIS(IDirectMusicSegment8Impl,iface); - +HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_Clone (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicSegment** ppSegment) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); FIXME("(%p, %ld, %ld, %p): stub\n", This, mtStart, mtEnd, ppSegment); - return S_OK; } -HRESULT WINAPI IDirectMusicSegment8Impl_SetStartPoint (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME mtStart) -{ - ICOM_THIS(IDirectMusicSegment8Impl,iface); - - TRACE("(%p, %ld): stub\n", This, mtStart); - This->segHeader.mtPlayStart = mtStart; - +HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_SetStartPoint (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME mtStart) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); + FIXME("(%p, %ld): stub\n", This, mtStart); return S_OK; } -HRESULT WINAPI IDirectMusicSegment8Impl_GetStartPoint (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME* pmtStart) -{ - ICOM_THIS(IDirectMusicSegment8Impl,iface); - - TRACE("(%p, %p): stub\n", This, pmtStart); - *pmtStart = This->segHeader.mtPlayStart; - +HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_GetStartPoint (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME* pmtStart) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); + FIXME("(%p, %p): stub\n", This, pmtStart); return S_OK; } -HRESULT WINAPI IDirectMusicSegment8Impl_SetLoopPoints (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd) -{ - ICOM_THIS(IDirectMusicSegment8Impl,iface); - - TRACE("(%p, %ld, %ld): stub\n", This, mtStart, mtEnd); - This->segHeader.mtLoopStart = mtStart; - This->segHeader.mtLoopEnd = mtEnd; - +HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_SetLoopPoints (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); + FIXME("(%p, %ld, %ld): stub\n", This, mtStart, mtEnd); return S_OK; } -HRESULT WINAPI IDirectMusicSegment8Impl_GetLoopPoints (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME* pmtStart, MUSIC_TIME* pmtEnd) -{ - ICOM_THIS(IDirectMusicSegment8Impl,iface); - - TRACE("(%p, %p, %p): stub\n", This, pmtStart, pmtEnd); - *pmtStart = This->segHeader.mtLoopStart; - *pmtEnd = This->segHeader.mtLoopEnd; - +HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_GetLoopPoints (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME* pmtStart, MUSIC_TIME* pmtEnd) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); + FIXME("(%p, %p, %p): stub\n", This, pmtStart, pmtEnd); return S_OK; } -HRESULT WINAPI IDirectMusicSegment8Impl_SetPChannelsUsed (LPDIRECTMUSICSEGMENT8 iface, DWORD dwNumPChannels, DWORD* paPChannels) -{ - ICOM_THIS(IDirectMusicSegment8Impl,iface); - +HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_SetPChannelsUsed (LPDIRECTMUSICSEGMENT8 iface, DWORD dwNumPChannels, DWORD* paPChannels) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); FIXME("(%p, %ld, %p): stub\n", This, dwNumPChannels, paPChannels); - return S_OK; } -/* IDirectMusicSegment8 IDirectMusicSegment8 part: */ -HRESULT WINAPI IDirectMusicSegment8Impl_SetTrackConfig (LPDIRECTMUSICSEGMENT8 iface, REFGUID rguidTrackClassID, DWORD dwGroupBits, DWORD dwIndex, DWORD dwFlagsOn, DWORD dwFlagsOff) -{ - ICOM_THIS(IDirectMusicSegment8Impl,iface); - +HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_SetTrackConfig (LPDIRECTMUSICSEGMENT8 iface, REFGUID rguidTrackClassID, DWORD dwGroupBits, DWORD dwIndex, DWORD dwFlagsOn, DWORD dwFlagsOff) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); FIXME("(%p, %s, %ld, %ld, %ld, %ld): stub\n", This, debugstr_guid(rguidTrackClassID), dwGroupBits, dwIndex, dwFlagsOn, dwFlagsOff); - return S_OK; } -HRESULT WINAPI IDirectMusicSegment8Impl_GetAudioPathConfig (LPDIRECTMUSICSEGMENT8 iface, IUnknown** ppAudioPathConfig) -{ - ICOM_THIS(IDirectMusicSegment8Impl,iface); - +HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_GetAudioPathConfig (LPDIRECTMUSICSEGMENT8 iface, IUnknown** ppAudioPathConfig){ + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); FIXME("(%p, %p): stub\n", This, ppAudioPathConfig); - return S_OK; } -HRESULT WINAPI IDirectMusicSegment8Impl_Compose (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME mtTime, IDirectMusicSegment* pFromSegment, IDirectMusicSegment* pToSegment, IDirectMusicSegment** ppComposedSegment) -{ - ICOM_THIS(IDirectMusicSegment8Impl,iface); - +HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_Compose (LPDIRECTMUSICSEGMENT8 iface, MUSIC_TIME mtTime, IDirectMusicSegment* pFromSegment, IDirectMusicSegment* pToSegment, IDirectMusicSegment** ppComposedSegment) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); FIXME("(%p, %ld, %p, %p, %p): stub\n", This, mtTime, pFromSegment, pToSegment, ppComposedSegment); - return S_OK; } -HRESULT WINAPI IDirectMusicSegment8Impl_Download (LPDIRECTMUSICSEGMENT8 iface, IUnknown *pAudioPath) -{ - ICOM_THIS(IDirectMusicSegment8Impl,iface); - +HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_Download (LPDIRECTMUSICSEGMENT8 iface, IUnknown *pAudioPath) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); FIXME("(%p, %p): stub\n", This, pAudioPath); - return S_OK; } -HRESULT WINAPI IDirectMusicSegment8Impl_Unload (LPDIRECTMUSICSEGMENT8 iface, IUnknown *pAudioPath) -{ - ICOM_THIS(IDirectMusicSegment8Impl,iface); - +HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_Unload (LPDIRECTMUSICSEGMENT8 iface, IUnknown *pAudioPath) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, SegmentVtbl, iface); FIXME("(%p, %p): stub\n", This, pAudioPath); - return S_OK; } -ICOM_VTABLE(IDirectMusicSegment8) DirectMusicSegment8_Vtbl = +ICOM_VTABLE(IDirectMusicSegment8) DirectMusicSegment8_Segment_Vtbl = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE - IDirectMusicSegment8Impl_QueryInterface, - IDirectMusicSegment8Impl_AddRef, - IDirectMusicSegment8Impl_Release, - IDirectMusicSegment8Impl_GetLength, - IDirectMusicSegment8Impl_SetLength, - IDirectMusicSegment8Impl_GetRepeats, - IDirectMusicSegment8Impl_SetRepeats, - IDirectMusicSegment8Impl_GetDefaultResolution, - IDirectMusicSegment8Impl_SetDefaultResolution, - IDirectMusicSegment8Impl_GetTrack, - IDirectMusicSegment8Impl_GetTrackGroup, - IDirectMusicSegment8Impl_InsertTrack, - IDirectMusicSegment8Impl_RemoveTrack, - IDirectMusicSegment8Impl_InitPlay, - IDirectMusicSegment8Impl_GetGraph, - IDirectMusicSegment8Impl_SetGraph, - IDirectMusicSegment8Impl_AddNotificationType, - IDirectMusicSegment8Impl_RemoveNotificationType, - IDirectMusicSegment8Impl_GetParam, - IDirectMusicSegment8Impl_SetParam, - IDirectMusicSegment8Impl_Clone, - IDirectMusicSegment8Impl_SetStartPoint, - IDirectMusicSegment8Impl_GetStartPoint, - IDirectMusicSegment8Impl_SetLoopPoints, - IDirectMusicSegment8Impl_GetLoopPoints, - IDirectMusicSegment8Impl_SetPChannelsUsed, - IDirectMusicSegment8Impl_SetTrackConfig, - IDirectMusicSegment8Impl_GetAudioPathConfig, - IDirectMusicSegment8Impl_Compose, - IDirectMusicSegment8Impl_Download, - IDirectMusicSegment8Impl_Unload + IDirectMusicSegment8Impl_IDirectMusicSegment8_QueryInterface, + IDirectMusicSegment8Impl_IDirectMusicSegment8_AddRef, + IDirectMusicSegment8Impl_IDirectMusicSegment8_Release, + IDirectMusicSegment8Impl_IDirectMusicSegment8_GetLength, + IDirectMusicSegment8Impl_IDirectMusicSegment8_SetLength, + IDirectMusicSegment8Impl_IDirectMusicSegment8_GetRepeats, + IDirectMusicSegment8Impl_IDirectMusicSegment8_SetRepeats, + IDirectMusicSegment8Impl_IDirectMusicSegment8_GetDefaultResolution, + IDirectMusicSegment8Impl_IDirectMusicSegment8_SetDefaultResolution, + IDirectMusicSegment8Impl_IDirectMusicSegment8_GetTrack, + IDirectMusicSegment8Impl_IDirectMusicSegment8_GetTrackGroup, + IDirectMusicSegment8Impl_IDirectMusicSegment8_InsertTrack, + IDirectMusicSegment8Impl_IDirectMusicSegment8_RemoveTrack, + IDirectMusicSegment8Impl_IDirectMusicSegment8_InitPlay, + IDirectMusicSegment8Impl_IDirectMusicSegment8_GetGraph, + IDirectMusicSegment8Impl_IDirectMusicSegment8_SetGraph, + IDirectMusicSegment8Impl_IDirectMusicSegment8_AddNotificationType, + IDirectMusicSegment8Impl_IDirectMusicSegment8_RemoveNotificationType, + IDirectMusicSegment8Impl_IDirectMusicSegment8_GetParam, + IDirectMusicSegment8Impl_IDirectMusicSegment8_SetParam, + IDirectMusicSegment8Impl_IDirectMusicSegment8_Clone, + IDirectMusicSegment8Impl_IDirectMusicSegment8_SetStartPoint, + IDirectMusicSegment8Impl_IDirectMusicSegment8_GetStartPoint, + IDirectMusicSegment8Impl_IDirectMusicSegment8_SetLoopPoints, + IDirectMusicSegment8Impl_IDirectMusicSegment8_GetLoopPoints, + IDirectMusicSegment8Impl_IDirectMusicSegment8_SetPChannelsUsed, + IDirectMusicSegment8Impl_IDirectMusicSegment8_SetTrackConfig, + IDirectMusicSegment8Impl_IDirectMusicSegment8_GetAudioPathConfig, + IDirectMusicSegment8Impl_IDirectMusicSegment8_Compose, + IDirectMusicSegment8Impl_IDirectMusicSegment8_Download, + IDirectMusicSegment8Impl_IDirectMusicSegment8_Unload }; -/* for ClassFactory */ -HRESULT WINAPI DMUSIC_CreateDirectMusicSegment (LPCGUID lpcGUID, LPDIRECTMUSICSEGMENT8 *ppDMSeg, LPUNKNOWN pUnkOuter) -{ - IDirectMusicSegment8Impl *segment; - - TRACE("(%p,%p,%p)\n", lpcGUID, ppDMSeg, pUnkOuter); - if (IsEqualIID (lpcGUID, &IID_IDirectMusicSegment) - || IsEqualIID (lpcGUID, &IID_IDirectMusicSegment2) - || IsEqualIID (lpcGUID, &IID_IDirectMusicSegment8)) { - segment = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicSegment8Impl)); - if (NULL == segment) { - *ppDMSeg = (LPDIRECTMUSICSEGMENT8) NULL; - return E_OUTOFMEMORY; - } - segment->lpVtbl = &DirectMusicSegment8_Vtbl; - segment->ref = 1; - *ppDMSeg = (LPDIRECTMUSICSEGMENT8) segment; - return S_OK; - } - - WARN("No interface found\n"); - return E_NOINTERFACE; +/* IDirectMusicSegment8Impl IDirectMusicObject part: */ +HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, ObjectVtbl, iface); + return IDirectMusicSegment8Impl_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj); } - -/***************************************************************************** - * IDirectMusicSegmentObject implementation - */ -/* IDirectMusicSegmentObject IUnknown part: */ -HRESULT WINAPI IDirectMusicSegmentObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj) -{ - ICOM_THIS(IDirectMusicSegmentObject,iface); - - if (IsEqualGUID(riid, &IID_IUnknown) - || IsEqualGUID(riid, &IID_IDirectMusicObject)) { - IDirectMusicSegmentObject_AddRef(iface); - *ppobj = This; - return S_OK; - } else if (IsEqualGUID (riid, &IID_IPersistStream)) { - IDirectMusicSegmentObjectStream_AddRef ((LPPERSISTSTREAM)This->pStream); - *ppobj = This->pStream; - return S_OK; - } else if (IsEqualGUID (riid, &IID_IDirectMusicSegment) - || IsEqualGUID (riid, &IID_IDirectMusicSegment8)) { - IDirectMusicSegment8Impl_AddRef ((LPDIRECTMUSICSEGMENT8)This->pSegment); - *ppobj = This->pSegment; - return S_OK; - } - WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj); - return E_NOINTERFACE; +ULONG WINAPI IDirectMusicSegment8Impl_IDirectMusicObject_AddRef (LPDIRECTMUSICOBJECT iface) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, ObjectVtbl, iface); + return IDirectMusicSegment8Impl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl); } -ULONG WINAPI IDirectMusicSegmentObject_AddRef (LPDIRECTMUSICOBJECT iface) -{ - ICOM_THIS(IDirectMusicSegmentObject,iface); - TRACE("(%p) : AddRef from %ld\n", This, This->ref); - return ++(This->ref); +ULONG WINAPI IDirectMusicSegment8Impl_IDirectMusicObject_Release (LPDIRECTMUSICOBJECT iface) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, ObjectVtbl, iface); + return IDirectMusicSegment8Impl_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl); } -ULONG WINAPI IDirectMusicSegmentObject_Release (LPDIRECTMUSICOBJECT iface) -{ - ICOM_THIS(IDirectMusicSegmentObject,iface); - ULONG ref = --This->ref; - TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref); - if (ref == 0) - { - HeapFree(GetProcessHeap(), 0, This); - } - return ref; -} - -/* IDirectMusicSegmentObject IDirectMusicObject part: */ -HRESULT WINAPI IDirectMusicSegmentObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc) -{ - ICOM_THIS(IDirectMusicSegmentObject,iface); - +HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, 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 IDirectMusicSegmentObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc) -{ - ICOM_THIS(IDirectMusicSegmentObject,iface); - - TRACE("(%p, %p)\n", This, pDesc); - This->pDesc = pDesc; +HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, 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; } -HRESULT WINAPI IDirectMusicSegmentObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc) -{ - ICOM_THIS(IDirectMusicSegmentObject,iface); - - FIXME("(%p, %p, %p): stub\n", This, pStream, pDesc); - - return S_OK; -} - -ICOM_VTABLE(IDirectMusicObject) DirectMusicSegmentObject_Vtbl = -{ - ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE - IDirectMusicSegmentObject_QueryInterface, - IDirectMusicSegmentObject_AddRef, - IDirectMusicSegmentObject_Release, - IDirectMusicSegmentObject_GetDescriptor, - IDirectMusicSegmentObject_SetDescriptor, - IDirectMusicSegmentObject_ParseDescriptor -}; - -/* for ClassFactory */ -HRESULT WINAPI DMUSIC_CreateDirectMusicSegmentObject (LPCGUID lpcGUID, LPDIRECTMUSICOBJECT* ppObject, LPUNKNOWN pUnkOuter) -{ - IDirectMusicSegmentObject *obj; - - TRACE("(%p,%p,%p)\n", lpcGUID, ppObject, pUnkOuter); - if (IsEqualGUID (lpcGUID, &IID_IDirectMusicObject)) { - obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicSegmentObject)); - if (NULL == obj) { - *ppObject = (LPDIRECTMUSICOBJECT) NULL; - return E_OUTOFMEMORY; - } - obj->lpVtbl = &DirectMusicSegmentObject_Vtbl; - obj->ref = 1; - /* prepare IPersistStream */ - obj->pStream = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicSegmentObjectStream)); - obj->pStream->lpVtbl = &DirectMusicSegmentObjectStream_Vtbl; - obj->pStream->ref = 1; - obj->pStream->pParentObject = obj; - /* prepare IDirectMusicSegment8 */ - DMUSIC_CreateDirectMusicSegment (&IID_IDirectMusicSegment8, (LPDIRECTMUSICSEGMENT8*)&obj->pSegment, NULL); - obj->pSegment->pObject = obj; - *ppObject = (LPDIRECTMUSICOBJECT) obj; - return S_OK; - } - WARN("No interface found\n"); - - return E_NOINTERFACE; -} - -/***************************************************************************** - * IDirectMusicSegmentObjectStream implementation - */ -/* IDirectMusicSegmentObjectStream IUnknown part: */ -HRESULT WINAPI IDirectMusicSegmentObjectStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj) -{ - ICOM_THIS(IDirectMusicSegmentObjectStream,iface); - - if (IsEqualGUID(riid, &IID_IUnknown) - || IsEqualGUID(riid, &IID_IPersistStream)) { - IDirectMusicSegmentObjectStream_AddRef (iface); - *ppobj = This; - return S_OK; - } - WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj); - return E_NOINTERFACE; -} - -ULONG WINAPI IDirectMusicSegmentObjectStream_AddRef (LPPERSISTSTREAM iface) -{ - ICOM_THIS(IDirectMusicSegmentObjectStream,iface); - TRACE("(%p) : AddRef from %ld\n", This, This->ref); - return ++(This->ref); -} - -ULONG WINAPI IDirectMusicSegmentObjectStream_Release (LPPERSISTSTREAM iface) -{ - ICOM_THIS(IDirectMusicSegmentObjectStream,iface); - ULONG ref = --This->ref; - TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref); - if (ref == 0) - { - HeapFree(GetProcessHeap(), 0, This); - } - return ref; -} - -/* IDirectMusicSegmentObjectStream IPersist part: */ -HRESULT WINAPI IDirectMusicSegmentObjectStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) -{ - return E_NOTIMPL; -} - -/* IDirectMusicSegmentObjectStream IPersistStream part: */ -HRESULT WINAPI IDirectMusicSegmentObjectStream_IsDirty (LPPERSISTSTREAM iface) -{ - return E_NOTIMPL; -} - -HRESULT WINAPI IDirectMusicSegmentObjectStream_Load (LPPERSISTSTREAM iface, IStream* pStm) -{ - ICOM_THIS(IDirectMusicSegmentObjectStream,iface); - FOURCC chunkID; - DWORD chunkSize, StreamSize, StreamCount, ListSize[10], ListCount[10]; +HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, ObjectVtbl, iface); + DMUS_PRIVATE_CHUNK Chunk; + DWORD StreamSize, StreamCount, ListSize[1], ListCount[1]; LARGE_INTEGER liMove; /* used when skipping chunks */ - IDirectMusicSegment8Impl* pSegment = This->pParentObject->pSegment; /* that's where we load data */ - DMUS_IO_TRACK_HEADER tempHeader; - DMUS_IO_TRACK_EXTRAS_HEADER tempXHeader; + + TRACE("(%p,%p, %p)\n", This, pStream, pDesc); - IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL); - IStream_Read (pStm, &chunkSize, sizeof(FOURCC), 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_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 (pStm, &chunkID, sizeof(FOURCC), NULL); - TRACE_(dmfile)(": RIFF chunk containing %s", debugstr_fourcc (chunkID)); + 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_SEGMENT_FORM) { + TRACE_(dmfile)(": segment 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) DirectMusicSegment8_Object_Vtbl = { + ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE + IDirectMusicSegment8Impl_IDirectMusicObject_QueryInterface, + IDirectMusicSegment8Impl_IDirectMusicObject_AddRef, + IDirectMusicSegment8Impl_IDirectMusicObject_Release, + IDirectMusicSegment8Impl_IDirectMusicObject_GetDescriptor, + IDirectMusicSegment8Impl_IDirectMusicObject_SetDescriptor, + IDirectMusicSegment8Impl_IDirectMusicObject_ParseDescriptor +}; + +/* IDirectMusicSegment8Impl IPersistStream part: */ +HRESULT WINAPI IDirectMusicSegment8Impl_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, PersistStreamVtbl, iface); + return IDirectMusicSegment8Impl_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj); +} + +ULONG WINAPI IDirectMusicSegment8Impl_IPersistStream_AddRef (LPPERSISTSTREAM iface) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, PersistStreamVtbl, iface); + return IDirectMusicSegment8Impl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl); +} + +ULONG WINAPI IDirectMusicSegment8Impl_IPersistStream_Release (LPPERSISTSTREAM iface) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, PersistStreamVtbl, iface); + return IDirectMusicSegment8Impl_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl); +} + +HRESULT WINAPI IDirectMusicSegment8Impl_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) { + return E_NOTIMPL; +} + +HRESULT WINAPI IDirectMusicSegment8Impl_IPersistStream_IsDirty (LPPERSISTSTREAM iface) { + return E_NOTIMPL; +} + +HRESULT WINAPI IDirectMusicSegment8Impl_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm) { + ICOM_THIS_MULTI(IDirectMusicSegment8Impl, 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) - { + switch (chunkID) { case DMUS_FOURCC_SEGMENT_FORM: { TRACE_(dmfile)(": segment form\n"); do { IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL); IStream_Read (pStm, &chunkSize, sizeof(FOURCC), NULL); - StreamCount += sizeof (FOURCC) + sizeof (DWORD) + chunkSize; + StreamCount += sizeof(FOURCC) + sizeof(DWORD) + chunkSize; TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (chunkID), chunkSize); switch (chunkID) { - case DMUS_FOURCC_SEGMENT_CHUNK: { - TRACE_(dmfile)(": segment header chunk\n"); - IStream_Read (pStm, &pSegment->segHeader, chunkSize, NULL); - break; - } case DMUS_FOURCC_GUID_CHUNK: { TRACE_(dmfile)(": GUID chunk\n"); - IStream_Read (pStm, &pSegment->vVersion, chunkSize, NULL); + 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"); - IStream_Read (pStm, &pSegment->guidID, chunkSize, NULL); + 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: { @@ -620,34 +600,41 @@ HRESULT WINAPI IDirectMusicSegmentObjectStream_Load (LPPERSISTSTREAM iface, IStr 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"); - pSegment->wszName = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, chunkSize); - IStream_Read (pStm, pSegment->wszName, chunkSize, NULL); + 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\n"); - pSegment->wszArtist = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, chunkSize); - IStream_Read (pStm, pSegment->wszArtist, chunkSize, NULL); + 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\n"); - pSegment->wszCopyright = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, chunkSize); - IStream_Read (pStm, pSegment->wszCopyright, chunkSize, NULL); + 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\n"); - pSegment->wszSubject = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, chunkSize); - IStream_Read (pStm, pSegment->wszSubject, chunkSize, NULL); + 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\n"); - pSegment->wszComment = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, chunkSize); - IStream_Read (pStm, pSegment->wszComment, chunkSize, NULL); + TRACE_(dmfile)(": comment chunk (ignored)\n"); + liMove.QuadPart = chunkSize; + IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); break; } default: { @@ -655,95 +642,6 @@ HRESULT WINAPI IDirectMusicSegmentObjectStream_Load (LPPERSISTSTREAM iface, IStr 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_TRACK_LIST: { - TRACE_(dmfile)(": 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_RIFF: { - TRACE_(dmfile)(": RIFF chunk"); - IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL); - switch (chunkID) - { - case DMUS_FOURCC_TRACK_FORM: { - TRACE_(dmfile)(": containing %s: track form\n", debugstr_fourcc(chunkID)); - ListSize[1] = chunkSize - sizeof(FOURCC); - ListCount[1] = 0; - 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_TRACK_CHUNK: { - TRACE_(dmfile)(": track header chunk\n"); - IStream_Read (pStm, &tempHeader, chunkSize, NULL); - break; - } - case DMUS_FOURCC_TRACK_EXTRAS_CHUNK: { - TRACE_(dmfile)(": track extra header chunk\n"); - IStream_Read (pStm, &tempXHeader, chunkSize, NULL); - break; - } - /* add other stuff (look at note below) */ - default: { - TRACE_(dmfile)(": unknown chunk (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]); - FIXME(": loading tracks not supported yet\n"); - /* sigh... now comes track creation... currently I have some problems with implementing - this one because my test are contradicting: - - tracks are not loaded by loader (at least my dxdiag test with native dmime doesn't show it) - therefore i guess they're created with CoCreateInstance with CLSID specified in header and - IID_IDirectMusicTrack(8). Tracks are then probably passed to IDirectMusicSegment_Insert - (not quite sure, but behaviour complies with the one described in MSDN (about calling IDirectMusicTrack_Init) - - but on the other hand, track's stream implementation gets only chunk (look in MSDN for more info) - (tested with native dmime and builtin dmband and dmstyle) => this means that all info about track (header, extra header - UNFO, GUID and version are read by segment's stream... now, how the hell is all this info set on track?! - => I believe successful approach would be to create structure like this: - _DMUSIC_PRIVATE_TRACK_ENTRY { - DMUS_IO_TRACK_HEADER trkHeader; - DMUS_IO_TRACK_EXTRAS_HEADER trkXHeader; - WCHAR* name, ...; - GUID guidID; - DMUS_VERSION vVersion; - ... - IDirectMusicTrack* pTrack; - } DMUSIC_PRIVATE_TRACK_ENTRY; - and then load all stuff into it - => anyway, I'll try to implement it when I find some time again, but this note is here for anyone that wants to give it a try :) - */ - break; - } - default: { - TRACE_(dmfile)(": unknown chunk (only DMTK expected; skipping)\n"); - liMove.QuadPart = chunkSize - sizeof(FOURCC); - IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); - break; - } - } - break; - } - default: { - TRACE_(dmfile)("(unexpected) non-RIFF chunk (skipping, but expect errors)\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]); @@ -755,21 +653,21 @@ HRESULT WINAPI IDirectMusicSegmentObjectStream_Load (LPPERSISTSTREAM iface, IStr liMove.QuadPart = chunkSize - sizeof(FOURCC); IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); break; - } + } } - break; - } + break; + } default: { - TRACE_(dmfile)(": unknown chunk (skipping)\n"); + TRACE_(dmfile)(": unknown chunk (irrevelant & skipping)\n"); liMove.QuadPart = chunkSize; IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); break; - } + } } - TRACE_(dmfile)(": StreamCount = %ld < StreamSize = %ld\n", StreamCount, StreamSize); + 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; @@ -787,29 +685,48 @@ HRESULT WINAPI IDirectMusicSegmentObjectStream_Load (LPPERSISTSTREAM iface, IStr return E_FAIL; } } - + return S_OK; } -HRESULT WINAPI IDirectMusicSegmentObjectStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) -{ +HRESULT WINAPI IDirectMusicSegment8Impl_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) { return E_NOTIMPL; } -HRESULT WINAPI IDirectMusicSegmentObjectStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) -{ +HRESULT WINAPI IDirectMusicSegment8Impl_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) { return E_NOTIMPL; } -ICOM_VTABLE(IPersistStream) DirectMusicSegmentObjectStream_Vtbl = -{ +ICOM_VTABLE(IPersistStream) DirectMusicSegment8_PersistStream_Vtbl = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE - IDirectMusicSegmentObjectStream_QueryInterface, - IDirectMusicSegmentObjectStream_AddRef, - IDirectMusicSegmentObjectStream_Release, - IDirectMusicSegmentObjectStream_GetClassID, - IDirectMusicSegmentObjectStream_IsDirty, - IDirectMusicSegmentObjectStream_Load, - IDirectMusicSegmentObjectStream_Save, - IDirectMusicSegmentObjectStream_GetSizeMax + IDirectMusicSegment8Impl_IPersistStream_QueryInterface, + IDirectMusicSegment8Impl_IPersistStream_AddRef, + IDirectMusicSegment8Impl_IPersistStream_Release, + IDirectMusicSegment8Impl_IPersistStream_GetClassID, + IDirectMusicSegment8Impl_IPersistStream_IsDirty, + IDirectMusicSegment8Impl_IPersistStream_Load, + IDirectMusicSegment8Impl_IPersistStream_Save, + IDirectMusicSegment8Impl_IPersistStream_GetSizeMax }; + +/* for ClassFactory */ +HRESULT WINAPI DMUSIC_CreateDirectMusicSegmentImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) { + IDirectMusicSegment8Impl* obj; + + obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicSegment8Impl)); + if (NULL == obj) { + *ppobj = (LPVOID) NULL; + return E_OUTOFMEMORY; + } + obj->UnknownVtbl = &DirectMusicSegment8_Unknown_Vtbl; + obj->SegmentVtbl = &DirectMusicSegment8_Segment_Vtbl; + obj->ObjectVtbl = &DirectMusicSegment8_Object_Vtbl; + obj->PersistStreamVtbl = &DirectMusicSegment8_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)); + obj->ref = 0; /* will be inited by QueryInterface */ + + return IDirectMusicSegment8Impl_IUnknown_QueryInterface ((LPUNKNOWN)&obj->UnknownVtbl, lpcGUID, ppobj); +} diff --git a/dlls/dmime/segmentstate.c b/dlls/dmime/segmentstate.c index acf6711895d..5f81b9ef6b8 100644 --- a/dlls/dmime/segmentstate.c +++ b/dlls/dmime/segmentstate.c @@ -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 - -#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); } diff --git a/dlls/dmime/segtriggertrack.c b/dlls/dmime/segtriggertrack.c index 9a257467c6b..7db28f21e6d 100644 --- a/dlls/dmime/segtriggertrack.c +++ b/dlls/dmime/segtriggertrack.c @@ -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 - -#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); +} diff --git a/dlls/dmime/seqtrack.c b/dlls/dmime/seqtrack.c index 3a4d3d71a8e..a9bbe9437b0 100644 --- a/dlls/dmime/seqtrack.c +++ b/dlls/dmime/seqtrack.c @@ -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 - -#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); +} diff --git a/dlls/dmime/song.c b/dlls/dmime/song.c deleted file mode 100644 index dbcb17dca57..00000000000 --- a/dlls/dmime/song.c +++ /dev/null @@ -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 - -#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 -}; diff --git a/dlls/dmime/sysextrack.c b/dlls/dmime/sysextrack.c index ecdf12dafd2..e41dd2e181e 100644 --- a/dlls/dmime/sysextrack.c +++ b/dlls/dmime/sysextrack.c @@ -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 - -#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); +} diff --git a/dlls/dmime/tempotrack.c b/dlls/dmime/tempotrack.c index e357a7a3e34..997c4720fcc 100644 --- a/dlls/dmime/tempotrack.c +++ b/dlls/dmime/tempotrack.c @@ -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 - -#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); +} diff --git a/dlls/dmime/timesigtrack.c b/dlls/dmime/timesigtrack.c index d3b16787efc..9e3238e580a 100644 --- a/dlls/dmime/timesigtrack.c +++ b/dlls/dmime/timesigtrack.c @@ -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 - -#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); +} diff --git a/dlls/dmime/tool.c b/dlls/dmime/tool.c index e97ca982412..cc2c9801cc6 100644 --- a/dlls/dmime/tool.c +++ b/dlls/dmime/tool.c @@ -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 - -#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); } diff --git a/dlls/dmime/version.rc b/dlls/dmime/version.rc index a885e996912..65d5c2fc098 100644 --- a/dlls/dmime/version.rc +++ b/dlls/dmime/version.rc @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003 Rok Mandeljc + * Copyright (C) 2003-2004 Rok Mandeljc * * 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" diff --git a/dlls/dmime/wavetrack.c b/dlls/dmime/wavetrack.c index 59a352e4c10..2018c774a18 100644 --- a/dlls/dmime/wavetrack.c +++ b/dlls/dmime/wavetrack.c @@ -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 - -#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); +} diff --git a/dlls/dmloader/container.c b/dlls/dmloader/container.c index 9fd1438e6f1..af3e0c29750 100644 --- a/dlls/dmloader/container.c +++ b/dlls/dmloader/container.c @@ -1,6 +1,6 @@ /* IDirectMusicContainer * - * 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,43 +17,49 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include - -#include "windef.h" -#include "winbase.h" -#include "winuser.h" -#include "wingdi.h" -#include "wine/debug.h" - #include "dmloader_private.h" WINE_DEFAULT_DEBUG_CHANNEL(dmloader); +WINE_DECLARE_DEBUG_CHANNEL(dmfile); -/* IDirectMusicContainer IUnknown parts follow: */ -HRESULT WINAPI IDirectMusicContainerImpl_QueryInterface (LPDIRECTMUSICCONTAINER iface, REFIID riid, LPVOID *ppobj) -{ - ICOM_THIS(IDirectMusicContainerImpl,iface); - - if (IsEqualIID (riid, &IID_IUnknown) || - IsEqualIID (riid, &IID_IDirectMusicContainer)) { - IDirectMusicContainerImpl_AddRef(iface); - *ppobj = This; +/***************************************************************************** + * IDirectMusicContainerImpl implementation + */ +/* IDirectMusicContainerImpl IUnknown part: */ +HRESULT WINAPI IDirectMusicContainerImpl_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) { + ICOM_THIS_MULTI(IDirectMusicContainerImpl, UnknownVtbl, iface); + + TRACE("(%p, %s, %p)\n", This, debugstr_guid(riid), ppobj); + if (IsEqualIID (riid, &IID_IUnknown)) { + *ppobj = (LPVOID)&This->UnknownVtbl; + IDirectMusicContainerImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl); + return S_OK; + } else if (IsEqualIID (riid, &IID_IDirectMusicContainer)) { + *ppobj = (LPVOID)&This->ContainerVtbl; + IDirectMusicContainerImpl_IDirectMusicContainer_AddRef ((LPDIRECTMUSICCONTAINER)&This->ContainerVtbl); + return S_OK; + } else if (IsEqualIID (riid, &IID_IDirectMusicObject)) { + *ppobj = (LPVOID)&This->ObjectVtbl; + IDirectMusicContainerImpl_IDirectMusicObject_AddRef ((LPDIRECTMUSICOBJECT)&This->ObjectVtbl); + return S_OK; + } else if (IsEqualIID (riid, &IID_IPersistStream)) { + *ppobj = (LPVOID)&This->PersistStreamVtbl; + IDirectMusicContainerImpl_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 IDirectMusicContainerImpl_AddRef (LPDIRECTMUSICCONTAINER iface) -{ - ICOM_THIS(IDirectMusicContainerImpl,iface); +ULONG WINAPI IDirectMusicContainerImpl_IUnknown_AddRef (LPUNKNOWN iface) { + ICOM_THIS_MULTI(IDirectMusicContainerImpl, UnknownVtbl, iface); TRACE("(%p) : AddRef from %ld\n", This, This->ref); return ++(This->ref); } -ULONG WINAPI IDirectMusicContainerImpl_Release (LPDIRECTMUSICCONTAINER iface) -{ - ICOM_THIS(IDirectMusicContainerImpl,iface); +ULONG WINAPI IDirectMusicContainerImpl_IUnknown_Release (LPUNKNOWN iface) { + ICOM_THIS_MULTI(IDirectMusicContainerImpl, UnknownVtbl, iface); ULONG ref = --This->ref; TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref); if (ref == 0) { @@ -62,235 +68,749 @@ ULONG WINAPI IDirectMusicContainerImpl_Release (LPDIRECTMUSICCONTAINER iface) return ref; } +ICOM_VTABLE(IUnknown) DirectMusicContainer_Unknown_Vtbl = { + ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE + IDirectMusicContainerImpl_IUnknown_QueryInterface, + IDirectMusicContainerImpl_IUnknown_AddRef, + IDirectMusicContainerImpl_IUnknown_Release +}; + /* IDirectMusicContainer Interface follow: */ -HRESULT WINAPI IDirectMusicContainerImpl_EnumObject (LPDIRECTMUSICCONTAINER iface, REFGUID rguidClass, DWORD dwIndex, LPDMUS_OBJECTDESC pDesc, WCHAR* pwszAlias) -{ - ICOM_THIS(IDirectMusicContainerImpl,iface); +HRESULT WINAPI IDirectMusicContainerImpl_IDirectMusicContainer_QueryInterface (LPDIRECTMUSICCONTAINER iface, REFIID riid, LPVOID *ppobj) { + ICOM_THIS_MULTI(IDirectMusicContainerImpl, ContainerVtbl, iface); + return IDirectMusicContainerImpl_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj); +} - FIXME("(%p, %s, %ld, %p, %p): stub\n", This, debugstr_guid(rguidClass), dwIndex, pDesc, pwszAlias); +ULONG WINAPI IDirectMusicContainerImpl_IDirectMusicContainer_AddRef (LPDIRECTMUSICCONTAINER iface) { + ICOM_THIS_MULTI(IDirectMusicContainerImpl, ContainerVtbl, iface); + return IDirectMusicContainerImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl); +} + +ULONG WINAPI IDirectMusicContainerImpl_IDirectMusicContainer_Release (LPDIRECTMUSICCONTAINER iface) { + ICOM_THIS_MULTI(IDirectMusicContainerImpl, ContainerVtbl, iface); + return IDirectMusicContainerImpl_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl); +} + +HRESULT WINAPI IDirectMusicContainerImpl_IDirectMusicContainer_EnumObject (LPDIRECTMUSICCONTAINER iface, REFGUID rguidClass, DWORD dwIndex, LPDMUS_OBJECTDESC pDesc, WCHAR* pwszAlias) { + ICOM_THIS_MULTI(IDirectMusicContainerImpl, ContainerVtbl, iface); + DWORD i = -1; /* index ;) ... must be -1 since dwIndex can be 0 */ + struct list *listEntry; + LPDMUS_PRIVATE_CONTAINED_OBJECT_ENTRY objectEntry; + + TRACE("(%p, %s, %ld, %p, %p)\n", This, debugstr_guid(rguidClass), dwIndex, pDesc, pwszAlias); + LIST_FOR_EACH (listEntry, &This->ObjectsList) { + objectEntry = LIST_ENTRY(listEntry, DMUS_PRIVATE_CONTAINED_OBJECT_ENTRY, entry); + if (IsEqualGUID(rguidClass, &GUID_DirectMusicAllTypes)) i++; + else if (IsEqualGUID(rguidClass, &objectEntry->pDesc->guidClass)) i++; + + if (i == dwIndex) { + if (pDesc) + memcpy (pDesc, objectEntry->pDesc, sizeof(DMUS_OBJECTDESC)); + if (pwszAlias && objectEntry->wszAlias) { + strncpyW (pwszAlias, objectEntry->wszAlias, DMUS_MAX_NAME); + if (strlenW (objectEntry->wszAlias) > DMUS_MAX_NAME) + return DMUS_S_STRING_TRUNCATED; + } + + return S_OK; + } + } + + return S_FALSE; +} + +ICOM_VTABLE(IDirectMusicContainer) DirectMusicContainer_Container_Vtbl = { + ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE + IDirectMusicContainerImpl_IDirectMusicContainer_QueryInterface, + IDirectMusicContainerImpl_IDirectMusicContainer_AddRef, + IDirectMusicContainerImpl_IDirectMusicContainer_Release, + IDirectMusicContainerImpl_IDirectMusicContainer_EnumObject +}; + +/* IDirectMusicContainerImpl IDirectMusicObject part: */ +HRESULT WINAPI IDirectMusicContainerImpl_IDirectMusicObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj) { + ICOM_THIS_MULTI(IDirectMusicContainerImpl, ObjectVtbl, iface); + return IDirectMusicContainerImpl_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj); +} + +ULONG WINAPI IDirectMusicContainerImpl_IDirectMusicObject_AddRef (LPDIRECTMUSICOBJECT iface) { + ICOM_THIS_MULTI(IDirectMusicContainerImpl, ObjectVtbl, iface); + return IDirectMusicContainerImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl); +} + +ULONG WINAPI IDirectMusicContainerImpl_IDirectMusicObject_Release (LPDIRECTMUSICOBJECT iface) { + ICOM_THIS_MULTI(IDirectMusicContainerImpl, ObjectVtbl, iface); + return IDirectMusicContainerImpl_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl); +} + +HRESULT WINAPI IDirectMusicContainerImpl_IDirectMusicObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc) { + ICOM_THIS_MULTI(IDirectMusicContainerImpl, 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 IDirectMusicContainerImpl_IDirectMusicObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc) { + ICOM_THIS_MULTI(IDirectMusicContainerImpl, ObjectVtbl, iface); + TRACE("(%p, %p): setting descriptor:\n", This, pDesc); + if (TRACE_ON(dmloader)) { + 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(IDirectMusicContainer) DirectMusicContainer_Vtbl = -{ +HRESULT WINAPI IDirectMusicContainerImpl_IDirectMusicObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc) { + ICOM_THIS_MULTI(IDirectMusicContainerImpl, 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_DirectMusicContainer, 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_CONTAINER_FORM) { + TRACE_(dmfile)(": container 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(dmloader)) { + DMUSIC_dump_DMUS_OBJECTDESC (pDesc); + } + + return S_OK; +} + +ICOM_VTABLE(IDirectMusicObject) DirectMusicContainer_Object_Vtbl = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE - IDirectMusicContainerImpl_QueryInterface, - IDirectMusicContainerImpl_AddRef, - IDirectMusicContainerImpl_Release, - IDirectMusicContainerImpl_EnumObject + IDirectMusicContainerImpl_IDirectMusicObject_QueryInterface, + IDirectMusicContainerImpl_IDirectMusicObject_AddRef, + IDirectMusicContainerImpl_IDirectMusicObject_Release, + IDirectMusicContainerImpl_IDirectMusicObject_GetDescriptor, + IDirectMusicContainerImpl_IDirectMusicObject_SetDescriptor, + IDirectMusicContainerImpl_IDirectMusicObject_ParseDescriptor +}; + +/* IDirectMusicContainerImpl IPersistStream part: */ +HRESULT WINAPI IDirectMusicContainerImpl_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj) { + ICOM_THIS_MULTI(IDirectMusicContainerImpl, PersistStreamVtbl, iface); + return IDirectMusicContainerImpl_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj); +} + +ULONG WINAPI IDirectMusicContainerImpl_IPersistStream_AddRef (LPPERSISTSTREAM iface) { + ICOM_THIS_MULTI(IDirectMusicContainerImpl, PersistStreamVtbl, iface); + return IDirectMusicContainerImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl); +} + +ULONG WINAPI IDirectMusicContainerImpl_IPersistStream_Release (LPPERSISTSTREAM iface) { + ICOM_THIS_MULTI(IDirectMusicContainerImpl, PersistStreamVtbl, iface); + return IDirectMusicContainerImpl_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl); +} + +HRESULT WINAPI IDirectMusicContainerImpl_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) { + return E_NOTIMPL; +} + +HRESULT WINAPI IDirectMusicContainerImpl_IPersistStream_IsDirty (LPPERSISTSTREAM iface) { + return E_NOTIMPL; +} + +HRESULT WINAPI IDirectMusicContainerImpl_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm) { + ICOM_THIS_MULTI(IDirectMusicContainerImpl, PersistStreamVtbl, iface); + + DMUS_PRIVATE_CHUNK Chunk; + DWORD StreamSize, StreamCount, ListSize[3], ListCount[3]; + LARGE_INTEGER liMove; /* used when skipping chunks */ + ULARGE_INTEGER uliPos; /* needed when dealing with RIFF chunks */ + LPDIRECTMUSICGETLOADER pGetLoader; + LPDIRECTMUSICLOADER pLoader; + + /* get loader since it will be needed later */ + IStream_QueryInterface (pStm, &IID_IDirectMusicGetLoader, (LPVOID*)&pGetLoader); + IDirectMusicGetLoader_GetLoader (pGetLoader, &pLoader); + IDirectMusicGetLoader_Release (pGetLoader); + + IStream_AddRef (pStm); /* add count for later references */ + + 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_RIFF: { + IStream_Read (pStm, &Chunk.fccID, sizeof(FOURCC), NULL); + TRACE_(dmfile)(": RIFF chunk of type %s", debugstr_fourcc(Chunk.fccID)); + StreamSize = Chunk.dwSize - sizeof(FOURCC); + StreamCount = 0; + switch (Chunk.fccID) { + case DMUS_FOURCC_CONTAINER_FORM: { + TRACE_(dmfile)(": container form\n"); + do { + IStream_Read (pStm, &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_CONTAINER_CHUNK: { + TRACE_(dmfile)(": container header chunk\n"); + This->pHeader = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, Chunk.dwSize); + IStream_Read (pStm, This->pHeader, Chunk.dwSize, NULL); + break; + } + case DMUS_FOURCC_GUID_CHUNK: { + TRACE_(dmfile)(": GUID chunk\n"); + This->pDesc->dwValidData |= DMUS_OBJ_OBJECT; + IStream_Read (pStm, &This->pDesc->guidObject, Chunk.dwSize, NULL); + break; + } + case DMUS_FOURCC_VERSION_CHUNK: { + TRACE_(dmfile)(": version chunk\n"); + This->pDesc->dwValidData |= DMUS_OBJ_VERSION; + IStream_Read (pStm, &This->pDesc->vVersion, Chunk.dwSize, NULL); + break; + } + case DMUS_FOURCC_CATEGORY_CHUNK: { + TRACE_(dmfile)(": category chunk\n"); + This->pDesc->dwValidData |= DMUS_OBJ_CATEGORY; + IStream_Read (pStm, This->pDesc->wszCategory, 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[0] = Chunk.dwSize - sizeof(FOURCC); + ListCount[0] = 0; + switch (Chunk.fccID) { + case DMUS_FOURCC_UNFO_LIST: { + TRACE_(dmfile)(": UNFO 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 = %ld)", 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"); + This->pDesc->dwValidData |= DMUS_OBJ_NAME; + IStream_Read (pStm, This->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 (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 = Chunk.dwSize; + 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 = Chunk.dwSize; + 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 = Chunk.dwSize; + IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, 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[0] = %ld < ListSize[0] = %ld\n", ListCount[0], ListSize[0]); + } while (ListCount[0] < ListSize[0]); + break; + } + case DMUS_FOURCC_CONTAINED_OBJECTS_LIST: { + TRACE_(dmfile)(": contained objects 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 = %ld)", 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[1] = Chunk.dwSize - sizeof(FOURCC); + ListCount[1] = 0; + switch (Chunk.fccID) { + case DMUS_FOURCC_CONTAINED_OBJECT_LIST: { + DMUS_IO_CONTAINED_OBJECT_HEADER tmpObjectHeader; /* temporary structure */ + LPDMUS_PRIVATE_CONTAINED_OBJECT_ENTRY newEntry; + TRACE_(dmfile)(": contained object list\n"); + memset (&tmpObjectHeader, 0, sizeof(DMUS_IO_CONTAINED_OBJECT_HEADER)); + newEntry = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(DMUS_PRIVATE_CONTAINED_OBJECT_ENTRY)); + newEntry->pDesc = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC)); + DM_STRUCT_INIT(newEntry->pDesc); + do { + IStream_Read (pStm, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL); + ListCount[1] += sizeof(FOURCC) + sizeof(DWORD) + Chunk.dwSize; + TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize); + switch (Chunk.fccID) { + case DMUS_FOURCC_CONTAINED_ALIAS_CHUNK: { + TRACE_(dmfile)(": alias chunk\n"); + newEntry->wszAlias = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, Chunk.dwSize); + IStream_Read (pStm, newEntry->wszAlias, Chunk.dwSize, NULL); + break; + } + case DMUS_FOURCC_CONTAINED_OBJECT_CHUNK: { + TRACE_(dmfile)(": contained object header chunk\n"); + IStream_Read (pStm, &tmpObjectHeader, Chunk.dwSize, NULL); + /* copy guidClass */ + newEntry->pDesc->dwValidData |= DMUS_OBJ_CLASS; + memcpy (&newEntry->pDesc->guidClass, &tmpObjectHeader.guidClassID, sizeof(GUID)); + break; + } + /* now read data... it may be safe to read everything after object header chunk, + but I'm not comfortable with MSDN's "the header is *normally* followed by ..." */ + 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 DMUS_FOURCC_REF_LIST: { + DMUS_IO_REFERENCE tmpReferenceHeader; /* temporary structure */ + TRACE_(dmfile)(": reference list\n"); + memset (&tmpReferenceHeader, 0, sizeof(DMUS_IO_REFERENCE)); + do { + IStream_Read (pStm, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL); + ListCount[2] += sizeof(FOURCC) + sizeof(DWORD) + Chunk.dwSize; + TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize); + switch (Chunk.fccID) { + case DMUS_FOURCC_REF_CHUNK: { + TRACE_(dmfile)(": reference header chunk\n"); + IStream_Read (pStm, &tmpReferenceHeader, Chunk.dwSize, NULL); + /* copy retrieved data to DMUS_OBJECTDESC */ + if (!IsEqualCLSID (&newEntry->pDesc->guidClass, &tmpReferenceHeader.guidClassID)) ERR(": object header declares different CLSID than reference header\n"); + /* no need since it's already there */ + /*memcpy (&newEntry->pDesc->guidClass, &tempReferenceHeader.guidClassID, sizeof(GUID)); */ + newEntry->pDesc->dwValidData = tmpReferenceHeader.dwValidData; + break; + } + case DMUS_FOURCC_GUID_CHUNK: { + TRACE_(dmfile)(": guid chunk\n"); + /* no need to set flags since they were copied from reference header */ + IStream_Read (pStm, &newEntry->pDesc->guidObject, Chunk.dwSize, NULL); + break; + } + case DMUS_FOURCC_DATE_CHUNK: { + TRACE_(dmfile)(": file date chunk\n"); + /* no need to set flags since they were copied from reference header */ + IStream_Read (pStm, &newEntry->pDesc->ftDate, Chunk.dwSize, NULL); + break; + } + case DMUS_FOURCC_NAME_CHUNK: { + TRACE_(dmfile)(": name chunk\n"); + /* no need to set flags since they were copied from reference header */ + IStream_Read (pStm, newEntry->pDesc->wszName, Chunk.dwSize, NULL); + break; + } + case DMUS_FOURCC_FILE_CHUNK: { + TRACE_(dmfile)(": file name chunk\n"); + /* no need to set flags since they were copied from reference header */ + IStream_Read (pStm, newEntry->pDesc->wszFileName, Chunk.dwSize, NULL); + break; + } + case DMUS_FOURCC_CATEGORY_CHUNK: { + TRACE_(dmfile)(": category chunk\n"); + /* no need to set flags since they were copied from reference header */ + IStream_Read (pStm, newEntry->pDesc->wszCategory, Chunk.dwSize, NULL); + break; + } + case DMUS_FOURCC_VERSION_CHUNK: { + TRACE_(dmfile)(": version chunk\n"); + /* no need to set flags since they were copied from reference header */ + IStream_Read (pStm, &newEntry->pDesc->vVersion, Chunk.dwSize, NULL); + break; + } + default: { + TRACE_(dmfile)(": unknown chunk (skipping)\n"); + liMove.QuadPart = Chunk.dwSize; + 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; + } + case FOURCC_RIFF: { + IStream_Read (pStm, &Chunk.fccID, sizeof(FOURCC), NULL); + TRACE_(dmfile)(": RIFF chunk of type %s", debugstr_fourcc(Chunk.fccID)); + if (IS_VALID_DMFORM (Chunk.fccID)) { + TRACE_(dmfile)(": valid DMUSIC form\n"); + /* we'll have to skip whole RIFF chunk after SetObject call */ + #define RIFF_LOADING /* effective hack ;) */ + liMove.QuadPart = 0; + IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, &uliPos); + uliPos.QuadPart += (Chunk.dwSize - sizeof(FOURCC)); /* set uliPos at the end of RIFF chunk */ + /* move at the beginning of RIFF chunk */ + liMove.QuadPart = 0; + liMove.QuadPart -= (sizeof(FOURCC)+sizeof(DWORD)+sizeof(FOURCC)); + IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); + /* put pointer to stream in descriptor */ + newEntry->pDesc->dwValidData |= DMUS_OBJ_STREAM; + /* this is not how M$ does it (according to my tests), but + who says their way is better? */ + /* *newEntry->pDesc->pStream = pStm; */ + /* *IStream_AddRef (pStm); */ /* reference increased */ + IStream_Clone (pStm, &newEntry->pDesc->pStream); + /* wait till we get on the end of object list */ + } else { + TRACE_(dmfile)(": invalid DMUSIC form (skipping)\n"); + liMove.QuadPart = Chunk.dwSize - sizeof(FOURCC); + IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); + /* FIXME: should we return E_FAIL? */ + } + 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]); + /* SetObject: this will fill descriptor with additional info + and add alias in loader's cache */ + IDirectMusicLoader_SetObject (pLoader, newEntry->pDesc); + /* my tests show tha we shouldn't return any info on stream when calling EnumObject... sigh... which + means we have to clear these fields to be M$ compliant; but funny thing is, we return filename + when loading from reference... M$ sux */ + /* FIXME: test what happens when we load with DMUS_OBJ_MEMORY */ + /* if we have loaded through RIFF chunk, skip it and clear stream flag */ + #ifdef RIFF_LOADING + liMove.QuadPart = uliPos.QuadPart; + IStream_Seek (pStm, liMove, STREAM_SEEK_SET, NULL); + newEntry->pDesc->dwValidData &= ~DMUS_OBJ_STREAM; /* clear flag */ + newEntry->pDesc->pStream = NULL; + #undef RIFF_LOADING + #endif + /* add entry to list of objects */ + list_add_tail (&This->ObjectsList, &newEntry->entry); + + /* now, if DMUS_CONTAINER_NOLOADS is not set, we are supposed to load contained objects; + so when we call GetObject later, they'll already be in cache */ + if (!(This->pHeader->dwFlags & DMUS_CONTAINER_NOLOADS)) { + IDirectMusicObject* pObject; + TRACE_(dmfile)(": DMUS_CONTAINER_NOLOADS not set\n"); + /* native container and builtin loader show that we use IDirectMusicObject here */ + if (SUCCEEDED(IDirectMusicLoader_GetObject (pLoader, newEntry->pDesc, &IID_IDirectMusicObject, (LPVOID*)&pObject))) + IDirectMusicObject_Release (pObject); + } + 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 (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)(": 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 = Chunk.dwSize; + IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */ + return E_FAIL; + } + } + + IDirectMusicLoader_Release (pLoader); /* release loader */ + +#if 0 + /* DEBUG: dumps whole container object tree: */ + if (TRACE_ON(dmloader)) { + int r = 0; + DMUS_PRIVATE_CONTAINED_OBJECT_ENTRY *tmpEntry; + struct list *listEntry; + + TRACE("*** IDirectMusicContainer (%p) ***\n", This->ContainerVtbl); + TRACE(" - Object descriptor:\n"); + DMUSIC_dump_DMUS_OBJECTDESC (This->pDesc); + TRACE(" - Header:\n"); + TRACE(" - dwFlags: "); + DMUSIC_dump_DMUS_CONTAINER_FLAGS (This->pHeader->dwFlags); + + TRACE(" - Objects:\n"); + + LIST_FOR_EACH (listEntry, &This->ObjectsList) { + tmpEntry = LIST_ENTRY( listEntry, DMUS_PRIVATE_CONTAINED_OBJECT_ENTRY, entry ); + TRACE(" - Object[%i]:\n", r); + TRACE(" - wszAlias: %s\n", debugstr_w(tmpEntry->wszAlias)); + TRACE(" - Object descriptor:\n"); + DMUSIC_dump_DMUS_OBJECTDESC(tmpEntry->pDesc); + r++; + } + } +#endif + + + return S_OK; +} + +HRESULT WINAPI IDirectMusicContainerImpl_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) { + return E_NOTIMPL; +} + +HRESULT WINAPI IDirectMusicContainerImpl_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) { + return E_NOTIMPL; +} + +ICOM_VTABLE(IPersistStream) DirectMusicContainer_PersistStream_Vtbl = { + ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE + IDirectMusicContainerImpl_IPersistStream_QueryInterface, + IDirectMusicContainerImpl_IPersistStream_AddRef, + IDirectMusicContainerImpl_IPersistStream_Release, + IDirectMusicContainerImpl_IPersistStream_GetClassID, + IDirectMusicContainerImpl_IPersistStream_IsDirty, + IDirectMusicContainerImpl_IPersistStream_Load, + IDirectMusicContainerImpl_IPersistStream_Save, + IDirectMusicContainerImpl_IPersistStream_GetSizeMax }; /* for ClassFactory */ -HRESULT WINAPI DMUSIC_CreateDirectMusicContainer (LPCGUID lpcGUID, LPDIRECTMUSICCONTAINER *ppDMCon, LPUNKNOWN pUnkOuter) -{ - IDirectMusicContainerImpl* dmcon; +HRESULT WINAPI DMUSIC_CreateDirectMusicContainerImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) { + IDirectMusicContainerImpl* obj; - if (IsEqualIID (lpcGUID, &IID_IDirectMusicContainer)) { - dmcon = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicContainerImpl)); - if (NULL == dmcon) { - *ppDMCon = (LPDIRECTMUSICCONTAINER) NULL; - return E_OUTOFMEMORY; - } - dmcon->lpVtbl = &DirectMusicContainer_Vtbl; - dmcon->ref = 1; - *ppDMCon = (LPDIRECTMUSICCONTAINER) dmcon; - return S_OK; + obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicContainerImpl)); + if (NULL == obj) { + *ppobj = (LPVOID) NULL; + return E_OUTOFMEMORY; } - WARN("No interface found\n"); + obj->UnknownVtbl = &DirectMusicContainer_Unknown_Vtbl; + obj->ContainerVtbl = &DirectMusicContainer_Container_Vtbl; + obj->ObjectVtbl = &DirectMusicContainer_Object_Vtbl; + obj->PersistStreamVtbl = &DirectMusicContainer_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_DirectMusicContainer, sizeof (CLSID)); + obj->ref = 0; /* will be inited by QueryInterface */ + list_init (&obj->ObjectsList); - return E_NOINTERFACE; + return IDirectMusicContainerImpl_IUnknown_QueryInterface ((LPUNKNOWN)&obj->UnknownVtbl, lpcGUID, ppobj); } - -/***************************************************************************** - * IDirectMusicContainerObject implementation - */ -/* IDirectMusicContainerObject IUnknown part: */ -HRESULT WINAPI IDirectMusicContainerObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj) -{ - ICOM_THIS(IDirectMusicContainerObject,iface); - - if (IsEqualIID (riid, &IID_IUnknown) - || IsEqualIID (riid, &IID_IDirectMusicObject)) { - IDirectMusicContainerObject_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_IDirectMusicContainer)) { - IDirectMusicContainer_AddRef ((LPDIRECTMUSICCONTAINER)This->pContainer); - *ppobj = (LPDIRECTMUSICCONTAINER)This->pContainer; - return S_OK; - } - WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj); - return E_NOINTERFACE; -} - -ULONG WINAPI IDirectMusicContainerObject_AddRef (LPDIRECTMUSICOBJECT iface) -{ - ICOM_THIS(IDirectMusicContainerObject,iface); - TRACE("(%p) : AddRef from %ld\n", This, This->ref); - return ++(This->ref); -} - -ULONG WINAPI IDirectMusicContainerObject_Release (LPDIRECTMUSICOBJECT iface) -{ - ICOM_THIS(IDirectMusicContainerObject,iface); - ULONG ref = --This->ref; - TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref); - if (ref == 0) { - HeapFree(GetProcessHeap(), 0, This); - } - return ref; -} - -/* IDirectMusicContainerObject IDirectMusicObject part: */ -HRESULT WINAPI IDirectMusicContainerObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc) -{ - ICOM_THIS(IDirectMusicContainerObject,iface); - - TRACE("(%p, %p)\n", This, pDesc); - pDesc = This->pDesc; - - return S_OK; -} - -HRESULT WINAPI IDirectMusicContainerObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc) -{ - ICOM_THIS(IDirectMusicContainerObject,iface); - - TRACE("(%p, %p)\n", This, pDesc); - This->pDesc = pDesc; - - return S_OK; -} - -HRESULT WINAPI IDirectMusicContainerObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc) -{ - ICOM_THIS(IDirectMusicContainerObject,iface); - - FIXME("(%p, %p, %p): stub\n", This, pStream, pDesc); - - return S_OK; -} - -ICOM_VTABLE(IDirectMusicObject) DirectMusicContainerObject_Vtbl = -{ - ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE - IDirectMusicContainerObject_QueryInterface, - IDirectMusicContainerObject_AddRef, - IDirectMusicContainerObject_Release, - IDirectMusicContainerObject_GetDescriptor, - IDirectMusicContainerObject_SetDescriptor, - IDirectMusicContainerObject_ParseDescriptor -}; - -/* for ClassFactory */ -HRESULT WINAPI DMUSIC_CreateDirectMusicContainerObject (LPCGUID lpcGUID, LPDIRECTMUSICOBJECT* ppObject, LPUNKNOWN pUnkOuter) -{ - IDirectMusicContainerObject *obj; - - TRACE("(%p,%p,%p)\n", lpcGUID, ppObject, pUnkOuter); - if (IsEqualIID (lpcGUID, &IID_IDirectMusicObject)) { - obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicContainerObject)); - if (NULL == obj) { - *ppObject = (LPDIRECTMUSICOBJECT) NULL; - return E_OUTOFMEMORY; - } - obj->lpVtbl = &DirectMusicContainerObject_Vtbl; - obj->ref = 1; - /* prepare IPersistStream */ - obj->pStream = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(IDirectMusicContainerObjectStream)); - obj->pStream->lpVtbl = &DirectMusicContainerObjectStream_Vtbl; - obj->pStream->ref = 1; - obj->pStream->pParentObject = obj; - /* prepare IDirectMusicContainer */ - DMUSIC_CreateDirectMusicContainer (&IID_IDirectMusicContainer, (LPDIRECTMUSICCONTAINER*)&obj->pContainer, NULL); - obj->pContainer->pObject = obj; - *ppObject = (LPDIRECTMUSICOBJECT) obj; - return S_OK; - } - WARN("No interface found\n"); - - return E_NOINTERFACE; -} - -/***************************************************************************** - * IDirectMusicContainerObjectStream implementation - */ -/* IDirectMusicContainerObjectStream IUnknown part: */ -HRESULT WINAPI IDirectMusicContainerObjectStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj) -{ - ICOM_THIS(IDirectMusicContainerObjectStream,iface); - - if (IsEqualIID (riid, &IID_IUnknown) - || IsEqualIID (riid, &IID_IPersistStream)) { - IDirectMusicContainerObjectStream_AddRef(iface); - *ppobj = This; - return S_OK; - } - - WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj); - return E_NOINTERFACE; -} - -ULONG WINAPI IDirectMusicContainerObjectStream_AddRef (LPPERSISTSTREAM iface) -{ - ICOM_THIS(IDirectMusicContainerObjectStream,iface); - TRACE("(%p) : AddRef from %ld\n", This, This->ref); - return ++(This->ref); -} - -ULONG WINAPI IDirectMusicContainerObjectStream_Release (LPPERSISTSTREAM iface) -{ - ICOM_THIS(IDirectMusicContainerObjectStream,iface); - ULONG ref = --This->ref; - TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref); - if (ref == 0) { - HeapFree(GetProcessHeap(), 0, This); - } - return ref; -} - -/* IDirectMusicContainerObjectStream IPersist part: */ -HRESULT WINAPI IDirectMusicContainerObjectStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) -{ - return E_NOTIMPL; -} - -/* IDirectMusicContainerObjectStream IPersistStream part: */ -HRESULT WINAPI IDirectMusicContainerObjectStream_IsDirty (LPPERSISTSTREAM iface) -{ - return E_NOTIMPL; -} - -HRESULT WINAPI IDirectMusicContainerObjectStream_Load (LPPERSISTSTREAM iface, IStream* pStm) -{ - FIXME(": Loading not implemented yet\n"); - return S_OK; -} - -HRESULT WINAPI IDirectMusicContainerObjectStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) -{ - return E_NOTIMPL; -} - -HRESULT WINAPI IDirectMusicContainerObjectStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) -{ - return E_NOTIMPL; -} - -ICOM_VTABLE(IPersistStream) DirectMusicContainerObjectStream_Vtbl = -{ - ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE - IDirectMusicContainerObjectStream_QueryInterface, - IDirectMusicContainerObjectStream_AddRef, - IDirectMusicContainerObjectStream_Release, - IDirectMusicContainerObjectStream_GetClassID, - IDirectMusicContainerObjectStream_IsDirty, - IDirectMusicContainerObjectStream_Load, - IDirectMusicContainerObjectStream_Save, - IDirectMusicContainerObjectStream_GetSizeMax -}; diff --git a/dlls/dmloader/dmloader_main.c b/dlls/dmloader/dmloader_main.c index e95d12a34f6..eee90596b66 100644 --- a/dlls/dmloader/dmloader_main.c +++ b/dlls/dmloader/dmloader_main.c @@ -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; diff --git a/dlls/dmloader/dmloader_private.h b/dlls/dmloader/dmloader_private.h index e705156cf9a..8f170eacdbf 100644 --- a/dlls/dmloader/dmloader_private.h +++ b/dlls/dmloader/dmloader_private.h @@ -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 #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 */ diff --git a/dlls/dmloader/loader.c b/dlls/dmloader/loader.c index 733e9fe1a05..bdece6f8c85 100644 --- a/dlls/dmloader/loader.c +++ b/dlls/dmloader/loader.c @@ -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 - -#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]; diff --git a/dlls/dmloader/loaderstream.c b/dlls/dmloader/loaderstream.c index 397baeb9516..bf6c6838573 100644 --- a/dlls/dmloader/loaderstream.c +++ b/dlls/dmloader/loaderstream.c @@ -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 - -#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); } diff --git a/dlls/dmloader/regsvr.c b/dlls/dmloader/regsvr.c index 698542b5e06..9e8fefa575e 100644 --- a/dlls/dmloader/regsvr.c +++ b/dlls/dmloader/regsvr.c @@ -18,21 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include - -#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"); diff --git a/dlls/dmloader/version.rc b/dlls/dmloader/version.rc index 43d10443521..a7565c421cc 100644 --- a/dlls/dmloader/version.rc +++ b/dlls/dmloader/version.rc @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003 Rok Mandeljc + * Copyright (C) 2003-2004 Rok Mandeljc * * 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" diff --git a/dlls/dmscript/dmscript_main.c b/dlls/dmscript/dmscript_main.c index df9b2dde7ce..ab8f3a3ee19 100644 --- a/dlls/dmscript/dmscript_main.c +++ b/dlls/dmscript/dmscript_main.c @@ -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; diff --git a/dlls/dmscript/dmscript_private.h b/dlls/dmscript/dmscript_private.h index 7d0466adc56..bfb8ff840ff 100644 --- a/dlls/dmscript/dmscript_private.h +++ b/dlls/dmscript/dmscript_private.h @@ -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 #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 */ diff --git a/dlls/dmscript/regsvr.c b/dlls/dmscript/regsvr.c index 2b6f994808d..f1c29f02da8 100644 --- a/dlls/dmscript/regsvr.c +++ b/dlls/dmscript/regsvr.c @@ -18,21 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include - -#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"); diff --git a/dlls/dmscript/script.c b/dlls/dmscript/script.c index c2116ca9041..a3e04435817 100644 --- a/dlls/dmscript/script.c +++ b/dlls/dmscript/script.c @@ -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 - -#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 -}; diff --git a/dlls/dmscript/scripttrack.c b/dlls/dmscript/scripttrack.c index 3c47d4bfd37..f28c1c5baaf 100644 --- a/dlls/dmscript/scripttrack.c +++ b/dlls/dmscript/scripttrack.c @@ -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 - -#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); +} diff --git a/dlls/dmscript/version.rc b/dlls/dmscript/version.rc index a0b322227ca..bc1b1daac45 100644 --- a/dlls/dmscript/version.rc +++ b/dlls/dmscript/version.rc @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003 Rok Mandeljc + * Copyright (C) 2003-2004 Rok Mandeljc * * 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" diff --git a/dlls/dmstyle/Makefile.in b/dlls/dmstyle/Makefile.in index 5a5696c3ad8..0cb36cc8636 100644 --- a/dlls/dmstyle/Makefile.in +++ b/dlls/dmstyle/Makefile.in @@ -11,7 +11,6 @@ C_SRCS = \ chordtrack.c \ commandtrack.c \ dmstyle_main.c \ - melodyformulationtrack.c \ motiftrack.c \ mutetrack.c \ regsvr.c \ diff --git a/dlls/dmstyle/auditiontrack.c b/dlls/dmstyle/auditiontrack.c index ac25cf2114b..80ab4d3d2df 100644 --- a/dlls/dmstyle/auditiontrack.c +++ b/dlls/dmstyle/auditiontrack.c @@ -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 - -#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); +} diff --git a/dlls/dmstyle/chordtrack.c b/dlls/dmstyle/chordtrack.c index 7c2c3c0a33f..08342504f6c 100644 --- a/dlls/dmstyle/chordtrack.c +++ b/dlls/dmstyle/chordtrack.c @@ -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 - -#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 -}; diff --git a/dlls/dmstyle/commandtrack.c b/dlls/dmstyle/commandtrack.c index ad3fd91a05e..6ff568c5b98 100644 --- a/dlls/dmstyle/commandtrack.c +++ b/dlls/dmstyle/commandtrack.c @@ -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 - -#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); +} diff --git a/dlls/dmstyle/dmstyle_main.c b/dlls/dmstyle/dmstyle_main.c index d85c7d5f8cb..920b50c3a93 100644 --- a/dlls/dmstyle/dmstyle_main.c +++ b/dlls/dmstyle/dmstyle_main.c @@ -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; diff --git a/dlls/dmstyle/dmstyle_private.h b/dlls/dmstyle/dmstyle_private.h index c664947ecd0..a607915d54c 100644 --- a/dlls/dmstyle/dmstyle_private.h +++ b/dlls/dmstyle/dmstyle_private.h @@ -1,6 +1,6 @@ /* DirectMusicStyle 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,614 +23,574 @@ #include #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 IDirectMusicStyle8Impl IDirectMusicStyle8Impl; -typedef struct IDirectMusicStyleObject IDirectMusicStyleObject; -typedef struct IDirectMusicStyleObjectStream IDirectMusicStyleObjectStream; - typedef struct IDirectMusicAuditionTrack IDirectMusicAuditionTrack; -typedef struct IDirectMusicAuditionTrackStream IDirectMusicAuditionTrackStream; typedef struct IDirectMusicChordTrack IDirectMusicChordTrack; -typedef struct IDirectMusicChordTrackStream IDirectMusicChordTrackStream; typedef struct IDirectMusicCommandTrack IDirectMusicCommandTrack; -typedef struct IDirectMusicCommandTrackStream IDirectMusicCommandTrackStream; typedef struct IDirectMusicMelodyFormulationTrack IDirectMusicMelodyFormulationTrack; -typedef struct IDirectMusicMelodyFormulationTrackStream IDirectMusicMelodyFormulationTrackStream; typedef struct IDirectMusicMotifTrack IDirectMusicMotifTrack; -typedef struct IDirectMusicMotifTrackStream IDirectMusicMotifTrackStream; typedef struct IDirectMusicMuteTrack IDirectMusicMuteTrack; -typedef struct IDirectMusicMuteTrackStream IDirectMusicMuteTrackStream; typedef struct IDirectMusicStyleTrack IDirectMusicStyleTrack; -typedef struct IDirectMusicStyleTrackStream IDirectMusicStyleTrackStream; /***************************************************************************** * Predeclare the interface implementation structures */ -extern ICOM_VTABLE(IDirectMusicStyle8) DirectMusicStyle8_Vtbl; +extern ICOM_VTABLE(IUnknown) DirectMusicStyle8_Unknown_Vtbl; +extern ICOM_VTABLE(IDirectMusicStyle8) DirectMusicStyle8_Style_Vtbl; +extern ICOM_VTABLE(IDirectMusicObject) DirectMusicStyle8_Object_Vtbl; +extern ICOM_VTABLE(IPersistStream) DirectMusicStyle8_IPersistStream_Vtbl; -extern ICOM_VTABLE(IDirectMusicObject) DirectMusicStyleObject_Vtbl; -extern ICOM_VTABLE(IPersistStream) DirectMusicStyleObjectStream_Vtbl; +extern ICOM_VTABLE(IUnknown) DirectMusicAuditionTrack_Unknown_Vtbl; +extern ICOM_VTABLE(IDirectMusicTrack8) DirectMusicAuditionTrack_Track_Vtbl; +extern ICOM_VTABLE(IPersistStream) DirectMusicAuditionTrack_PersistStream_Vtbl; -extern ICOM_VTABLE(IDirectMusicTrack8) DirectMusicAuditionTrack_Vtbl; -extern ICOM_VTABLE(IPersistStream) DirectMusicAuditionTrackStream_Vtbl; -extern ICOM_VTABLE(IDirectMusicTrack8) DirectMusicChordTrack_Vtbl; -extern ICOM_VTABLE(IPersistStream) DirectMusicChordTrackStream_Vtbl; -extern ICOM_VTABLE(IDirectMusicTrack8) DirectMusicCommandTrack_Vtbl; -extern ICOM_VTABLE(IPersistStream) DirectMusicCommandTrackStream_Vtbl; -extern ICOM_VTABLE(IDirectMusicTrack8) DirectMusicMelodyFormulationTrack_Vtbl; -extern ICOM_VTABLE(IPersistStream) DirectMusicMelodyFormulationTrackStream_Vtbl; -extern ICOM_VTABLE(IDirectMusicTrack8) DirectMusicMotifTrack_Vtbl; -extern ICOM_VTABLE(IPersistStream) DirectMusicMotifTrackStream_Vtbl; -extern ICOM_VTABLE(IDirectMusicTrack8) DirectMusicMuteTrack_Vtbl; -extern ICOM_VTABLE(IPersistStream) DirectMusicMuteTrackStream_Vtbl; -extern ICOM_VTABLE(IDirectMusicTrack8) DirectMusicStyleTrack_Vtbl; -extern ICOM_VTABLE(IPersistStream) DirectMusicStyleTrackStream_Vtbl; +extern ICOM_VTABLE(IUnknown) DirectMusicChordTrack_Unknown_Vtbl; +extern ICOM_VTABLE(IDirectMusicTrack8) DirectMusicChordTrack_Track_Vtbl; +extern ICOM_VTABLE(IPersistStream) DirectMusicChordTrack_PersistStream_Vtbl; + +extern ICOM_VTABLE(IUnknown) DirectMusicCommandTrack_Unknown_Vtbl; +extern ICOM_VTABLE(IDirectMusicTrack8) DirectMusicCommandTrack_Track_Vtbl; +extern ICOM_VTABLE(IPersistStream) DirectMusicCommandTrack_PersistStream_Vtbl; + +extern ICOM_VTABLE(IUnknown) DirectMusicMelodyFormulationTrack_Unknown_Vtbl; +extern ICOM_VTABLE(IDirectMusicTrack8) DirectMusicMelodyFormulationTrack_Track_Vtbl; +extern ICOM_VTABLE(IPersistStream) DirectMusicMelodyFormulationTrack_PersistStream_Vtbl; + +extern ICOM_VTABLE(IUnknown) DirectMusicMotifTrack_Unknown_Vtbl; +extern ICOM_VTABLE(IDirectMusicTrack8) DirectMusicMotifTrack_Track_Vtbl; +extern ICOM_VTABLE(IPersistStream) DirectMusicMotifTrack_PersistStream_Vtbl; + +extern ICOM_VTABLE(IUnknown) DirectMusicMuteTrack_Unknown_Vtbl; +extern ICOM_VTABLE(IDirectMusicTrack8) DirectMusicMuteTrack_Track_Vtbl; +extern ICOM_VTABLE(IPersistStream) DirectMusicMuteTrack_PersistStream_Vtbl; + +extern ICOM_VTABLE(IUnknown) DirectMusicStyleTrack_Unknown_Vtbl; +extern ICOM_VTABLE(IDirectMusicTrack8) DirectMusicStyleTrack_Track_Vtbl; +extern ICOM_VTABLE(IPersistStream) DirectMusicStyleTrack_PersistStream_Vtbl; /***************************************************************************** * ClassFactory - * - * can support IID_IDirectMusicStyle and IID_IDirectMusicStyle8 - * return always an IDirectMusicStyle8Impl */ -extern HRESULT WINAPI DMUSIC_CreateDirectMusicStyle (LPCGUID lpcGUID, LPDIRECTMUSICSTYLE8* ppDMStyle, LPUNKNOWN pUnkOuter); +extern HRESULT WINAPI DMUSIC_CreateDirectMusicStyleImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter); -extern HRESULT WINAPI DMUSIC_CreateDirectMusicStyleObject (LPCGUID lpcGUID, LPDIRECTMUSICOBJECT* ppObject, LPUNKNOWN pUnkOuter); - -extern HRESULT WINAPI DMUSIC_CreateDirectMusicAuditionTrack (LPCGUID lpcGUID, LPDIRECTMUSICTRACK8* ppTrack, LPUNKNOWN pUnkOuter); -extern HRESULT WINAPI DMUSIC_CreateDirectMusicChordTrack (LPCGUID lpcGUID, LPDIRECTMUSICTRACK8* ppTrack, LPUNKNOWN pUnkOuter); -extern HRESULT WINAPI DMUSIC_CreateDirectMusicCommandTrack (LPCGUID lpcGUID, LPDIRECTMUSICTRACK8* ppTrack, LPUNKNOWN pUnkOuter); -extern HRESULT WINAPI DMUSIC_CreateDirectMusicMelodyFormulationTrack (LPCGUID lpcGUID, LPDIRECTMUSICTRACK8* ppTrack, LPUNKNOWN pUnkOuter); -extern HRESULT WINAPI DMUSIC_CreateDirectMusicMotifTrack (LPCGUID lpcGUID, LPDIRECTMUSICTRACK8* ppTrack, LPUNKNOWN pUnkOuter); -extern HRESULT WINAPI DMUSIC_CreateDirectMusicMuteTrack (LPCGUID lpcGUID, LPDIRECTMUSICTRACK8* ppTrack, LPUNKNOWN pUnkOuter); -extern HRESULT WINAPI DMUSIC_CreateDirectMusicStyleTrack (LPCGUID lpcGUID, LPDIRECTMUSICTRACK8* ppTrack, LPUNKNOWN pUnkOuter); +extern HRESULT WINAPI DMUSIC_CreateDirectMusicAuditionTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter); +extern HRESULT WINAPI DMUSIC_CreateDirectMusicChordTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter); +extern HRESULT WINAPI DMUSIC_CreateDirectMusicCommandTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter); +extern HRESULT WINAPI DMUSIC_CreateDirectMusicMelodyFormulationTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter); +extern HRESULT WINAPI DMUSIC_CreateDirectMusicMotifTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter); +extern HRESULT WINAPI DMUSIC_CreateDirectMusicMuteTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter); +extern HRESULT WINAPI DMUSIC_CreateDirectMusicStyleTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter); /***************************************************************************** * IDirectMusicStyle8Impl implementation structure */ -struct IDirectMusicStyle8Impl -{ +struct IDirectMusicStyle8Impl { /* IUnknown fields */ - ICOM_VFIELD(IDirectMusicStyle8); + ICOM_VTABLE(IUnknown) *UnknownVtbl; + ICOM_VTABLE(IDirectMusicStyle8) *StyleVtbl; + ICOM_VTABLE(IDirectMusicObject) *ObjectVtbl; + ICOM_VTABLE(IPersistStream) *PersistStreamVtbl; DWORD ref; /* IDirectMusicStyle8Impl fields */ - IDirectMusicStyleObject* pObject; -}; - -/* IUnknown: */ -extern HRESULT WINAPI IDirectMusicStyle8Impl_QueryInterface (LPDIRECTMUSICSTYLE8 iface, REFIID riid, LPVOID *ppobj); -extern ULONG WINAPI IDirectMusicStyle8Impl_AddRef (LPDIRECTMUSICSTYLE8 iface); -extern ULONG WINAPI IDirectMusicStyle8Impl_Release (LPDIRECTMUSICSTYLE8 iface); -/* IDirectMusicStyle: */ -extern HRESULT WINAPI IDirectMusicStyle8Impl_GetBand (LPDIRECTMUSICSTYLE8 iface, WCHAR* pwszName, IDirectMusicBand** ppBand); -extern HRESULT WINAPI IDirectMusicStyle8Impl_EnumBand (LPDIRECTMUSICSTYLE8 iface, DWORD dwIndex, WCHAR* pwszName); -extern HRESULT WINAPI IDirectMusicStyle8Impl_GetDefaultBand (LPDIRECTMUSICSTYLE8 iface, IDirectMusicBand** ppBand); -extern HRESULT WINAPI IDirectMusicStyle8Impl_EnumMotif (LPDIRECTMUSICSTYLE8 iface, DWORD dwIndex, WCHAR* pwszName); -extern HRESULT WINAPI IDirectMusicStyle8Impl_GetMotif (LPDIRECTMUSICSTYLE8 iface, WCHAR* pwszName, IDirectMusicSegment** ppSegment); -extern HRESULT WINAPI IDirectMusicStyle8Impl_GetDefaultChordMap (LPDIRECTMUSICSTYLE8 iface, IDirectMusicChordMap** ppChordMap); -extern HRESULT WINAPI IDirectMusicStyle8Impl_EnumChordMap (LPDIRECTMUSICSTYLE8 iface, DWORD dwIndex, WCHAR* pwszName); -extern HRESULT WINAPI IDirectMusicStyle8Impl_GetChordMap (LPDIRECTMUSICSTYLE8 iface, WCHAR* pwszName, IDirectMusicChordMap** ppChordMap); -extern HRESULT WINAPI IDirectMusicStyle8Impl_GetTimeSignature (LPDIRECTMUSICSTYLE8 iface, DMUS_TIMESIGNATURE* pTimeSig); -extern HRESULT WINAPI IDirectMusicStyle8Impl_GetEmbellishmentLength (LPDIRECTMUSICSTYLE8 iface, DWORD dwType, DWORD dwLevel, DWORD* pdwMin, DWORD* pdwMax); -extern HRESULT WINAPI IDirectMusicStyle8Impl_GetTempo (LPDIRECTMUSICSTYLE8 iface, double* pTempo); -/* IDirectMusicStyle8: */ -extern HRESULT WINAPI IDirectMusicStyle8ImplEnumPattern (LPDIRECTMUSICSTYLE8 iface, DWORD dwIndex, DWORD dwPatternType, WCHAR* pwszName); - - -/***************************************************************************** - * IDirectMusicStyleObject implementation structure - */ -struct IDirectMusicStyleObject -{ - /* IUnknown fields */ - ICOM_VFIELD(IDirectMusicObject); - DWORD ref; - - /* IDirectMusicObjectImpl fields */ LPDMUS_OBJECTDESC pDesc; - IDirectMusicStyleObjectStream* pStream; - IDirectMusicStyle8Impl* pStyle; }; /* IUnknown: */ -extern HRESULT WINAPI IDirectMusicStyleObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj); -extern ULONG WINAPI IDirectMusicStyleObject_AddRef (LPDIRECTMUSICOBJECT iface); -extern ULONG WINAPI IDirectMusicStyleObject_Release (LPDIRECTMUSICOBJECT iface); +extern HRESULT WINAPI IDirectMusicStyle8Impl_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicStyle8Impl_IUnknown_AddRef (LPUNKNOWN iface); +extern ULONG WINAPI IDirectMusicStyle8Impl_IUnknown_Release (LPUNKNOWN iface); +/* IDirectMusicStyle: */ +extern HRESULT WINAPI IDirectMusicStyle8Impl_IDirectMusicStyle8_QueryInterface (LPDIRECTMUSICSTYLE8 iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicStyle8Impl_IDirectMusicStyle8_AddRef (LPDIRECTMUSICSTYLE8 iface); +extern ULONG WINAPI IDirectMusicStyle8Impl_IDirectMusicStyle8_Release (LPDIRECTMUSICSTYLE8 iface); +extern HRESULT WINAPI IDirectMusicStyle8Impl_IDirectMusicStyle8_GetBand (LPDIRECTMUSICSTYLE8 iface, WCHAR* pwszName, IDirectMusicBand** ppBand); +extern HRESULT WINAPI IDirectMusicStyle8Impl_IDirectMusicStyle8_EnumBand (LPDIRECTMUSICSTYLE8 iface, DWORD dwIndex, WCHAR* pwszName); +extern HRESULT WINAPI IDirectMusicStyle8Impl_IDirectMusicStyle8_GetDefaultBand (LPDIRECTMUSICSTYLE8 iface, IDirectMusicBand** ppBand); +extern HRESULT WINAPI IDirectMusicStyle8Impl_IDirectMusicStyle8_EnumMotif (LPDIRECTMUSICSTYLE8 iface, DWORD dwIndex, WCHAR* pwszName); +extern HRESULT WINAPI IDirectMusicStyle8Impl_IDirectMusicStyle8_GetMotif (LPDIRECTMUSICSTYLE8 iface, WCHAR* pwszName, IDirectMusicSegment** ppSegment); +extern HRESULT WINAPI IDirectMusicStyle8Impl_IDirectMusicStyle8_GetDefaultChordMap (LPDIRECTMUSICSTYLE8 iface, IDirectMusicChordMap** ppChordMap); +extern HRESULT WINAPI IDirectMusicStyle8Impl_IDirectMusicStyle8_EnumChordMap (LPDIRECTMUSICSTYLE8 iface, DWORD dwIndex, WCHAR* pwszName); +extern HRESULT WINAPI IDirectMusicStyle8Impl_IDirectMusicStyle8_GetChordMap (LPDIRECTMUSICSTYLE8 iface, WCHAR* pwszName, IDirectMusicChordMap** ppChordMap); +extern HRESULT WINAPI IDirectMusicStyle8Impl_IDirectMusicStyle8_GetTimeSignature (LPDIRECTMUSICSTYLE8 iface, DMUS_TIMESIGNATURE* pTimeSig); +extern HRESULT WINAPI IDirectMusicStyle8Impl_IDirectMusicStyle8_GetEmbellishmentLength (LPDIRECTMUSICSTYLE8 iface, DWORD dwType, DWORD dwLevel, DWORD* pdwMin, DWORD* pdwMax); +extern HRESULT WINAPI IDirectMusicStyle8Impl_IDirectMusicStyle8_GetTempo (LPDIRECTMUSICSTYLE8 iface, double* pTempo); +extern HRESULT WINAPI IDirectMusicStyle8Impl_IDirectMusicStyle8_EnumPattern (LPDIRECTMUSICSTYLE8 iface, DWORD dwIndex, DWORD dwPatternType, WCHAR* pwszName); /* IDirectMusicObject: */ -extern HRESULT WINAPI IDirectMusicStyleObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc); -extern HRESULT WINAPI IDirectMusicStyleObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc); -extern HRESULT WINAPI IDirectMusicStyleObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc); - -/***************************************************************************** - * IDirectMusicStyleObjectStream implementation structure - */ -struct IDirectMusicStyleObjectStream -{ - /* IUnknown fields */ - ICOM_VFIELD (IPersistStream); - DWORD ref; - - /* IPersistStreamImpl fields */ - IDirectMusicStyleObject* pParentObject; -}; - -/* IUnknown: */ -extern HRESULT WINAPI IDirectMusicStyleObjectStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject); -extern ULONG WINAPI IDirectMusicStyleObjectStream_AddRef (LPPERSISTSTREAM iface); -extern ULONG WINAPI IDirectMusicStyleObjectStream_Release (LPPERSISTSTREAM iface); -/* IPersist: */ -extern HRESULT WINAPI IDirectMusicStyleObjectStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID); +extern HRESULT WINAPI IDirectMusicStyle8Impl_IDirectMusicObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicStyle8Impl_IDirectMusicObject_AddRef (LPDIRECTMUSICOBJECT iface); +extern ULONG WINAPI IDirectMusicStyle8Impl_IDirectMusicObject_Release (LPDIRECTMUSICOBJECT iface); +extern HRESULT WINAPI IDirectMusicStyle8Impl_IDirectMusicObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc); +extern HRESULT WINAPI IDirectMusicStyle8Impl_IDirectMusicObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc); +extern HRESULT WINAPI IDirectMusicStyle8Impl_IDirectMusicObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc); /* IPersistStream: */ -extern HRESULT WINAPI IDirectMusicStyleObjectStream_IsDirty (LPPERSISTSTREAM iface); -extern HRESULT WINAPI IDirectMusicStyleObjectStream_Load (LPPERSISTSTREAM iface, IStream* pStm); -extern HRESULT WINAPI IDirectMusicStyleObjectStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty); -extern HRESULT WINAPI IDirectMusicStyleObjectStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize); +extern HRESULT WINAPI IDirectMusicStyle8Impl_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject); +extern ULONG WINAPI IDirectMusicStyle8Impl_IPersistStream_AddRef (LPPERSISTSTREAM iface); +extern ULONG WINAPI IDirectMusicStyle8Impl_IPersistStream_Release (LPPERSISTSTREAM iface); +extern HRESULT WINAPI IDirectMusicStyle8Impl_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID); +extern HRESULT WINAPI IDirectMusicStyle8Impl_IPersistStream_IsDirty (LPPERSISTSTREAM iface); +extern HRESULT WINAPI IDirectMusicStyle8Impl_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm); +extern HRESULT WINAPI IDirectMusicStyle8Impl_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty); +extern HRESULT WINAPI IDirectMusicStyle8Impl_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize); /***************************************************************************** * IDirectMusicAuditionTrack implementation structure */ -struct IDirectMusicAuditionTrack -{ +struct IDirectMusicAuditionTrack { /* IUnknown fields */ - ICOM_VFIELD(IDirectMusicTrack8); + ICOM_VTABLE(IUnknown) *UnknownVtbl; + ICOM_VTABLE(IDirectMusicTrack8) *TrackVtbl; + ICOM_VTABLE(IPersistStream) *PersistStreamVtbl; DWORD ref; /* IDirectMusicAuditionTrack fields */ - IDirectMusicAuditionTrackStream* pStream; + LPDMUS_OBJECTDESC pDesc; }; /* IUnknown: */ -extern HRESULT WINAPI IDirectMusicAuditionTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj); -extern ULONG WINAPI IDirectMusicAuditionTrack_AddRef (LPDIRECTMUSICTRACK8 iface); -extern ULONG WINAPI IDirectMusicAuditionTrack_Release (LPDIRECTMUSICTRACK8 iface); -/* IDirectMusicTrack: */ -extern HRESULT WINAPI IDirectMusicAuditionTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment); -extern HRESULT WINAPI IDirectMusicAuditionTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicAuditionTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData); -extern 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); -extern HRESULT WINAPI IDirectMusicAuditionTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam); -extern HRESULT WINAPI IDirectMusicAuditionTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam); -extern HRESULT WINAPI IDirectMusicAuditionTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType); -extern HRESULT WINAPI IDirectMusicAuditionTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); -extern HRESULT WINAPI IDirectMusicAuditionTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); -extern HRESULT WINAPI IDirectMusicAuditionTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack); -/* IDirectMusicTrack8: */ -extern 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); -extern HRESULT WINAPI IDirectMusicAuditionTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicAuditionTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicAuditionTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); -extern HRESULT WINAPI IDirectMusicAuditionTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); - -/***************************************************************************** - * IDirectMusicAuditionTrackStream implementation structure - */ -struct IDirectMusicAuditionTrackStream -{ - /* IUnknown fields */ - ICOM_VFIELD (IPersistStream); - DWORD ref; - - /* IPersistStreamImpl fields */ - IDirectMusicAuditionTrack* pParentTrack; -}; - -/* IUnknown: */ -extern HRESULT WINAPI IDirectMusicAuditionTrackStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject); -extern ULONG WINAPI IDirectMusicAuditionTrackStream_AddRef (LPPERSISTSTREAM iface); -extern ULONG WINAPI IDirectMusicAuditionTrackStream_Release (LPPERSISTSTREAM iface); -/* IPersist: */ -extern HRESULT WINAPI IDirectMusicAuditionTrackStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID); +extern HRESULT WINAPI IDirectMusicAuditionTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicAuditionTrack_IUnknown_AddRef (LPUNKNOWN iface); +extern ULONG WINAPI IDirectMusicAuditionTrack_IUnknown_Release (LPUNKNOWN iface); +/* IDirectMusicTrack(8): */ +extern HRESULT WINAPI IDirectMusicAuditionTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicAuditionTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface); +extern ULONG WINAPI IDirectMusicAuditionTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface); +extern HRESULT WINAPI IDirectMusicAuditionTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment); +extern HRESULT WINAPI IDirectMusicAuditionTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicAuditionTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData); +extern 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); +extern HRESULT WINAPI IDirectMusicAuditionTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam); +extern HRESULT WINAPI IDirectMusicAuditionTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam); +extern HRESULT WINAPI IDirectMusicAuditionTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType); +extern HRESULT WINAPI IDirectMusicAuditionTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); +extern HRESULT WINAPI IDirectMusicAuditionTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); +extern HRESULT WINAPI IDirectMusicAuditionTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack); +extern 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); +extern HRESULT WINAPI IDirectMusicAuditionTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicAuditionTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicAuditionTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); +extern HRESULT WINAPI IDirectMusicAuditionTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); /* IPersistStream: */ -extern HRESULT WINAPI IDirectMusicAuditionTrackStream_IsDirty (LPPERSISTSTREAM iface); -extern HRESULT WINAPI IDirectMusicAuditionTrackStream_Load (LPPERSISTSTREAM iface, IStream* pStm); -extern HRESULT WINAPI IDirectMusicAuditionTrackStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty); -extern HRESULT WINAPI IDirectMusicAuditionTrackStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize); +extern HRESULT WINAPI IDirectMusicAuditionTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject); +extern ULONG WINAPI IDirectMusicAuditionTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface); +extern ULONG WINAPI IDirectMusicAuditionTrack_IPersistStream_Release (LPPERSISTSTREAM iface); +extern HRESULT WINAPI IDirectMusicAuditionTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID); +extern HRESULT WINAPI IDirectMusicAuditionTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface); +extern HRESULT WINAPI IDirectMusicAuditionTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm); +extern HRESULT WINAPI IDirectMusicAuditionTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty); +extern HRESULT WINAPI IDirectMusicAuditionTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize); /***************************************************************************** * IDirectMusicChordTrack implementation structure */ -struct IDirectMusicChordTrack -{ +struct IDirectMusicChordTrack { /* IUnknown fields */ - ICOM_VFIELD(IDirectMusicTrack8); + ICOM_VTABLE(IUnknown) *UnknownVtbl; + ICOM_VTABLE(IDirectMusicTrack8) *TrackVtbl; + ICOM_VTABLE(IPersistStream) *PersistStreamVtbl; DWORD ref; /* IDirectMusicChordTrack fields */ - IDirectMusicChordTrackStream* pStream; - DWORD dwHeader; - /* FIXME: scheme with HeapReAlloc doesn't work so.. */ -/* - * DMUS_CHORD_KEY* pChordKeys; - * MUSIC_TIME* pChordKeysTime; - */ - DMUS_CHORD_KEY pChordKeys[255]; - MUSIC_TIME pChordKeysTime[255]; - DWORD dwChordKeys; + LPDMUS_OBJECTDESC pDesc; }; /* IUnknown: */ -extern HRESULT WINAPI IDirectMusicChordTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj); -extern ULONG WINAPI IDirectMusicChordTrack_AddRef (LPDIRECTMUSICTRACK8 iface); -extern ULONG WINAPI IDirectMusicChordTrack_Release (LPDIRECTMUSICTRACK8 iface); -/* IDirectMusicTrack: */ -extern HRESULT WINAPI IDirectMusicChordTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment); -extern HRESULT WINAPI IDirectMusicChordTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicChordTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData); -extern 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); -extern HRESULT WINAPI IDirectMusicChordTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam); -extern HRESULT WINAPI IDirectMusicChordTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam); -extern HRESULT WINAPI IDirectMusicChordTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType); -extern HRESULT WINAPI IDirectMusicChordTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); -extern HRESULT WINAPI IDirectMusicChordTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); -extern HRESULT WINAPI IDirectMusicChordTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack); -/* IDirectMusicTrack8: */ -extern 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); -extern HRESULT WINAPI IDirectMusicChordTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicChordTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicChordTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); -extern HRESULT WINAPI IDirectMusicChordTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); - -/***************************************************************************** - * IDirectMusicChordTrackStream implementation structure - */ -struct IDirectMusicChordTrackStream -{ - /* IUnknown fields */ - ICOM_VFIELD (IPersistStream); - DWORD ref; - - /* IPersistStreamImpl fields */ - IDirectMusicChordTrack* pParentTrack; -}; - -/* IUnknown: */ -extern HRESULT WINAPI IDirectMusicChordTrackStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject); -extern ULONG WINAPI IDirectMusicChordTrackStream_AddRef (LPPERSISTSTREAM iface); -extern ULONG WINAPI IDirectMusicChordTrackStream_Release (LPPERSISTSTREAM iface); -/* IPersist: */ -extern HRESULT WINAPI IDirectMusicChordTrackStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID); +extern HRESULT WINAPI IDirectMusicChordTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicChordTrack_IUnknown_AddRef (LPUNKNOWN iface); +extern ULONG WINAPI IDirectMusicChordTrack_IUnknown_Release (LPUNKNOWN iface); +/* IDirectMusicTrack(8): */ +extern HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicChordTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface); +extern ULONG WINAPI IDirectMusicChordTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface); +extern HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment); +extern HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData); +extern 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); +extern HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam); +extern HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam); +extern HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType); +extern HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); +extern HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); +extern HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack); +extern 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); +extern HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); +extern HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); /* IPersistStream: */ -extern HRESULT WINAPI IDirectMusicChordTrackStream_IsDirty (LPPERSISTSTREAM iface); -extern HRESULT WINAPI IDirectMusicChordTrackStream_Load (LPPERSISTSTREAM iface, IStream* pStm); -extern HRESULT WINAPI IDirectMusicChordTrackStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty); -extern HRESULT WINAPI IDirectMusicChordTrackStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize); +extern HRESULT WINAPI IDirectMusicChordTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject); +extern ULONG WINAPI IDirectMusicChordTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface); +extern ULONG WINAPI IDirectMusicChordTrack_IPersistStream_Release (LPPERSISTSTREAM iface); +extern HRESULT WINAPI IDirectMusicChordTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID); +extern HRESULT WINAPI IDirectMusicChordTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface); +extern HRESULT WINAPI IDirectMusicChordTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm); +extern HRESULT WINAPI IDirectMusicChordTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty); +extern HRESULT WINAPI IDirectMusicChordTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize); +typedef struct _DMUS_PRIVATE_COMMAND { + struct list entry; /* for listing elements */ + DMUS_IO_COMMAND pCommand; + IDirectMusicCollection* ppReferenceCollection; +} DMUS_PRIVATE_COMMAND, *LPDMUS_PRIVATE_COMMAND; /***************************************************************************** * IDirectMusicCommandTrack implementation structure */ -struct IDirectMusicCommandTrack -{ +struct IDirectMusicCommandTrack { /* IUnknown fields */ - ICOM_VFIELD(IDirectMusicTrack8); + ICOM_VTABLE(IUnknown) *UnknownVtbl; + ICOM_VTABLE(IDirectMusicTrack8) *TrackVtbl; + ICOM_VTABLE(IPersistStream) *PersistStreamVtbl; DWORD ref; /* IDirectMusicCommandTrack fields */ - IDirectMusicCommandTrackStream* pStream; + LPDMUS_OBJECTDESC pDesc; /* track data */ - DMUS_IO_COMMAND* pCommands; - DWORD dwCommands; /* nr. of DMUS_IO_COMMAND structures in pCommands */ + struct list Commands; }; /* IUnknown: */ -extern HRESULT WINAPI IDirectMusicCommandTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj); -extern ULONG WINAPI IDirectMusicCommandTrack_AddRef (LPDIRECTMUSICTRACK8 iface); -extern ULONG WINAPI IDirectMusicCommandTrack_Release (LPDIRECTMUSICTRACK8 iface); -/* IDirectMusicTrack: */ -extern HRESULT WINAPI IDirectMusicCommandTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment); -extern HRESULT WINAPI IDirectMusicCommandTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicCommandTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData); -extern 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); -extern HRESULT WINAPI IDirectMusicCommandTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam); -extern HRESULT WINAPI IDirectMusicCommandTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam); -extern HRESULT WINAPI IDirectMusicCommandTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType); -extern HRESULT WINAPI IDirectMusicCommandTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); -extern HRESULT WINAPI IDirectMusicCommandTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); -extern HRESULT WINAPI IDirectMusicCommandTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack); -/* IDirectMusicTrack8: */ -extern 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); -extern HRESULT WINAPI IDirectMusicCommandTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicCommandTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicCommandTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); -extern HRESULT WINAPI IDirectMusicCommandTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); - -/***************************************************************************** - * IDirectMusicCommandTrackStream implementation structure - */ -struct IDirectMusicCommandTrackStream -{ - /* IUnknown fields */ - ICOM_VFIELD (IPersistStream); - DWORD ref; - - /* IPersistStreamImpl fields */ - IDirectMusicCommandTrack* pParentTrack; -}; - -/* IUnknown: */ -extern HRESULT WINAPI IDirectMusicCommandTrackStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject); -extern ULONG WINAPI IDirectMusicCommandTrackStream_AddRef (LPPERSISTSTREAM iface); -extern ULONG WINAPI IDirectMusicCommandTrackStream_Release (LPPERSISTSTREAM iface); -/* IPersist: */ -extern HRESULT WINAPI IDirectMusicCommandTrackStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID); +extern HRESULT WINAPI IDirectMusicCommandTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicCommandTrack_IUnknown_AddRef (LPUNKNOWN iface); +extern ULONG WINAPI IDirectMusicCommandTrack_IUnknown_Release (LPUNKNOWN iface); +/* IDirectMusicTrack(8): */ +extern HRESULT WINAPI IDirectMusicCommandTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicCommandTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface); +extern ULONG WINAPI IDirectMusicCommandTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface); +extern HRESULT WINAPI IDirectMusicCommandTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment); +extern HRESULT WINAPI IDirectMusicCommandTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicCommandTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData); +extern 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); +extern HRESULT WINAPI IDirectMusicCommandTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam); +extern HRESULT WINAPI IDirectMusicCommandTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam); +extern HRESULT WINAPI IDirectMusicCommandTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType); +extern HRESULT WINAPI IDirectMusicCommandTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); +extern HRESULT WINAPI IDirectMusicCommandTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); +extern HRESULT WINAPI IDirectMusicCommandTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack); +extern 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); +extern HRESULT WINAPI IDirectMusicCommandTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicCommandTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicCommandTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); +extern HRESULT WINAPI IDirectMusicCommandTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); /* IPersistStream: */ -extern HRESULT WINAPI IDirectMusicCommandTrackStream_IsDirty (LPPERSISTSTREAM iface); -extern HRESULT WINAPI IDirectMusicCommandTrackStream_Load (LPPERSISTSTREAM iface, IStream* pStm); -extern HRESULT WINAPI IDirectMusicCommandTrackStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty); -extern HRESULT WINAPI IDirectMusicCommandTrackStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize); +extern HRESULT WINAPI IDirectMusicCommandTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject); +extern ULONG WINAPI IDirectMusicCommandTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface); +extern ULONG WINAPI IDirectMusicCommandTrack_IPersistStream_Release (LPPERSISTSTREAM iface); +extern HRESULT WINAPI IDirectMusicCommandTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID); +extern HRESULT WINAPI IDirectMusicCommandTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface); +extern HRESULT WINAPI IDirectMusicCommandTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm); +extern HRESULT WINAPI IDirectMusicCommandTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty); +extern HRESULT WINAPI IDirectMusicCommandTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize); /***************************************************************************** * IDirectMusicMelodyFormulationTrack implementation structure */ -struct IDirectMusicMelodyFormulationTrack -{ +struct IDirectMusicMelodyFormulationTrack { /* IUnknown fields */ - ICOM_VFIELD(IDirectMusicTrack8); + ICOM_VTABLE(IUnknown) *UnknownVtbl; + ICOM_VTABLE(IDirectMusicTrack8) *TrackVtbl; + ICOM_VTABLE(IPersistStream) *PersistStreamVtbl; DWORD ref; /* IDirectMusicMelodyFormulationTrack fields */ - IDirectMusicMelodyFormulationTrackStream* pStream; + LPDMUS_OBJECTDESC pDesc; }; /* IUnknown: */ -extern HRESULT WINAPI IDirectMusicMelodyFormulationTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj); -extern ULONG WINAPI IDirectMusicMelodyFormulationTrack_AddRef (LPDIRECTMUSICTRACK8 iface); -extern ULONG WINAPI IDirectMusicMelodyFormulationTrack_Release (LPDIRECTMUSICTRACK8 iface); -/* IDirectMusicTrack: */ -extern HRESULT WINAPI IDirectMusicMelodyFormulationTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment); -extern HRESULT WINAPI IDirectMusicMelodyFormulationTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicMelodyFormulationTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData); -extern 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); -extern HRESULT WINAPI IDirectMusicMelodyFormulationTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam); -extern HRESULT WINAPI IDirectMusicMelodyFormulationTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam); -extern HRESULT WINAPI IDirectMusicMelodyFormulationTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType); -extern HRESULT WINAPI IDirectMusicMelodyFormulationTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); -extern HRESULT WINAPI IDirectMusicMelodyFormulationTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); -extern HRESULT WINAPI IDirectMusicMelodyFormulationTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack); -/* IDirectMusicTrack8: */ -extern 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); -extern HRESULT WINAPI IDirectMusicMelodyFormulationTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicMelodyFormulationTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicMelodyFormulationTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); -extern HRESULT WINAPI IDirectMusicMelodyFormulationTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); - -/***************************************************************************** - * IDirectMusicMelodyFormulationTrackStream implementation structure - */ -struct IDirectMusicMelodyFormulationTrackStream -{ - /* IUnknown fields */ - ICOM_VFIELD (IPersistStream); - DWORD ref; - - /* IPersistStreamImpl fields */ - IDirectMusicMelodyFormulationTrack* pParentTrack; -}; - -/* IUnknown: */ -extern HRESULT WINAPI IDirectMusicMelodyFormulationTrackStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject); -extern ULONG WINAPI IDirectMusicMelodyFormulationTrackStream_AddRef (LPPERSISTSTREAM iface); -extern ULONG WINAPI IDirectMusicMelodyFormulationTrackStream_Release (LPPERSISTSTREAM iface); -/* IPersist: */ -extern HRESULT WINAPI IDirectMusicMelodyFormulationTrackStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID); +extern HRESULT WINAPI IDirectMusicMelodyFormulationTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicMelodyFormulationTrack_IUnknown_AddRef (LPUNKNOWN iface); +extern ULONG WINAPI IDirectMusicMelodyFormulationTrack_IUnknown_Release (LPUNKNOWN iface); +/* IDirectMusicTrack(8): */ +extern HRESULT WINAPI IDirectMusicMelodyFormulationTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicMelodyFormulationTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface); +extern ULONG WINAPI IDirectMusicMelodyFormulationTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface); +extern HRESULT WINAPI IDirectMusicMelodyFormulationTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment); +extern HRESULT WINAPI IDirectMusicMelodyFormulationTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicMelodyFormulationTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData); +extern HRESULT WINAPI IDirectMusicMelodyFormulationTrack_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 IDirectMusicMelodyFormulationTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam); +extern HRESULT WINAPI IDirectMusicMelodyFormulationTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam); +extern HRESULT WINAPI IDirectMusicMelodyFormulationTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType); +extern HRESULT WINAPI IDirectMusicMelodyFormulationTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); +extern HRESULT WINAPI IDirectMusicMelodyFormulationTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); +extern HRESULT WINAPI IDirectMusicMelodyFormulationTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack); +extern HRESULT WINAPI IDirectMusicMelodyFormulationTrack_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 IDirectMusicMelodyFormulationTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicMelodyFormulationTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicMelodyFormulationTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); +extern HRESULT WINAPI IDirectMusicMelodyFormulationTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); /* IPersistStream: */ -extern HRESULT WINAPI IDirectMusicMelodyFormulationTrackStream_IsDirty (LPPERSISTSTREAM iface); -extern HRESULT WINAPI IDirectMusicMelodyFormulationTrackStream_Load (LPPERSISTSTREAM iface, IStream* pStm); -extern HRESULT WINAPI IDirectMusicMelodyFormulationTrackStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty); -extern HRESULT WINAPI IDirectMusicMelodyFormulationTrackStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize); +extern HRESULT WINAPI IDirectMusicMelodyFormulationTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject); +extern ULONG WINAPI IDirectMusicMelodyFormulationTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface); +extern ULONG WINAPI IDirectMusicMelodyFormulationTrack_IPersistStream_Release (LPPERSISTSTREAM iface); +extern HRESULT WINAPI IDirectMusicMelodyFormulationTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID); +extern HRESULT WINAPI IDirectMusicMelodyFormulationTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface); +extern HRESULT WINAPI IDirectMusicMelodyFormulationTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm); +extern HRESULT WINAPI IDirectMusicMelodyFormulationTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty); +extern HRESULT WINAPI IDirectMusicMelodyFormulationTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize); /***************************************************************************** * IDirectMusicMotifTrack implementation structure */ -struct IDirectMusicMotifTrack -{ +struct IDirectMusicMotifTrack { /* IUnknown fields */ - ICOM_VFIELD(IDirectMusicTrack8); + ICOM_VTABLE(IUnknown) *UnknownVtbl; + ICOM_VTABLE(IDirectMusicTrack8) *TrackVtbl; + ICOM_VTABLE(IPersistStream) *PersistStreamVtbl; DWORD ref; /* IDirectMusicMotifTrack fields */ - IDirectMusicMotifTrackStream* pStream; + LPDMUS_OBJECTDESC pDesc; }; /* IUnknown: */ -extern HRESULT WINAPI IDirectMusicMotifTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj); -extern ULONG WINAPI IDirectMusicMotifTrack_AddRef (LPDIRECTMUSICTRACK8 iface); -extern ULONG WINAPI IDirectMusicMotifTrack_Release (LPDIRECTMUSICTRACK8 iface); -/* IDirectMusicTrack: */ -extern HRESULT WINAPI IDirectMusicMotifTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment); -extern HRESULT WINAPI IDirectMusicMotifTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicMotifTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData); -extern 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); -extern HRESULT WINAPI IDirectMusicMotifTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam); -extern HRESULT WINAPI IDirectMusicMotifTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam); -extern HRESULT WINAPI IDirectMusicMotifTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType); -extern HRESULT WINAPI IDirectMusicMotifTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); -extern HRESULT WINAPI IDirectMusicMotifTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); -extern HRESULT WINAPI IDirectMusicMotifTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack); -/* IDirectMusicTrack8: */ -extern 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); -extern HRESULT WINAPI IDirectMusicMotifTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicMotifTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicMotifTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); -extern HRESULT WINAPI IDirectMusicMotifTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); - -/***************************************************************************** - * IDirectMusicMotifTrackStream implementation structure - */ -struct IDirectMusicMotifTrackStream -{ - /* IUnknown fields */ - ICOM_VFIELD (IPersistStream); - DWORD ref; - - /* IPersistStreamImpl fields */ - IDirectMusicMotifTrack* pParentTrack; -}; - -/* IUnknown: */ -extern HRESULT WINAPI IDirectMusicMotifTrackStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject); -extern ULONG WINAPI IDirectMusicMotifTrackStream_AddRef (LPPERSISTSTREAM iface); -extern ULONG WINAPI IDirectMusicMotifTrackStream_Release (LPPERSISTSTREAM iface); -/* IPersist: */ -extern HRESULT WINAPI IDirectMusicMotifTrackStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID); +extern HRESULT WINAPI IDirectMusicMotifTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicMotifTrack_IUnknown_AddRef (LPUNKNOWN iface); +extern ULONG WINAPI IDirectMusicMotifTrack_IUnknown_Release (LPUNKNOWN iface); +/* IDirectMusicTrack(8): */ +extern HRESULT WINAPI IDirectMusicMotifTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicMotifTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface); +extern ULONG WINAPI IDirectMusicMotifTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface); +extern HRESULT WINAPI IDirectMusicMotifTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment); +extern HRESULT WINAPI IDirectMusicMotifTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicMotifTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData); +extern 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); +extern HRESULT WINAPI IDirectMusicMotifTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam); +extern HRESULT WINAPI IDirectMusicMotifTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam); +extern HRESULT WINAPI IDirectMusicMotifTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType); +extern HRESULT WINAPI IDirectMusicMotifTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); +extern HRESULT WINAPI IDirectMusicMotifTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); +extern HRESULT WINAPI IDirectMusicMotifTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack); +extern 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); +extern HRESULT WINAPI IDirectMusicMotifTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicMotifTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicMotifTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); +extern HRESULT WINAPI IDirectMusicMotifTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); /* IPersistStream: */ -extern HRESULT WINAPI IDirectMusicMotifTrackStream_IsDirty (LPPERSISTSTREAM iface); -extern HRESULT WINAPI IDirectMusicMotifTrackStream_Load (LPPERSISTSTREAM iface, IStream* pStm); -extern HRESULT WINAPI IDirectMusicMotifTrackStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty); -extern HRESULT WINAPI IDirectMusicMotifTrackStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize); +extern HRESULT WINAPI IDirectMusicMotifTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject); +extern ULONG WINAPI IDirectMusicMotifTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface); +extern ULONG WINAPI IDirectMusicMotifTrack_IPersistStream_Release (LPPERSISTSTREAM iface); +extern HRESULT WINAPI IDirectMusicMotifTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID); +extern HRESULT WINAPI IDirectMusicMotifTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface); +extern HRESULT WINAPI IDirectMusicMotifTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm); +extern HRESULT WINAPI IDirectMusicMotifTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty); +extern HRESULT WINAPI IDirectMusicMotifTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize); /***************************************************************************** * IDirectMusicMuteTrack implementation structure */ -struct IDirectMusicMuteTrack -{ +struct IDirectMusicMuteTrack { /* IUnknown fields */ - ICOM_VFIELD(IDirectMusicTrack8); + ICOM_VTABLE(IUnknown) *UnknownVtbl; + ICOM_VTABLE(IDirectMusicTrack8) *TrackVtbl; + ICOM_VTABLE(IPersistStream) *PersistStreamVtbl; DWORD ref; /* IDirectMusicMuteTrack fields */ - IDirectMusicMuteTrackStream* pStream; - DMUS_IO_MUTE* pMutes; - DWORD dwMutes; /* nr. of DMUS_IO_MUTE structures in pMutes */ + LPDMUS_OBJECTDESC pDesc; }; /* IUnknown: */ -extern HRESULT WINAPI IDirectMusicMuteTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj); -extern ULONG WINAPI IDirectMusicMuteTrack_AddRef (LPDIRECTMUSICTRACK8 iface); -extern ULONG WINAPI IDirectMusicMuteTrack_Release (LPDIRECTMUSICTRACK8 iface); -/* IDirectMusicTrack: */ -extern HRESULT WINAPI IDirectMusicMuteTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment); -extern HRESULT WINAPI IDirectMusicMuteTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicMuteTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData); -extern 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); -extern HRESULT WINAPI IDirectMusicMuteTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam); -extern HRESULT WINAPI IDirectMusicMuteTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam); -extern HRESULT WINAPI IDirectMusicMuteTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType); -extern HRESULT WINAPI IDirectMusicMuteTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); -extern HRESULT WINAPI IDirectMusicMuteTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); -extern HRESULT WINAPI IDirectMusicMuteTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack); -/* IDirectMusicTrack8: */ -extern 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); -extern HRESULT WINAPI IDirectMusicMuteTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicMuteTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicMuteTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); -extern HRESULT WINAPI IDirectMusicMuteTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); - -/***************************************************************************** - * IDirectMusicMuteTrackStream implementation structure - */ -struct IDirectMusicMuteTrackStream -{ - /* IUnknown fields */ - ICOM_VFIELD (IPersistStream); - DWORD ref; - - /* IPersistStreamImpl fields */ - IDirectMusicMuteTrack* pParentTrack; -}; - -/* IUnknown: */ -extern HRESULT WINAPI IDirectMusicMuteTrackStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject); -extern ULONG WINAPI IDirectMusicMuteTrackStream_AddRef (LPPERSISTSTREAM iface); -extern ULONG WINAPI IDirectMusicMuteTrackStream_Release (LPPERSISTSTREAM iface); -/* IPersist: */ -extern HRESULT WINAPI IDirectMusicMuteTrackStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID); +extern HRESULT WINAPI IDirectMusicMuteTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicMuteTrack_IUnknown_AddRef (LPUNKNOWN iface); +extern ULONG WINAPI IDirectMusicMuteTrack_IUnknown_Release (LPUNKNOWN iface); +/* IDirectMusicTrack(8): */ +extern HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface); +extern ULONG WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface); +extern HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment); +extern HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData); +extern 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); +extern HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam); +extern HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam); +extern HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType); +extern HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); +extern HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); +extern HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack); +extern 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); +extern HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); +extern HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); /* IPersistStream: */ -extern HRESULT WINAPI IDirectMusicMuteTrackStream_IsDirty (LPPERSISTSTREAM iface); -extern HRESULT WINAPI IDirectMusicMuteTrackStream_Load (LPPERSISTSTREAM iface, IStream* pStm); -extern HRESULT WINAPI IDirectMusicMuteTrackStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty); -extern HRESULT WINAPI IDirectMusicMuteTrackStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize); +extern HRESULT WINAPI IDirectMusicMuteTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject); +extern ULONG WINAPI IDirectMusicMuteTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface); +extern ULONG WINAPI IDirectMusicMuteTrack_IPersistStream_Release (LPPERSISTSTREAM iface); +extern HRESULT WINAPI IDirectMusicMuteTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID); +extern HRESULT WINAPI IDirectMusicMuteTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface); +extern HRESULT WINAPI IDirectMusicMuteTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm); +extern HRESULT WINAPI IDirectMusicMuteTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty); +extern HRESULT WINAPI IDirectMusicMuteTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize); /***************************************************************************** * IDirectMusicStyleTrack implementation structure */ -struct IDirectMusicStyleTrack -{ +struct IDirectMusicStyleTrack { /* IUnknown fields */ - ICOM_VFIELD(IDirectMusicTrack8); + ICOM_VTABLE(IUnknown) *UnknownVtbl; + ICOM_VTABLE(IDirectMusicTrack8) *TrackVtbl; + ICOM_VTABLE(IPersistStream) *PersistStreamVtbl; DWORD ref; /* IDirectMusicStyleTrack fields */ - IDirectMusicStyleTrackStream* pStream; - /* FIXME: implement it with HeapReAlloc */ - DWORD pStampTimes[255]; /* stamp times for styles */ - IDirectMusicStyle8Impl* ppStyles[255]; - DWORD dwStyles; /* nr. of IDirectMusicStyle8Impl* and DWORD */ + LPDMUS_OBJECTDESC pDesc; }; /* IUnknown: */ -extern HRESULT WINAPI IDirectMusicStyleTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj); -extern ULONG WINAPI IDirectMusicStyleTrack_AddRef (LPDIRECTMUSICTRACK8 iface); -extern ULONG WINAPI IDirectMusicStyleTrack_Release (LPDIRECTMUSICTRACK8 iface); -/* IDirectMusicTrack: */ -extern HRESULT WINAPI IDirectMusicStyleTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment); -extern HRESULT WINAPI IDirectMusicStyleTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicStyleTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData); -extern 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); -extern HRESULT WINAPI IDirectMusicStyleTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam); -extern HRESULT WINAPI IDirectMusicStyleTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam); -extern HRESULT WINAPI IDirectMusicStyleTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType); -extern HRESULT WINAPI IDirectMusicStyleTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); -extern HRESULT WINAPI IDirectMusicStyleTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); -extern HRESULT WINAPI IDirectMusicStyleTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack); -/* IDirectMusicTrack8: */ -extern 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); -extern HRESULT WINAPI IDirectMusicStyleTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicStyleTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags); -extern HRESULT WINAPI IDirectMusicStyleTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); -extern HRESULT WINAPI IDirectMusicStyleTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); +extern HRESULT WINAPI IDirectMusicStyleTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicStyleTrack_IUnknown_AddRef (LPUNKNOWN iface); +extern ULONG WINAPI IDirectMusicStyleTrack_IUnknown_Release (LPUNKNOWN iface); +/* IDirectMusicTrack(8): */ +extern HRESULT WINAPI IDirectMusicStyleTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj); +extern ULONG WINAPI IDirectMusicStyleTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface); +extern ULONG WINAPI IDirectMusicStyleTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface); +extern HRESULT WINAPI IDirectMusicStyleTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment); +extern HRESULT WINAPI IDirectMusicStyleTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicStyleTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData); +extern 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); +extern HRESULT WINAPI IDirectMusicStyleTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam); +extern HRESULT WINAPI IDirectMusicStyleTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam); +extern HRESULT WINAPI IDirectMusicStyleTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType); +extern HRESULT WINAPI IDirectMusicStyleTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); +extern HRESULT WINAPI IDirectMusicStyleTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType); +extern HRESULT WINAPI IDirectMusicStyleTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack); +extern 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); +extern HRESULT WINAPI IDirectMusicStyleTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicStyleTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags); +extern HRESULT WINAPI IDirectMusicStyleTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); +extern HRESULT WINAPI IDirectMusicStyleTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack); +/* IPersistStream: */ +extern HRESULT WINAPI IDirectMusicStyleTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject); +extern ULONG WINAPI IDirectMusicStyleTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface); +extern ULONG WINAPI IDirectMusicStyleTrack_IPersistStream_Release (LPPERSISTSTREAM iface); +extern HRESULT WINAPI IDirectMusicStyleTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID); +extern HRESULT WINAPI IDirectMusicStyleTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface); +extern HRESULT WINAPI IDirectMusicStyleTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm); +extern HRESULT WINAPI IDirectMusicStyleTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty); +extern HRESULT WINAPI IDirectMusicStyleTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize); + /***************************************************************************** - * IDirectMusicStyleTrackStream implementation structure + * Misc. */ -struct IDirectMusicStyleTrackStream -{ - /* 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 */ - IDirectMusicStyleTrack* 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 IDirectMusicStyleTrackStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject); -extern ULONG WINAPI IDirectMusicStyleTrackStream_AddRef (LPPERSISTSTREAM iface); -extern ULONG WINAPI IDirectMusicStyleTrackStream_Release (LPPERSISTSTREAM iface); -/* IPersist: */ -extern HRESULT WINAPI IDirectMusicStyleTrackStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID); -/* IPersistStream: */ -extern HRESULT WINAPI IDirectMusicStyleTrackStream_IsDirty (LPPERSISTSTREAM iface); -extern HRESULT WINAPI IDirectMusicStyleTrackStream_Load (LPPERSISTSTREAM iface, IStream* pStm); -extern HRESULT WINAPI IDirectMusicStyleTrackStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty); -extern HRESULT WINAPI IDirectMusicStyleTrackStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize); - -static inline const char *debugstr_fourcc( DWORD fourcc ) -{ +/* 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) ); + 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_DMSTYLE_PRIVATE_H */ diff --git a/dlls/dmstyle/melodyformulationtrack.c b/dlls/dmstyle/melodyformulationtrack.c deleted file mode 100644 index 8326cea28fc..00000000000 --- a/dlls/dmstyle/melodyformulationtrack.c +++ /dev/null @@ -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 - -#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 -}; diff --git a/dlls/dmstyle/motiftrack.c b/dlls/dmstyle/motiftrack.c index e87522a6997..058c25ee3b8 100644 --- a/dlls/dmstyle/motiftrack.c +++ b/dlls/dmstyle/motiftrack.c @@ -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 - -#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); +} diff --git a/dlls/dmstyle/mutetrack.c b/dlls/dmstyle/mutetrack.c index c580fe02119..c2622859846 100644 --- a/dlls/dmstyle/mutetrack.c +++ b/dlls/dmstyle/mutetrack.c @@ -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 - -#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 -}; diff --git a/dlls/dmstyle/regsvr.c b/dlls/dmstyle/regsvr.c index 1b98a7e07d9..184fb64c585 100644 --- a/dlls/dmstyle/regsvr.c +++ b/dlls/dmstyle/regsvr.c @@ -18,21 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include - -#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"); diff --git a/dlls/dmstyle/style.c b/dlls/dmstyle/style.c index 7b64912c701..575fe874d2b 100644 --- a/dlls/dmstyle/style.c +++ b/dlls/dmstyle/style.c @@ -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 - -#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 -}; diff --git a/dlls/dmstyle/styletrack.c b/dlls/dmstyle/styletrack.c index 8838a1522b6..b3b1db4e2fe 100644 --- a/dlls/dmstyle/styletrack.c +++ b/dlls/dmstyle/styletrack.c @@ -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 - -#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 -}; diff --git a/dlls/dmstyle/version.rc b/dlls/dmstyle/version.rc index bf7645d547e..afdea3659b9 100644 --- a/dlls/dmstyle/version.rc +++ b/dlls/dmstyle/version.rc @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003 Rok Mandeljc + * Copyright (C) 2003-2004 Rok Mandeljc * * 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" diff --git a/dlls/dmsynth/dmsynth_main.c b/dlls/dmsynth/dmsynth_main.c index c529981740c..db3f72d772e 100644 --- a/dlls/dmsynth/dmsynth_main.c +++ b/dlls/dmsynth/dmsynth_main.c @@ -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; diff --git a/dlls/dmsynth/dmsynth_private.h b/dlls/dmsynth/dmsynth_private.h index 262ab574a37..f2a44888252 100644 --- a/dlls/dmsynth/dmsynth_private.h +++ b/dlls/dmsynth/dmsynth_private.h @@ -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 #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; diff --git a/dlls/dmsynth/regsvr.c b/dlls/dmsynth/regsvr.c index 8e8b96e60ee..401033d869a 100644 --- a/dlls/dmsynth/regsvr.c +++ b/dlls/dmsynth/regsvr.c @@ -18,21 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include - -#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"); diff --git a/dlls/dmsynth/synth.c b/dlls/dmsynth/synth.c index 5b89e66c26e..0658b788e18 100644 --- a/dlls/dmsynth/synth.c +++ b/dlls/dmsynth/synth.c @@ -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 - -#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); } diff --git a/dlls/dmsynth/synthsink.c b/dlls/dmsynth/synthsink.c index fad7de497d4..49a70770b67 100644 --- a/dlls/dmsynth/synthsink.c +++ b/dlls/dmsynth/synthsink.c @@ -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 - -#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); } diff --git a/dlls/dmsynth/version.rc b/dlls/dmsynth/version.rc index 4ccbc66e0bb..505109200f8 100644 --- a/dlls/dmsynth/version.rc +++ b/dlls/dmsynth/version.rc @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003 Rok Mandeljc + * Copyright (C) 2003-2004 Rok Mandeljc * * 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" diff --git a/dlls/dmusic/buffer.c b/dlls/dmusic/buffer.c index 8dd73eb926c..04af316ad46 100644 --- a/dlls/dmusic/buffer.c +++ b/dlls/dmusic/buffer.c @@ -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 - -#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); } diff --git a/dlls/dmusic/clock.c b/dlls/dmusic/clock.c index 01914b60446..85cea5a44cd 100644 --- a/dlls/dmusic/clock.c +++ b/dlls/dmusic/clock.c @@ -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 - -#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); } diff --git a/dlls/dmusic/collection.c b/dlls/dmusic/collection.c index 903a3bb2f08..0550d08abf1 100644 --- a/dlls/dmusic/collection.c +++ b/dlls/dmusic/collection.c @@ -1,6 +1,6 @@ /* IDirectMusicCollection 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 - -#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); -/* IDirectMusicCollection IUnknown parts follow: */ -HRESULT WINAPI IDirectMusicCollectionImpl_QueryInterface (LPDIRECTMUSICCOLLECTION iface, REFIID riid, LPVOID *ppobj) -{ - ICOM_THIS(IDirectMusicCollectionImpl,iface); - - if (IsEqualIID (riid, &IID_IUnknown) - || IsEqualIID (riid, &IID_IDirectMusicCollection)) { - IDirectMusicCollectionImpl_AddRef(iface); - *ppobj = This; +/***************************************************************************** + * IDirectMusicCollectionImpl implementation + */ +/* IDirectMusicCollectionImpl IUnknown part: */ +HRESULT WINAPI IDirectMusicCollectionImpl_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) { + ICOM_THIS_MULTI(IDirectMusicCollectionImpl, UnknownVtbl, iface); + + if (IsEqualIID (riid, &IID_IUnknown)) { + *ppobj = (LPVOID)&This->UnknownVtbl; + IDirectMusicCollectionImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl); + return S_OK; + } else if (IsEqualIID (riid, &IID_IDirectMusicCollection)) { + *ppobj = (LPVOID)&This->CollectionVtbl; + IDirectMusicCollectionImpl_IDirectMusicCollection_AddRef ((LPDIRECTMUSICCOLLECTION)&This->CollectionVtbl); + return S_OK; + } else if (IsEqualIID (riid, &IID_IDirectMusicObject)) { + *ppobj = (LPVOID)&This->ObjectVtbl; + IDirectMusicCollectionImpl_IDirectMusicObject_AddRef ((LPDIRECTMUSICOBJECT)&This->ObjectVtbl); + return S_OK; + } else if (IsEqualIID (riid, &IID_IPersistStream)) { + *ppobj = (LPVOID)&This->PersistStreamVtbl; + IDirectMusicCollectionImpl_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 IDirectMusicCollectionImpl_AddRef (LPDIRECTMUSICCOLLECTION iface) -{ - ICOM_THIS(IDirectMusicCollectionImpl,iface); +ULONG WINAPI IDirectMusicCollectionImpl_IUnknown_AddRef (LPUNKNOWN iface) { + ICOM_THIS_MULTI(IDirectMusicCollectionImpl, UnknownVtbl, iface); TRACE("(%p) : AddRef from %ld\n", This, This->ref); return ++(This->ref); } -ULONG WINAPI IDirectMusicCollectionImpl_Release (LPDIRECTMUSICCOLLECTION iface) -{ - ICOM_THIS(IDirectMusicCollectionImpl,iface); +ULONG WINAPI IDirectMusicCollectionImpl_IUnknown_Release (LPUNKNOWN iface) { + ICOM_THIS_MULTI(IDirectMusicCollectionImpl, UnknownVtbl, iface); ULONG ref = --This->ref; TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref); if (ref == 0) { @@ -63,276 +67,703 @@ ULONG WINAPI IDirectMusicCollectionImpl_Release (LPDIRECTMUSICCOLLECTION iface) return ref; } +ICOM_VTABLE(IUnknown) DirectMusicCollection_Unknown_Vtbl = { + ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE + IDirectMusicCollectionImpl_IUnknown_QueryInterface, + IDirectMusicCollectionImpl_IUnknown_AddRef, + IDirectMusicCollectionImpl_IUnknown_Release +}; + +/* IDirectMusicCollectionImpl IDirectMusicCollection part: */ +HRESULT WINAPI IDirectMusicCollectionImpl_IDirectMusicCollection_QueryInterface (LPDIRECTMUSICCOLLECTION iface, REFIID riid, LPVOID *ppobj) { + ICOM_THIS_MULTI(IDirectMusicCollectionImpl, CollectionVtbl, iface); + return IDirectMusicCollectionImpl_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj); +} + +ULONG WINAPI IDirectMusicCollectionImpl_IDirectMusicCollection_AddRef (LPDIRECTMUSICCOLLECTION iface) { + ICOM_THIS_MULTI(IDirectMusicCollectionImpl, CollectionVtbl, iface); + return IDirectMusicCollectionImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl); +} + +ULONG WINAPI IDirectMusicCollectionImpl_IDirectMusicCollection_Release (LPDIRECTMUSICCOLLECTION iface) { + ICOM_THIS_MULTI(IDirectMusicCollectionImpl, CollectionVtbl, iface); + return IDirectMusicCollectionImpl_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl); +} + /* IDirectMusicCollection Interface follow: */ -HRESULT WINAPI IDirectMusicCollectionImpl_GetInstrument (LPDIRECTMUSICCOLLECTION iface, DWORD dwPatch, IDirectMusicInstrument** ppInstrument) -{ - ICOM_THIS(IDirectMusicCollectionImpl,iface); - int i; - +HRESULT WINAPI IDirectMusicCollectionImpl_IDirectMusicCollection_GetInstrument (LPDIRECTMUSICCOLLECTION iface, DWORD dwPatch, IDirectMusicInstrument** ppInstrument) { + ICOM_THIS_MULTI(IDirectMusicCollectionImpl, CollectionVtbl, iface); + DMUS_PRIVATE_INSTRUMENTENTRY *tmpEntry; + struct list *listEntry; + DWORD dwInstPatch; + TRACE("(%p, %ld, %p)\n", This, dwPatch, ppInstrument); - for (i = 0; i < This->nrofinstruments; i++) { - if (This->ppInstruments[i]->dwPatch == dwPatch) { - *ppInstrument = (LPDIRECTMUSICINSTRUMENT)This->ppInstruments[i]; + + LIST_FOR_EACH (listEntry, &This->Instruments) { + tmpEntry = LIST_ENTRY(listEntry, DMUS_PRIVATE_INSTRUMENTENTRY, entry); + IDirectMusicInstrument_GetPatch (tmpEntry->pInstrument, &dwInstPatch); + if (dwPatch == dwInstPatch) { + *ppInstrument = (LPDIRECTMUSICINSTRUMENT)tmpEntry->pInstrument; + IDirectMusicInstrument_AddRef (tmpEntry->pInstrument); + IDirectMusicInstrumentImpl_Custom_Load (tmpEntry->pInstrument, This->pStm); /* load instrument before returning it */ + TRACE(": returning instrument %p\n", *ppInstrument); return S_OK; } + } + TRACE(": instrument not found\n"); return DMUS_E_INVALIDPATCH; } -HRESULT WINAPI IDirectMusicCollectionImpl_EnumInstrument (LPDIRECTMUSICCOLLECTION iface, DWORD dwIndex, DWORD* pdwPatch, LPWSTR pwszName, DWORD dwNameLen) -{ - ICOM_THIS(IDirectMusicCollectionImpl,iface); - +HRESULT WINAPI IDirectMusicCollectionImpl_IDirectMusicCollection_EnumInstrument (LPDIRECTMUSICCOLLECTION iface, DWORD dwIndex, DWORD* pdwPatch, LPWSTR pwszName, DWORD dwNameLen) { + ICOM_THIS_MULTI(IDirectMusicCollectionImpl, CollectionVtbl, iface); + int r = 0; + DMUS_PRIVATE_INSTRUMENTENTRY *tmpEntry; + struct list *listEntry; + TRACE("(%p, %ld, %p, %p, %ld)\n", This, dwIndex, pdwPatch, pwszName, dwNameLen); - if (dwIndex > This->nrofinstruments) - return S_FALSE; - *pdwPatch = This->ppInstruments[dwIndex]->dwPatch; - if (pwszName != NULL) { - /* - *pwszName = (LPWSTR)This->ppInstruments[dwIndex]->pwszName; - *dwNameLen = wcslen (This->ppInstruments[dwIndex]->pwszName); - */ + LIST_FOR_EACH (listEntry, &This->Instruments) { + tmpEntry = LIST_ENTRY(listEntry, DMUS_PRIVATE_INSTRUMENTENTRY, entry); + if (r == dwIndex) { + ICOM_NAME_MULTI (IDirectMusicInstrumentImpl, InstrumentVtbl, tmpEntry->pInstrument, pInstrument); + IDirectMusicInstrument_GetPatch (tmpEntry->pInstrument, pdwPatch); + dwNameLen = strlenW (pInstrument->wszName); + strncpyW (pwszName, pInstrument->wszName, dwNameLen); + return S_OK; + } + r++; + } + + return S_FALSE; +} + +ICOM_VTABLE(IDirectMusicCollection) DirectMusicCollection_Collection_Vtbl = { + ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE + IDirectMusicCollectionImpl_IDirectMusicCollection_QueryInterface, + IDirectMusicCollectionImpl_IDirectMusicCollection_AddRef, + IDirectMusicCollectionImpl_IDirectMusicCollection_Release, + IDirectMusicCollectionImpl_IDirectMusicCollection_GetInstrument, + IDirectMusicCollectionImpl_IDirectMusicCollection_EnumInstrument +}; + +/* IDirectMusicCollectionImpl IDirectMusicObject part: */ +HRESULT WINAPI IDirectMusicCollectionImpl_IDirectMusicObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj) { + ICOM_THIS_MULTI(IDirectMusicCollectionImpl, ObjectVtbl, iface); + return IDirectMusicCollectionImpl_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj); +} + +ULONG WINAPI IDirectMusicCollectionImpl_IDirectMusicObject_AddRef (LPDIRECTMUSICOBJECT iface) { + ICOM_THIS_MULTI(IDirectMusicCollectionImpl, ObjectVtbl, iface); + return IDirectMusicCollectionImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl); +} + +ULONG WINAPI IDirectMusicCollectionImpl_IDirectMusicObject_Release (LPDIRECTMUSICOBJECT iface) { + ICOM_THIS_MULTI(IDirectMusicCollectionImpl, ObjectVtbl, iface); + return IDirectMusicCollectionImpl_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl); +} + +HRESULT WINAPI IDirectMusicCollectionImpl_IDirectMusicObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc) { + ICOM_THIS_MULTI(IDirectMusicCollectionImpl, 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 IDirectMusicCollectionImpl_IDirectMusicObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc) { + ICOM_THIS_MULTI(IDirectMusicCollectionImpl, ObjectVtbl, iface); + TRACE("(%p, %p): setting descriptor:\n", This, pDesc); + if (TRACE_ON(dmusic)) { + 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 IDirectMusicCollectionImpl_IDirectMusicObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc) { + ICOM_THIS_MULTI(IDirectMusicCollectionImpl, 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_DirectMusicCollection, 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('D','L','S',' ')) { + TRACE_(dmfile)(": collection 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 FOURCC_DLID: { + 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) { + /* pure INFO list, such can be found in dls collections */ + case mmioFOURCC('I','N','F','O'): { + TRACE_(dmfile)(": INFO 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) { + case mmioFOURCC('I','N','A','M'):{ + CHAR szName[DMUS_MAX_NAME]; + TRACE_(dmfile)(": name chunk\n"); + pDesc->dwValidData |= DMUS_OBJ_NAME; + IStream_Read (pStream, szName, Chunk.dwSize, NULL); + MultiByteToWideChar (CP_ACP, 0, szName, -1, pDesc->wszName, DMUS_MAX_NAME); + if (even_or_odd(Chunk.dwSize)) { + ListCount[0] ++; + liMove.QuadPart = 1; + IStream_Seek (pStream, 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[0] ++; + Chunk.dwSize++; + } + liMove.QuadPart = Chunk.dwSize; + IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL); + break; + } + case mmioFOURCC('I','C','O','P'): { + TRACE_(dmfile)(": copyright chunk (ignored)\n"); + if (even_or_odd(Chunk.dwSize)) { + ListCount[0] ++; + Chunk.dwSize++; + } + liMove.QuadPart = Chunk.dwSize; + IStream_Seek (pStream, 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[0] ++; + Chunk.dwSize++; + } + liMove.QuadPart = Chunk.dwSize; + IStream_Seek (pStream, 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[0] ++; + Chunk.dwSize++; + } + liMove.QuadPart = Chunk.dwSize; + IStream_Seek (pStream, liMove, STREAM_SEEK_CUR, NULL); + break; + } + default: { + TRACE_(dmfile)(": unknown chunk (irrevelant & skipping)\n"); + if (even_or_odd(Chunk.dwSize)) { + ListCount[0] ++; + Chunk.dwSize++; + } + 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(dmusic)) { + DMUSIC_dump_DMUS_OBJECTDESC (pDesc); } return S_OK; } -ICOM_VTABLE(IDirectMusicCollection) DirectMusicCollection_Vtbl = -{ +ICOM_VTABLE(IDirectMusicObject) DirectMusicCollection_Object_Vtbl = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE - IDirectMusicCollectionImpl_QueryInterface, - IDirectMusicCollectionImpl_AddRef, - IDirectMusicCollectionImpl_Release, - IDirectMusicCollectionImpl_GetInstrument, - IDirectMusicCollectionImpl_EnumInstrument + IDirectMusicCollectionImpl_IDirectMusicObject_QueryInterface, + IDirectMusicCollectionImpl_IDirectMusicObject_AddRef, + IDirectMusicCollectionImpl_IDirectMusicObject_Release, + IDirectMusicCollectionImpl_IDirectMusicObject_GetDescriptor, + IDirectMusicCollectionImpl_IDirectMusicObject_SetDescriptor, + IDirectMusicCollectionImpl_IDirectMusicObject_ParseDescriptor }; +/* IDirectMusicCollectionImpl IPersistStream part: */ +HRESULT WINAPI IDirectMusicCollectionImpl_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj) { + ICOM_THIS_MULTI(IDirectMusicCollectionImpl, PersistStreamVtbl, iface); + return IDirectMusicCollectionImpl_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj); +} + +ULONG WINAPI IDirectMusicCollectionImpl_IPersistStream_AddRef (LPPERSISTSTREAM iface) { + ICOM_THIS_MULTI(IDirectMusicCollectionImpl, PersistStreamVtbl, iface); + return IDirectMusicCollectionImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl); +} + +ULONG WINAPI IDirectMusicCollectionImpl_IPersistStream_Release (LPPERSISTSTREAM iface) { + ICOM_THIS_MULTI(IDirectMusicCollectionImpl, PersistStreamVtbl, iface); + return IDirectMusicCollectionImpl_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl); +} + +HRESULT WINAPI IDirectMusicCollectionImpl_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) { + return E_NOTIMPL; +} + +HRESULT WINAPI IDirectMusicCollectionImpl_IPersistStream_IsDirty (LPPERSISTSTREAM iface) { + return E_NOTIMPL; +} + +HRESULT WINAPI IDirectMusicCollectionImpl_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm) { + ICOM_THIS_MULTI(IDirectMusicCollectionImpl, PersistStreamVtbl, iface); + + DMUS_PRIVATE_CHUNK Chunk; + DWORD StreamSize, StreamCount, ListSize[3], ListCount[3]; + LARGE_INTEGER liMove; /* used when skipping chunks */ + ULARGE_INTEGER dlibCollectionPosition, dlibInstrumentPosition, dlibWavePoolPosition; + + IStream_AddRef (pStm); /* add count for later references */ + liMove.QuadPart = 0; + IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, &dlibCollectionPosition); /* store offset, in case it'll be needed later */ + This->liCollectionPosition.QuadPart = dlibCollectionPosition.QuadPart; + This->pStm = pStm; + + 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_RIFF: { + IStream_Read (pStm, &Chunk.fccID, sizeof(FOURCC), NULL); + TRACE_(dmfile)(": RIFF chunk of type %s", debugstr_fourcc(Chunk.fccID)); + StreamSize = Chunk.dwSize - sizeof(FOURCC); + StreamCount = 0; + switch (Chunk.fccID) { + case FOURCC_DLS: { + TRACE_(dmfile)(": collection form\n"); + do { + IStream_Read (pStm, &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 FOURCC_COLH: { + TRACE_(dmfile)(": collection header chunk\n"); + This->pHeader = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, Chunk.dwSize); + IStream_Read (pStm, This->pHeader, Chunk.dwSize, NULL); + break; + } + case FOURCC_DLID: { + TRACE_(dmfile)(": DLID (GUID) chunk\n"); + This->pDesc->dwValidData |= DMUS_OBJ_OBJECT; + IStream_Read (pStm, &This->pDesc->guidObject, Chunk.dwSize, NULL); + break; + } + case FOURCC_VERS: { + TRACE_(dmfile)(": version chunk\n"); + This->pDesc->dwValidData |= DMUS_OBJ_VERSION; + IStream_Read (pStm, &This->pDesc->vVersion, Chunk.dwSize, NULL); + break; + } + case FOURCC_PTBL: { + TRACE_(dmfile)(": pool table chunk\n"); + This->pPoolTable = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(POOLTABLE)); + IStream_Read (pStm, This->pPoolTable, sizeof(POOLTABLE), NULL); + Chunk.dwSize -= sizeof(POOLTABLE); + This->pPoolCues = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, This->pPoolTable->cCues*sizeof(POOLCUE)); + IStream_Read (pStm, This->pPoolCues, 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[0] = Chunk.dwSize - sizeof(FOURCC); + ListCount[0] = 0; + switch (Chunk.fccID) { + case mmioFOURCC('I','N','F','O'): { + TRACE_(dmfile)(": INFO 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 mmioFOURCC('I','N','A','M'): { + CHAR szName[DMUS_MAX_NAME]; + TRACE_(dmfile)(": name chunk\n"); + This->pDesc->dwValidData |= DMUS_OBJ_NAME; + IStream_Read (pStm, szName, Chunk.dwSize, NULL); + MultiByteToWideChar (CP_ACP, 0, szName, -1, This->pDesc->wszName, DMUS_MAX_NAME); + if (even_or_odd(Chunk.dwSize)) { + ListCount[0] ++; + liMove.QuadPart = 1; + 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[0] ++; + Chunk.dwSize++; + } + liMove.QuadPart = Chunk.dwSize; + IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); + break; + } + case mmioFOURCC('I','C','O','P'): { + TRACE_(dmfile)(": copyright chunk\n"); + This->szCopyright = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, Chunk.dwSize); + IStream_Read (pStm, This->szCopyright, Chunk.dwSize, NULL); + if (even_or_odd(Chunk.dwSize)) { + ListCount[0] ++; + 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[0] ++; + 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[0] ++; + 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[0] ++; + Chunk.dwSize++; + } + 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; + } + case FOURCC_WVPL: { + TRACE_(dmfile)(": wave pool list (mark & skip)\n"); + liMove.QuadPart = 0; + IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, &dlibWavePoolPosition); /* store position */ + This->liWavePoolTablePosition.QuadPart = dlibWavePoolPosition.QuadPart; + liMove.QuadPart = Chunk.dwSize - sizeof(FOURCC); + IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); + break; + } + case FOURCC_LINS: { + TRACE_(dmfile)(": instruments 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_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_INS: { + LPDMUS_PRIVATE_INSTRUMENTENTRY pNewInstrument = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(DMUS_PRIVATE_INSTRUMENTENTRY)); + TRACE_(dmfile)(": instrument list\n"); + DMUSIC_CreateDirectMusicInstrumentImpl (&IID_IDirectMusicInstrument, (LPVOID*)&pNewInstrument->pInstrument, NULL); /* only way to create this one... even M$ does it discretly */ + { + ICOM_NAME_MULTI (IDirectMusicInstrumentImpl, InstrumentVtbl, pNewInstrument->pInstrument, pInstrument); + liMove.QuadPart = 0; + IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, &dlibInstrumentPosition); + pInstrument->liInstrumentPosition.QuadPart = dlibInstrumentPosition.QuadPart - (2*sizeof(FOURCC) + sizeof(DWORD)); /* store offset, it'll be needed later */ + + 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_INSH: { + TRACE_(dmfile)(": instrument header chunk\n"); + pInstrument->pHeader = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, Chunk.dwSize); + IStream_Read (pStm, pInstrument->pHeader, Chunk.dwSize, NULL); + break; + } + case FOURCC_DLID: { + TRACE_(dmfile)(": DLID (GUID) chunk\n"); + pInstrument->pInstrumentID = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, Chunk.dwSize); + IStream_Read (pStm, pInstrument->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[2] = Chunk.dwSize - sizeof(FOURCC); + ListCount[2] = 0; + switch (Chunk.fccID) { + 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]); + /* DEBUG: dumps whole instrument object tree: */ + if (TRACE_ON(dmusic)) { + TRACE("*** IDirectMusicInstrument (%p) ***\n", pInstrument); + if (pInstrument->pInstrumentID) + TRACE(" - GUID = %s\n", debugstr_guid(pInstrument->pInstrumentID)); + + TRACE(" - Instrument header:\n"); + TRACE(" - cRegions: %ld\n", pInstrument->pHeader->cRegions); + TRACE(" - Locale:\n"); + TRACE(" - ulBank: %ld\n", pInstrument->pHeader->Locale.ulBank); + TRACE(" - ulInstrument: %ld\n", pInstrument->pHeader->Locale.ulInstrument); + TRACE(" => dwPatch: %ld\n", MIDILOCALE2Patch(&pInstrument->pHeader->Locale)); + } + list_add_tail (&This->Instruments, &pNewInstrument->entry); + } + 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 (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)(": StreamCount = %ld < StreamSize = %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 = Chunk.dwSize; + IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */ + return E_FAIL; + } + } + + /* DEBUG: dumps whole collection object tree: */ + if (TRACE_ON(dmusic)) { + int r = 0; + DMUS_PRIVATE_INSTRUMENTENTRY *tmpEntry; + struct list *listEntry; + + TRACE("*** IDirectMusicCollection (%p) ***\n", This->CollectionVtbl); + if (This->pDesc->dwValidData & DMUS_OBJ_OBJECT) + TRACE(" - GUID = %s\n", debugstr_guid(&This->pDesc->guidObject)); + if (This->pDesc->dwValidData & DMUS_OBJ_VERSION) + TRACE(" - Version = %i,%i,%i,%i\n", (This->pDesc->vVersion.dwVersionMS >> 8) && 0x0000FFFF, This->pDesc->vVersion.dwVersionMS && 0x0000FFFF, \ + (This->pDesc->vVersion.dwVersionLS >> 8) && 0x0000FFFF, This->pDesc->vVersion.dwVersionLS && 0x0000FFFF); + if (This->pDesc->dwValidData & DMUS_OBJ_NAME) + TRACE(" - Name = %s\n", debugstr_w(This->pDesc->wszName)); + + TRACE(" - Collection header:\n"); + TRACE(" - cInstruments: %ld\n", This->pHeader->cInstruments); + TRACE(" - Instruments:\n"); + + LIST_FOR_EACH (listEntry, &This->Instruments) { + tmpEntry = LIST_ENTRY( listEntry, DMUS_PRIVATE_INSTRUMENTENTRY, entry ); + TRACE(" - Instrument[%i]: %p\n", r, tmpEntry->pInstrument); + r++; + } + } + + return S_OK; +} + +HRESULT WINAPI IDirectMusicCollectionImpl_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) { + return E_NOTIMPL; +} + +HRESULT WINAPI IDirectMusicCollectionImpl_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) { + return E_NOTIMPL; +} + +ICOM_VTABLE(IPersistStream) DirectMusicCollection_PersistStream_Vtbl = { + ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE + IDirectMusicCollectionImpl_IPersistStream_QueryInterface, + IDirectMusicCollectionImpl_IPersistStream_AddRef, + IDirectMusicCollectionImpl_IPersistStream_Release, + IDirectMusicCollectionImpl_IPersistStream_GetClassID, + IDirectMusicCollectionImpl_IPersistStream_IsDirty, + IDirectMusicCollectionImpl_IPersistStream_Load, + IDirectMusicCollectionImpl_IPersistStream_Save, + IDirectMusicCollectionImpl_IPersistStream_GetSizeMax +}; + + /* for ClassFactory */ -HRESULT WINAPI DMUSIC_CreateDirectMusicCollection (LPCGUID lpcGUID, LPDIRECTMUSICCOLLECTION* ppDMColl, LPUNKNOWN pUnkOuter) -{ - IDirectMusicCollectionImpl *collection; +HRESULT WINAPI DMUSIC_CreateDirectMusicCollectionImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) { + IDirectMusicCollectionImpl* obj; - TRACE("(%p,%p,%p)\n", lpcGUID, ppDMColl, pUnkOuter); - if (IsEqualIID (lpcGUID, &IID_IDirectMusicCollection)) { - collection = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicCollectionImpl)); - if (NULL == collection) { - *ppDMColl = (LPDIRECTMUSICCOLLECTION) NULL; - return E_OUTOFMEMORY; - } - collection->lpVtbl = &DirectMusicCollection_Vtbl; - collection->ref = 1; - *ppDMColl = (LPDIRECTMUSICCOLLECTION) collection; - return S_OK; + obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicCollectionImpl)); + if (NULL == obj) { + *ppobj = (LPVOID) NULL; + return E_OUTOFMEMORY; } - - WARN("No interface found\n"); - return E_NOINTERFACE; -} - - -/***************************************************************************** - * IDirectMusicCollectionObject implementation - */ -/* IDirectMusicCollectionObject IUnknown part: */ -HRESULT WINAPI IDirectMusicCollectionObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj) -{ - ICOM_THIS(IDirectMusicCollectionObject,iface); - - if (IsEqualIID (riid, &IID_IUnknown) - || IsEqualIID (riid, &IID_IDirectMusicObject)) { - IDirectMusicCollectionObject_AddRef(iface); - *ppobj = This; - return S_OK; - } else if (IsEqualIID (riid, &IID_IPersistStream)) { - IDirectMusicCollectionObjectStream_AddRef ((LPPERSISTSTREAM)This->pStream); - *ppobj = This->pStream; - return S_OK; - } else if (IsEqualIID (riid, &IID_IDirectMusicCollection)) { - IDirectMusicCollectionImpl_AddRef ((LPDIRECTMUSICCOLLECTION)This->pCollection); - *ppobj = This->pCollection; - return S_OK; - } - - WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj); - return E_NOINTERFACE; -} - -ULONG WINAPI IDirectMusicCollectionObject_AddRef (LPDIRECTMUSICOBJECT iface) -{ - ICOM_THIS(IDirectMusicCollectionObject,iface); - TRACE("(%p) : AddRef from %ld\n", This, This->ref); - return ++(This->ref); -} - -ULONG WINAPI IDirectMusicCollectionObject_Release (LPDIRECTMUSICOBJECT iface) -{ - ICOM_THIS(IDirectMusicCollectionObject,iface); - ULONG ref = --This->ref; - TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref); - if (ref == 0) { - HeapFree(GetProcessHeap(), 0, This); - } - return ref; -} - -/* IDirectMusicCollectionObject IDirectMusicObject part: */ -HRESULT WINAPI IDirectMusicCollectionObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc) -{ - ICOM_THIS(IDirectMusicCollectionObject,iface); - - TRACE("(%p, %p)\n", This, pDesc); - pDesc = This->pDesc; + obj->UnknownVtbl = &DirectMusicCollection_Unknown_Vtbl; + obj->CollectionVtbl = &DirectMusicCollection_Collection_Vtbl; + obj->ObjectVtbl = &DirectMusicCollection_Object_Vtbl; + obj->PersistStreamVtbl = &DirectMusicCollection_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_DirectMusicCollection, sizeof (CLSID)); + obj->ref = 0; /* will be inited by QueryInterface */ + list_init (&obj->Instruments); - return S_OK; + return IDirectMusicCollectionImpl_IUnknown_QueryInterface ((LPUNKNOWN)&obj->UnknownVtbl, lpcGUID, ppobj); } - -HRESULT WINAPI IDirectMusicCollectionObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc) -{ - ICOM_THIS(IDirectMusicCollectionObject,iface); - - TRACE("(%p, %p)\n", This, pDesc); - This->pDesc = pDesc; - - return S_OK; -} - -HRESULT WINAPI IDirectMusicCollectionObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc) -{ - ICOM_THIS(IDirectMusicCollectionObject,iface); - - FIXME("(%p, %p, %p): stub\n", This, pStream, pDesc); - - return S_OK; -} - -ICOM_VTABLE(IDirectMusicObject) DirectMusicCollectionObject_Vtbl = -{ - ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE - IDirectMusicCollectionObject_QueryInterface, - IDirectMusicCollectionObject_AddRef, - IDirectMusicCollectionObject_Release, - IDirectMusicCollectionObject_GetDescriptor, - IDirectMusicCollectionObject_SetDescriptor, - IDirectMusicCollectionObject_ParseDescriptor -}; - -/* for ClassFactory */ -HRESULT WINAPI DMUSIC_CreateDirectMusicCollectionObject (LPCGUID lpcGUID, LPDIRECTMUSICOBJECT* ppObject, LPUNKNOWN pUnkOuter) -{ - IDirectMusicCollectionObject *obj; - - TRACE("(%p,%p,%p)\n", lpcGUID, ppObject, pUnkOuter); - if (IsEqualIID (lpcGUID, &IID_IDirectMusicObject)) { - obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicCollectionObject)); - if (NULL == obj) { - *ppObject = (LPDIRECTMUSICOBJECT) NULL; - return E_OUTOFMEMORY; - } - obj->lpVtbl = &DirectMusicCollectionObject_Vtbl; - obj->ref = 1; - /* prepare IPersistStream */ - obj->pStream = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicCollectionObjectStream)); - obj->pStream->lpVtbl = &DirectMusicCollectionObjectStream_Vtbl; - obj->pStream->ref = 1; - obj->pStream->pParentObject = obj; - /* prepare IDirectMusicCollection */ - DMUSIC_CreateDirectMusicCollection (&IID_IDirectMusicCollection, (LPDIRECTMUSICCOLLECTION*)&obj->pCollection, NULL); - obj->pCollection->pObject = obj; - *ppObject = (LPDIRECTMUSICOBJECT) obj; - return S_OK; - } - WARN("No interface found\n"); - - return E_NOINTERFACE; -} - -/***************************************************************************** - * IDirectMusicCollectionObjectStream implementation - */ -/* IDirectMusicCollectionObjectStream IUnknown part: */ -HRESULT WINAPI IDirectMusicCollectionObjectStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj) -{ - ICOM_THIS(IDirectMusicCollectionObjectStream,iface); - - if (IsEqualIID (riid, &IID_IUnknown) - || IsEqualIID (riid, &IID_IPersistStream)) { - IDirectMusicCollectionObjectStream_AddRef (iface); - *ppobj = This; - return S_OK; - } - - WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj); - return E_NOINTERFACE; -} - -ULONG WINAPI IDirectMusicCollectionObjectStream_AddRef (LPPERSISTSTREAM iface) -{ - ICOM_THIS(IDirectMusicCollectionObjectStream,iface); - TRACE("(%p) : AddRef from %ld\n", This, This->ref); - return ++(This->ref); -} - -ULONG WINAPI IDirectMusicCollectionObjectStream_Release (LPPERSISTSTREAM iface) -{ - ICOM_THIS(IDirectMusicCollectionObjectStream,iface); - ULONG ref = --This->ref; - TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref); - if (ref == 0) { - HeapFree(GetProcessHeap(), 0, This); - } - return ref; -} - -/* IDirectMusicCollectionObjectStream IPersist part: */ -HRESULT WINAPI IDirectMusicCollectionObjectStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) -{ - return E_NOTIMPL; -} - -/* IDirectMusicCollectionObjectStream IPersistStream part: */ -HRESULT WINAPI IDirectMusicCollectionObjectStream_IsDirty (LPPERSISTSTREAM iface) -{ - return E_NOTIMPL; -} - -HRESULT WINAPI IDirectMusicCollectionObjectStream_Load (LPPERSISTSTREAM iface, IStream* pStm) -{ - FOURCC chunkID; - DWORD chunkSize; - - IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL); - IStream_Read (pStm, &chunkSize, sizeof(FOURCC), NULL); - - if (chunkID == FOURCC_RIFF) { - FIXME(": Loading not implemented yet\n"); - } else { - WARN("Not a RIFF file\n"); - return E_FAIL; - } - - return S_OK; -} - -HRESULT WINAPI IDirectMusicCollectionObjectStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) -{ - return E_NOTIMPL; -} - -HRESULT WINAPI IDirectMusicCollectionObjectStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) -{ - return E_NOTIMPL; -} - -ICOM_VTABLE(IPersistStream) DirectMusicCollectionObjectStream_Vtbl = -{ - ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE - IDirectMusicCollectionObjectStream_QueryInterface, - IDirectMusicCollectionObjectStream_AddRef, - IDirectMusicCollectionObjectStream_Release, - IDirectMusicCollectionObjectStream_GetClassID, - IDirectMusicCollectionObjectStream_IsDirty, - IDirectMusicCollectionObjectStream_Load, - IDirectMusicCollectionObjectStream_Save, - IDirectMusicCollectionObjectStream_GetSizeMax -}; diff --git a/dlls/dmusic/dmusic.c b/dlls/dmusic/dmusic.c index db3a8976c03..88fd1efe2b3 100644 --- a/dlls/dmusic/dmusic.c +++ b/dlls/dmusic/dmusic.c @@ -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 - -#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); } diff --git a/dlls/dmusic/dmusic_main.c b/dlls/dmusic/dmusic_main.c index b258888cb1c..53388f35033 100644 --- a/dlls/dmusic/dmusic_main.c +++ b/dlls/dmusic/dmusic_main.c @@ -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; diff --git a/dlls/dmusic/dmusic_private.h b/dlls/dmusic/dmusic_private.h index 63d11752b3a..04ebcfd1c1a 100644 --- a/dlls/dmusic/dmusic_private.h +++ b/dlls/dmusic/dmusic_private.h @@ -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 #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 */ diff --git a/dlls/dmusic/download.c b/dlls/dmusic/download.c index 8c334b43b59..9a6b9f039ec 100644 --- a/dlls/dmusic/download.c +++ b/dlls/dmusic/download.c @@ -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 - -#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); } diff --git a/dlls/dmusic/downloadedinstrument.c b/dlls/dmusic/downloadedinstrument.c index aeb1bcbb041..8e2dcc3c7f6 100644 --- a/dlls/dmusic/downloadedinstrument.c +++ b/dlls/dmusic/downloadedinstrument.c @@ -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 - -#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); } diff --git a/dlls/dmusic/helper.c b/dlls/dmusic/helper.c deleted file mode 100644 index ef2f90fcb8b..00000000000 --- a/dlls/dmusic/helper.c +++ /dev/null @@ -1,1610 +0,0 @@ -/* Helper functions for dmusic file handling - * - * 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. - */ -#if 0 -#include - -#include "windef.h" -#include "winbase.h" -#include "winuser.h" -#include "wingdi.h" -#include "wine/debug.h" -#include "wine/unicode.h" - -#include "dmusic_private.h" - -/* used while still in testing */ -WINE_DEFAULT_DEBUG_CHANNEL(dmfile); -WINE_DECLARE_DEBUG_CHANNEL(dmfiledat); - -/****************************************************************************** - * DMUSIC_FillUNFOFromFileHandle: - * - fills a UNFO_List struct (dmusic_private.h) with data from file handle. - * - IMPORTANT: it expects a LIST chunk at beginning, so if you are calling it - * from another DMUSIC_Fill* function, make sure pointer is at - * correct place! - */ -HRESULT WINAPI DMUSIC_FillUNFOFromFileHandle (UNFO_List UNFO, HANDLE fd) -{ - rawChunk chunk; - DWORD BytesRead, ListCount = 0, ListSize; - - TRACE("reading 'LIST' chunk...\n"); - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); /* read 'LIST' */ - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); /* read size of 'LIST' chunk */ - if (chunk.id == FOURCC_LIST && ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL) && chunk.id == DMUS_FOURCC_UNFO_LIST) { - TRACE("'UNFO': UNFO list\n"); - ListSize = chunk.size - sizeof(FOURCC); /* list contents size is same as size of LIST chunk - size of following field ID*/ - do { - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); /* read ID of following field */ - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); /* read size of following field */ - ListCount += chunk.size + sizeof(DWORD) + sizeof(FOURCC); - switch (chunk.id) - { - case DMUS_FOURCC_UNAM_CHUNK: { - TRACE("'UNAM': name\n"); - UNFO.name = (WCHAR*) HeapAlloc (GetProcessHeap (), 0, chunk.size); /* allocate space */ - ReadFile (fd, UNFO.name, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> name = %s\n", debugstr_w(UNFO.name)); - break; - } case DMUS_FOURCC_UART_CHUNK: { - TRACE("'UART': artist\n"); - UNFO.artist = (WCHAR*) HeapAlloc (GetProcessHeap (), 0, chunk.size); /* allocate space */ - ReadFile (fd, UNFO.artist, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("artist = %s\n", debugstr_w(UNFO.artist)); - break; - } case DMUS_FOURCC_UCOP_CHUNK: { - TRACE("'UCOP': copyright\n"); - UNFO.copyright = (WCHAR*) HeapAlloc (GetProcessHeap (), 0, chunk.size); /* allocate space */ - ReadFile (fd, UNFO.copyright, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> copyright = %s\n", debugstr_w(UNFO.copyright)); - break; - } case DMUS_FOURCC_USBJ_CHUNK:{ - TRACE("'USBJ': subject\n"); - UNFO.subject = (WCHAR*) HeapAlloc (GetProcessHeap (), 0, chunk.size); /* allocate space */ - ReadFile (fd, UNFO.subject, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> subject = %s\n", debugstr_w(UNFO.subject)); - break; - } case DMUS_FOURCC_UCMT_CHUNK: { - TRACE("'UCMT': comment\n"); - UNFO.comment = (WCHAR*) HeapAlloc (GetProcessHeap (), 0, chunk.size); /* allocate space */ - ReadFile (fd, UNFO.comment, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> comment = %s\n", debugstr_w(UNFO.comment)); - break; - } default: { - WARN("invalid chunk (only 'UNAM', 'UART', 'UCOP', 'USBJ', 'UCMT' allowed)\n"); - break; - } - } - TRACE("ListCount (%ld) < ListSize(%ld)\n", ListCount, ListSize); - } while (ListCount < ListSize); - } else { - WARN("'UNFO' not found: not an UNFO list\n"); - } - return S_OK; -} - -/****************************************************************************** - * DMUSIC_FillReferenceFromFileHandle: - * - fills a Reference struct (dmusic_private.h) with data from file handle. - * - IMPORTANT: it expects a LIST chunk at beginning, so if you are calling it - * from another DMUSIC_Fill* function, make sure pointer is at - * correct place! - */ -HRESULT WINAPI DMUSIC_FillReferenceFromFileHandle (Reference reference, HANDLE fd) -{ - rawChunk chunk; - DWORD BytesRead, ListCount = 0, ListSize; - - TRACE("reading 'LIST' chunk...\n"); - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); /* read 'LIST' */ - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); /* read size of 'LIST' chunk */ - if (chunk.id == FOURCC_LIST && ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL) && chunk.id == DMUS_FOURCC_REF_LIST) { - TRACE("'DMRF': reference list\n"); - ListSize = chunk.size - sizeof(FOURCC); /* list contents size is same as size of LIST chunk - size of following field ID*/ - do { - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); /* read ID of following field */ - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); /* read size of following field */ - ListCount += chunk.size + sizeof(DWORD) + sizeof(FOURCC); - switch (chunk.id) - { - case DMUS_FOURCC_REF_CHUNK: { - TRACE("'refh': reference header\n"); - ReadFile (fd, &reference.header, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> guidClassID = %s; dwValidData = %ld\n", debugstr_guid (&reference.header.guidClassID), reference.header.dwValidData); - break; - } case DMUS_FOURCC_GUID_CHUNK: { - TRACE("'guid': GUID\n"); - ReadFile (fd, &reference.guid, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> GUID = %s\n", debugstr_guid (&reference.guid)); - break; - } case DMUS_FOURCC_DATE_CHUNK: { - TRACE("'date': file date\n"); - ReadFile (fd, &reference.date, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> file date = %ld%ld\n", reference.date.dwHighDateTime, reference.date.dwLowDateTime); - break; - } case DMUS_FOURCC_NAME_CHUNK: { - TRACE("'name': name\n"); - reference.name = (WCHAR*) HeapAlloc (GetProcessHeap (), 0, chunk.size); - ReadFile (fd, reference.name, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> name = %s\n", debugstr_w (reference.name)); - break; - } case DMUS_FOURCC_FILE_CHUNK: { - TRACE("'file': file name\n"); - reference.file = (WCHAR*) HeapAlloc (GetProcessHeap (), 0, chunk.size); - ReadFile (fd, reference.file, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> file name = %s\n", debugstr_w (reference.file)); - break; - } case DMUS_FOURCC_CATEGORY_CHUNK: { - TRACE("'catg': category\n"); - reference.category = (WCHAR*) HeapAlloc (GetProcessHeap (), 0, chunk.size); - ReadFile (fd, reference.category, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> category = %s\n", debugstr_w (reference.category)); - break; - } case DMUS_FOURCC_VERSION_CHUNK: { - TRACE("'vers': version\n"); - ReadFile (fd, &reference.version, sizeof(DMUS_IO_VERSION), &BytesRead, NULL); - TRACE_(dmfiledat)("=> version = %ld%ld\n", reference.version.dwVersionMS, reference.version.dwVersionLS); - break; - } default: { - WARN("invalid chunk (only 'refh, 'guid', 'date', 'name', 'file', 'catg', 'vers' allowed\n"); - break; - } - } - TRACE("ListCount (%ld) < ListSize (%ld)\n", ListCount, ListSize); - } while (ListCount < ListSize); - } - - return S_OK; -} - -/****************************************************************************** - * DMUSIC_FillBandFromFileHandle: - * - fills a IDirectMusicBandImpl struct with data from file handle. - * - IMPORTANT: it expects a RIFF chunk at beginning, so if you are calling it - * from another DMUSIC_Fill* function, make sure pointer is at - * correct place! - * - TODO: replace data in function with data in IDirectMusicBandImpl - */ -HRESULT WINAPI DMUSIC_FillBandFromFileHandle (IDirectMusicBandImpl *band, HANDLE fd) -{ - rawChunk chunk; - DWORD BytesRead, ListCount = 0, ListSize, ListCount2 = 0, ListSize2, FileCount = 0, FileSize; - /* FIXME: Replace stuff located below with the stuff in band */ - UNFO_List UNFO; - DMUS_IO_VERSION version; - GUID guid; - /* only in singular form for time being */ - DMUS_IO_INSTRUMENT header; - Reference reference; - - TRACE("reading 'RIFF' chunk...\n"); - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); /* read 'RIFF' */ - if (chunk.id == FOURCC_RIFF) { - TRACE("'RIFF': RIFF file\n"); - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); /* read size of 'RIFF' chunk */ - FileSize = chunk.size - sizeof(FOURCC); /* file content size = size of 'RIFF' chunk - FOURCC ID of following form */ - TRACE("reading chunks ...\n"); - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); /* read ID of following form */ - if (chunk.id == DMUS_FOURCC_BAND_FORM) { - TRACE("'DMBD': band form\n"); - do { - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); - FileCount += chunk.size + sizeof(DWORD) + sizeof(FOURCC); - switch (chunk.id) - { - case DMUS_FOURCC_GUID_CHUNK: { - TRACE("'guid': GUID\n"); - ReadFile (fd, &guid, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> GUID = %s\n", debugstr_guid(&guid)); - break; - } case DMUS_FOURCC_VERSION_CHUNK: { - TRACE("'vers': version\n"); - ReadFile (fd, &version, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> version = %ld%ld\n", version.dwVersionMS, version.dwVersionLS); - break; - } case FOURCC_LIST:{ - TRACE("'LIST': list chunk (size = %ld)\n", chunk.size); - ListSize = chunk.size - sizeof(FOURCC); /* list content size = size of 'LIST' chunk - FOURCC ID of the list */ - ListCount = 0; /* reset */ - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); /* read list ID */ - switch (chunk.id) - { - case DMUS_FOURCC_UNFO_LIST: { - TRACE("'UNFO': UNFO list (content size = %ld)\n", ListSize); - SetFilePointer (fd, -(sizeof(DWORD) + 2*sizeof(FOURCC)), NULL, FILE_CURRENT); /* set pointer at beginning of list */ - DMUSIC_FillUNFOFromFileHandle (UNFO, fd); /* forward to DMUSIC_FillUNFOFromFileHandle */ - break; - } case DMUS_FOURCC_INSTRUMENTS_LIST: { - TRACE("'lbil': instrumets list (content size = %ld)\n", ListSize); - do { - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); - ListCount += sizeof(FOURCC) + sizeof(DWORD) + chunk.size; - if (chunk.id == FOURCC_LIST && ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL) && chunk.id == DMUS_FOURCC_INSTRUMENT_LIST) { - ListSize2 = chunk.size - sizeof(FOURCC); /* list content size = size of 'LIST' chunk - FOURCC ID of the list */ - ListCount2 = 0; /* reset */ - TRACE("'lbin': instrument (size = %ld)\n", ListSize2); - do { - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); - ListCount2 += sizeof(FOURCC) + sizeof(DWORD) + chunk.size; - switch (chunk.id) - { - case DMUS_FOURCC_INSTRUMENT_CHUNK: { - TRACE("'bins': instrument header\n"); - ReadFile (fd, &header, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> dwPatch = %ld; dwAssignPatch = %ld; dwPChannel = %ld; dwFlags = %ld; bPan = %i; bVolume = %i; nTranspose = %i; dwChannelPriority = %ld; nPitchBendRange = %i", \ - header.dwPatch, header.dwAssignPatch, header.dwPChannel, header.dwFlags, header.bPan, header.bVolume, header.nTranspose, header.dwChannelPriority, header.nPitchBendRange); - break; - } case FOURCC_LIST: { - TRACE("'LIST': list chunk (size = %ld)\n", chunk.size); - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - if (chunk.id == DMUS_FOURCC_REF_LIST) { - TRACE("'DMRF': reference list (size = %ld)\n", chunk.size - 4); /* set pointer at beginning of list */ - SetFilePointer (fd, -(sizeof(DWORD) + 2*sizeof(FOURCC)), NULL, FILE_CURRENT); - DMUSIC_FillReferenceFromFileHandle (reference, fd); /* forward to DMUSIC_FillReferenceFromFileHandle */ - } else WARN("invalid chunk (only 'DMRF' chunk allowed\n"); - break; - } default: { - WARN("invalid chunk (only 'bins' and 'LIST' chunks allowed\n"); - break; - } - } - TRACE("ListCount2 (%ld) < ListSize2 (%ld)\n", ListCount2, ListSize2); - } while (ListCount2 < ListSize2); - } else WARN("invalid chunk (only 'lbin' chunk allowed)\n"); - TRACE("ListCount (%ld) < ListSize (%ld)\n", ListCount, ListSize); - } while (ListCount < ListSize); - break; - } default: { - WARN("invalid chunk (only 'UNFO' and 'lbil' chunks allowed\n"); - break; - } - } - break; - } default: { - WARN("invalid chunk (only 'guid', 'vers' and 'LIST' chunks allowed)\n"); - break; - } - } - TRACE("FileCount (%ld) < FileSize (%ld)\n", FileCount, FileSize); - } while (FileCount < FileSize); - } - } else { - WARN("'RIFF' not found: not a RIFF file\n"); - } - - return S_OK; -} - -/****************************************************************************** - * DMUSIC_FillTrackFromFileHandle: - * - fills a IDirectMusicTrack8Impl struct with data from file handle. - * - IMPORTANT: it expects a RIFF chunk at beginning, so if you are calling it - * from another DMUSIC_Fill* function, make sure pointer is at - * correct place! - * - TODO: replace data in function with data in IDirectMusicTrackImpl - * implement loading for missing (empty) clauses - * fix a problem with tempo track loading (look at code) - */ -HRESULT WINAPI DMUSIC_FillTrackFromFileHandle (IDirectMusicTrack8Impl *segment, HANDLE fd) -{ - rawChunk chunk; - DWORD BytesRead, ListCount = 0, ListCount2 = 0, ListCount3 = 0, ListCount4 = 0, \ - ListSize, ListSize2, ListSize3, ListSize4, FileCount = 0, FileSize, FileCount2 = 0, FileSize2 /* *2s, *3s and *4s are for various subchunks */; - int i; - - /* general track info */ - DMUS_IO_TRACK_HEADER header; - DMUS_IO_TRACK_EXTRAS_HEADER extheader; - GUID guid; - DMUS_IO_VERSION version; - UNFO_List UNFO; - /* tempo track stuff */ - DMUS_IO_TEMPO_ITEM tempo; - /* chord track stuff */ - DWORD chordHeader; - ChordData chordData; - /* command track stuff */ - DMUS_IO_COMMAND command; - /* sytle list stuff (support only 1 while still in parse development mode)*/ - DWORD timestamp; - Reference reference; - /* band track stuff */ - BandTrack bandTrack; - /* wave track stuff (only singular) */ - WaveTrack waveTrack; - /* segment trigger track stuff */ - SegTriggerTrack segTriggerTrack; - /* time signature track stuff */ - TimeSigTrack timeSigTrack; - /* script track list stuff */ - ScriptEvent event; - - TRACE("reading 'RIFF' chunk...\n"); - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - if (chunk.id == FOURCC_RIFF) { - TRACE ("'RIFF': RIFF file\n"); - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); /* read size of 'RIFF' chunk */ - FileSize = chunk.size - sizeof(FOURCC); /* file content size = size of 'RIFF' chunk - FOURCC ID of following form */ - TRACE("reading chunks ...\n"); - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); /* read ID of following form */ - if (chunk.id == DMUS_FOURCC_TRACK_FORM) { - TRACE("'DMTK': track form\n"); - do { - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); - FileCount += chunk.size + sizeof(DWORD) + sizeof(FOURCC); - switch (chunk.id) - { - case DMUS_FOURCC_TRACK_CHUNK: { - TRACE("'trkh': track header\n"); - ReadFile (fd, &header, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> track guidClassID = %s; dwPosition = %ld; dwGroup = %ld; ckid = %ld; fccType = %ld\n", \ - debugstr_guid (&header.guidClassID), header.dwPosition, header.dwGroup, header.ckid, header.fccType); - break; - } case DMUS_FOURCC_TRACK_EXTRAS_CHUNK: { - TRACE("'trkx': extra track flags\n"); - ReadFile (fd, &extheader, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> dwFlags = %ld; dwPriority = %ld\n", extheader.dwFlags, - extheader.dwPriority); - break; - } case DMUS_FOURCC_GUID_CHUNK: { - TRACE("'guid': GUID\n"); - ReadFile (fd, &guid, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> GUID = %s\n", debugstr_guid(&guid)); - break; - } case DMUS_FOURCC_VERSION_CHUNK: { - TRACE("'vers': version\n"); - ReadFile (fd, &version, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> version = %ld%ld\n", version.dwVersionMS, version.dwVersionLS); - break; - } case FOURCC_LIST:{ - TRACE("'LIST': list (size = %ld)\n", chunk.size); - ListSize = chunk.size - sizeof(FOURCC); /* list content size = size of 'LIST' chunk - FOURCC ID of the list */ - ListCount = 0; /* reset */ - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - switch (chunk.id) - { - case DMUS_FOURCC_UNFO_LIST: { - TRACE("'UNFO': UNFO list (forward to DMUSIC_FillUNFOFromFileHandle(...))\n"); - SetFilePointer (fd, -(sizeof(DWORD) + 2*sizeof(FOURCC)), NULL, FILE_CURRENT); /* place pointer before the 'LIST' chunk */ - DMUSIC_FillUNFOFromFileHandle (UNFO, fd); /* forward to DMUSIC_FillUNFOFromFileHandle */ - break; - } case DMUS_FOURCC_CHORDTRACK_LIST: { - TRACE("'cord': chord track list\n"); - do { - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); - ListCount += sizeof(FOURCC) + sizeof(DWORD) + chunk.size; - switch (chunk.id) - { - case DMUS_FOURCC_CHORDTRACKHEADER_CHUNK: { - TRACE("'crdh': chord header\n"); - ReadFile (fd, &chordHeader, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> chord root = %i; scale = %i\n", (chordHeader && 0xFF000000) >> 24, chordHeader && 0x00FFFFFF); - break; - } case DMUS_FOURCC_CHORDTRACKBODY_CHUNK: { - TRACE("'crdb': chord body\n"); - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); /* read sizeof (DMUS_IO_CHORD) */ - ReadFile (fd, &chordData.chord, chunk.size, &BytesRead, NULL); /* read DMUS_IO_CHORD */ - TRACE_(dmfiledat)("=> wszName[16] = %s; mtTime = %li; chord.wMeasure = %d; chord.bBeat = %i; bFlags = %i\n", \ - debugstr_w (chordData.chord.wszName), chordData.chord.mtTime, chordData.chord.wMeasure, chordData.chord.bBeat, chordData.chord.bFlags); - ReadFile (fd, &chordData.nrofsubchords, sizeof(DWORD), &BytesRead, NULL); /* read number of subchords */ - TRACE_(dmfiledat)("=> number of subchords = %ld\n", chordData.nrofsubchords); - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); /* read sizeof (DMUS_IO_SUBCHORD) */ - chordData.subchord = (DMUS_IO_SUBCHORD*) HeapAlloc (GetProcessHeap (), 0, sizeof(DMUS_IO_SUBCHORD) * chordData.nrofsubchords); /* allocate space */ - for (i = 0; i < chordData.nrofsubchords; i++) - { - TRACE_(dmfiledat)("=> subchord[%i]: dwChordPattern = %ld; dwScalePattern = %ld; dwInversionPoints = %ld; dwLevels = %ld; bChordRoot = %i; bScaleRoot = %i\n", \ - i, chordData.subchord[i].dwChordPattern, chordData.subchord[i].dwScalePattern, chordData.subchord[i].dwInversionPoints, chordData.subchord[i].dwLevels, \ - chordData.subchord[i].bChordRoot, chordData.subchord[i].bScaleRoot); - } - ReadFile (fd, chordData.subchord, chunk.size*chordData.nrofsubchords, &BytesRead, NULL); - break; - } default: { - WARN("Invalid chunk (only 'crdh' and 'crdb' chunks allowed)\n"); - break; - } - } - TRACE("ListCount (%ld) < ListSize (%ld)\n", ListCount, ListSize); - } while (ListCount < ListSize); - break; - } case DMUS_FOURCC_STYLE_TRACK_LIST: { - TRACE("'sttr': style track list\n"); - do { - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); - ListCount += sizeof(FOURCC) + sizeof(DWORD) + chunk.size; - if (chunk.id == FOURCC_LIST && ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL) && chunk.id == DMUS_FOURCC_STYLE_REF_LIST) { - ListSize2 = chunk.size - sizeof(FOURCC); - ListCount2 = 0; - TRACE("'strf': style reference list (size = %ld)\n", ListSize2); - do { - - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); - ListCount2 += sizeof(FOURCC) + sizeof(DWORD) + chunk.size; - switch (chunk.id) - { - case DMUS_FOURCC_TIME_STAMP_CHUNK: { - TRACE("'stmp': time stamp\n"); - ReadFile (fd, ×tamp, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> time stamp = %ld\n", timestamp); - break; - } case FOURCC_LIST: { - TRACE("'LIST': list\n"); - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - if (chunk.id == DMUS_FOURCC_REF_LIST){ - TRACE("'DMRF': reference list (forward to DMUSIC_FillReferenceFromFileHandle(...)\n"); - SetFilePointer (fd, -(sizeof(DWORD) + 2*sizeof(FOURCC)), NULL, FILE_CURRENT); /* place pointer before 'LIST' chunk */ - DMUSIC_FillReferenceFromFileHandle (reference, fd); - } else { - WARN("invalid chunk (only 'DMRF' chunk allwed)\n"); - } - break; - } default: { - WARN("invalid chunk (only 'stmp' and 'LIST' chunk allowed)\n"); - break; - } - } - TRACE("ListCount2 (%ld) < ListSize2 (%ld)\n", ListCount2, ListSize2); - } while (ListCount2 < ListSize2); - } else { - WARN("invalid chunk (only 'strf' allowed)\n"); - } - TRACE("ListCount (%ld) < ListSize (%ld)\n", ListCount, ListSize); - } while (ListCount < ListSize); - break; - } case DMUS_FOURCC_PERS_TRACK_LIST: { - FIXME("'pftr': chordmap track list: not supported yet\n"); - break; - } case DMUS_FOURCC_LYRICSTRACK_LIST: { - FIXME("'lyrt': lyrics track list: not supported yet\n"); - break; - } case DMUS_FOURCC_MARKERTRACK_LIST: { - FIXME("'MARK': marker track list: not supported yet\n"); - break; - } case DMUS_FOURCC_MELODYFORM_TRACK_LIST: { - FIXME("'mfrm': melody formulation track list: not supported yet\n"); - break; - } case DMUS_FOURCC_PARAMCONTROLTRACK_TRACK_LIST: { - FIXME("'prmt': parameter control track list: not supported yet\n"); - break; - } case DMUS_FOURCC_SCRIPTTRACK_LIST: { - TRACE("'scrt': script track list\n"); - do { - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); - ListCount += sizeof(FOURCC) + sizeof(DWORD) + chunk.size; - if (chunk.id == FOURCC_LIST && ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL) && chunk.id == DMUS_FOURCC_SCRIPTTRACKEVENTS_LIST) { - TRACE("'scrl': script events list\n"); - ListSize2 = chunk.size - sizeof(FOURCC); /* list content size = size of 'LIST' chunk - FOURCC ID of the list */ - ListCount2 = 0; - do { - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); - ListCount2 += sizeof(FOURCC) + sizeof(DWORD) + chunk.size; - if (chunk.id == FOURCC_LIST && ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL) && chunk.id == DMUS_FOURCC_SCRIPTTRACKEVENT_LIST) { - TRACE("'scre': script event list\n"); - ListSize3 = chunk.size - sizeof(FOURCC); /* list content size = size of 'LIST' chunk - FOURCC ID of the list */ - ListCount3 = 0; - do { - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); - ListCount3 += sizeof(FOURCC) + sizeof(DWORD) + chunk.size; - switch (chunk.id) - { - case DMUS_FOURCC_SCRIPTTRACKEVENTHEADER_CHUNK: { - TRACE("'scrh': event header\n"); - ReadFile (fd, &event.header, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> dwFlags = %ld; lTimeLogical = %li; lTimePhysical = %li\n", \ - event.header.dwFlags, event.header.lTimeLogical, event.header.lTimePhysical); - break; - } case FOURCC_LIST: { - TRACE("'LIST': list\n"); - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - if (chunk.id == DMUS_FOURCC_REF_LIST){ - TRACE("'DMRF': reference list (forward to DMUSIC_FillReferenceFromFileHandle(...)\n"); - SetFilePointer (fd, -(sizeof(DWORD) + 2*sizeof(FOURCC)), NULL, FILE_CURRENT); /* place pointer before 'LIST' chunk */ - DMUSIC_FillReferenceFromFileHandle (event.reference, fd); - } else { - WARN("invalid chunk (only 'DMRF' chunk allwed)\n"); - } - break; - } case DMUS_FOURCC_SCRIPTTRACKEVENTNAME_CHUNK: { - TRACE("'scrn': routine name\n"); - event.name = (WCHAR*) HeapAlloc (GetProcessHeap (), 0, chunk.size); - ReadFile (fd, event.name, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> routine name = %s\n", debugstr_w (event.name)); - break; - } default: { - WARN("invalid chunk (only 'scrh', 'scrn' and 'LIST' chunk allowed)\n"); - break; - } - } - TRACE("ListCount3 (%ld) < ListSize3 (%ld)\n", ListCount3, ListSize3); - } while (ListCount3 < ListSize3); - } else { - WARN("invalid chunk (only 'scre' chunk allowed)\n"); - } - TRACE("ListCount2 (%ld) < ListSize2 (%ld)\n", ListCount2, ListSize2); - } while (ListCount2 < ListSize2); - } else { - WARN("invalid chunk (only 'scrl' chunk allowed)\n"); - } - TRACE("ListCount (%ld) < ListSize (%ld)\n", ListCount, ListSize); - } while (ListCount < ListSize); - break; - } case DMUS_FOURCC_SEGTRACK_LIST: { - TRACE("'segt': segment trigger track list\n"); - do { - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); - ListCount += sizeof(FOURCC) + sizeof(DWORD) + chunk.size; - switch (chunk.id) - { - case DMUS_FOURCC_SEGTRACK_CHUNK: { - TRACE("'sgth': segment track header\n"); - ReadFile (fd, &segTriggerTrack.header, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> dwFlags = %ld\n", segTriggerTrack.header.dwFlags); - break; - } case FOURCC_LIST: { - TRACE("'LIST': list\n"); - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - if (chunk.id == DMUS_FOURCC_SEGMENTS_LIST) { - TRACE("'lsgl': segment lists list\n"); - ListSize2 = chunk.size - sizeof(FOURCC); /* list content size = size of 'LIST' chunk - FOURCC ID of the list */ - ListCount2 = 0; - do { - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); - ListCount2 += sizeof(FOURCC) + sizeof(DWORD) + chunk.size; - if (chunk.id == FOURCC_LIST && ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL) && chunk.id == DMUS_FOURCC_SEGMENT_LIST) { - ListSize3 = chunk.size - sizeof(FOURCC); - ListCount3 = 0; - do { - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); - ListCount3 += sizeof(FOURCC) + sizeof(DWORD) + chunk.size; - switch (chunk.id) - { - case DMUS_FOURCC_SEGMENTITEM_CHUNK: { - TRACE("'sgih': segment item header\n"); - ReadFile (fd, &segTriggerTrack.itemHeader, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> lTimeLogical = %li; lTimePhysical = %li; dwPlayFlags = %ld; dwFlags = %ld\n", \ - segTriggerTrack.itemHeader.lTimeLogical, segTriggerTrack.itemHeader.lTimePhysical, \ - segTriggerTrack.itemHeader.dwPlayFlags, segTriggerTrack.itemHeader.dwFlags); - break; - } case DMUS_FOURCC_SEGMENTITEMNAME_CHUNK: { - TRACE("'snam': motif name\n"); - segTriggerTrack.motifName = (WCHAR*) HeapAlloc (GetProcessHeap (), 0, chunk.size); - ReadFile (fd, segTriggerTrack.motifName, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> motif name = %s\n", debugstr_w (segTriggerTrack.motifName)); - break; - } case FOURCC_LIST: { - TRACE("'LIST': list\n"); - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - if (chunk.id == DMUS_FOURCC_REF_LIST) { - TRACE("'DMRF': reference list (forward to DMUSIC_FillReferenceFromFileHandle(...)\n"); - SetFilePointer (fd, -(sizeof(DWORD) + 2*sizeof(FOURCC)), NULL, FILE_CURRENT); /* place pointer before 'LIST' chunk */ - DMUSIC_FillReferenceFromFileHandle (segTriggerTrack.reference, fd); - } else { - WARN("invalid chunk (only 'DMRF' chunk allowed)\n"); - } - break; - } default: { - WARN("invalid chunk (only 'sgih', 'snam' and 'LIST' chunks allowed)\n"); - break; - } - } - TRACE("ListCount3 (%ld) < ListSize3 (%ld)\n", ListCount3, ListSize3); - } while (ListCount3 < ListSize3); - } else { - WARN("invalid chunk (only 'lseg' chunk allowed)\n"); - } - TRACE("ListCount2 (%ld) < ListSize2 (%ld)\n", ListCount2, ListSize2); - } while (ListCount2 < ListSize2); - } else { - WARN("invalid chunk (only 'lsgl' chunk allowed\n"); - } - break; - } default: { - WARN("invalid chunk (only 'sgth' and 'LIST' chunks allowed)\n"); - break; - } - } - TRACE("ListCount (%ld) < ListSize (%ld)\n", ListCount, ListSize); - } while (ListCount < ListSize); - break; - } case DMUS_FOURCC_TIMESIGTRACK_LIST: { - TRACE("'TIMS': time signature track list\n"); - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - if (chunk.id == DMUS_FOURCC_TIMESIGNATURE_TRACK) { - TRACE("'tims': time signatures\n"); - timeSigTrack.nrofitems = chunk.size - sizeof(DWORD); - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); - if (chunk.size != sizeof(DMUS_IO_TIMESIGNATURE_ITEM)) - WARN("there seem to be a problem: file claims that size of DMUSIC_IO_TEMPO_ITEM is %ld, while real sizeof returns %i\n", chunk.size, sizeof(DMUS_IO_TIMESIGNATURE_ITEM)); - timeSigTrack.nrofitems /= chunk.size; - TRACE_(dmfiledat)("=> number of items = %ld\n", timeSigTrack.nrofitems); - timeSigTrack.items = (DMUS_IO_TIMESIGNATURE_ITEM*) HeapAlloc (GetProcessHeap (), 0, chunk.size * timeSigTrack.nrofitems); - ReadFile(fd, timeSigTrack.items, chunk.size * timeSigTrack.nrofitems, &BytesRead, NULL); - for (i = 0; i < timeSigTrack.nrofitems; i++) - { - TRACE_(dmfiledat)("=> time signature[%i]: lTime = %li; bBeatsPerMeasure = %i; bBeat = %i; wGridsPerBeat = %d\n", \ - i, timeSigTrack.items[i].lTime, timeSigTrack.items[i].bBeatsPerMeasure, timeSigTrack.items[i].bBeat, timeSigTrack.items[i].wGridsPerBeat); - } - } else { - WARN("invalid chunk (only 'tims' chunk allowed)\n"); - } - break; - } case DMUS_FOURCC_WAVETRACK_LIST: { - TRACE("'wavt': wave track list\n"); - do { - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); - ListCount += sizeof(FOURCC) + sizeof(DWORD) + chunk.size; - switch (chunk.id) - { - case DMUS_FOURCC_WAVETRACK_CHUNK: { - TRACE("'wath': wave track header\n"); - ReadFile (fd, &waveTrack.header, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> lVolume = %li; dwFlags = %ld\n", waveTrack.header.lVolume, waveTrack.header.dwFlags); - break; - } case FOURCC_LIST: { - TRACE("'LIST': list\n"); - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - if (chunk.id == DMUS_FOURCC_WAVEPART_LIST) { - TRACE("'wavp': wave parts list\n"); - ListSize2 = chunk.size - sizeof(FOURCC); - ListCount2 = 0; - do { - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); - ListCount2 += sizeof(FOURCC) + sizeof(DWORD) + chunk.size; - switch (chunk.id) - { - case DMUS_FOURCC_WAVEPART_CHUNK: { - TRACE("'waph': wave part header\n"); - ReadFile (fd, &waveTrack.partHeader, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> lVolume = %li; dwVariations = %ld; dwPChannel = %ld; dwLockToPart = %ld; dwFlags = %ld; dwIndex = %ld\n", \ - waveTrack.partHeader.lVolume, waveTrack.partHeader.dwVariations, waveTrack.partHeader.dwPChannel, \ - waveTrack.partHeader.dwLockToPart, waveTrack.partHeader.dwFlags, waveTrack.partHeader.dwIndex); - break; - } case FOURCC_LIST: { - TRACE("'LIST': list\n"); - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - if (chunk.id == DMUS_FOURCC_WAVEITEM_LIST) { - TRACE("'wavi': wave items list\n"); - ListSize3 = chunk.size - sizeof(FOURCC); - ListCount3 = 0; - do { - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); - ListCount3 += sizeof(FOURCC) + sizeof(DWORD) + chunk.size; - if (chunk.id == FOURCC_LIST && ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL) && chunk.id == DMUS_FOURCC_WAVE_LIST) { - TRACE("'wave': wave item list\n"); - ListSize4 = chunk.size - sizeof(FOURCC); /* list content size = size of 'LIST' chunk - FOURCC ID of the list */ - ListCount4 = 0; /* reset */ - do { - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); - ListCount4 += sizeof(FOURCC) + sizeof(DWORD) + chunk.size; - switch (chunk.id) - { - case DMUS_FOURCC_WAVEITEM_CHUNK: { - TRACE("'waih': wave item header\n"); - ReadFile (fd, &waveTrack.itemHeader, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> lVolume = %li; lPitch = %li; dwVariations = %ld; rtTime = FIXME; rtStartOffset = FIXME; rtReserved = FIXME; rtDuration = FIXME; mtLogicalTime = %li; dwLoopStart = %ld; dwLoopEnd = %ld; dwFlags = %ld\n", \ - waveTrack.itemHeader.lVolume, waveTrack.itemHeader.lPitch, waveTrack.itemHeader.dwVariations, /*waveTrack.itemHeader.rtTime, \ - waveTrack.itemHeader.rtStartOffset, waveTrack.itemHeader.rtReserved, waveTrack.itemHeader.rtDuration, */waveTrack.itemHeader.mtLogicalTime, \ - waveTrack.itemHeader.dwLoopStart, waveTrack.itemHeader.dwLoopEnd, waveTrack.itemHeader.dwFlags); - break; - } case mmioFOURCC('w','v','c','u'): { - FIXME("'wvcu': undocumented and unknown chunk type (skipping)\n"); - SetFilePointer (fd, chunk.size, NULL, FILE_CURRENT); /* skip */ - break; - } case FOURCC_LIST: { - TRACE("'LIST': list\n"); - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - if (chunk.id == DMUS_FOURCC_REF_LIST) { - TRACE("'DMRF': reference list (forward to DMUSIC_FillReferenceFromFileHandle(...)\n"); - SetFilePointer (fd, -(sizeof(DWORD) + 2*sizeof(FOURCC)), NULL, FILE_CURRENT); /* place pointer before 'LIST' chunk */ - DMUSIC_FillReferenceFromFileHandle (waveTrack.reference, fd); - } else { - WARN ("invalid chunk (only 'DMRF' chunk allowed\n"); - } - break; - } default: { - WARN("invalid chunk (only 'waih' and 'LIST' (and undocumented 'wvcu') chunks allowed)\n"); - } - } - TRACE("ListCount4 (%ld) < ListSize4 (%ld)\n", ListCount4, ListSize4); - } while (ListCount4 < ListSize4); - } else { - WARN("invalid chunk (only 'wave' chunk allowed)\n"); - } - TRACE("ListCount3 (%ld) < ListSize3 (%ld)\n", ListCount3, ListSize3); - } while (ListCount3 < ListSize3); - } else { - WARN("invalid chunk (only 'wavi' chunk allowed)\n"); - } - break; - } default: { - WARN("invalid chunk (only 'waph' and 'LIST' chunks allowed)\n"); - break; - } - } - TRACE("ListCount2 (%ld) < ListSize2 (%ld)\n", ListCount2, ListSize2); - } while (ListCount2 < ListSize2); - } else { - WARN("invalid chunk (only 'wavp' chunk allwed)\n"); - } - break; - } default: { - WARN("invalid chunk (only 'wath' and 'LIST' chunks allowed)\n"); - break; - } - } - TRACE("ListCount (%ld) < ListSize (%ld)\n", ListCount, ListSize); - } while (ListCount < ListSize); - break; - } default: { - WARN ("invalid chunk (only 'UNFO', 'cord', 'sttr', 'pftr', 'lyrt', 'MARK' and 'mfrm' chunks allowed)\n"); - break; - } - } - break; - } case FOURCC_RIFF: { - TRACE("'RIFF': embedded RIFF chunk (probably band track form)\n"); - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - if (chunk.id == DMUS_FOURCC_BANDTRACK_FORM) { - TRACE("'DMBT': band track form\n"); - FileSize2 = chunk.size - sizeof(FOURCC); - do { - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); - FileCount2 += sizeof(FOURCC) + sizeof(DWORD) + chunk.size; - switch (chunk.id) - { - case DMUS_FOURCC_BANDTRACK_CHUNK: { - TRACE("'dbth': band track header\n"); - ReadFile (fd, &bandTrack.header, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> bAutoDownload = %d\n", bandTrack.header.bAutoDownload); - break; - } case DMUS_FOURCC_GUID_CHUNK: { - TRACE("'guid': GUID\n"); - ReadFile (fd, &bandTrack.guid, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> GUID = %s\n", debugstr_guid (&bandTrack.guid)); - break; - } case DMUS_FOURCC_VERSION_CHUNK: { - TRACE("'vers': version\n"); - ReadFile (fd, &bandTrack.version, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> version = %ld%ld\n", bandTrack.version.dwVersionMS, bandTrack.version.dwVersionLS); - break; - } case FOURCC_LIST: { - TRACE("'LIST': list (content size = %ld)\n", chunk.size); - ListSize = chunk.size - sizeof(FOURCC); - ListCount = 0; - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - switch (chunk.id) - { - case DMUS_FOURCC_UNFO_LIST:{ - TRACE("'UNFO': UNFO list (forward to DMUSIC_FillUNFOFromFileHandle)\n"); - SetFilePointer (fd, -(sizeof(DWORD) + 2*sizeof(FOURCC)), NULL, FILE_CURRENT); /* place pointer before 'LIST' chunk */ - DMUSIC_FillUNFOFromFileHandle (UNFO, fd); - break; - } case DMUS_FOURCC_BANDS_LIST: { - TRACE("'lbdl': bands list (content size = %ld)\n", ListSize); - do { - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); - ListCount += sizeof(FOURCC) + sizeof(DWORD) + chunk.size; - if (chunk.id == FOURCC_LIST && ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL) && chunk.id == DMUS_FOURCC_BAND_LIST) { - ListSize2 = chunk.size - sizeof(FOURCC); - ListCount2 = 0; - TRACE("'lbnd': band list (content size = %ld)\n", ListSize2); - do { - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); - ListCount2 += sizeof(FOURCC) + sizeof(DWORD) + chunk.size; - switch (chunk.id) - { - case DMUS_FOURCC_BANDITEM_CHUNK: { - TRACE("'bdih': old band header\n"); - ReadFile (fd, &bandTrack.header1, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> lBandTime = %li\n", bandTrack.header1.lBandTime); - break; - } case DMUS_FOURCC_BANDITEM_CHUNK2: { - TRACE("'bd2h': new band header\n"); - ReadFile (fd, &bandTrack.header2, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> lBandTimeLogical = %li; lBandTimePhysical = %li\n", \ - bandTrack.header2.lBandTimeLogical, bandTrack.header2.lBandTimePhysical); - break; - } case FOURCC_RIFF: { - TRACE("'RIFF': embedded RIFF (size = %ld; could be embedded band form)\n", chunk.size); - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - if (chunk.id == DMUS_FOURCC_BAND_FORM) { - TRACE("'DMBD': embedded band form (forward to DMUSIC_FillBandFromFileHandle)\n"); - SetFilePointer (fd, -(sizeof(DWORD) + 2*sizeof(FOURCC)), NULL, FILE_CURRENT); /* place pointer before 'RIFF' chunk */ - DMUSIC_FillBandFromFileHandle (NULL, fd); - } else WARN("invalid chunk (only 'DMBD' chunk allowed)\n"); - break; - } default: { - WARN("invalid chunk (only 'bdih', 'bd2h' and 'RIFF' chunks allowed)\n"); - break; - } - } - TRACE("ListCount2 (%ld) < ListSize2 (%ld)\n", ListCount2, ListSize2); - } while (ListCount2 < ListSize2); - } else WARN("unknown chunk - expect error\n"); - - } while (ListCount < ListSize); - break; - } default: { - WARN("invalid chunk (only 'UNFO' and 'lbdl' chunks allowed)\n"); - } - } - break; - } default: { - WARN("invalid chunk (only 'dbth', 'guid', 'vers' and 'LIST' chunks allowed)\n"); - break; - } - } - TRACE("FileCount2 (%ld) < FileSize2 (%ld)\n", FileCount2, FileSize2); - } while (FileCount2 < FileSize2); - } else { - WARN("invalid chunk (only 'DMBT' chunk allowed\n"); - } - break; - } case DMUS_FOURCC_COMMANDTRACK_CHUNK: { - TRACE("'cmnd': command track\n"); - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); /* read sizeof(DMUS_IO_COMMAND) */ - ReadFile (fd, &command, chunk.size, &BytesRead, NULL); /* read DMUS_IO_COMMAND */ - TRACE_(dmfiledat)("wMeasure = %d; bBeat = %i; bCommand = %i; bGrooveLevel = %i; bGrooveRange = %i; bRepeatMode = %i\n", \ - command.wMeasure, command.bBeat, command.bCommand, command.bGrooveLevel, command.bGrooveRange, command.bRepeatMode); - break; - } case DMUS_FOURCC_MUTE_CHUNK: { - FIXME("'mute': mute track chunk: not supported yet\n"); - break; - } case DMUS_FOURCC_PATTERN_FORM: { - FIXME("'DMPT': pattern track form: not supported yet\n"); - break; - } case DMUS_FOURCC_SEQ_TRACK: { - FIXME("'seqt': sequence track chunk: not supported yet\n"); - break; - } case DMUS_FOURCC_SIGNPOST_TRACK_CHUNK: { - FIXME("'sgnp': signpost track chunk: not supported yet\n"); - break; - } case DMUS_FOURCC_SYSEX_TRACK: { - FIXME("'syex': sysex track chunk: not supported yet\n"); - break; - } case DMUS_FOURCC_TEMPO_TRACK: { - TRACE("'tetr': tempo track chunk\n"); - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); - if (chunk.size != sizeof(DMUS_IO_TEMPO_ITEM)) - WARN("there seem to be a problem: file claims that size of DMUSIC_IO_TEMPO_ITEM is %ld, while real sizeof returns %i\n", \ - chunk.size, sizeof(DMUS_IO_TEMPO_ITEM)); - ReadFile (fd, &tempo, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> lTime = %ld; dblTempo = %f\n", tempo.lTime, tempo.dblTempo); - break; - } default: { - WARN("invalid chunk (too many too list)\n"); - break; - } - } - TRACE("FileCount (%ld) < FileSize (%ld)\n", FileCount, FileSize); - } while (FileCount < FileSize); - } else { - WARN("invalid chunk (only 'DMTK' chunk allowed)\n"); - } - } else { - WARN("'RIFF' not found: not a RIFF file\n"); - } - - return S_OK; -} - -/****************************************************************************** - * DMUSIC_FillSegmentFromFileHandle: - * - fills a IDirectMusicSegment8Impl struct with data from file handle. - * - IMPORTANT: it expects a RIFF chunk at beginning, so if you are calling it - * from another DMUSIC_Fill* function, make sure pointer is at - * correct place! - * - TODO: replace data in function with data in IDirectMusicSegmentImpl - * implement loading for missing (empty) clauses - */ -HRESULT WINAPI DMUSIC_FillSegmentFromFileHandle (IDirectMusicSegment8Impl *segment, HANDLE fd) -{ - rawChunk chunk; - DWORD BytesRead, ListCount = 0, ListSize, FileCount = 0, FileSize; - /* FIXME: Replace stuff located below with the stuff in segment */ - UNFO_List UNFO; - DMUS_IO_SEGMENT_HEADER header; - DMUS_IO_VERSION version; - GUID guid; - - TRACE("reading 'RIFF' chunk...\n"); - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - if (chunk.id == FOURCC_RIFF) { - TRACE("'RIFF': RIFF file\n"); - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); /* read size of 'RIFF' chunk */ - FileSize = chunk.size - sizeof(FOURCC); /* file content size = size of 'RIFF' chunk - FOURCC ID of following form */ - TRACE("reading chunks ...\n"); - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); /* read ID of following form */ - if (chunk.id == DMUS_FOURCC_SEGMENT_FORM) { - TRACE("DMSG: segment form\n"); - do { - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); - FileCount += chunk.size + sizeof(DWORD) + sizeof(FOURCC); - switch (chunk.id) - { - case DMUS_FOURCC_SEGMENT_CHUNK: { - TRACE("segh: segment header\n"); - ReadFile (fd, &header, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> dwRepeats = %ld; mtLength = %li; mtPlayStart = %li; mtLoopStart = %li; mtLoopEnd = %li; dwResolution = %ld; rtLength = FIXME; dwFlags = %ld; dwReserved = %ld\n", \ - header.dwRepeats, header.mtLength, header.mtPlayStart, header.mtLoopStart, header.mtLoopEnd, header.dwResolution/*, header.rtLength*/, header.dwFlags, header.dwReserved); - break; - } case DMUS_FOURCC_GUID_CHUNK: { - TRACE("'guid': GUID\n"); - ReadFile (fd, &guid, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> GUID = %s\n", debugstr_guid(&guid)); - break; - } case DMUS_FOURCC_VERSION_CHUNK: { - TRACE("'vers': version\n"); - ReadFile (fd, &version, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> version = %ld%ld\n", version.dwVersionMS, version.dwVersionLS); - break; - } case FOURCC_LIST:{ - TRACE("'LIST': list (size) = %ld\n", chunk.size); - ListSize = chunk.size - sizeof(FOURCC); /* list content size = size of 'LIST' chunk - FOURCC ID of the list */ - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - switch (chunk.id) - { - case DMUS_FOURCC_UNFO_LIST: { - TRACE("'UNFO': UNFO list (forward to DMUSIC_FillUNFOFromFileHandle(...))\n"); - SetFilePointer (fd, -(sizeof(DWORD) + 2*sizeof(FOURCC)), NULL, FILE_CURRENT); /* place pointer before the 'LIST' chunk */ - DMUSIC_FillUNFOFromFileHandle (UNFO, fd); - break; - } case DMUS_FOURCC_TRACK_LIST: { - TRACE("'trkl': track list chunk (forward)\n"); - do { - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); /* read RIFF */ - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); /* read track size */ - TRACE("track size = %ld\n", chunk.size); - ListCount += chunk.size + sizeof(DWORD) + sizeof(FOURCC); - SetFilePointer (fd, -(sizeof(DWORD) + sizeof(FOURCC)), NULL, FILE_CURRENT); /* place pointer before the 'RIFF' chunk */ - DMUSIC_FillTrackFromFileHandle (NULL, fd); /* read encapsulated track as if it was in a track file */ - TRACE("(Track) List Count = %ld < (Track) List Size = %ld\n", ListCount, ListSize); - } while (ListCount < ListSize); - break; - } - } - break; - } case FOURCC_RIFF: { - TRACE("'RIFF': embedded RIFF (size = %ld; could be embedded container form)\n", chunk.size); - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - if (chunk.id == DMUS_FOURCC_CONTAINER_FORM) { - TRACE("'DMCN': embedded container form (forward to DMUSIC_FillContainerFromFileHandle(...))\n"); - SetFilePointer (fd, -(sizeof(DWORD) + 2*sizeof(FOURCC)), NULL, FILE_CURRENT); /* place pointer before 'RIFF' chunk */ - DMUSIC_FillContainerFromFileHandle (NULL, fd); - } else WARN("invalid chunk (only 'DMCN' chunk allowed)\n"); - break; - } case DMUS_FOURCC_TOOLGRAPH_FORM: { - FIXME("'DMTG': toolgraph chunk: not supported yet\n"); - break; - } case DMUS_FOURCC_AUDIOPATH_FORM: { - FIXME("'DMAP': audiopath chunk: not supported yet\n"); - break; - } default: { - WARN("invalid chunk (only 'segh', 'guid', 'vers', 'LIST', 'RIFF', 'DMTG' and 'DMAP' chunks allowed)\n"); - break; - } - } - TRACE("FileCount (%ld) < FileSize (%ld)\n", FileCount, FileSize); - } while (FileCount < FileSize); - } else { - WARN("invalid chunk (only 'DMSG' chunk allowed)\n"); - } - } else { - WARN("'RIFF' not found: not a RIFF file\n"); - } - - return S_OK; -} - - /****************************************************************************** - * DMUSIC_FillScriptFromFileHandle: - * - fills a IDirectMusicScriptImpl struct with data from file handle. - * - IMPORTANT: it expects a RIFF chunk at beginning, so if you are calling it - * from another DMUSIC_Fill* function, make sure pointer is at - * correct place! - * - TODO: replace data in function with data in IDirectMusicScriptImpl - */ - -HRESULT WINAPI DMUSIC_FillScriptFromFileHandle (IDirectMusicScriptImpl *script, HANDLE fd) -{ - rawChunk chunk; - DWORD BytesRead/*, ListCount = 0*/, ListSize, FileCount = 0, FileSize; - /* FIXME: Replace stuff located below with the stuff in script */ - UNFO_List UNFO; - DMUS_IO_SCRIPT_HEADER header; - DMUS_IO_VERSION version, scriptversion; - GUID guid; - WCHAR* scriptlang; - WCHAR* scriptsrc; - Reference scriptsrcref; - - TRACE("reading 'RIFF' chunk...\n"); - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - if (chunk.id == FOURCC_RIFF) { - TRACE("'RIFF': RIFF file\n"); - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); /* read size of 'RIFF' chunk */ - FileSize = chunk.size - sizeof(FOURCC); /* file content size = size of 'RIFF' chunk - FOURCC ID of following form */ - TRACE("reading chunks ...\n"); - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); /* read ID of following form */ - if (chunk.id == DMUS_FOURCC_SCRIPT_FORM) { - TRACE("'DMSC': script form\n"); - do { - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); - FileCount += chunk.size + sizeof(DWORD) + sizeof(FOURCC); - switch (chunk.id) - { - case DMUS_FOURCC_SCRIPT_CHUNK: { - TRACE("'schd': script header\n"); - ReadFile (fd, &header, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> dwFlags = %ld\n", header.dwFlags); - break; - } case DMUS_FOURCC_GUID_CHUNK: { - TRACE("'guid': GUID\n"); - ReadFile (fd, &guid, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> GUID = %s\n", debugstr_guid(&guid)); - break; - } case DMUS_FOURCC_VERSION_CHUNK: { - TRACE("'vers': version\n"); - ReadFile (fd, &version, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> version = %ld%ld\n", version.dwVersionMS, version.dwVersionLS); - break; - } case FOURCC_LIST:{ - TRACE("'LIST': list (size) = %ld\n", chunk.size); - ListSize = chunk.size - sizeof(FOURCC); /* list content size = size of 'LIST' chunk - FOURCC ID of the list */ - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - switch (chunk.id) - { - case DMUS_FOURCC_UNFO_LIST: { - TRACE("'UNFO': UNFO list (forward to DMUSIC_FillUNFOFromFileHandle(...))\n"); - SetFilePointer (fd, -(sizeof(DWORD) + 2*sizeof(FOURCC)), NULL, FILE_CURRENT); /* place pointer before the 'LIST' chunk */ - DMUSIC_FillUNFOFromFileHandle (UNFO, fd); - break; - } case DMUS_FOURCC_REF_LIST: { - TRACE("'DMRF': reference list (forward to DMUSIC_FillReferenceFromFileHandle(...)\n"); - SetFilePointer (fd, -(sizeof(DWORD) + 2*sizeof(FOURCC)), NULL, FILE_CURRENT); /* place pointer before 'LIST' chunk */ - DMUSIC_FillReferenceFromFileHandle (scriptsrcref, fd); - } default: { - WARN("invalid chunk (only 'UNFO' and 'DMRF' chunks allowed)\n"); - } - } - break; - } case DMUS_FOURCC_SCRIPTVERSION_CHUNK: { - TRACE("'scve': DirectMusic version\n"); - ReadFile (fd, &scriptversion, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> script version = %ld%ld\n", scriptversion.dwVersionMS, scriptversion.dwVersionLS); - break; - } case FOURCC_RIFF: { - TRACE("'RIFF': embedded RIFF (size = %ld; could be embedded container form)\n", chunk.size); - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - if (chunk.id == DMUS_FOURCC_CONTAINER_FORM) { - TRACE("'DMCN': embedded container form (forward to DMUSIC_FillContainerFromFileHandle(...))\n"); - SetFilePointer (fd, -(sizeof(DWORD) + 2*sizeof(FOURCC)), NULL, FILE_CURRENT); /* place pointer before 'RIFF' chunk */ - DMUSIC_FillContainerFromFileHandle (NULL, fd); - } else WARN("invalid chunk (only 'DMCN' chunk allowed)\n"); - break; - } case DMUS_FOURCC_SCRIPTLANGUAGE_CHUNK: { - TRACE("'scla': scripting language\n"); - scriptlang = (WCHAR*) HeapAlloc (GetProcessHeap (), 0, chunk.size); /* allocate space */ - ReadFile (fd, scriptlang, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("script language = %s\n", debugstr_w(scriptlang)); - break; - } case DMUS_FOURCC_SCRIPTSOURCE_CHUNK: { - TRACE("'scsr': script source\n"); - scriptsrc = (WCHAR*) HeapAlloc (GetProcessHeap (), 0, chunk.size); /* allocate space */ - ReadFile (fd, scriptsrc, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("script source = %s\n", debugstr_w(scriptsrc)); - break; - } default: { - WARN("invalid chunk (only 'schd', 'guid', 'vers', 'LIST', 'scve', 'RIFF' and 'scla' chunks allowed)\n"); - break; - } - } - TRACE("FileCount (%ld) < FileSize (%ld)\n", FileCount, FileSize); - } while (FileCount < FileSize); - } else { - WARN("invalid chunk (only 'DMSC' chunk allowed)\n"); - } - } else { - WARN("'RIFF' not found: not a RIFF file\n"); - } - - return S_OK; -} - -/****************************************************************************** - * DMUSIC_FillContainerFromFileHandle: - * - fills a IDirectMusicContainerImpl struct with data from file handle. - * - IMPORTANT: it expects a RIFF chunk at beginning, so if you are calling it - * from another DMUSIC_Fill* function, make sure pointer is at - * correct place! - * - TODO: replace data in function with data in IDirectMusicContainerImpl - */ -HRESULT WINAPI DMUSIC_FillContainerFromFileHandle (IDirectMusicContainerImpl *container, HANDLE fd) -{ - rawChunk chunk; - DWORD BytesRead, ListCount = 0, ListSize, ListCount2 = 0, ListSize2, FileCount = 0, FileSize; - /* FIXME: Replace stuff located below with the stuff in container */ - UNFO_List UNFO; - DMUS_IO_CONTAINER_HEADER header; - DMUS_IO_VERSION version; - GUID guid; - WCHAR* alias; - DMUS_IO_CONTAINED_OBJECT_HEADER objheader; - Reference dataref; - - TRACE("reading 'RIFF' chunk...\n"); - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - if (chunk.id == FOURCC_RIFF) { - TRACE("'RIFF': RIFF file\n"); - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); /* read size of 'RIFF' chunk */ - FileSize = chunk.size - sizeof(FOURCC); /* file content size = size of 'RIFF' chunk - FOURCC ID of following form */ - TRACE("reading chunks ...\n"); - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); /* read ID of following form */ - if (chunk.id == DMUS_FOURCC_CONTAINER_FORM) { - TRACE("'DMCN': container form\n"); - do { - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); - FileCount += chunk.size + sizeof(DWORD) + sizeof(FOURCC); - switch (chunk.id) - { - case DMUS_FOURCC_CONTAINER_CHUNK: { - TRACE("'conh': container header\n"); - ReadFile (fd, &header, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> dwFlags = %ld\n", header.dwFlags); - break; - } case DMUS_FOURCC_GUID_CHUNK: { - TRACE("'guid': GUID\n"); - ReadFile (fd, &guid, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> GUID = %s\n", debugstr_guid(&guid)); - break; - } case DMUS_FOURCC_VERSION_CHUNK: { - TRACE("'vers': version\n"); - ReadFile (fd, &version, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> version = %ld%ld\n", version.dwVersionMS, version.dwVersionLS); - break; - } case FOURCC_LIST:{ - TRACE("'LIST': list (size) = %ld\n", chunk.size); - ListSize = chunk.size - sizeof(FOURCC); /* list content size = size of 'LIST' chunk - FOURCC ID of the list */ - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - switch (chunk.id) - { - case DMUS_FOURCC_UNFO_LIST: { - TRACE("'UNFO': UNFO list (forward to DMUSIC_FillUNFOFromFileHandle(...))\n"); - SetFilePointer (fd, -(sizeof(DWORD) + 2*sizeof(FOURCC)), NULL, FILE_CURRENT); /* place pointer before the 'LIST' chunk */ - DMUSIC_FillUNFOFromFileHandle (UNFO, fd); - break; - } case DMUS_FOURCC_CONTAINED_OBJECTS_LIST: { - TRACE("'cosl': objects list (content size = %ld)\n", ListSize); - do { - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); - ListCount += sizeof(FOURCC) + sizeof(DWORD) + chunk.size; - if (chunk.id == FOURCC_LIST && ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL) && chunk.id == DMUS_FOURCC_CONTAINED_OBJECT_LIST) { - ListSize2 = chunk.size - sizeof(FOURCC); /* list content size = size of 'LIST' chunk - FOURCC ID of the list */ - ListCount2 = 0; /* reset */ - TRACE("'cobl': object (content size = %ld)\n", ListSize2); - do { - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); - ListCount2 += sizeof(FOURCC) + sizeof(DWORD) + chunk.size; - switch (chunk.id) - { - case DMUS_FOURCC_CONTAINED_ALIAS_CHUNK: { - TRACE("'coba': alias (size = %ld)\n", chunk.size); - alias = (WCHAR*) HeapAlloc (GetProcessHeap (), 0, chunk.size); /* allocate space */ - ReadFile (fd, alias, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> alias = %s\n", debugstr_w(alias)); - break; - } case DMUS_FOURCC_CONTAINED_OBJECT_CHUNK: { - TRACE("'cobh': object header (size = %ld)\n", chunk.size); - ReadFile (fd, &objheader, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> guidClassID = %s; dwFlags = %ld; ckid = %ld; fccType = %ld\n", \ - debugstr_guid(&objheader.guidClassID), objheader.dwFlags, objheader.ckid, objheader.fccType); - break; - } case FOURCC_LIST: { - TRACE("'LIST': list chunk (size = %ld)\n", chunk.size); - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - if (chunk.id == DMUS_FOURCC_REF_LIST) { - TRACE("'DMRF': reference list (instead of 'data' chunk: size = %ld)\n", chunk.size - 4); /* set pointer at beginning of list */ - SetFilePointer (fd, -(sizeof(DWORD) + 2*sizeof(FOURCC)), NULL, FILE_CURRENT); - DMUSIC_FillReferenceFromFileHandle (dataref, fd); /* forward to DMUSIC_FillReferenceFromFileHandle */ - } else WARN("invalid chunk (only 'DMRF' chunk allowed\n"); - break; - } case FOURCC_RIFF: { - TRACE("'RIFF': encapsulated data (can be 'DMSG' or 'DMSG')\n"); - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - SetFilePointer (fd, -(sizeof(DWORD) + 2*sizeof(FOURCC)), NULL, FILE_CURRENT); /* place pointer before 'RIFF' chunk */ - switch (chunk.id) - { - case DMUS_FOURCC_SEGMENT_FORM: { - TRACE("'DMSG': embedded segment form (forward to DMUSIC_FillSegmentFromFileHandle(...))\n"); - DMUSIC_FillSegmentFromFileHandle (NULL, fd); - break; - } case DMUS_FOURCC_STYLE_FORM: { - TRACE("'DMST': embedded style form (forward to DMUSIC_FillStyleFromFileHandle(...))\n"); - DMUSIC_FillStyleFromFileHandle (NULL, fd); - break; - } case mmioFOURCC('W','A','V','E'): { - FIXME("'WAVE': not yet supported (skipping)\n"); - SetFilePointer (fd, sizeof(FOURCC) + sizeof(DWORD) + chunk.size, NULL, FILE_CURRENT); /* skip */ - break; - } default: { - WARN("invalid chunk (only 'DMSG' and 'DMST' chunks allowed)\n"); - break; - } - } - break; - } default: { - WARN("invalid chunk (only 'coba', 'cobh', 'data' and 'LIST' chunks allowed\n"); - break; - } - } - TRACE("ListCount2 (%ld) < ListSize2 (%ld)\n", ListCount2, ListSize2); - } while (ListCount2 < ListSize2); - } else WARN("invalid chunk (only 'cobl' chunk allowed)\n"); - TRACE("ListCount (%ld) < ListSize (%ld)\n", ListCount, ListSize); - } while (ListCount < ListSize); - break; - } default: { - WARN("invalid chunk (only 'UNFO' and 'cosl' chunks allowed)\n"); - } - } - break; - } default: { - WARN("invalid chunk (only 'schd', 'guid', 'vers', 'LIST', 'scve', 'RIFF' and 'scla' chunks allowed)\n"); - break; - } - } - TRACE("FileCount (%ld) < FileSize (%ld)\n", FileCount, FileSize); - } while (FileCount < FileSize); - } else { - WARN("invalid chunk (only 'DMSC' chunk allowed)\n"); - } - } else { - WARN("'RIFF' not found: not a RIFF file\n"); - } - - return S_OK; -} - -/****************************************************************************** - * DMUSIC_FillStyleFromFileHandle: - * - fills a IDirectMusicStyle8Impl struct with data from file handle. - * - IMPORTANT: it expects a RIFF chunk at beginning, so if you are calling it - * from another DMUSIC_Fill* function, make sure pointer is at - * correct place! - * - TODO: replace data in function with data in IDirectMusicStyleImpl - */ -HRESULT WINAPI DMUSIC_FillStyleFromFileHandle (IDirectMusicStyle8Impl *style, HANDLE fd) -{ - rawChunk chunk; - DWORD BytesRead, ListCount = 0, ListSize, ListCount2 = 0, ListSize2, FileCount = 0, FileSize; - int i; - /* FIXME: Replace stuff located below with the stuff in container */ - UNFO_List UNFO; - DMUS_IO_STYLE header; - DMUS_IO_VERSION version; - GUID guid; - Part part; - Pattern pattern; - - TRACE("reading 'RIFF' chunk...\n"); - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - if (chunk.id == FOURCC_RIFF) { - TRACE("'RIFF': RIFF file\n"); - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); /* read size of 'RIFF' chunk */ - FileSize = chunk.size - sizeof(FOURCC); /* file content size = size of 'RIFF' chunk - FOURCC ID of following form */ - TRACE("reading chunks ...\n"); - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); /* read ID of following form */ - if (chunk.id == DMUS_FOURCC_STYLE_FORM) { - TRACE("'DMST': style form\n"); - do { - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); - FileCount += chunk.size + sizeof(DWORD) + sizeof(FOURCC); - - switch (chunk.id) - { - case DMUS_FOURCC_STYLE_CHUNK: { - TRACE("'styh': style header\n"); - ReadFile (fd, &header, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> timeSig.bBeatsPerMeasure = %i; timeSig.bBeat = %i; timeSig.wGridsPerBeat = %d; dblTempo = %f\n", \ - header.timeSig.bBeatsPerMeasure, header.timeSig.bBeat, header.timeSig.wGridsPerBeat, header.dblTempo); - break; - } case DMUS_FOURCC_GUID_CHUNK: { - TRACE("'guid': GUID\n"); - ReadFile (fd, &guid, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> GUID = %s\n", debugstr_guid(&guid)); - break; - } case DMUS_FOURCC_VERSION_CHUNK: { - TRACE("'vers': version\n"); - ReadFile (fd, &version, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> version = %ld%ld\n", version.dwVersionMS, version.dwVersionLS); - break; - } case FOURCC_RIFF: { - TRACE("'RIFF': embedded RIFF (size = %ld; could be embedded band form)\n", chunk.size); - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - if (chunk.id == DMUS_FOURCC_BAND_FORM) { - TRACE("'DMBD': embedded band form (forward to DMUSIC_FillBandFromFileHandle)\n"); - SetFilePointer (fd, -(sizeof(DWORD) + 2*sizeof(FOURCC)), NULL, FILE_CURRENT); /* place pointer before 'RIFF' chunk */ - DMUSIC_FillBandFromFileHandle (NULL, fd); - } else WARN("invalid chunk (only 'DMBD' chunk allowed)\n"); - break; - } case FOURCC_LIST:{ - TRACE("'LIST': list (size) = %ld\n", chunk.size); - ListSize = chunk.size - sizeof(FOURCC); /* list content size = size of 'LIST' chunk - FOURCC ID of the list */ - ListCount = 0; - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - switch (chunk.id) - { - case DMUS_FOURCC_UNFO_LIST: { - TRACE("'UNFO': UNFO list (forward to DMUSIC_FillUNFOFromFileHandle(...))\n"); - SetFilePointer (fd, -(sizeof(DWORD) + 2*sizeof(FOURCC)), NULL, FILE_CURRENT); /* place pointer before the 'LIST' chunk */ - DMUSIC_FillUNFOFromFileHandle (UNFO, fd); - break; - } case DMUS_FOURCC_PART_LIST: { - TRACE("'part': parts list (content size = %ld)\n", ListSize); - do { - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); - ListCount += sizeof(FOURCC) + sizeof(DWORD) + chunk.size; - switch (chunk.id) - { - case DMUS_FOURCC_PART_CHUNK: { - TRACE("'prth': part header\n"); - ReadFile (fd, &part.header, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> timeSig.bBeatsPerMeasure = %i; timeSig.bBeat = %i; timeSig.wGridsPerBeat = %d; dwVariationChoices = %p; guidPartID = %s; wNbrMeasures = %d; bPlayModeFlags = %i; bInvertUpper = %i; bInvertLower = %i; bPad = %p; dwFlags = %ld\n", \ - part.header.timeSig.bBeatsPerMeasure, part.header.timeSig.bBeat, part.header.timeSig.wGridsPerBeat, part.header.dwVariationChoices, \ - debugstr_guid (&part.header.guidPartID), part.header.wNbrMeasures, part.header.bPlayModeFlags, part.header.bInvertUpper, part.header.bInvertLower, \ - part.header.bPad, part.header.dwFlags); - break; - } case DMUS_FOURCC_NOTE_CHUNK: { - TRACE("'note': notes (size = %ld)\n", chunk.size); - part.nrofnotes = chunk.size - sizeof(DWORD); /* pure contents of 'note' (without first DWORD) */ - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); /* read sizeof (DMUS_IO_STYLENOTE) */ - part.nrofnotes /= chunk.size; /* nrofnotes = pure contents / sizeof (DMUS_IO_STYLENOTE) */ - part.notes = (DMUS_IO_STYLENOTE*) HeapAlloc (GetProcessHeap (), 0, chunk.size * part.nrofnotes); - ReadFile (fd, part.notes, chunk.size * part.nrofnotes, &BytesRead, NULL); - TRACE_(dmfiledat)("=> number of notes = %ld\n", part.nrofnotes); - for (i = 0; i < part.nrofnotes; i++) - { - TRACE_(dmfiledat)("=> note[%i]: mtGridStart = %li; dwVariation = %ld; mtDuration = %li; nTimeOffset = %i; wMusicValue = %d; bVelocity = %i; bTimeRange = %i; bDurRange = %i; bVelRange = %i; bInversionID = %i; bPlayModeFlags = %i; bNoteFlags= %i;\n", \ - i, part.notes[i].mtGridStart, part.notes[i].dwVariation, part.notes[i].mtDuration, part.notes[i].nTimeOffset, part.notes[i].wMusicValue, part.notes[i].bVelocity, part.notes[i].bTimeRange, \ - part.notes[i].bDurRange, part.notes[i].bVelRange, part.notes[i].bInversionID, part.notes[i].bPlayModeFlags, part.notes[i].bNoteFlags); - } - break; - } case DMUS_FOURCC_CURVE_CHUNK: { - TRACE("'crve': curves (size = %ld)\n", chunk.size); - part.nrofcurves = chunk.size - sizeof(DWORD); /* pure contents of 'crve' (without first DWORD) */ - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); /* read sizeof (DMUS_IO_STYLECURVE) */ - part.nrofcurves /= chunk.size; /* nrofnotes = pure contents / sizeof (DMUS_IO_STYLECURVE) */ - part.curves = (DMUS_IO_STYLECURVE*) HeapAlloc (GetProcessHeap (), 0, chunk.size * part.nrofcurves); - ReadFile (fd, part.curves, chunk.size * part.nrofcurves, &BytesRead, NULL); - TRACE_(dmfiledat)("=> number of curves = %ld\n", part.nrofcurves); - for (i = 0; i < part.nrofcurves; i++) - { - TRACE_(dmfiledat)("=> curve[%i]: mtGridStart = %li; dwVariation = %ld; mtDuration = %li; mtResetDuration = %li; nTimeOffset = %i; nStartValue = %i; nEndValue = %i; nResetValue = %i; bEventType = %i; bCurveShape = %i; bCCData = %i; bFlags = %i; wParamType = %d;wMergeIndex = %d\n", \ - i, part.curves[i].mtGridStart, part.curves[i].dwVariation, part.curves[i].mtDuration, part.curves[i].mtResetDuration, part.curves[i].nTimeOffset, part.curves[i].nStartValue, part.curves[i].nEndValue, \ - part.curves[i].nResetValue, part.curves[i].bEventType, part.curves[i].bCurveShape, part.curves[i].bCCData, part.curves[i].bFlags, part.curves[i].wParamType, part.curves[i].wMergeIndex); - } - break; - } case DMUS_FOURCC_MARKER_CHUNK: { - TRACE("'mrkr': markers (size = %ld)\n", chunk.size); - part.nrofmarkers = chunk.size - sizeof(DWORD); /* pure contents of 'mrkr' (without first DWORD) */ - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); /* read sizeof (DMUS_IO_STYLEMARKER) */ - part.nrofmarkers /= chunk.size; /* nrofnotes = pure contents / sizeof (DMUS_IO_STYLEMARKER) */ - part.markers = (DMUS_IO_STYLEMARKER*) HeapAlloc (GetProcessHeap (), 0, chunk.size * part.nrofmarkers); - ReadFile (fd, part.markers, chunk.size * part.nrofmarkers, &BytesRead, NULL); - TRACE_(dmfiledat)("=> number of markers = %ld\n", part.nrofmarkers); - for (i = 0; i < part.nrofmarkers; i++) - { - TRACE_(dmfiledat)("=> marker[%i]: mtGridStart = %li; dwVariation = %ld; wMarkerFlags = %d\n", \ - i, part.markers[i].mtGridStart, part.markers[i].dwVariation, part.markers[i].wMarkerFlags); - } - break; - } case DMUS_FOURCC_RESOLUTION_CHUNK: { - TRACE("'rsln': resolutions (size = %ld)\n", chunk.size); - part.nrofresolutions = chunk.size - sizeof(DWORD); /* pure contents of 'rsln' (without first DWORD) */ - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); /* read sizeof (DMUS_IO_STYLERESOLUTION) */ - part.nrofresolutions /= chunk.size; /* nrofnotes = pure contents / sizeof (DMUS_IO_STYLERESOLUTION) */ - part.resolutions = (DMUS_IO_STYLERESOLUTION*) HeapAlloc (GetProcessHeap (), 0, chunk.size * part.nrofresolutions); - ReadFile (fd, part.resolutions, chunk.size * part.nrofresolutions, &BytesRead, NULL); - TRACE_(dmfiledat)("=> number of resolutions = %ld\n", part.nrofresolutions); - for (i = 0; i < part.nrofresolutions; i++) - { - TRACE_(dmfiledat)("=> resolution[%i]: dwVariation = %ld; wMusicValue = %d; bInversionID = %i; bPlayModeFlags = %i", \ - i, part.resolutions[i].dwVariation, part.resolutions[i].wMusicValue, part.resolutions[i].bInversionID, part.resolutions[i].bPlayModeFlags); - } - break; - } case DMUS_FOURCC_ANTICIPATION_CHUNK: { - TRACE("'anpn': anticipations (size = %ld)\n", chunk.size); - part.nrofanticipations = chunk.size - sizeof(DWORD); /* pure contents of 'anpn' (without first DWORD) */ - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); /* read sizeof (DMUS_IO_STYLE_ANTICIPATION) */ - part.nrofanticipations /= chunk.size; /* nrofnotes = pure contents / sizeof (DMUS_IO_STYLE_ANTICIPATION) */ - part.anticipations = (DMUS_IO_STYLE_ANTICIPATION*) HeapAlloc (GetProcessHeap (), 0, chunk.size * part.nrofanticipations); - ReadFile (fd, part.anticipations, chunk.size * part.nrofanticipations, &BytesRead, NULL); - TRACE_(dmfiledat)("=> number of anticipations = %ld\n", part.nrofanticipations); - for (i = 0; i < part.nrofanticipations; i++) - { - TRACE_(dmfiledat)("=> anticipation[%i]: mtGridStart = %li; dwVariation = %ld; nTimeOffset = %i; bTimeRange = %i\n", \ - i, part.anticipations[i].mtGridStart, part.anticipations[i].dwVariation, part.anticipations[i].nTimeOffset, part.anticipations[i].bTimeRange); - } - break; - } case FOURCC_LIST: { - TRACE("'LIST': list chunk (size = %ld)\n", chunk.size); - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - if (chunk.id == DMUS_FOURCC_UNFO_LIST) { - TRACE("'UNFO': UNFO list (forward to DMUSIC_FillUNFOFromFileHandle(...))\n"); - SetFilePointer (fd, -(sizeof(DWORD) + 2*sizeof(FOURCC)), NULL, FILE_CURRENT); /* set pointer at beginning of list */ - DMUSIC_FillUNFOFromFileHandle (part.UNFO, fd); - } else WARN("invalid chunk (only 'UNFO' chunk allowed\n"); - break; - } default: { - WARN("invalid chunk (only 'prth','note', 'crve', 'mrkr', 'rsln', 'anpn' and 'LIST' chunks allowed\n"); - break; - } - } - TRACE("ListCount (%ld) < ListSize (%ld)\n", ListCount, ListSize); - } while (ListCount < ListSize); - break; - } case DMUS_FOURCC_PATTERN_LIST: { - TRACE("'pttn': patterns list (content size = %ld)\n", ListSize); - do { - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); - ListCount += sizeof(FOURCC) + sizeof(DWORD) + chunk.size; - switch (chunk.id) - { - case DMUS_FOURCC_PATTERN_CHUNK: { - TRACE("'ptnh': pattern header\n"); - ReadFile (fd, &pattern.header, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> timeSig.bBeatsPerMeasure = %i; timeSig.bBeat = %i; timeSig.wGridsPerBeat = %d; bGrooveBottom = %i; bGrooveTop = %i; wEmbellishment = %d; wNbrMeasures = %d; bDestGrooveBottom = %i; bDestGrooveTop = %i; dwFlags = %ld\n", \ - pattern.header.timeSig.bBeatsPerMeasure, pattern.header.timeSig.bBeat, pattern.header.timeSig.wGridsPerBeat, pattern.header.bGrooveBottom, pattern.header.bGrooveTop, pattern.header.wEmbellishment, \ - pattern.header.wNbrMeasures, pattern.header.bDestGrooveBottom, pattern.header.bDestGrooveTop, pattern.header.dwFlags); - break; - } case DMUS_FOURCC_RHYTHM_CHUNK: { - TRACE("'rhtm': rhytms\n"); - pattern.nrofrhytms = chunk.size / sizeof(DWORD); - TRACE_(dmfiledat)("=> number of rhytms = %ld\n", pattern.nrofrhytms); - pattern.rhytms = (DWORD*) HeapAlloc (GetProcessHeap (), 0, sizeof(DWORD) * pattern.nrofrhytms); - ReadFile (fd, pattern.rhytms, sizeof(DWORD) * pattern.nrofrhytms, &BytesRead, NULL); - for (i = 0; i < pattern.nrofrhytms; i++) - { - TRACE_(dmfiledat)("=> rhytm[%i] = %ld\n", i, pattern.rhytms[i]); - } - break; - } case DMUS_FOURCC_MOTIFSETTINGS_CHUNK: { - TRACE("'mtfs': motif settings\n"); - ReadFile (fd, &pattern.motsettings, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> dwRepeats = %ld; mtPlayStart = %li; mtLoopStart = %li; mtLoopEnd = %li; dwResolution = %ld\n", \ - pattern.motsettings.dwRepeats, pattern.motsettings.mtPlayStart, pattern.motsettings.mtLoopStart, pattern.motsettings.mtLoopEnd, pattern.motsettings.dwResolution); - break; - } case FOURCC_LIST: { - TRACE("'LIST': list chunk (size = %ld)\n", chunk.size); - ListSize2 = chunk.size - sizeof(FOURCC); /* list content size = size of 'LIST' chunk - FOURCC ID of the list */ - ListCount2 = 0; - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - switch (chunk.id) - { - case DMUS_FOURCC_UNFO_LIST: { - TRACE("'UNFO': UNFO list (forward to DMUSIC_FillUNFOFromFileHandle(...))\n"); - SetFilePointer (fd, -(sizeof(DWORD) + 2*sizeof(FOURCC)), NULL, FILE_CURRENT); /* place pointer before the 'LIST' chunk */ - DMUSIC_FillUNFOFromFileHandle (UNFO, fd); - break; - } case DMUS_FOURCC_PARTREF_LIST: { - TRACE("'pref': part references list (content size = %ld)\n", ListSize2); - do { - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - ReadFile (fd, &chunk.size, sizeof(DWORD), &BytesRead, NULL); - ListCount2 += sizeof(FOURCC) + sizeof(DWORD) + chunk.size; - switch (chunk.id) - { - case DMUS_FOURCC_PARTREF_CHUNK: { - TRACE("'prfc': part reference\n"); - ReadFile (fd, &pattern.partref, chunk.size, &BytesRead, NULL); - TRACE_(dmfiledat)("=> guidPartID = %s; wLogicalPartID = %d; bVariationLockID = %i; bSubChordLevel = %i; bPriority = %i; bRandomVariation = %i; wPad = %d; dwPChannel = %ld\n", \ - debugstr_guid (&pattern.partref.guidPartID), pattern.partref.wLogicalPartID, pattern.partref.bVariationLockID, pattern.partref.bSubChordLevel, \ - pattern.partref.bPriority, pattern.partref.bRandomVariation, pattern.partref.wPad, pattern.partref.dwPChannel); - break; - } case FOURCC_LIST: { - TRACE("'LIST': list chunk (MSDN doesn't mention it)\n"); - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - if (chunk.id == DMUS_FOURCC_UNFO_LIST) { - TRACE("'UNFO': UNFO list (forward to DMUSIC_FillUNFOFromFileHandle(...))\n"); - SetFilePointer (fd, -(sizeof(DWORD) + 2*sizeof(FOURCC)), NULL, FILE_CURRENT); /* place pointer before the 'LIST' chunk */ - DMUSIC_FillUNFOFromFileHandle (UNFO, fd); - } else { - WARN("invalid chunk (only 'UNFO' chunk allowed)\n"); - } - break; - } default: { - WARN("invalid chunk (only 'prfc' and 'UNFO'chunk allowed)\n"); - } - } - TRACE("ListCount2 (%ld) < ListSize2 (%ld)\n", ListCount2, ListSize2); - } while (ListCount2 < ListSize2); - break; - } default: { - WARN("invalid chunk (only 'UNFO' and 'pref' chunks allowed\n"); - break; - } - } - break; - } case FOURCC_RIFF: { - TRACE("'RIFF': embedded RIFF (size = %ld; could be embedded band form)\n", chunk.size); - ReadFile (fd, &chunk.id, sizeof(FOURCC), &BytesRead, NULL); - if (chunk.id == DMUS_FOURCC_BAND_FORM) { - TRACE("'DMBD': embedded band form (forward to DMUSIC_FillBandFromFileHandle(...))\n"); - SetFilePointer (fd, -(sizeof(DWORD) + 2*sizeof(FOURCC)), NULL, FILE_CURRENT); /* place pointer before 'RIFF' chunk */ - DMUSIC_FillBandFromFileHandle (NULL, fd); - } else WARN("invalid chunk (only 'DMBD' chunk allowed)\n"); - break; - } default: { - WARN("invalid chunk (only 'prnh','rhtm', 'mtfs', 'LIST' and 'RIFF' chunks allowed\n"); - break; - } - } - TRACE("ListCount (%ld) < ListSize (%ld)\n", ListCount, ListSize); - } while (ListCount < ListSize); - break; - } default: { - WARN("invalid chunk (only 'UNFO', 'part', 'pttn' and 'RIFF' chunks allowed)\n"); - } - } - break; - } default: { - WARN("invalid chunk (only 'styh', 'guid', 'vers', 'LIST', and 'RIFF' chunks allowed)\n"); - break; - } - } - TRACE("FileCount (%ld) < FileSize (%ld)\n", FileCount, FileSize); - } while (FileCount < FileSize); - } else { - WARN("invalid chunk (only 'DMST' chunk allowed)\n"); - } - } else { - WARN("'RIFF' not found: not a RIFF file\n"); - } - - return S_OK; -} - -#endif diff --git a/dlls/dmusic/instrument.c b/dlls/dmusic/instrument.c index 2b9187203f9..7f649e8a204 100644 --- a/dlls/dmusic/instrument.c +++ b/dlls/dmusic/instrument.c @@ -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 - -#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; } diff --git a/dlls/dmusic/port.c b/dlls/dmusic/port.c index e6095333225..16b14c7e1ea 100644 --- a/dlls/dmusic/port.c +++ b/dlls/dmusic/port.c @@ -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 - -#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; -} diff --git a/dlls/dmusic/portdownload.c b/dlls/dmusic/portdownload.c index d683d5757ad..634f449d31b 100644 --- a/dlls/dmusic/portdownload.c +++ b/dlls/dmusic/portdownload.c @@ -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 - -#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; -} diff --git a/dlls/dmusic/regsvr.c b/dlls/dmusic/regsvr.c index 91470d2b640..62a285392e9 100644 --- a/dlls/dmusic/regsvr.c +++ b/dlls/dmusic/regsvr.c @@ -18,21 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include - -#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"); diff --git a/dlls/dmusic/thru.c b/dlls/dmusic/thru.c index 62d6ed8362c..71e82a26cea 100644 --- a/dlls/dmusic/thru.c +++ b/dlls/dmusic/thru.c @@ -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 - -#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; -} diff --git a/dlls/dmusic/version.rc b/dlls/dmusic/version.rc index 727866b45ea..09df126b3de 100644 --- a/dlls/dmusic/version.rc +++ b/dlls/dmusic/version.rc @@ -1,5 +1,5 @@ /* - * Copyright 2001 Ove Kaaven + * Copyright (C) 2003-2004 Rok Mandeljc * * 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" diff --git a/dlls/dmusic32/dmusic32_main.c b/dlls/dmusic32/dmusic32_main.c index 1cf8675efa8..bfc0f803811 100644 --- a/dlls/dmusic32/dmusic32_main.c +++ b/dlls/dmusic32/dmusic32_main.c @@ -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 #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) { diff --git a/dlls/dmusic32/version.rc b/dlls/dmusic32/version.rc index 087ac335be9..168d6c09b76 100644 --- a/dlls/dmusic32/version.rc +++ b/dlls/dmusic32/version.rc @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003 Rok Mandeljc + * Copyright (C) 2003-2004 Rok Mandeljc * * 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" diff --git a/dlls/dswave/.cvsignore b/dlls/dswave/.cvsignore new file mode 100644 index 00000000000..9854a67ffb4 --- /dev/null +++ b/dlls/dswave/.cvsignore @@ -0,0 +1,5 @@ +Makefile +dswave.dll.dbg.c +dswave.spec.c +dswave.spec.def +version.res diff --git a/dlls/dswave/Makefile.in b/dlls/dswave/Makefile.in new file mode 100644 index 00000000000..399b5d61bce --- /dev/null +++ b/dlls/dswave/Makefile.in @@ -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: diff --git a/dlls/dswave/dswave.c b/dlls/dswave/dswave.c new file mode 100644 index 00000000000..40b5c6dea83 --- /dev/null +++ b/dlls/dswave/dswave.c @@ -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); +} diff --git a/dlls/dswave/dswave.spec b/dlls/dswave/dswave.spec new file mode 100644 index 00000000000..7bbacee2885 --- /dev/null +++ b/dlls/dswave/dswave.spec @@ -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 diff --git a/dlls/dswave/dswave_main.c b/dlls/dswave/dswave_main.c new file mode 100644 index 00000000000..5146ae713d3 --- /dev/null +++ b/dlls/dswave/dswave_main.c @@ -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; +} diff --git a/dlls/dswave/dswave_private.h b/dlls/dswave/dswave_private.h new file mode 100644 index 00000000000..5eb34af6ed6 --- /dev/null +++ b/dlls/dswave/dswave_private.h @@ -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 + +#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 */ diff --git a/dlls/dswave/regsvr.c b/dlls/dswave/regsvr.c new file mode 100644 index 00000000000..12d1ca7854a --- /dev/null +++ b/dlls/dswave/regsvr.c @@ -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; +} diff --git a/dlls/dswave/version.rc b/dlls/dswave/version.rc new file mode 100644 index 00000000000..fe5fc24d2f7 --- /dev/null +++ b/dlls/dswave/version.rc @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2003-2004 Rok Mandeljc + * + * 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" diff --git a/include/Makefile.in b/include/Makefile.in index b44a3f52fd3..ad5201ea72e 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -63,6 +63,7 @@ WINDOWS_INCLUDES = \ dispdib.h \ dlgs.h \ dls1.h \ + dls2.h \ dmdls.h \ dmerror.h \ dmo.h \ diff --git a/include/dls1.h b/include/dls1.h index 89c3b2620ff..0fc1d7a4465 100644 --- a/include/dls1.h +++ b/include/dls1.h @@ -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 */ diff --git a/include/dls2.h b/include/dls2.h new file mode 100644 index 00000000000..db3dc8d7456 --- /dev/null +++ b/include/dls2.h @@ -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 */ diff --git a/include/dmdls.h b/include/dmdls.h index dfe73c5ec17..6826d586d41 100644 --- a/include/dmdls.h +++ b/include/dmdls.h @@ -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 -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 */ diff --git a/include/dmerror.h b/include/dmerror.h index adae948a5f9..7af265350b5 100644 --- a/include/dmerror.h +++ b/include/dmerror.h @@ -1,6 +1,6 @@ /* DirectMusic Error Codes * - * 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,8 +23,8 @@ /***************************************************************************** * Error code handling */ -#define FACILITY_DIRECTMUSIC 0x878 -#define DMUS_ERRBASE 0x1000 +#define FACILITY_DIRECTMUSIC 0x878 +#define DMUS_ERRBASE 0x1000 #ifndef MAKE_HRESULT #define MAKE_HRESULT(sev,fac,code) \ diff --git a/include/dmplugin.h b/include/dmplugin.h index e4472468447..94925ec3a43 100644 --- a/include/dmplugin.h +++ b/include/dmplugin.h @@ -1,7 +1,7 @@ /* * DirectMusic Performance Layer Plugins API * - * 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,46 +21,105 @@ #ifndef __WINE_DMUSIC_PLUGIN_H #define __WINE_DMUSIC_PLUGIN_H +#ifndef __WINESRC__ +#include +#endif /* __WINESRC__ */ + #include #include +#include +#include #ifdef __cplusplus extern "C" { #endif -#define DMUS_REGSTR_PATH_TOOLS "Software\\Microsoft\\DirectMusic\\Tools" +/***************************************************************************** + * Registry path + */ +#define DMUS_REGSTR_PATH_TOOLS "Software\\Microsoft\\DirectMusic\\Tools" + /***************************************************************************** * Predeclare the interfaces */ -DEFINE_GUID(IID_IDirectMusicTrack, 0xf96029a1,0x4282,0x11d2,0x87,0x17,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(IID_IDirectMusicTool, 0xd2ac28ba,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(IID_IDirectMusicTool8, 0xe674303,0x3b05,0x11d3,0x9b,0xd1,0xf9,0xe7,0xf0,0xa0,0x15,0x36); -DEFINE_GUID(IID_IDirectMusicTrack8, 0xe674304,0x3b05,0x11d3,0x9b,0xd1,0xf9,0xe7,0xf0,0xa0,0x15,0x36); +/* CLSIDs */ +DEFINE_GUID(CLSID_DirectMusicBandTrack, 0xd2ac2894,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(CLSID_DirectMusicChordTrack, 0xd2ac288b,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(CLSID_DirectMusicChordMapTrack, 0xd2ac2896,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(CLSID_DirectMusicCommandTrack, 0xd2ac288c,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(CLSID_DirectMusicLyricsTrack, 0x995c1cf5,0x54ff,0x11d3,0x8b,0xda,0x00,0x60,0x08,0x93,0xb1,0xb6); +DEFINE_GUID(CLSID_DirectMusicMarkerTrack, 0x55a8fd00,0x4288,0x11d3,0x9b,0xd1,0x8a,0x0d,0x61,0xc8,0x88,0x35); +DEFINE_GUID(CLSID_DirectMusicMotifTrack, 0xd2ac288e,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(CLSID_DirectMusicMuteTrack, 0xd2ac2898,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(CLSID_DirectMusicParamControlTrack, 0x4be0537b,0x5c19,0x11d3,0x8b,0xdc,0x00,0x60,0x08,0x93,0xb1,0xb6); +DEFINE_GUID(CLSID_DirectMusicScriptTrack, 0x4108fa85,0x3586,0x11d3,0x8b,0xd7,0x00,0x60,0x08,0x93,0xb1,0xb6); +DEFINE_GUID(CLSID_DirectMusicSegmentTriggerTrack, 0xbae4d665,0x4ea1,0x11d3,0x8b,0xda,0x00,0x60,0x08,0x93,0xb1,0xb6); +DEFINE_GUID(CLSID_DirectMusicSeqTrack, 0xd2ac2886,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(CLSID_DirectMusicSignPostTrack, 0xf17e8672,0xc3b4,0x11d1,0x87,0x0b,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(CLSID_DirectMusicStyleTrack, 0xd2ac288d,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(CLSID_DirectMusicSysExTrack, 0xd2ac2887,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(CLSID_DirectMusicTempoTrack, 0xd2ac2885,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(CLSID_DirectMusicTimeSigTrack, 0xd2ac2888,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(CLSID_DirectMusicWaveTrack, 0xeed36461,0x9ea5,0x11d3,0x9b,0xd1,0x00,0x80,0xc7,0x15,0x0a,0x74); +/* MS doesn't support this in DX 9.0 and newer... but there's no harm in keeping it around */ +DEFINE_GUID(CLSID_DirectMusicMelodyFormulationTrack, 0xb0684266,0xb57f,0x11d2,0x97,0xf9,0x00,0xc0,0x4f,0xa3,0x6e,0x58); -/* typedef definitions of interfaces are in dmusici.h */ +/* IIDs */ +DEFINE_GUID(IID_IDirectMusicTool, 0xd2ac28ba,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(IID_IDirectMusicTool8, 0x0e674303,0x3b05,0x11d3,0x9b,0xd1,0xf9,0xe7,0xf0,0xa0,0x15,0x36); +DEFINE_GUID(IID_IDirectMusicTrack, 0xf96029a1,0x4282,0x11d2,0x87,0x17,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(IID_IDirectMusicTrack8, 0x0e674304,0x3b05,0x11d3,0x9b,0xd1,0xf9,0xe7,0xf0,0xa0,0x15,0x36); -DEFINE_GUID(CLSID_DirectMusicTempoTrack, 0xd2ac2885,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(CLSID_DirectMusicSeqTrack, 0xd2ac2886,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(CLSID_DirectMusicSysExTrack, 0xd2ac2887,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(CLSID_DirectMusicTimeSigTrack, 0xd2ac2888,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(CLSID_DirectMusicChordTrack, 0xd2ac288b,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(CLSID_DirectMusicCommandTrack, 0xd2ac288c,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(CLSID_DirectMusicStyleTrack, 0xd2ac288d,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(CLSID_DirectMusicMotifTrack, 0xd2ac288e,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(CLSID_DirectMusicSignPostTrack, 0xf17e8672,0xc3b4,0x11d1,0x87,0xb,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(CLSID_DirectMusicBandTrack, 0xd2ac2894,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(CLSID_DirectMusicChordMapTrack, 0xd2ac2896,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(CLSID_DirectMusicMuteTrack, 0xd2ac2898,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(CLSID_DirectMusicScriptTrack, 0x4108fa85,0x3586,0x11d3,0x8b,0xd7,0x0,0x60,0x8,0x93,0xb1,0xb6); -DEFINE_GUID(CLSID_DirectMusicMarkerTrack, 0x55a8fd00,0x4288,0x11d3,0x9b,0xd1,0x8a,0xd,0x61,0xc8,0x88,0x35); -DEFINE_GUID(CLSID_DirectMusicSegmentTriggerTrack, 0xbae4d665,0x4ea1,0x11d3,0x8b,0xda,0x0,0x60,0x8,0x93,0xb1,0xb6); -DEFINE_GUID(CLSID_DirectMusicLyricsTrack, 0x995c1cf5,0x54ff,0x11d3,0x8b,0xda,0x0,0x60,0x8,0x93,0xb1,0xb6); -DEFINE_GUID(CLSID_DirectMusicParamControlTrack, 0x4be0537b,0x5c19,0x11d3,0x8b,0xdc,0x0,0x60,0x8,0x93,0xb1,0xb6); -DEFINE_GUID(CLSID_DirectMusicMelodyFormulationTrack, 0xb0684266,0xb57f,0x11d2,0x97,0xf9,0x0,0xc0,0x4f,0xa3,0x6e,0x58); -DEFINE_GUID(CLSID_DirectMusicWaveTrack, 0xeed36461,0x9ea5,0x11d3,0x9b,0xd1,0x0,0x80,0xc7,0x15,0xa,0x74); +/* typedef definitions */ +typedef struct IDirectMusicTrack IDirectMusicTrack, *LPDIRECTMUSICTRACK; +typedef struct IDirectMusicTrack IDirectMusicTrack8, *LPDIRECTMUSICTRACK8; +typedef struct IDirectMusicTool IDirectMusicTool, *LPDIRECTMUSICTOOL; +typedef struct IDirectMusicTool8 IDirectMusicTool8, *LPDIRECTMUSICTOOL8; +/* these are from dmusici.h and are needed here */ +typedef struct IDirectMusicPerformance IDirectMusicPerformance, *LPDIRECTMUSICPERFORMANCE; +typedef struct IDirectMusicPerformance8 IDirectMusicPerformance8, *LPDIRECTMUSICPERFORMANCE8; +typedef struct IDirectMusicSegment IDirectMusicSegment, *LPDIRECTMUSICSEGMENT; +typedef struct IDirectMusicSegment IDirectMusicSegment8, *LPDIRECTMUSICSEGMENT8; +typedef struct IDirectMusicSegmentState IDirectMusicSegmentState, *LPDIRECTMUSICSEGMENTSTATE; +typedef struct IDirectMusicSegmentState8 IDirectMusicSegmentState8, *LPDIRECTMUSICSEGMENTSTATE8; +typedef struct IDirectMusicGraph IDirectMusicGraph, *LPDIRECTMUSICGRAPH; +typedef struct IDirectMusicGraph IDirectMusicGraph8, *LPDIRECTMUSICGRAPH8; +/***************************************************************************** + * Typedef definitions + */ +typedef struct _DMUS_PMSG DMUS_PMSG; +typedef long MUSIC_TIME; + + +/***************************************************************************** + * Flags + */ +#define DMUS_TRACK_PARAMF_CLOCK 0x1 + +/***************************************************************************** + * Enumerations + */ +/* typedef definitions */ +typedef enum enumDMUS_TRACKF_FLAGS DMUS_TRACKF_FLAGS; + +/* actual enumerations */ +enum enumDMUS_TRACKF_FLAGS { + DMUS_TRACKF_SEEK = 0x001, + DMUS_TRACKF_LOOP = 0x002, + DMUS_TRACKF_START = 0x004, + DMUS_TRACKF_FLUSH = 0x008, + DMUS_TRACKF_DIRTY = 0x010, + DMUS_TRACKF_NOTIFY_OFF = 0x020, + DMUS_TRACKF_PLAY_OFF = 0x040, + DMUS_TRACKF_LOOPEND = 0x080, + DMUS_TRACKF_STOP = 0x100, + DMUS_TRACKF_RECOMPOSE = 0x200, + DMUS_TRACKF_CLOCK = 0x400, +}; + /***************************************************************************** * IDirectMusicTool interface */ @@ -79,16 +138,16 @@ ICOM_DEFINE(IDirectMusicTool,IUnknown) #ifdef COBJMACROS /*** IUnknown methods ***/ -#define IDirectMusicTool_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectMusicTool_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectMusicTool_Release(p) (p)->lpVtbl->Release(p) +#define IDirectMusicTool_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectMusicTool_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectMusicTool_Release(p) (p)->lpVtbl->Release(p) /*** IDirectMusicTool methods ***/ -#define IDirectMusicTool_Init(p,a) (p)->lpVtbl->Init(p,a) -#define IDirectMusicTool_GetMsgDeliveryType(p,a) (p)->lpVtbl->GetMsgDeliveryType(p,a) -#define IDirectMusicTool_GetMediaTypeArraySize(p,a) (p)->lpVtbl->GetMediaTypeArraySize(p,a) -#define IDirectMusicTool_GetMediaTypes(p,a,b) (p)->lpVtbl->GetMediaTypes(p,a,b) -#define IDirectMusicTool_ProcessPMsg(p,a,b) (p)->lpVtbl->ProcessPMsg(p,a,b) -#define IDirectMusicTool_Flush(p,a,b,c) (p)->lpVtbl->Flush(p,a,b,c) +#define IDirectMusicTool_Init(p,a) (p)->lpVtbl->Init(p,a) +#define IDirectMusicTool_GetMsgDeliveryType(p,a) (p)->lpVtbl->GetMsgDeliveryType(p,a) +#define IDirectMusicTool_GetMediaTypeArraySize(p,a) (p)->lpVtbl->GetMediaTypeArraySize(p,a) +#define IDirectMusicTool_GetMediaTypes(p,a,b) (p)->lpVtbl->GetMediaTypes(p,a,b) +#define IDirectMusicTool_ProcessPMsg(p,a,b) (p)->lpVtbl->ProcessPMsg(p,a,b) +#define IDirectMusicTool_Flush(p,a,b,c) (p)->lpVtbl->Flush(p,a,b,c) #endif @@ -105,40 +164,21 @@ ICOM_DEFINE(IDirectMusicTool8,IDirectMusicTool) #ifdef COBJMACROS /*** IUnknown methods ***/ -#define IDirectMusicTool8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectMusicTool8_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectMusicTool8_Release(p) (p)->lpVtbl->Release(p) +#define IDirectMusicTool8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectMusicTool8_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectMusicTool8_Release(p) (p)->lpVtbl->Release(p) /*** IDirectMusicTool methods ***/ -#define IDirectMusicTool8_Init(p,a) (p)->lpVtbl->Init(p,a) -#define IDirectMusicTool8_GetMsgDeliveryType(p,a) (p)->lpVtbl->GetMsgDeliveryType(p,a) -#define IDirectMusicTool8_GetMediaTypeArraySize(p,a) (p)->lpVtbl->GetMediaTypeArraySize(p,a) -#define IDirectMusicTool8_GetMediaTypes(p,a,b) (p)->lpVtbl->GetMediaTypes(p,a,b) -#define IDirectMusicTool8_ProcessPMsg(p,a,b) (p)->lpVtbl->ProcessPMsg(p,a,b) -#define IDirectMusicTool8_Flush(p,a,b) (p)->lpVtbl->Flush(p,a,b) +#define IDirectMusicTool8_Init(p,a) (p)->lpVtbl->Init(p,a) +#define IDirectMusicTool8_GetMsgDeliveryType(p,a) (p)->lpVtbl->GetMsgDeliveryType(p,a) +#define IDirectMusicTool8_GetMediaTypeArraySize(p,a) (p)->lpVtbl->GetMediaTypeArraySize(p,a) +#define IDirectMusicTool8_GetMediaTypes(p,a,b) (p)->lpVtbl->GetMediaTypes(p,a,b) +#define IDirectMusicTool8_ProcessPMsg(p,a,b) (p)->lpVtbl->ProcessPMsg(p,a,b) +#define IDirectMusicTool8_Flush(p,a,b) (p)->lpVtbl->Flush(p,a,b) /*** IDirectMusicTool8 methods ***/ -#define IDirectMusicTool8_Clone(p,a) (p)->lpVtbl->Clone(p,a) +#define IDirectMusicTool8_Clone(p,a) (p)->lpVtbl->Clone(p,a) #endif -typedef enum enumDMUS_TRACKF_FLAGS -{ - DMUS_TRACKF_SEEK = 1, - DMUS_TRACKF_LOOP = 2, - DMUS_TRACKF_START = 4, - DMUS_TRACKF_FLUSH = 8, - DMUS_TRACKF_DIRTY = 0x10, - DMUS_TRACKF_NOTIFY_OFF = 0x20, - DMUS_TRACKF_PLAY_OFF = 0x40, - DMUS_TRACKF_LOOPEND = 0x80, - DMUS_TRACKF_STOP = 0x100, - DMUS_TRACKF_RECOMPOSE = 0x200, - DMUS_TRACKF_CLOCK = 0x400, -} DMUS_TRACKF_FLAGS; - -#define DMUS_TRACK_PARAMF_CLOCK 0x01 - - - /***************************************************************************** * IDirectMusicTrack interface */ @@ -161,20 +201,20 @@ ICOM_DEFINE(IDirectMusicTrack,IUnknown) #ifdef COBJMACROS /*** IUnknown methods ***/ -#define IDirectMusicTrack_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectMusicTrack_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectMusicTrack_Release(p) (p)->lpVtbl->Release(p) +#define IDirectMusicTrack_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectMusicTrack_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectMusicTrack_Release(p) (p)->lpVtbl->Release(p) /*** IDirectMusicTrack methods ***/ -#define IDirectMusicTrack_Init(p,a) (p)->lpVtbl->Init(p,a) -#define IDirectMusicTrack_InitPlay(p,a,b,c,d,e) (p)->lpVtbl->InitPlay(p,a,b,c,d,e) -#define IDirectMusicTrack_EndPlay(p,a) (p)->lpVtbl->EndPlay(p,a) -#define IDirectMusicTrack_Play(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->Play(p,a,b,c,d,e,f,g,h) -#define IDirectMusicTrack_GetParam(p,a,b,c,d) (p)->lpVtbl->GetParam(p,a,b,c,d) -#define IDirectMusicTrack_SetParam(p,a,b,c) (p)->lpVtbl->SetParam(p,a,b,c) -#define IDirectMusicTrack_IsParamSupported(p,a) (p)->lpVtbl->IsParamSupported(p,a) -#define IDirectMusicTrack_AddNotificationType(p,a) (p)->lpVtbl->AddNotificationType(p,a) -#define IDirectMusicTrack_RemoveNotificationType(p,a) (p)->lpVtbl->RemoveNotificationType(p,a) -#define IDirectMusicTrack_Clone(p,a,b,c) (p)->lpVtbl->Clone(p,a,b,c) +#define IDirectMusicTrack_Init(p,a) (p)->lpVtbl->Init(p,a) +#define IDirectMusicTrack_InitPlay(p,a,b,c,d,e) (p)->lpVtbl->InitPlay(p,a,b,c,d,e) +#define IDirectMusicTrack_EndPlay(p,a) (p)->lpVtbl->EndPlay(p,a) +#define IDirectMusicTrack_Play(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->Play(p,a,b,c,d,e,f,g,h) +#define IDirectMusicTrack_GetParam(p,a,b,c,d) (p)->lpVtbl->GetParam(p,a,b,c,d) +#define IDirectMusicTrack_SetParam(p,a,b,c) (p)->lpVtbl->SetParam(p,a,b,c) +#define IDirectMusicTrack_IsParamSupported(p,a) (p)->lpVtbl->IsParamSupported(p,a) +#define IDirectMusicTrack_AddNotificationType(p,a) (p)->lpVtbl->AddNotificationType(p,a) +#define IDirectMusicTrack_RemoveNotificationType(p,a) (p)->lpVtbl->RemoveNotificationType(p,a) +#define IDirectMusicTrack_Clone(p,a,b,c) (p)->lpVtbl->Clone(p,a,b,c) #endif @@ -195,31 +235,32 @@ ICOM_DEFINE(IDirectMusicTrack8,IDirectMusicTrack) #ifdef COBJMACROS /*** IUnknown methods ***/ -#define IDirectMusicTrack8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectMusicTrack8_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectMusicTrack8_Release(p) (p)->lpVtbl->Release(p) +#define IDirectMusicTrack8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectMusicTrack8_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectMusicTrack8_Release(p) (p)->lpVtbl->Release(p) /*** IDirectMusicTrack methods ***/ -#define IDirectMusicTrack8_Init(p,a) (p)->lpVtbl->Init(p,a) -#define IDirectMusicTrack8_InitPlay(p,a,b,c,d,e) (p)->lpVtbl->InitPlay(p,a,b,c,d,e) -#define IDirectMusicTrack8_EndPlay(p,a) (p)->lpVtbl->EndPlay(p,a) -#define IDirectMusicTrack8_Play(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->Play(p,a,b,c,d,e,f,g,h) -#define IDirectMusicTrack8_GetParam(p,a,b,c,d) (p)->lpVtbl->GetParam(p,a,b,c,d) -#define IDirectMusicTrack8_SetParam(p,a,b,c) (p)->lpVtbl->SetParam(p,a,b,c) -#define IDirectMusicTrack8_IsParamSupported(p,a) (p)->lpVtbl->IsParamSupported(p,a) -#define IDirectMusicTrack8_AddNotificationType(p,a) (p)->lpVtbl->AddNotificationType(p,a) -#define IDirectMusicTrack8_RemoveNotificationType(p,a) (p)->lpVtbl->RemoveNotificationType(p,a) -#define IDirectMusicTrack8_Clone(p,a,b,c) (p)->lpVtbl->Clone(p,a,b,c) +#define IDirectMusicTrack8_Init(p,a) (p)->lpVtbl->Init(p,a) +#define IDirectMusicTrack8_InitPlay(p,a,b,c,d,e) (p)->lpVtbl->InitPlay(p,a,b,c,d,e) +#define IDirectMusicTrack8_EndPlay(p,a) (p)->lpVtbl->EndPlay(p,a) +#define IDirectMusicTrack8_Play(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->Play(p,a,b,c,d,e,f,g,h) +#define IDirectMusicTrack8_GetParam(p,a,b,c,d) (p)->lpVtbl->GetParam(p,a,b,c,d) +#define IDirectMusicTrack8_SetParam(p,a,b,c) (p)->lpVtbl->SetParam(p,a,b,c) +#define IDirectMusicTrack8_IsParamSupported(p,a) (p)->lpVtbl->IsParamSupported(p,a) +#define IDirectMusicTrack8_AddNotificationType(p,a) (p)->lpVtbl->AddNotificationType(p,a) +#define IDirectMusicTrack8_RemoveNotificationType(p,a) (p)->lpVtbl->RemoveNotificationType(p,a) +#define IDirectMusicTrack8_Clone(p,a,b,c) (p)->lpVtbl->Clone(p,a,b,c) /*** IDirectMusicTrack8 methods ***/ -#define IDirectMusicTrack8_PlayEx(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->PlayEx(p,a,b,c,d,e,f,g,h) -#define IDirectMusicTrack8_GetParamEx(p,a,b,c,d,e,f) (p)->lpVtbl->GetParamEx(p,a,b,c,d,e,f) -#define IDirectMusicTrack8_SetParamEx(p,a,b,c,d,e) (p)->lpVtbl->SetParamEx(p,a,b,c,d,e) -#define IDirectMusicTrack8_Compose(p,a,b,c) (p)->lpVtbl->Compose(p,a,b,c) -#define IDirectMusicTrack8_Join(p,a,b,c,d,e) (p)->lpVtbl->Join(p,a,b,c,d,e) +#define IDirectMusicTrack8_PlayEx(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->PlayEx(p,a,b,c,d,e,f,g,h) +#define IDirectMusicTrack8_GetParamEx(p,a,b,c,d,e,f) (p)->lpVtbl->GetParamEx(p,a,b,c,d,e,f) +#define IDirectMusicTrack8_SetParamEx(p,a,b,c,d,e) (p)->lpVtbl->SetParamEx(p,a,b,c,d,e) +#define IDirectMusicTrack8_Compose(p,a,b,c) (p)->lpVtbl->Compose(p,a,b,c) +#define IDirectMusicTrack8_Join(p,a,b,c,d,e) (p)->lpVtbl->Join(p,a,b,c,d,e) #endif - #ifdef __cplusplus } #endif +#include + #endif /* __WINE_DMUSIC_PLUGIN_H */ diff --git a/include/dmusbuff.h b/include/dmusbuff.h index 6008fdcaf2f..c4fa408884b 100644 --- a/include/dmusbuff.h +++ b/include/dmusbuff.h @@ -1,6 +1,6 @@ /* DirectMusic Buffer Format * - * 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,26 +20,31 @@ #ifndef __WINE_DMUSIC_BUFFER_H #define __WINE_DMUSIC_BUFFER_H -#include - /***************************************************************************** - * Definitions + * Misc. definitions */ -#define DMUS_EVENT_STRUCTURED 0x00000001 #define QWORD_ALIGN(x) (((x) + 7) & ~7) #define DMUS_EVENT_SIZE(cb) QWORD_ALIGN(sizeof(DMUS_EVENTHEADER) + cb) +/***************************************************************************** + * Flags + */ +#define DMUS_EVENT_STRUCTURED 0x1 + /***************************************************************************** * Structures */ -typedef struct _DMUS_EVENTHEADER -{ +/* typedef definitions */ +typedef struct _DMUS_EVENTHEADER DMUS_EVENTHEADER, *LPDMUS_EVENTHEADER; + +/* actual structure*/ +#include +struct _DMUS_EVENTHEADER { DWORD cbEvent; DWORD dwChannelGroup; REFERENCE_TIME rtDelta; DWORD dwFlags; -} DMUS_EVENTHEADER, *LPDMUS_EVENTHEADER; - +}; #include #endif /* __WINE_DMUSIC_BUFFER_H */ diff --git a/include/dmusicc.h b/include/dmusicc.h index bc5b5a6e672..24f786d977b 100644 --- a/include/dmusicc.h +++ b/include/dmusicc.h @@ -1,6 +1,6 @@ /* DirectMusic Core API Stuff * - * 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,269 +20,351 @@ #ifndef __WINE_DMUSIC_CORE_H #define __WINE_DMUSIC_CORE_H -#include +#ifndef __WINESRC__ +#include +#endif /* __WINESRC__ */ +#include #include -#include #include #include #include +#include #include -/*#include */ +#include #ifdef __cplusplus extern "C" { -#endif /* __cplusplus */ +#endif + /***************************************************************************** * Predeclare the interfaces */ -DEFINE_GUID(CLSID_DirectMusic, 0x636b9f10, 0x0c7d, 0x11d1, 0x95, 0xb2, 0x00, 0x20, 0xaf, 0xdc, 0x74, 0x21); -DEFINE_GUID(CLSID_DirectMusicCollection, 0x480ff4b0, 0x28b2, 0x11d1, 0xbe, 0xf7, 0x0, 0xc0, 0x4f, 0xbf, 0x8f, 0xef); -DEFINE_GUID(CLSID_DirectMusicSynth, 0x58C2B4D0, 0x46E7, 0x11D1, 0x89, 0xAC, 0x00, 0xA0, 0xC9, 0x05, 0x41, 0x29); +/* CLSIDs */ +DEFINE_GUID(CLSID_DirectMusic, 0x636b9f10,0x0c7d,0x11d1,0x95,0xb2,0x00,0x20,0xaf,0xdc,0x74,0x21); +DEFINE_GUID(CLSID_DirectMusicCollection, 0x480ff4b0,0x28b2,0x11d1,0xbe,0xf7,0x00,0xc0,0x4f,0xbf,0x8f,0xef); +DEFINE_GUID(CLSID_DirectMusicSynth, 0x58c2b4d0,0x46e7,0x11d1,0x89,0xac,0x00,0xa0,0xc9,0x05,0x41,0x29); + +/* IIDs */ +DEFINE_GUID(IID_IDirectMusic, 0x6536115a,0x7b2d,0x11d2,0xba,0x18,0x00,0x00,0xf8,0x75,0xac,0x12); +DEFINE_GUID(IID_IDirectMusic2, 0x6fc2cae1,0xbc78,0x11d2,0xaf,0xa6,0x00,0xaa,0x00,0x24,0xd8,0xb6); +DEFINE_GUID(IID_IDirectMusic8, 0x2d3629f7,0x813d,0x4939,0x85,0x08,0xf0,0x5c,0x6b,0x75,0xfd,0x97); +DEFINE_GUID(IID_IDirectMusicBuffer, 0xd2ac2878,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(IID_IDirectMusicCollection, 0xd2ac287c,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(IID_IDirectMusicDownload, 0xd2ac287b,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(IID_IDirectMusicDownloadedInstrument, 0xd2ac287e,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(IID_IDirectMusicInstrument, 0xd2ac287d,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(IID_IDirectMusicPort, 0x08f2d8c9,0x37c2,0x11d2,0xb9,0xf9,0x00,0x00,0xf8,0x75,0xac,0x12); +DEFINE_GUID(IID_IDirectMusicPortDownload, 0xd2ac287a,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(IID_IDirectMusicThru, 0xced153e7,0x3606,0x11d2,0xb9,0xf9,0x00,0x00,0xf8,0x75,0xac,0x12); -#ifndef __IReferenceClock_FWD_DEFINED__ -#define __IReferenceClock_FWD_DEFINED__ -typedef struct IReferenceClock IReferenceClock; -#endif - -DEFINE_GUID(IID_IDirectMusic, 0x6536115a,0x7b2d,0x11d2,0xba,0x18,0x00,0x00,0xf8,0x75,0xac,0x12); -typedef struct IDirectMusic IDirectMusic, *LPDIRECTMUSIC; -DEFINE_GUID(IID_IDirectMusicBuffer, 0xd2ac2878,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -typedef struct IDirectMusicBuffer IDirectMusicBuffer, *LPDIRECTMUSICBUFFER, IDirectMusicBuffer8, *LPDIRECTMUSICBUFFER8; -DEFINE_GUID(IID_IDirectMusicPort, 0x08f2d8c9,0x37c2,0x11d2,0xb9,0xf9,0x00,0x00,0xf8,0x75,0xac,0x12); -#define IID_IDirectMusicPort8 IID_IDirectMusicPort -typedef struct IDirectMusicPort IDirectMusicPort, *LPDIRECTMUSICPORT, IDirectMusicPort8, *LPDIRECTMUSICPORT8; -DEFINE_GUID(IID_IDirectMusicThru, 0xced153e7,0x3606,0x11d2,0xb9,0xf9,0x00,0x00,0xf8,0x75,0xac,0x12); -#define IID_IDirectMusicThru8 IID_IDirectMusicThru -typedef struct IDirectMusicThru IDirectMusicThru, *LPDIRECTMUSICTHRU, IDirectMusicThru8, *LPDIRECTMUSICTHRU8; -DEFINE_GUID(IID_IDirectMusicPortDownload, 0xd2ac287a,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -typedef struct IDirectMusicPortDownload IDirectMusicPortDownload, *LPDIRECTMUSICPORTDOWNLOAD, IDirectMusicPortDownload8, *LPDIRECTMUSICPORTDOWNLOAD8; -#define IID_IDirectMusicPortDownload8 IID_IDirectMusicPortDownload -DEFINE_GUID(IID_IDirectMusicDownload, 0xd2ac287b,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -#define IID_IDirectMusicDownload8 IID_IDirectMusicDownload -typedef struct IDirectMusicDownload IDirectMusicDownload, *LPDIRECTMUSICDOWNLOAD, IDirectMusicDownload8, *LPDIRECTMUSICDOWNLOAD8; -DEFINE_GUID(IID_IDirectMusicCollection, 0xd2ac287c,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); #define IID_IDirectMusicCollection8 IID_IDirectMusicCollection -typedef struct IDirectMusicCollection IDirectMusicCollection, *LPDIRECTMUSICCOLLECTION, IDirectMusicCollection8, *LPDIRECTMUSICCOLLECTION8; -DEFINE_GUID(IID_IDirectMusicInstrument, 0xd2ac287d,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -#define IID_IDirectMusicInstrument8 IID_IDirectMusicInstrument -typedef struct IDirectMusicInstrument IDirectMusicInstrument, *LPDIRECTMUSICINSTRUMENT, IDirectMusicInstrument8, *LPDIRECTMUSICINSTRUMENT8; -DEFINE_GUID(IID_IDirectMusicDownloadedInstrument, 0xd2ac287e,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); +#define IID_IDirectMusicDownload8 IID_IDirectMusicDownload #define IID_IDirectMusicDownloadedInstrument8 IID_IDirectMusicDownloadedInstrument -typedef struct IDirectMusicDownloadedInstrument IDirectMusicDownloadedInstrument, *LPDIRECTMUSICDOWNLOADEDINSTRUMENT, IDirectMusicDownloadedInstrument8, *LPDIRECTMUSICDOWNLOADEDINSTRUMENT8; -DEFINE_GUID(IID_IDirectMusic2, 0x6fc2cae1,0xbc78,0x11d2,0xaf,0xa6,0x0,0xaa,0x0,0x24,0xd8,0xb6); -DEFINE_GUID(IID_IDirectMusic8, 0x2d3629f7,0x813d,0x4939,0x85,0x08,0xf0,0x5c,0x6b,0x75,0xfd,0x97); -typedef struct IDirectMusic8 IDirectMusic8, *LPDIRECTMUSIC8; +#define IID_IDirectMusicInstrument8 IID_IDirectMusicInstrument +#define IID_IDirectMusicPort8 IID_IDirectMusicPort +#define IID_IDirectMusicPortDownload8 IID_IDirectMusicPortDownload +#define IID_IDirectMusicThru8 IID_IDirectMusicThru -DEFINE_GUID(GUID_DMUS_PROP_GM_Hardware, 0x178f2f24,0xc364,0x11d1,0xa7,0x60,0x00,0x00,0xf8,0x75,0xac,0x12); -DEFINE_GUID(GUID_DMUS_PROP_GS_Hardware, 0x178f2f25,0xc364,0x11d1,0xa7,0x60,0x00,0x00,0xf8,0x75,0xac,0x12); -DEFINE_GUID(GUID_DMUS_PROP_XG_Hardware, 0x178f2f26,0xc364,0x11d1,0xa7,0x60,0x00,0x00,0xf8,0x75,0xac,0x12); -DEFINE_GUID(GUID_DMUS_PROP_XG_Capable, 0x6496aba1,0x61b0,0x11d2,0xaf,0xa6,0x0,0xaa,0x0,0x24,0xd8,0xb6); -DEFINE_GUID(GUID_DMUS_PROP_GS_Capable, 0x6496aba2,0x61b0,0x11d2,0xaf,0xa6,0x0,0xaa,0x0,0x24,0xd8,0xb6); -DEFINE_GUID(GUID_DMUS_PROP_DLS1, 0x178f2f27,0xc364,0x11d1,0xa7,0x60,0x00,0x00,0xf8,0x75,0xac,0x12); -DEFINE_GUID(GUID_DMUS_PROP_DLS2, 0xf14599e5,0x4689,0x11d2,0xaf,0xa6,0x0,0xaa,0x0,0x24,0xd8,0xb6); -DEFINE_GUID(GUID_DMUS_PROP_INSTRUMENT2, 0x865fd372,0x9f67,0x11d2,0x87,0x2a,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(GUID_DMUS_PROP_SynthSink_DSOUND, 0xaa97844,0xc877,0x11d1,0x87,0xc,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(GUID_DMUS_PROP_SynthSink_WAVE, 0xaa97845,0xc877,0x11d1,0x87,0xc,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(GUID_DMUS_PROP_SampleMemorySize, 0x178f2f28,0xc364,0x11d1,0xa7,0x60,0x00,0x00,0xf8,0x75,0xac, 0x12); -DEFINE_GUID(GUID_DMUS_PROP_SamplePlaybackRate, 0x2a91f713,0xa4bf,0x11d2,0xbb,0xdf,0x0,0x60,0x8,0x33,0xdb,0xd8); -DEFINE_GUID(GUID_DMUS_PROP_WriteLatency, 0x268a0fa0,0x60f2,0x11d2,0xaf,0xa6,0x0,0xaa,0x0,0x24,0xd8,0xb6); -DEFINE_GUID(GUID_DMUS_PROP_WritePeriod, 0x268a0fa1,0x60f2,0x11d2,0xaf,0xa6,0x0,0xaa,0x0,0x24,0xd8,0xb6); -DEFINE_GUID(GUID_DMUS_PROP_MemorySize, 0x178f2f28,0xc364,0x11d1,0xa7,0x60,0x00,0x00,0xf8, 0x75, 0xac, 0x12); -DEFINE_GUID(GUID_DMUS_PROP_WavesReverb, 0x4cb5622,0x32e5,0x11d2,0xaf,0xa6,0x0,0xaa,0x0,0x24,0xd8,0xb6); -DEFINE_GUID(GUID_DMUS_PROP_Effects, 0xcda8d611,0x684a,0x11d2,0x87,0x1e,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(GUID_DMUS_PROP_LegacyCaps, 0xcfa7cdc2,0x00a1,0x11d2,0xaa,0xd5,0x00,0x00,0xf8,0x75,0xac,0x12); -DEFINE_GUID(GUID_DMUS_PROP_Volume, 0xfedfae25L,0xe46e,0x11d1,0xaa,0xce,0x00,0x00,0xf8,0x75,0xac,0x12); +/* GUIDs - property set */ +DEFINE_GUID(GUID_DMUS_PROP_GM_Hardware, 0x178f2f24,0xc364,0x11d1,0xa7,0x60,0x00,0x00,0xf8,0x75,0xac,0x12); +DEFINE_GUID(GUID_DMUS_PROP_GS_Capable, 0x6496aba2,0x61b0,0x11d2,0xaf,0xa6,0x00,0xaa,0x00,0x24,0xd8,0xb6); +DEFINE_GUID(GUID_DMUS_PROP_GS_Hardware, 0x178f2f25,0xc364,0x11d1,0xa7,0x60,0x00,0x00,0xf8,0x75,0xac,0x12); +DEFINE_GUID(GUID_DMUS_PROP_DLS1, 0x178f2f27,0xc364,0x11d1,0xa7,0x60,0x00,0x00,0xf8,0x75,0xac,0x12); +DEFINE_GUID(GUID_DMUS_PROP_DLS2, 0xf14599e5,0x4689,0x11d2,0xaf,0xa6,0x00,0xaa,0x00,0x24,0xd8,0xb6); +DEFINE_GUID(GUID_DMUS_PROP_Effects, 0xcda8d611,0x684a,0x11d2,0x87,0x1e,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(GUID_DMUS_PROP_INSTRUMENT2, 0x865fd372,0x9f67,0x11d2,0x87,0x2a,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(GUID_DMUS_PROP_LegacyCaps, 0xcfa7cdc2,0x00a1,0x11d2,0xaa,0xd5,0x00,0x00,0xf8,0x75,0xac,0x12); +DEFINE_GUID(GUID_DMUS_PROP_MemorySize, 0x178f2f28,0xc364,0x11d1,0xa7,0x60,0x00,0x00,0xf8,0x75,0xac,0x12); +DEFINE_GUID(GUID_DMUS_PROP_SampleMemorySize, 0x178f2f28,0xc364,0x11d1,0xa7,0x60,0x00,0x00,0xf8,0x75,0xac,0x12); +DEFINE_GUID(GUID_DMUS_PROP_SamplePlaybackRate, 0x2a91f713,0xa4bf,0x11d2,0xbb,0xdf,0x00,0x60,0x08,0x33,0xdb,0xd8); +DEFINE_GUID(GUID_DMUS_PROP_SynthSink_DSOUND, 0x0aa97844,0xc877,0x11d1,0x87,0x0c,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(GUID_DMUS_PROP_SynthSink_WAVE, 0x0aa97845,0xc877,0x11d1,0x87,0x0c,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(GUID_DMUS_PROP_Volume, 0xfedfae25,0xe46e,0x11d1,0xaa,0xce,0x00,0x00,0xf8,0x75,0xac,0x12); +DEFINE_GUID(GUID_DMUS_PROP_WavesReverb, 0x04cb5622,0x32e5,0x11d2,0xaf,0xa6,0x00,0xaa,0x00,0x24,0xd8,0xb6); +DEFINE_GUID(GUID_DMUS_PROP_WriteLatency, 0x268a0fa0,0x60f2,0x11d2,0xaf,0xa6,0x00,0xaa,0x00,0x24,0xd8,0xb6); +DEFINE_GUID(GUID_DMUS_PROP_WritePeriod, 0x268a0fa1,0x60f2,0x11d2,0xaf,0xa6,0x00,0xaa,0x00,0x24,0xd8,0xb6); +DEFINE_GUID(GUID_DMUS_PROP_XG_Capable, 0x6496aba1,0x61b0,0x11d2,0xaf,0xa6,0x00,0xaa,0x00,0x24,0xd8,0xb6); +DEFINE_GUID(GUID_DMUS_PROP_XG_Hardware, 0x178f2f26,0xc364,0x11d1,0xa7,0x60,0x00,0x00,0xf8,0x75,0xac,0x12); +/* typedef definitions */ +typedef struct IDirectMusic IDirectMusic, *LPDIRECTMUSIC; +typedef struct IDirectMusic IDirectMusic8, *LPDIRECTMUSIC8; +typedef struct IDirectMusicBuffer IDirectMusicBuffer, *LPDIRECTMUSICBUFFER; +typedef struct IDirectMusicBuffer IDirectMusicBuffer8, *LPDIRECTMUSICBUFFER8; +typedef struct IDirectMusicInstrument IDirectMusicInstrument, *LPDIRECTMUSICINSTRUMENT; +typedef struct IDirectMusicInstrument IDirectMusicInstrument8, *LPDIRECTMUSICINSTRUMENT8; +typedef struct IDirectMusicDownloadedInstrument IDirectMusicDownloadedInstrument, *LPDIRECTMUSICDOWNLOADEDINSTRUMENT; +typedef struct IDirectMusicDownloadedInstrument IDirectMusicDownloadedInstrument8, *LPDIRECTMUSICDOWNLOADEDINSTRUMENT8; +typedef struct IDirectMusicCollection IDirectMusicCollection, *LPDIRECTMUSICCOLLECTION; +typedef struct IDirectMusicCollection IDirectMusicCollection8, *LPDIRECTMUSICCOLLECTION8; +typedef struct IDirectMusicDownload IDirectMusicDownload, *LPDIRECTMUSICDOWNLOAD; +typedef struct IDirectMusicDownload IDirectMusicDownload8, *LPDIRECTMUSICDOWNLOAD8; +typedef struct IDirectMusicPortDownload IDirectMusicPortDownload, *LPDIRECTMUSICPORTDOWNLOAD; +typedef struct IDirectMusicPortDownload IDirectMusicPortDownload8, *LPDIRECTMUSICPORTDOWNLOAD8; +typedef struct IDirectMusicPort IDirectMusicPort, *LPDIRECTMUSICPORT; +typedef struct IDirectMusicPort IDirectMusicPort8, *LPDIRECTMUSICPORT8; +typedef struct IDirectMusicThru IDirectMusicThru, *LPDIRECTMUSICTHRU; +typedef struct IDirectMusicThru IDirectMusicThru8, *LPDIRECTMUSICTHRU8; +typedef struct IReferenceClock IReferenceClock, *LPREFERENCECLOCK; + + +/***************************************************************************** + * Typedef definitions + */ typedef ULONGLONG SAMPLE_TIME, *LPSAMPLE_TIME; -typedef ULONGLONG SAMPLE_POSITION; +typedef ULONGLONG SAMPLE_POSITION, *LPSAMPLE_POSITION; -#define DMUS_MAX_DESCRIPTION 128 -#define DMUS_MAX_DRIVER 128 -typedef struct _DMUS_BUFFERDESC -{ - DWORD dwSize; - DWORD dwFlags; - GUID guidBufferFormat; - DWORD cbBuffer; -} DMUS_BUFFERDESC, *LPDMUS_BUFFERDESC; +/***************************************************************************** + * Flags + */ +#ifndef _DIRECTAUDIO_PRIORITIES_DEFINED_ + #define _DIRECTAUDIO_PRIORITIES_DEFINED_ -#define DMUS_EFFECT_NONE 0x00000000 -#define DMUS_EFFECT_REVERB 0x00000001 -#define DMUS_EFFECT_CHORUS 0x00000002 -#define DMUS_EFFECT_DELAY 0x00000004 - -#define DMUS_PC_INPUTCLASS (0) -#define DMUS_PC_OUTPUTCLASS (1) + #define DAUD_CRITICAL_VOICE_PRIORITY 0xF0000000 + #define DAUD_HIGH_VOICE_PRIORITY 0xC0000000 + #define DAUD_STANDARD_VOICE_PRIORITY 0x80000000 + #define DAUD_LOW_VOICE_PRIORITY 0x40000000 + #define DAUD_PERSIST_VOICE_PRIORITY 0x10000000 + + #define DAUD_CHAN1_VOICE_PRIORITY_OFFSET 0x0000000E + #define DAUD_CHAN2_VOICE_PRIORITY_OFFSET 0x0000000D + #define DAUD_CHAN3_VOICE_PRIORITY_OFFSET 0x0000000C + #define DAUD_CHAN4_VOICE_PRIORITY_OFFSET 0x0000000B + #define DAUD_CHAN5_VOICE_PRIORITY_OFFSET 0x0000000A + #define DAUD_CHAN6_VOICE_PRIORITY_OFFSET 0x00000009 + #define DAUD_CHAN7_VOICE_PRIORITY_OFFSET 0x00000008 + #define DAUD_CHAN8_VOICE_PRIORITY_OFFSET 0x00000007 + #define DAUD_CHAN9_VOICE_PRIORITY_OFFSET 0x00000006 + #define DAUD_CHAN10_VOICE_PRIORITY_OFFSET 0x0000000F + #define DAUD_CHAN11_VOICE_PRIORITY_OFFSET 0x00000005 + #define DAUD_CHAN12_VOICE_PRIORITY_OFFSET 0x00000004 + #define DAUD_CHAN13_VOICE_PRIORITY_OFFSET 0x00000003 + #define DAUD_CHAN14_VOICE_PRIORITY_OFFSET 0x00000002 + #define DAUD_CHAN15_VOICE_PRIORITY_OFFSET 0x00000001 + #define DAUD_CHAN16_VOICE_PRIORITY_OFFSET 0x00000000 + + #define DAUD_CHAN1_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN1_VOICE_PRIORITY_OFFSET) + #define DAUD_CHAN2_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN2_VOICE_PRIORITY_OFFSET) + #define DAUD_CHAN3_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN3_VOICE_PRIORITY_OFFSET) + #define DAUD_CHAN4_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN4_VOICE_PRIORITY_OFFSET) + #define DAUD_CHAN5_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN5_VOICE_PRIORITY_OFFSET) + #define DAUD_CHAN6_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN6_VOICE_PRIORITY_OFFSET) + #define DAUD_CHAN7_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN7_VOICE_PRIORITY_OFFSET) + #define DAUD_CHAN8_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN8_VOICE_PRIORITY_OFFSET) + #define DAUD_CHAN9_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN9_VOICE_PRIORITY_OFFSET) + #define DAUD_CHAN10_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN10_VOICE_PRIORITY_OFFSET) + #define DAUD_CHAN11_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN11_VOICE_PRIORITY_OFFSET) + #define DAUD_CHAN12_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN12_VOICE_PRIORITY_OFFSET) + #define DAUD_CHAN13_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN13_VOICE_PRIORITY_OFFSET) + #define DAUD_CHAN14_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN14_VOICE_PRIORITY_OFFSET) + #define DAUD_CHAN15_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN15_VOICE_PRIORITY_OFFSET) + #define DAUD_CHAN16_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN16_VOICE_PRIORITY_OFFSET) +#endif /* _DIRECTAUDIO_PRIORITIES_DEFINED_ */ -#define DMUS_PC_DLS (0x00000001) -#define DMUS_PC_EXTERNAL (0x00000002) -#define DMUS_PC_SOFTWARESYNTH (0x00000004) -#define DMUS_PC_MEMORYSIZEFIXED (0x00000008) -#define DMUS_PC_GMINHARDWARE (0x00000010) -#define DMUS_PC_GSINHARDWARE (0x00000020) -#define DMUS_PC_XGINHARDWARE (0x00000040) -#define DMUS_PC_DIRECTSOUND (0x00000080) -#define DMUS_PC_SHAREABLE (0x00000100) -#define DMUS_PC_DLS2 (0x00000200) -#define DMUS_PC_AUDIOPATH (0x00000400) -#define DMUS_PC_WAVE (0x00000800) +#define DMUS_CLOCKF_GLOBAL 0x1 -#define DMUS_PC_SYSTEMMEMORY (0x7FFFFFFF) +#define DMUS_EFFECT_NONE 0x0 +#define DMUS_EFFECT_REVERB 0x1 +#define DMUS_EFFECT_CHORUS 0x2 +#define DMUS_EFFECT_DELAY 0x4 + +#define DMUS_MAX_DESCRIPTION 0x80 +#define DMUS_MAX_DRIVER 0x80 -typedef struct _DMUS_PORTCAPS -{ - DWORD dwSize; - DWORD dwFlags; - GUID guidPort; - DWORD dwClass; - DWORD dwType; - DWORD dwMemorySize; - DWORD dwMaxChannelGroups; - DWORD dwMaxVoices; - DWORD dwMaxAudioChannels; - DWORD dwEffectFlags; - WCHAR wszDescription[DMUS_MAX_DESCRIPTION]; -} DMUS_PORTCAPS, *LPDMUS_PORTCAPS; +#define DMUS_PC_INPUTCLASS 0x0 +#define DMUS_PC_OUTPUTCLASS 0x1 -#define DMUS_PORT_WINMM_DRIVER (0) -#define DMUS_PORT_USER_MODE_SYNTH (1) -#define DMUS_PORT_KERNEL_MODE (2) +#define DMUS_PC_DLS 0x00000001 +#define DMUS_PC_EXTERNAL 0x00000002 +#define DMUS_PC_SOFTWARESYNTH 0x00000004 +#define DMUS_PC_MEMORYSIZEFIXED 0x00000008 +#define DMUS_PC_GMINHARDWARE 0x00000010 +#define DMUS_PC_GSINHARDWARE 0x00000020 +#define DMUS_PC_XGINHARDWARE 0x00000040 +#define DMUS_PC_DIRECTSOUND 0x00000080 +#define DMUS_PC_SHAREABLE 0x00000100 +#define DMUS_PC_DLS2 0x00000200 +#define DMUS_PC_AUDIOPATH 0x00000400 +#define DMUS_PC_WAVE 0x00000800 +#define DMUS_PC_SYSTEMMEMORY 0x7FFFFFFF -#define DMUS_PORTPARAMS_VOICES 0x00000001 -#define DMUS_PORTPARAMS_CHANNELGROUPS 0x00000002 -#define DMUS_PORTPARAMS_AUDIOCHANNELS 0x00000004 -#define DMUS_PORTPARAMS_SAMPLERATE 0x00000008 -#define DMUS_PORTPARAMS_EFFECTS 0x00000020 -#define DMUS_PORTPARAMS_SHARE 0x00000040 -#define DMUS_PORTPARAMS_FEATURES 0x00000080 +#define DMUS_PORT_WINMM_DRIVER 0x0 +#define DMUS_PORT_USER_MODE_SYNTH 0x1 +#define DMUS_PORT_KERNEL_MODE 0x2 -typedef struct _DMUS_PORTPARAMS -{ - DWORD dwSize; - DWORD dwValidParams; - DWORD dwVoices; - DWORD dwChannelGroups; - DWORD dwAudioChannels; - DWORD dwSampleRate; - DWORD dwEffectFlags; - BOOL fShare; -} DMUS_PORTPARAMS7; +#define DMUS_PORT_FEATURE_AUDIOPATH 0x1 +#define DMUS_PORT_FEATURE_STREAMING 0x2 -typedef struct _DMUS_PORTPARAMS8 -{ - DWORD dwSize; - DWORD dwValidParams; - DWORD dwVoices; - DWORD dwChannelGroups; - DWORD dwAudioChannels; - DWORD dwSampleRate; - DWORD dwEffectFlags; - BOOL fShare; - DWORD dwFeatures; -} DMUS_PORTPARAMS8, DMUS_PORTPARAMS, *LPDMUS_PORTPARAMS; +#define DMUS_PORTPARAMS_VOICES 0x01 +#define DMUS_PORTPARAMS_CHANNELGROUPS 0x02 +#define DMUS_PORTPARAMS_AUDIOCHANNELS 0x04 +#define DMUS_PORTPARAMS_SAMPLERATE 0x08 +#define DMUS_PORTPARAMS_EFFECTS 0x20 +#define DMUS_PORTPARAMS_SHARE 0x40 +#define DMUS_PORTPARAMS_FEATURES 0x80 -#define DMUS_PORT_FEATURE_AUDIOPATH 0x00000001 -#define DMUS_PORT_FEATURE_STREAMING 0x00000002 +#define DMUS_VOLUME_MAX 2000 +#define DMUS_VOLUME_MIN -20000 -typedef struct _DMUS_SYNTHSTATS -{ - DWORD dwSize; - DWORD dwValidStats; - DWORD dwVoices; - DWORD dwTotalCPU; - DWORD dwCPUPerVoice; - DWORD dwLostNotes; - DWORD dwFreeMemory; - long lPeakVolume; -} DMUS_SYNTHSTATS, *LPDMUS_SYNTHSTATS; +#define DMUS_SYNTHSTATS_VOICES 0x01 +#define DMUS_SYNTHSTATS_TOTAL_CPU 0x02 +#define DMUS_SYNTHSTATS_CPU_PER_VOICE 0x04 +#define DMUS_SYNTHSTATS_LOST_NOTES 0x08 +#define DMUS_SYNTHSTATS_PEAK_VOLUME 0x10 +#define DMUS_SYNTHSTATS_FREE_MEMORY 0x20 +#define DMUS_SYNTHSTATS_SYSTEMMEMORY DMUS_PC_SYSTEMMEMORY -typedef struct _DMUS_SYNTHSTATS8 -{ - DWORD dwSize; - DWORD dwValidStats; - DWORD dwVoices; - DWORD dwTotalCPU; - DWORD dwCPUPerVoice; - DWORD dwLostNotes; - DWORD dwFreeMemory; - long lPeakVolume; - DWORD dwSynthMemUse; -} DMUS_SYNTHSTATS8, *LPDMUS_SYNTHSTATS8; +#define DSBUSID_FIRST_SPKR_LOC 0x00000000 +#define DSBUSID_FRONT_LEFT 0x00000000 +#define DSBUSID_LEFT 0x00000000 +#define DSBUSID_FRONT_RIGHT 0x00000001 +#define DSBUSID_RIGHT 0x00000001 +#define DSBUSID_FRONT_CENTER 0x00000002 +#define DSBUSID_LOW_FREQUENCY 0x00000003 +#define DSBUSID_BACK_LEFT 0x00000004 +#define DSBUSID_BACK_RIGHT 0x00000005 +#define DSBUSID_FRONT_LEFT_OF_CENTER 0x00000006 +#define DSBUSID_FRONT_RIGHT_OF_CENTER 0x00000007 +#define DSBUSID_BACK_CENTER 0x00000008 +#define DSBUSID_SIDE_LEFT 0x00000009 +#define DSBUSID_SIDE_RIGHT 0x0000000A +#define DSBUSID_TOP_CENTER 0x0000000B +#define DSBUSID_TOP_FRONT_LEFT 0x0000000C +#define DSBUSID_TOP_FRONT_CENTER 0x0000000D +#define DSBUSID_TOP_FRONT_RIGHT 0x0000000E +#define DSBUSID_TOP_BACK_LEFT 0x0000000F +#define DSBUSID_TOP_BACK_CENTER 0x00000010 +#define DSBUSID_TOP_BACK_RIGHT 0x011 +#define DSBUSID_LAST_SPKR_LOC 0x00000011 +#define DSBUSID_IS_SPKR_LOC(id) (((id) >= DSBUSID_FIRST_SPKR_LOC) && ((id) <= DSBUSID_LAST_SPKR_LOC)) -#define DMUS_SYNTHSTATS_VOICES 1 -#define DMUS_SYNTHSTATS_TOTAL_CPU 2 -#define DMUS_SYNTHSTATS_CPU_PER_VOICE 4 -#define DMUS_SYNTHSTATS_LOST_NOTES 8 -#define DMUS_SYNTHSTATS_PEAK_VOLUME 16 -#define DMUS_SYNTHSTATS_FREE_MEMORY 32 +#define DSBUSID_REVERB_SEND 0x00000040 +#define DSBUSID_CHORUS_SEND 0x00000041 -#define DMUS_SYNTHSTATS_SYSTEMMEMORY DMUS_PC_SYSTEMMEMORY +#define DSBUSID_DYNAMIC_0 0x00000200 -typedef struct _DMUS_WAVES_REVERB_PARAMS -{ - float fInGain; - float fReverbMix; - float fReverbTime; - float fHighFreqRTRatio; -} DMUS_WAVES_REVERB_PARAMS; +#define DSBUSID_NULL 0xFFFFFFFF -typedef enum -{ - DMUS_CLOCK_SYSTEM = 0, - DMUS_CLOCK_WAVE = 1 +/***************************************************************************** + * Enumerations + */ +typedef enum { + DMUS_CLOCK_SYSTEM = 0x0, + DMUS_CLOCK_WAVE = 0x1 } DMUS_CLOCKTYPE; -#define DMUS_CLOCKF_GLOBAL 0x00000001 -typedef struct _DMUS_CLOCKINFO7 -{ - DWORD dwSize; - DMUS_CLOCKTYPE ctType; - GUID guidClock; - WCHAR wszDescription[DMUS_MAX_DESCRIPTION]; -} DMUS_CLOCKINFO7, *LPDMUS_CLOCKINFO7; +/***************************************************************************** + * Structures + */ +/* typedef definitions */ +typedef struct _DMUS_BUFFERDESC DMUS_BUFFERDESC, *LPDMUS_BUFFERDESC; +typedef struct _DMUS_PORTCAPS DMUS_PORTCAPS, *LPDMUS_PORTCAPS; +typedef struct _DMUS_PORTPARAMS DMUS_PORTPARAMS7, *LPDMUS_PORTPARAMS7; +typedef struct _DMUS_PORTPARAMS8 DMUS_PORTPARAMS8, *LPDMUS_PORTPARAMS8; +typedef DMUS_PORTPARAMS8 DMUS_PORTPARAMS, *LPDMUS_PORTPARAMS; +typedef struct _DMUS_SYNTHSTATS DMUS_SYNTHSTATS, *LPDMUS_SYNTHSTATS; +typedef struct _DMUS_SYNTHSTATS8 DMUS_SYNTHSTATS8, *LPDMUS_SYNTHSTATS8; +typedef struct _DMUS_WAVES_REVERB_PARAMS DMUS_WAVES_REVERB_PARAMS, *LPDMUS_WAVES_REVERB_PARAMS; +typedef struct _DMUS_CLOCKINFO7 DMUS_CLOCKINFO7, *LPDMUS_CLOCKINFO7; +typedef struct _DMUS_CLOCKINFO8 DMUS_CLOCKINFO8, *LPDMUS_CLOCKINFO8; +typedef DMUS_CLOCKINFO8 DMUS_CLOCKINFO, *LPDMUS_CLOCKINFO; -typedef struct _DMUS_CLOCKINFO8 -{ - DWORD dwSize; - DMUS_CLOCKTYPE ctType; - GUID guidClock; - WCHAR wszDescription[DMUS_MAX_DESCRIPTION]; - DWORD dwFlags; -} DMUS_CLOCKINFO8, *LPDMUS_CLOCKINFO8, DMUS_CLOCKINFO, *LPDMUS_CLOCKINFO; -#define DSBUSID_FIRST_SPKR_LOC 0 -#define DSBUSID_FRONT_LEFT 0 -#define DSBUSID_LEFT 0 -#define DSBUSID_FRONT_RIGHT 1 -#define DSBUSID_RIGHT 1 -#define DSBUSID_FRONT_CENTER 2 -#define DSBUSID_LOW_FREQUENCY 3 -#define DSBUSID_BACK_LEFT 4 -#define DSBUSID_BACK_RIGHT 5 -#define DSBUSID_FRONT_LEFT_OF_CENTER 6 -#define DSBUSID_FRONT_RIGHT_OF_CENTER 7 -#define DSBUSID_BACK_CENTER 8 -#define DSBUSID_SIDE_LEFT 9 -#define DSBUSID_SIDE_RIGHT 10 -#define DSBUSID_TOP_CENTER 11 -#define DSBUSID_TOP_FRONT_LEFT 12 -#define DSBUSID_TOP_FRONT_CENTER 13 -#define DSBUSID_TOP_FRONT_RIGHT 14 -#define DSBUSID_TOP_BACK_LEFT 15 -#define DSBUSID_TOP_BACK_CENTER 16 -#define DSBUSID_TOP_BACK_RIGHT 17 -#define DSBUSID_LAST_SPKR_LOC 17 -#define DSBUSID_IS_SPKR_LOC(id) ( ((id) >= DSBUSID_FIRST_SPKR_LOC) && ((id) <= DSBUSID_LAST_SPKR_LOC) ) -#define DSBUSID_REVERB_SEND 64 -#define DSBUSID_CHORUS_SEND 65 -#define DSBUSID_DYNAMIC_0 512 -#define DSBUSID_NULL 0xFFFFFFFF +/* actual structures */ +struct _DMUS_BUFFERDESC { + DWORD dwSize; + DWORD dwFlags; + GUID guidBufferFormat; + DWORD cbBuffer; +} ; + +struct _DMUS_PORTCAPS { + DWORD dwSize; + DWORD dwFlags; + GUID guidPort; + DWORD dwClass; + DWORD dwType; + DWORD dwMemorySize; + DWORD dwMaxChannelGroups; + DWORD dwMaxVoices; + DWORD dwMaxAudioChannels; + DWORD dwEffectFlags; + WCHAR wszDescription[DMUS_MAX_DESCRIPTION]; +}; + +struct _DMUS_PORTPARAMS { + DWORD dwSize; + DWORD dwValidParams; + DWORD dwVoices; + DWORD dwChannelGroups; + DWORD dwAudioChannels; + DWORD dwSampleRate; + DWORD dwEffectFlags; + BOOL fShare; +}; + +struct _DMUS_PORTPARAMS8 { + DWORD dwSize; + DWORD dwValidParams; + DWORD dwVoices; + DWORD dwChannelGroups; + DWORD dwAudioChannels; + DWORD dwSampleRate; + DWORD dwEffectFlags; + BOOL fShare; + DWORD dwFeatures; +}; + +struct _DMUS_SYNTHSTATS { + DWORD dwSize; + DWORD dwValidStats; + DWORD dwVoices; + DWORD dwTotalCPU; + DWORD dwCPUPerVoice; + DWORD dwLostNotes; + DWORD dwFreeMemory; + long lPeakVolume; +}; + +struct _DMUS_SYNTHSTATS8 { + DWORD dwSize; + DWORD dwValidStats; + DWORD dwVoices; + DWORD dwTotalCPU; + DWORD dwCPUPerVoice; + DWORD dwLostNotes; + DWORD dwFreeMemory; + long lPeakVolume; + DWORD dwSynthMemUse; +}; + +struct _DMUS_WAVES_REVERB_PARAMS { + float fInGain; + float fReverbMix; + float fReverbTime; + float fHighFreqRTRatio; +}; + +struct _DMUS_CLOCKINFO7 { + DWORD dwSize; + DMUS_CLOCKTYPE ctType; + GUID guidClock; + WCHAR wszDescription[DMUS_MAX_DESCRIPTION]; +}; + +struct _DMUS_CLOCKINFO8 { + DWORD dwSize; + DMUS_CLOCKTYPE ctType; + GUID guidClock; + WCHAR wszDescription[DMUS_MAX_DESCRIPTION]; + DWORD dwFlags; +}; /***************************************************************************** @@ -306,19 +388,19 @@ ICOM_DEFINE(IDirectMusic,IUnknown) #ifdef COBJMACROS /*** IUnknown methods ***/ -#define IDirectMusic_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectMusic_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectMusic_Release(p) (p)->lpVtbl->Release(p) +#define IDirectMusic_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectMusic_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectMusic_Release(p) (p)->lpVtbl->Release(p) /*** IDirectMusic methods ***/ -#define IDirectMusic_EnumPort(p,a,b) (p)->lpVtbl->EnumPort(p,a,b) -#define IDirectMusic_CreateMusicBuffer(p,a,b,c) (p)->lpVtbl->CreateMusicBuffer(p,a,b,c) -#define IDirectMusic_CreatePort(p,a,b,c,d) (p)->lpVtbl->CreatePort(p,a,b,c,d) -#define IDirectMusic_EnumMasterClock(p,a,b) (p)->lpVtbl->EnumMasterClock(p,a,b) -#define IDirectMusic_GetMasterClock(p,a,b) (p)->lpVtbl->GetMasterClock(p,a,b) -#define IDirectMusic_SetMasterClock(p,a) (p)->lpVtbl->SetMasterClock(p,a) -#define IDirectMusic_Activate(p,a) (p)->lpVtbl->Activate(p,a) -#define IDirectMusic_GetDefaultPort(p,a) (p)->lpVtbl->GetDefaultPort(p,a) -#define IDirectMusic_SetDirectSound(p,a,b) (p)->lpVtbl->SetDirectSound(p,a,b) +#define IDirectMusic_EnumPort(p,a,b) (p)->lpVtbl->EnumPort(p,a,b) +#define IDirectMusic_CreateMusicBuffer(p,a,b,c) (p)->lpVtbl->CreateMusicBuffer(p,a,b,c) +#define IDirectMusic_CreatePort(p,a,b,c,d) (p)->lpVtbl->CreatePort(p,a,b,c,d) +#define IDirectMusic_EnumMasterClock(p,a,b) (p)->lpVtbl->EnumMasterClock(p,a,b) +#define IDirectMusic_GetMasterClock(p,a,b) (p)->lpVtbl->GetMasterClock(p,a,b) +#define IDirectMusic_SetMasterClock(p,a) (p)->lpVtbl->SetMasterClock(p,a) +#define IDirectMusic_Activate(p,a) (p)->lpVtbl->Activate(p,a) +#define IDirectMusic_GetDefaultPort(p,a) (p)->lpVtbl->GetDefaultPort(p,a) +#define IDirectMusic_SetDirectSound(p,a,b) (p)->lpVtbl->SetDirectSound(p,a,b) #endif @@ -335,21 +417,21 @@ ICOM_DEFINE(IDirectMusic8,IDirectMusic) #ifdef COBJMACROS /*** IUnknown methods ***/ -#define IDirectMusic8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectMusic8_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectMusic8_Release(p) (p)->lpVtbl->Release(p) +#define IDirectMusic8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectMusic8_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectMusic8_Release(p) (p)->lpVtbl->Release(p) /*** IDirectMusic methods ***/ -#define IDirectMusic8_EnumPort(p,a,b) (p)->lpVtbl->EnumPort(p,a,b) -#define IDirectMusic8_CreateMusicBuffer(p,a,b,c) (p)->lpVtbl->CreateMusicBuffer(p,a,b,c) -#define IDirectMusic8_CreatePort(p,a,b,c,d) (p)->lpVtbl->CreatePort(p,a,b,c,d) -#define IDirectMusic8_EnumMasterClock(p,a,b) (p)->lpVtbl->EnumMasterClock(p,a,b) -#define IDirectMusic8_GetMasterClock(p,a,b) (p)->lpVtbl->GetMasterClock(p,a,b) -#define IDirectMusic8_SetMasterClock(p,a) (p)->lpVtbl->SetMasterClock(p,a) -#define IDirectMusic8_Activate(p,a) (p)->lpVtbl->Activate(p,a) -#define IDirectMusic8_GetDefaultPort(p,a) (p)->lpVtbl->GetDefaultPort(p,a) -#define IDirectMusic8_SetDirectSound(p,a,b) (p)->lpVtbl->SetDirectSound(p,a,b) +#define IDirectMusic8_EnumPort(p,a,b) (p)->lpVtbl->EnumPort(p,a,b) +#define IDirectMusic8_CreateMusicBuffer(p,a,b,c) (p)->lpVtbl->CreateMusicBuffer(p,a,b,c) +#define IDirectMusic8_CreatePort(p,a,b,c,d) (p)->lpVtbl->CreatePort(p,a,b,c,d) +#define IDirectMusic8_EnumMasterClock(p,a,b) (p)->lpVtbl->EnumMasterClock(p,a,b) +#define IDirectMusic8_GetMasterClock(p,a,b) (p)->lpVtbl->GetMasterClock(p,a,b) +#define IDirectMusic8_SetMasterClock(p,a) (p)->lpVtbl->SetMasterClock(p,a) +#define IDirectMusic8_Activate(p,a) (p)->lpVtbl->Activate(p,a) +#define IDirectMusic8_GetDefaultPort(p,a) (p)->lpVtbl->GetDefaultPort(p,a) +#define IDirectMusic8_SetDirectSound(p,a,b) (p)->lpVtbl->SetDirectSound(p,a,b) /*** IDirectMusic8 methods ***/ -#define IDirectMusic8_SetExternalMasterClock(p,a) (p)->lpVtbl->SetExternalMasterClock(p,a) +#define IDirectMusic8_SetExternalMasterClock(p,a) (p)->lpVtbl->SetExternalMasterClock(p,a) #endif @@ -397,6 +479,7 @@ ICOM_DEFINE(IDirectMusicBuffer,IUnknown) #define IDirectMusicBuffer_SetUsedBytes(p,a) (p)->lpVtbl->SetUsedBytes(p,a) #endif + /***************************************************************************** * IDirectMusicInstrument interface */ @@ -411,12 +494,12 @@ ICOM_DEFINE(IDirectMusicInstrument,IUnknown) #ifdef COBJMACROS /*** IUnknown methods ***/ -#define IDirectMusicInstrument_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectMusicInstrument_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectMusicInstrument_Release(p) (p)->lpVtbl->Release(p) +#define IDirectMusicInstrument_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectMusicInstrument_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectMusicInstrument_Release(p) (p)->lpVtbl->Release(p) /*** IDirectMusicInstrument methods ***/ -#define IDirectMusicInstrument_GetPatch(p,a) (p)->lpVtbl->GetPatch(p,a) -#define IDirectMusicInstrument_SetPatch(p,a) (p)->lpVtbl->SetPatch(p,a) +#define IDirectMusicInstrument_GetPatch(p,a) (p)->lpVtbl->GetPatch(p,a) +#define IDirectMusicInstrument_SetPatch(p,a) (p)->lpVtbl->SetPatch(p,a) #endif @@ -433,9 +516,9 @@ ICOM_DEFINE(IDirectMusicDownloadedInstrument,IUnknown) #ifdef COBJMACROS /*** IUnknown methods ***/ -#define IDirectMusicDownloadedInstrument_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectMusicDownloadedInstrument_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectMusicDownloadedInstrument_Release(p) (p)->lpVtbl->Release(p) +#define IDirectMusicDownloadedInstrument_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectMusicDownloadedInstrument_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectMusicDownloadedInstrument_Release(p) (p)->lpVtbl->Release(p) /*** IDirectMusicDownloadedInstrument methods ***/ /* none at this time */ #endif @@ -460,7 +543,7 @@ ICOM_DEFINE(IDirectMusicCollection,IUnknown) #define IDirectMusicCollection_Release(p) (p)->lpVtbl->Release(p) /*** IDirectMusicCollection methods ***/ #define IDirectMusicCollection_GetInstrument(p,a,b) (p)->lpVtbl->GetInstrument(p,a,b) -#define IDirectMusicCollection_EnumInstrument(p,a,b,c) (p)->lpVtbl->EnumInstrument(p,a,b,c) +#define IDirectMusicCollection_EnumInstrument(p,a,b,c,d) (p)->lpVtbl->EnumInstrument(p,a,b,c,d) #endif @@ -503,65 +586,19 @@ ICOM_DEFINE(IDirectMusicPortDownload,IUnknown) #ifdef COBJMACROS /*** IUnknown methods ***/ -#define IDirectMusicPortDownload_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectMusicPortDownload_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectMusicPortDownload_Release(p) (p)->lpVtbl->Release(p) +#define IDirectMusicPortDownload_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectMusicPortDownload_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectMusicPortDownload_Release(p) (p)->lpVtbl->Release(p) /*** IDirectMusicPortDownload methods ***/ -#define IDirectMusicPortDownload_GetBuffer(p,a,b) (p)->lpVtbl->GetBuffer(p,a,b) -#define IDirectMusicPortDownload_AllocateBuffer(p,a,b) (p)->lpVtbl->AllocateBuffer(p,a,b) -#define IDirectMusicPortDownload_GetDLId(p,a,b) (p)->lpVtbl->GetDLId(p,a,b) -#define IDirectMusicPortDownload_GetAppend(p,a) (p)->lpVtbl->GetAppend(p,a) -#define IDirectMusicPortDownload_Download(p,a) (p)->lpVtbl->Download(p,a) -#define IDirectMusicPortDownload_Unload(p,a) (p)->lpVtbl->GetBuffer(p,a) +#define IDirectMusicPortDownload_GetBuffer(p,a,b) (p)->lpVtbl->GetBuffer(p,a,b) +#define IDirectMusicPortDownload_AllocateBuffer(p,a,b) (p)->lpVtbl->AllocateBuffer(p,a,b) +#define IDirectMusicPortDownload_GetDLId(p,a,b) (p)->lpVtbl->GetDLId(p,a,b) +#define IDirectMusicPortDownload_GetAppend(p,a) (p)->lpVtbl->GetAppend(p,a) +#define IDirectMusicPortDownload_Download(p,a) (p)->lpVtbl->Download(p,a) +#define IDirectMusicPortDownload_Unload(p,a) (p)->lpVtbl->GetBuffer(p,a) #endif -#ifndef __WINE_DIRECTAUDIO_PRIORITIES_DEFINED -#define __WINE_DIRECTAUDIO_PRIORITIES_DEFINED - -#define DAUD_CRITICAL_VOICE_PRIORITY (0xF0000000) -#define DAUD_HIGH_VOICE_PRIORITY (0xC0000000) -#define DAUD_STANDARD_VOICE_PRIORITY (0x80000000) -#define DAUD_LOW_VOICE_PRIORITY (0x40000000) -#define DAUD_PERSIST_VOICE_PRIORITY (0x10000000) - -#define DAUD_CHAN1_VOICE_PRIORITY_OFFSET (0x0000000E) -#define DAUD_CHAN2_VOICE_PRIORITY_OFFSET (0x0000000D) -#define DAUD_CHAN3_VOICE_PRIORITY_OFFSET (0x0000000C) -#define DAUD_CHAN4_VOICE_PRIORITY_OFFSET (0x0000000B) -#define DAUD_CHAN5_VOICE_PRIORITY_OFFSET (0x0000000A) -#define DAUD_CHAN6_VOICE_PRIORITY_OFFSET (0x00000009) -#define DAUD_CHAN7_VOICE_PRIORITY_OFFSET (0x00000008) -#define DAUD_CHAN8_VOICE_PRIORITY_OFFSET (0x00000007) -#define DAUD_CHAN9_VOICE_PRIORITY_OFFSET (0x00000006) -#define DAUD_CHAN10_VOICE_PRIORITY_OFFSET (0x0000000F) -#define DAUD_CHAN11_VOICE_PRIORITY_OFFSET (0x00000005) -#define DAUD_CHAN12_VOICE_PRIORITY_OFFSET (0x00000004) -#define DAUD_CHAN13_VOICE_PRIORITY_OFFSET (0x00000003) -#define DAUD_CHAN14_VOICE_PRIORITY_OFFSET (0x00000002) -#define DAUD_CHAN15_VOICE_PRIORITY_OFFSET (0x00000001) -#define DAUD_CHAN16_VOICE_PRIORITY_OFFSET (0x00000000) - -#define DAUD_CHAN1_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN1_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN2_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN2_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN3_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN3_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN4_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN4_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN5_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN5_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN6_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN6_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN7_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN7_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN8_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN8_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN9_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN9_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN10_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN10_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN11_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN11_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN12_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN12_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN13_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN13_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN14_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN14_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN15_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN15_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN16_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN16_VOICE_PRIORITY_OFFSET) - -#endif /* __WINE_DIRECTAUDIO_PRIORITIES_DEFINED */ - - /***************************************************************************** * IDirectMusicPort interface */ @@ -576,6 +613,7 @@ ICOM_DEFINE(IDirectMusicPortDownload,IUnknown) STDMETHOD(UnloadInstrument)(THIS_ IDirectMusicDownloadedInstrument *pDownloadedInstrument) PURE; \ STDMETHOD(GetLatencyClock)(THIS_ IReferenceClock **ppClock) PURE; \ STDMETHOD(GetRunningStats)(THIS_ LPDMUS_SYNTHSTATS pStats) PURE; \ + STDMETHOD(Compact)(THIS) PURE; \ STDMETHOD(GetCaps)(THIS_ LPDMUS_PORTCAPS pPortCaps) PURE; \ STDMETHOD(DeviceIoControl)(THIS_ DWORD dwIoControlCode, LPVOID lpInBuffer, DWORD nInBufferSize, LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped) PURE; \ STDMETHOD(SetNumChannelGroups)(THIS_ DWORD dwChannelGroups) PURE; \ @@ -590,26 +628,27 @@ ICOM_DEFINE(IDirectMusicPort,IUnknown) #ifdef COBJMACROS /*** IUnknown methods ***/ -#define IDirectMusicPort_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectMusicPort_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectMusicPort_Release(p) (p)->lpVtbl->Release(p) +#define IDirectMusicPort_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectMusicPort_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectMusicPort_Release(p) (p)->lpVtbl->Release(p) /*** IDirectMusicPort methods ***/ -#define IDirectMusicPort_PlayBuffer(p,a) (p)->lpVtbl->PlayBuffer(p,a) -#define IDirectMusicPort_SetReadNotificationHandle(p,a) (p)->lpVtbl->SetReadNotificationHandle(p,a) -#define IDirectMusicPort_Read(p,a) (p)->lpVtbl->Read(p,a) -#define IDirectMusicPort_DownloadInstrument(p,a,b,c,d) (p)->lpVtbl->DownloadInstrument(p,a,b,c,d) -#define IDirectMusicPort_UnloadInstrument(p,a) (p)->lpVtbl->UnloadInstrument(p,a) -#define IDirectMusicPort_GetLatencyClock(p,a) (p)->lpVtbl->GetLatencyClock(p,a) -#define IDirectMusicPort_GetRunningStats(p,a) (p)->lpVtbl->GetRunningStats(p,a) -#define IDirectMusicPort_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a) -#define IDirectMusicPort_DeviceIoControl(p,a,b,c,d,e,f,g) (p)->lpVtbl->DeviceIoControl(p,a,b,c,d,e,f,g) -#define IDirectMusicPort_SetNumChannelGroups(p,a) (p)->lpVtbl->SetNumChannelGroups(p,a) -#define IDirectMusicPort_GetNumChannelGroups(p,a) (p)->lpVtbl->GetNumChannelGroups(p,a) -#define IDirectMusicPort_Activate(p,a) (p)->lpVtbl->Activate(p,a) -#define IDirectMusicPort_SetChannelPriority(p,a,b,c) (p)->lpVtbl->SetChannelPriority(p,a,b,c) -#define IDirectMusicPort_GetChannelPriority(p,a,b,c) (p)->lpVtbl->GetChannelPriority(p,a,b,c) -#define IDirectMusicPort_SetDirectSound(p,a,b) (p)->lpVtbl->SetDirectSound(p,a,b) -#define IDirectMusicPort_GetFormat(p,a,b,c) (p)->lpVtbl->GetFormat(p,a,b,c) +#define IDirectMusicPort_PlayBuffer(p,a) (p)->lpVtbl->PlayBuffer(p,a) +#define IDirectMusicPort_SetReadNotificationHandle(p,a) (p)->lpVtbl->SetReadNotificationHandle(p,a) +#define IDirectMusicPort_Read(p,a) (p)->lpVtbl->Read(p,a) +#define IDirectMusicPort_DownloadInstrument(p,a,b,c,d) (p)->lpVtbl->DownloadInstrument(p,a,b,c,d) +#define IDirectMusicPort_UnloadInstrument(p,a) (p)->lpVtbl->UnloadInstrument(p,a) +#define IDirectMusicPort_GetLatencyClock(p,a) (p)->lpVtbl->GetLatencyClock(p,a) +#define IDirectMusicPort_GetRunningStats(p,a) (p)->lpVtbl->GetRunningStats(p,a) +#define IDirectMusicPort_Compact(p) (p)->lpVtbl->Compact(p) +#define IDirectMusicPort_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a) +#define IDirectMusicPort_DeviceIoControl(p,a,b,c,d,e,f,g) (p)->lpVtbl->DeviceIoControl(p,a,b,c,d,e,f,g) +#define IDirectMusicPort_SetNumChannelGroups(p,a) (p)->lpVtbl->SetNumChannelGroups(p,a) +#define IDirectMusicPort_GetNumChannelGroups(p,a) (p)->lpVtbl->GetNumChannelGroups(p,a) +#define IDirectMusicPort_Activate(p,a) (p)->lpVtbl->Activate(p,a) +#define IDirectMusicPort_SetChannelPriority(p,a,b,c) (p)->lpVtbl->SetChannelPriority(p,a,b,c) +#define IDirectMusicPort_GetChannelPriority(p,a,b,c) (p)->lpVtbl->GetChannelPriority(p,a,b,c) +#define IDirectMusicPort_SetDirectSound(p,a,b) (p)->lpVtbl->SetDirectSound(p,a,b) +#define IDirectMusicPort_GetFormat(p,a,b,c) (p)->lpVtbl->GetFormat(p,a,b,c) #endif @@ -634,47 +673,41 @@ ICOM_DEFINE(IDirectMusicThru,IUnknown) #endif -/* this one should be defined in dsound.h too, but it's ok if it's here */ #ifndef __IReferenceClock_INTERFACE_DEFINED__ -#define __IReferenceClock_INTERFACE_DEFINED__ - -DEFINE_GUID(IID_IReferenceClock, 0x56a86897,0x0ad4,0x11ce,0xb0,0x3a,0x00,0x20,0xaf,0x0b,0xa7,0x70); - -/***************************************************************************** - * IReferenceClock interface - */ -#undef INTERFACE -#define INTERFACE IReferenceClock -#define IReferenceClock_METHODS \ - IUnknown_METHODS \ - STDMETHOD(GetTime)(THIS_ REFERENCE_TIME *pTime) PURE; \ - STDMETHOD(AdviseTime)(THIS_ REFERENCE_TIME baseTime, REFERENCE_TIME streamTime, HANDLE hEvent, DWORD *pdwAdviseCookie) PURE; \ - STDMETHOD(AdvisePeriodic)(THIS_ REFERENCE_TIME startTime, REFERENCE_TIME periodTime, HANDLE hSemaphore, DWORD *pdwAdviseCookie) PURE; \ - STDMETHOD(Unadvise)(THIS_ DWORD dwAdviseCookie) PURE; -ICOM_DEFINE(IReferenceClock,IUnknown) -#undef INTERFACE - -#ifdef COBJMACROS -/*** IUnknown methods ***/ -#define IReferenceClock_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IReferenceClock_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IReferenceClock_Release(p) (p)->lpVtbl->Release(p) -/*** IReferenceClock methods ***/ -#define IReferenceClock_GetTime(p,a) (p)->lpVtbl->GetTime(p,a) -#define IReferenceClock_AdviseTime(p,a,b,c,d) (p)->lpVtbl->AdviseTime(p,a,b,c,d) -#define IReferenceClock_AdvisePeriodic(p,a,b,c,d) (p)->lpVtbl->AdvisePeriodic(p,a,b,c,d) -#define IReferenceClock_Unadvise(p,a) (p)->lpVtbl->Unadvise(p,a) -#endif - + #define __IReferenceClock_INTERFACE_DEFINED__ + DEFINE_GUID(IID_IReferenceClock,0x56a86897,0x0ad4,0x11ce,0xb0,0x3a,0x00,0x20,0xaf,0x0b,0xa7,0x70); + + /***************************************************************************** + * IReferenceClock interface + */ + #undef INTERFACE + #define INTERFACE IReferenceClock + #define IReferenceClock_METHODS \ + IUnknown_METHODS \ + STDMETHOD(GetTime)(THIS_ REFERENCE_TIME *pTime) PURE; \ + STDMETHOD(AdviseTime)(THIS_ REFERENCE_TIME baseTime, REFERENCE_TIME streamTime, HANDLE hEvent, DWORD *pdwAdviseCookie) PURE; \ + STDMETHOD(AdvisePeriodic)(THIS_ REFERENCE_TIME startTime, REFERENCE_TIME periodTime, HANDLE hSemaphore, DWORD *pdwAdviseCookie) PURE; \ + STDMETHOD(Unadvise)(THIS_ DWORD dwAdviseCookie) PURE; + ICOM_DEFINE(IReferenceClock,IUnknown) + #undef INTERFACE + + #ifdef COBJMACROS + /*** IUnknown methods ***/ + #define IReferenceClock_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) + #define IReferenceClock_AddRef(p) (p)->lpVtbl->AddRef(p) + #define IReferenceClock_Release(p) (p)->lpVtbl->Release(p) + /*** IReferenceClock methods ***/ + #define IReferenceClock_GetTime(p,a) (p)->lpVtbl->GetTime(p,a) + #define IReferenceClock_AdviseTime(p,a,b,c,d) (p)->lpVtbl->AdviseTime(p,a,b,c,d) + #define IReferenceClock_AdvisePeriodic(p,a,b,c,d) (p)->lpVtbl->AdvisePeriodic(p,a,b,c,d) + #define IReferenceClock_Unadvise(p,a) (p)->lpVtbl->Unadvise(p,a) + #endif #endif /* __IReferenceClock_INTERFACE_DEFINED__ */ -#define DMUS_VOLUME_MAX 2000 -#define DMUS_VOLUME_MIN -20000 - #ifdef __cplusplus -} /* extern "C" */ -#endif /* __cplusplus */ +} +#endif -/*#include */ +#include #endif /* __WINE_DMUSIC_CORE_H */ diff --git a/include/dmusicf.h b/include/dmusicf.h index 9a496b54c81..deaba1b2088 100644 --- a/include/dmusicf.h +++ b/include/dmusicf.h @@ -1,7 +1,7 @@ /* * DirectMusic File Formats * - * 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,923 +21,890 @@ #ifndef __WINE_DMUSIC_FILEFORMATS_H #define __WINE_DMUSIC_FILEFORMATS_H +#ifndef __WINESRC__ +#include +#endif /* __WINESRC__ */ + #include #include +#include #ifdef __cplusplus extern "C" { #endif + /***************************************************************************** * FOURCC Definitons */ -#define DMUS_FOURCC_GUID_CHUNK mmioFOURCC('g','u','i','d') -#define DMUS_FOURCC_INFO_LIST mmioFOURCC('I','N','F','O') -#define DMUS_FOURCC_UNFO_LIST mmioFOURCC('U','N','F','O') -#define DMUS_FOURCC_UNAM_CHUNK mmioFOURCC('U','N','A','M') -#define DMUS_FOURCC_UART_CHUNK mmioFOURCC('U','A','R','T') -#define DMUS_FOURCC_UCOP_CHUNK mmioFOURCC('U','C','O','P') -#define DMUS_FOURCC_USBJ_CHUNK mmioFOURCC('U','S','B','J') -#define DMUS_FOURCC_UCMT_CHUNK mmioFOURCC('U','C','M','T') -#define DMUS_FOURCC_CATEGORY_CHUNK mmioFOURCC('c','a','t','g') -#define DMUS_FOURCC_VERSION_CHUNK mmioFOURCC('v','e','r','s') +/* Common chunks */ +#define DMUS_FOURCC_GUID_CHUNK mmioFOURCC('g','u','i','d') +#define DMUS_FOURCC_INFO_LIST mmioFOURCC('I','N','F','O') +#define DMUS_FOURCC_UNFO_LIST mmioFOURCC('U','N','F','O') +#define DMUS_FOURCC_UNAM_CHUNK mmioFOURCC('U','N','A','M') +#define DMUS_FOURCC_UART_CHUNK mmioFOURCC('U','A','R','T') +#define DMUS_FOURCC_UCOP_CHUNK mmioFOURCC('U','C','O','P') +#define DMUS_FOURCC_USBJ_CHUNK mmioFOURCC('U','S','B','J') +#define DMUS_FOURCC_UCMT_CHUNK mmioFOURCC('U','C','M','T') +#define DMUS_FOURCC_CATEGORY_CHUNK mmioFOURCC('c','a','t','g') +#define DMUS_FOURCC_VERSION_CHUNK mmioFOURCC('v','e','r','s') +/* AudioPath */ +#define DMUS_FOURCC_AUDIOPATH_FORM mmioFOURCC('D','M','A','P') +#define DMUS_FOURCC_PORTCONFIGS_LIST mmioFOURCC('p','c','s','l') +#define DMUS_FOURCC_PORTCONFIG_LIST mmioFOURCC('p','c','f','l') +#define DMUS_FOURCC_PORTCONFIG_ITEM mmioFOURCC('p','c','f','h') +#define DMUS_FOURCC_PORTPARAMS_ITEM mmioFOURCC('p','p','r','h') +#define DMUS_FOURCC_DSBUFFER_LIST mmioFOURCC('d','b','f','l') +#define DMUS_FOURCC_DSBUFFATTR_ITEM mmioFOURCC('d','d','a','h') +#define DMUS_FOURCC_PCHANNELS_LIST mmioFOURCC('p','c','h','l') +#define DMUS_FOURCC_PCHANNELS_ITEM mmioFOURCC('p','c','h','h') +/* Band */ +#define DMUS_FOURCC_BAND_FORM mmioFOURCC('D','M','B','D') +#define DMUS_FOURCC_INSTRUMENTS_LIST mmioFOURCC('l','b','i','l') +#define DMUS_FOURCC_INSTRUMENT_LIST mmioFOURCC('l','b','i','n') +#define DMUS_FOURCC_INSTRUMENT_CHUNK mmioFOURCC('b','i','n','s') +/* Chordmap */ +#define DMUS_FOURCC_CHORDMAP_FORM mmioFOURCC('D','M','P','R') +#define DMUS_FOURCC_IOCHORDMAP_CHUNK mmioFOURCC('p','e','r','h') +#define DMUS_FOURCC_SUBCHORD_CHUNK mmioFOURCC('c','h','d','t') +#define DMUS_FOURCC_CHORDENTRY_CHUNK mmioFOURCC('c','h','e','h') +#define DMUS_FOURCC_SUBCHORDID_CHUNK mmioFOURCC('s','b','c','n') +#define DMUS_FOURCC_IONEXTCHORD_CHUNK mmioFOURCC('n','c','r','d') +#define DMUS_FOURCC_NEXTCHORDSEQ_CHUNK mmioFOURCC('n','c','s','q') +#define DMUS_FOURCC_IOSIGNPOST_CHUNK mmioFOURCC('s','p','s','h') +#define DMUS_FOURCC_CHORDNAME_CHUNK mmioFOURCC('I','N','A','M') +#define DMUS_FOURCC_CHORDENTRY_LIST mmioFOURCC('c','h','o','e') +#define DMUS_FOURCC_CHORDMAP_LIST mmioFOURCC('c','m','a','p') +#define DMUS_FOURCC_CHORD_LIST mmioFOURCC('c','h','r','d') +#define DMUS_FOURCC_CHORDPALETTE_LIST mmioFOURCC('c','h','p','l') +#define DMUS_FOURCC_CADENCE_LIST mmioFOURCC('c','a','d','e') +#define DMUS_FOURCC_SIGNPOSTITEM_LIST mmioFOURCC('s','p','s','t') +#define DMUS_FOURCC_SIGNPOST_LIST mmioFOURCC('s','p','s','q') +/* Container */ +#define DMUS_FOURCC_CONTAINER_FORM mmioFOURCC('D','M','C','N') +#define DMUS_FOURCC_CONTAINER_CHUNK mmioFOURCC('c','o','n','h') +#define DMUS_FOURCC_CONTAINED_ALIAS_CHUNK mmioFOURCC('c','o','b','a') +#define DMUS_FOURCC_CONTAINED_OBJECT_CHUNK mmioFOURCC('c','o','b','h') +#define DMUS_FOURCC_CONTAINED_OBJECTS_LIST mmioFOURCC('c','o','s','l') +#define DMUS_FOURCC_CONTAINED_OBJECT_LIST mmioFOURCC('c','o','b','l') +/* DirectSound Buffer Configuration */ +#define DMUS_FOURCC_DSBC_FORM mmioFOURCC('D','S','B','C') +#define DMUS_FOURCC_DSBD_CHUNK mmioFOURCC('d','s','b','d') +#define DMUS_FOURCC_BSID_CHUNK mmioFOURCC('b','s','i','d') +#define DMUS_FOURCC_DS3D_CHUNK mmioFOURCC('d','s','3','d') +#define DMUS_FOURCC_DSBC_LIST mmioFOURCC('f','x','l','s') +/* Effects */ +#define DMUS_FOURCC_DSFX_FORM mmioFOURCC('D','S','F','X') +#define DMUS_FOURCC_DSFX_CHUNK mmioFOURCC('f','x','h','r') +#define DMUS_FOURCC_DSFX_DATA mmioFOURCC('d','a','t','a') +/* Reference */ +#define DMUS_FOURCC_REF_LIST mmioFOURCC('D','M','R','F') +#define DMUS_FOURCC_REF_CHUNK mmioFOURCC('r','e','f','h') +#define DMUS_FOURCC_DATE_CHUNK mmioFOURCC('d','a','t','e') +#define DMUS_FOURCC_NAME_CHUNK mmioFOURCC('n','a','m','e') +#define DMUS_FOURCC_FILE_CHUNK mmioFOURCC('f','i','l','e') +/* Script */ +#define DMUS_FOURCC_SCRIPT_FORM mmioFOURCC('D','M','S','C') +#define DMUS_FOURCC_SCRIPT_CHUNK mmioFOURCC('s','c','h','d') +#define DMUS_FOURCC_SCRIPTVERSION_CHUNK mmioFOURCC('s','c','v','e') +#define DMUS_FOURCC_SCRIPTLANGUAGE_CHUNK mmioFOURCC('s','c','l','a') +#define DMUS_FOURCC_SCRIPTSOURCE_CHUNK mmioFOURCC('s','c','s','r') +/* Segment */ +#define DMUS_FOURCC_SEGMENT_FORM mmioFOURCC('D','M','S','G') +#define DMUS_FOURCC_SEGMENT_CHUNK mmioFOURCC('s','e','g','h') +#define DMUS_FOURCC_TRACK_LIST mmioFOURCC('t','r','k','l') +/* Style chunks */ +#define DMUS_FOURCC_STYLE_FORM mmioFOURCC('D','M','S','T') +#define DMUS_FOURCC_STYLE_CHUNK mmioFOURCC('s','t','y','h') +#define DMUS_FOURCC_PART_LIST mmioFOURCC('p','a','r','t') +#define DMUS_FOURCC_PART_CHUNK mmioFOURCC('p','r','t','h') +#define DMUS_FOURCC_NOTE_CHUNK mmioFOURCC('n','o','t','e') +#define DMUS_FOURCC_CURVE_CHUNK mmioFOURCC('c','r','v','e') +#define DMUS_FOURCC_MARKER_CHUNK mmioFOURCC('m','r','k','r') +#define DMUS_FOURCC_RESOLUTION_CHUNK mmioFOURCC('r','s','l','n') +#define DMUS_FOURCC_ANTICIPATION_CHUNK mmioFOURCC('a','n','p','n') +#define DMUS_FOURCC_PATTERN_LIST mmioFOURCC('p','t','t','n') +#define DMUS_FOURCC_PATTERN_CHUNK mmioFOURCC('p','t','n','h') +#define DMUS_FOURCC_RHYTHM_CHUNK mmioFOURCC('r','h','t','m') +#define DMUS_FOURCC_PARTREF_LIST mmioFOURCC('p','r','e','f') +#define DMUS_FOURCC_PARTREF_CHUNK mmioFOURCC('p','r','f','c') +#define DMUS_FOURCC_STYLE_PERS_REF_LIST mmioFOURCC('p','r','r','f') +#define DMUS_FOURCC_MOTIFSETTINGS_CHUNK mmioFOURCC('m','t','f','s') +/* Tool */ +#define DMUS_FOURCC_TOOL_FORM mmioFOURCC('D','M','T','L') +#define DMUS_FOURCC_TOOL_CHUNK mmioFOURCC('t','o','l','h') +/* ToolGraph */ +#define DMUS_FOURCC_TOOLGRAPH_FORM mmioFOURCC('D','M','T','G') +#define DMUS_FOURCC_TOOL_LIST mmioFOURCC('t','o','l','l') +/* Track */ +#define DMUS_FOURCC_TRACK_FORM mmioFOURCC('D','M','T','K') +#define DMUS_FOURCC_TRACK_CHUNK mmioFOURCC('t','r','k','h') +#define DMUS_FOURCC_TRACK_EXTRAS_CHUNK mmioFOURCC('t','r','k','x') +/* Band Track */ +#define DMUS_FOURCC_BANDTRACK_FORM mmioFOURCC('D','M','B','T') +#define DMUS_FOURCC_BANDTRACK_CHUNK mmioFOURCC('b','d','t','h') +#define DMUS_FOURCC_BANDS_LIST mmioFOURCC('l','b','d','l') +#define DMUS_FOURCC_BAND_LIST mmioFOURCC('l','b','n','d') +#define DMUS_FOURCC_BANDITEM_CHUNK mmioFOURCC('b','d','i','h') +#define DMUS_FOURCC_BANDITEM_CHUNK2 mmioFOURCC('b','d','2','h') +/* Chord Track */ +#define DMUS_FOURCC_CHORDTRACK_LIST mmioFOURCC('c','o','r','d') +#define DMUS_FOURCC_CHORDTRACKHEADER_CHUNK mmioFOURCC('c','r','d','h') +#define DMUS_FOURCC_CHORDTRACKBODY_CHUNK mmioFOURCC('c','r','d','b') +/* Chordmap Track */ +#define DMUS_FOURCC_PERS_TRACK_LIST mmioFOURCC('p','f','t','r') +#define DMUS_FOURCC_PERS_REF_LIST mmioFOURCC('p','f','r','f') +#define DMUS_FOURCC_TIME_STAMP_CHUNK mmioFOURCC('s','t','m','p') +/* Command Track */ +#define DMUS_FOURCC_COMMANDTRACK_CHUNK mmioFOURCC('c','m','n','d') +/* Lyrics Track */ +#define DMUS_FOURCC_LYRICSTRACK_LIST mmioFOURCC('l','y','r','t') +#define DMUS_FOURCC_LYRICSTRACKEVENTS_LIST mmioFOURCC('l','y','r','l') +#define DMUS_FOURCC_LYRICSTRACKEVENT_LIST mmioFOURCC('l','y','r','e') +#define DMUS_FOURCC_LYRICSTRACKEVENTHEADER_CHUNK mmioFOURCC('l','y','r','h') +#define DMUS_FOURCC_LYRICSTRACKEVENTTEXT_CHUNK mmioFOURCC('l','y','r','n') +/* Marker Track */ +#define DMUS_FOURCC_MARKERTRACK_LIST mmioFOURCC('M','A','R','K') +#define DMUS_FOURCC_VALIDSTART_CHUNK mmioFOURCC('v','a','l','s') +#define DMUS_FOURCC_PLAYMARKER_CHUNK mmioFOURCC('p','l','a','y') +/* Mute Track */ +#define DMUS_FOURCC_MUTE_CHUNK mmioFOURCC('m','u','t','e') +/* Parameter Control Track */ +#define DMUS_FOURCC_PARAMCONTROLTRACK_TRACK_LIST mmioFOURCC('p','r','m','t') +#define DMUS_FOURCC_PARAMCONTROLTRACK_OBJECT_LIST mmioFOURCC('p','r','o','l') +#define DMUS_FOURCC_PARAMCONTROLTRACK_OBJECT_CHUNK mmioFOURCC('p','r','o','h') +#define DMUS_FOURCC_PARAMCONTROLTRACK_PARAM_LIST mmioFOURCC('p','r','p','l') +#define DMUS_FOURCC_PARAMCONTROLTRACK_PARAM_CHUNK mmioFOURCC('p','r','p','h') +#define DMUS_FOURCC_PARAMCONTROLTRACK_CURVES_CHUNK mmioFOURCC('p','r','c','c') +/* Pattern Track */ +#define DMUS_FOURCC_PATTERN_FORM mmioFOURCC('D','M','P','T') +/* Script Track */ +#define DMUS_FOURCC_SCRIPTTRACK_LIST mmioFOURCC('s','c','r','t') +#define DMUS_FOURCC_SCRIPTTRACKEVENTS_LIST mmioFOURCC('s','c','r','l') +#define DMUS_FOURCC_SCRIPTTRACKEVENT_LIST mmioFOURCC('s','c','r','e') +#define DMUS_FOURCC_SCRIPTTRACKEVENTHEADER_CHUNK mmioFOURCC('s','c','r','h') +#define DMUS_FOURCC_SCRIPTTRACKEVENTNAME_CHUNK mmioFOURCC('s','c','r','n') +/* Segment Trgigger Track */ +#define DMUS_FOURCC_SEGTRACK_LIST mmioFOURCC('s','e','g','t') +#define DMUS_FOURCC_SEGTRACK_CHUNK mmioFOURCC('s','g','t','h') +#define DMUS_FOURCC_SEGMENTS_LIST mmioFOURCC('l','s','g','l') +#define DMUS_FOURCC_SEGMENT_LIST mmioFOURCC('l','s','e','g') +#define DMUS_FOURCC_SEGMENTITEM_CHUNK mmioFOURCC('s','g','i','h') +#define DMUS_FOURCC_SEGMENTITEMNAME_CHUNK mmioFOURCC('s','n','a','m') +/* Sequence Track */ +#define DMUS_FOURCC_SEQ_TRACK mmioFOURCC('s','e','q','t') +#define DMUS_FOURCC_SEQ_LIST mmioFOURCC('e','v','t','l') +#define DMUS_FOURCC_CURVE_LIST mmioFOURCC('c','u','r','l') +/* Signpost Track */ +#define DMUS_FOURCC_SIGNPOST_TRACK_CHUNK mmioFOURCC('s','g','n','p') +/* Style Track */ +#define DMUS_FOURCC_STYLE_TRACK_LIST mmioFOURCC('s','t','t','r') +#define DMUS_FOURCC_STYLE_REF_LIST mmioFOURCC('s','t','r','f') +/* SysEx Track */ +#define DMUS_FOURCC_SYSEX_TRACK mmioFOURCC('s','y','e','x') +/* Tempo Track */ +#define DMUS_FOURCC_TEMPO_TRACK mmioFOURCC('t','e','t','r') +/* Time Signature Track */ +#define DMUS_FOURCC_TIMESIGNATURE_TRACK mmioFOURCC('t','i','m','s') +#define DMUS_FOURCC_TIMESIGTRACK_LIST mmioFOURCC('T','I','M','S') +#define DMUS_FOURCC_TIMESIG_CHUNK DMUS_FOURCC_TIMESIGNATURE_TRACK +/* Wave Track */ +#define DMUS_FOURCC_WAVETRACK_LIST mmioFOURCC('w','a','v','t') +#define DMUS_FOURCC_WAVETRACK_CHUNK mmioFOURCC('w','a','t','h') +#define DMUS_FOURCC_WAVEPART_LIST mmioFOURCC('w','a','v','p') +#define DMUS_FOURCC_WAVEPART_CHUNK mmioFOURCC('w','a','p','h') +#define DMUS_FOURCC_WAVEITEM_LIST mmioFOURCC('w','a','v','i') +#define DMUS_FOURCC_WAVE_LIST mmioFOURCC('w','a','v','e') +#define DMUS_FOURCC_WAVEITEM_CHUNK mmioFOURCC('w','a','i','h') +/* Wave Header */ +#define DMUS_FOURCC_WAVEHEADER_CHUNK mmioFOURCC('w','a','v','h') -#define DMUS_FOURCC_STYLE_FORM mmioFOURCC('D','M','S','T') -#define DMUS_FOURCC_STYLE_CHUNK mmioFOURCC('s','t','y','h') -#define DMUS_FOURCC_PART_LIST mmioFOURCC('p','a','r','t') -#define DMUS_FOURCC_PART_CHUNK mmioFOURCC('p','r','t','h') -#define DMUS_FOURCC_NOTE_CHUNK mmioFOURCC('n','o','t','e') -#define DMUS_FOURCC_CURVE_CHUNK mmioFOURCC('c','r','v','e') -#define DMUS_FOURCC_MARKER_CHUNK mmioFOURCC('m','r','k','r') -#define DMUS_FOURCC_RESOLUTION_CHUNK mmioFOURCC('r','s','l','n') -#define DMUS_FOURCC_ANTICIPATION_CHUNK mmioFOURCC('a','n','p','n') -#define DMUS_FOURCC_PATTERN_LIST mmioFOURCC('p','t','t','n') -#define DMUS_FOURCC_PATTERN_CHUNK mmioFOURCC('p','t','n','h') -#define DMUS_FOURCC_RHYTHM_CHUNK mmioFOURCC('r','h','t','m') -#define DMUS_FOURCC_PARTREF_LIST mmioFOURCC('p','r','e','f') -#define DMUS_FOURCC_PARTREF_CHUNK mmioFOURCC('p','r','f','c') -#define DMUS_FOURCC_STYLE_PERS_REF_LIST mmioFOURCC('p','r','r','f') -#define DMUS_FOURCC_MOTIFSETTINGS_CHUNK mmioFOURCC('m','t','f','s') - -#define DMUS_FOURCC_PATTERN_FORM mmioFOURCC('D','M','P','T') - -#define DMUS_FOURCC_CHORDTRACK_LIST mmioFOURCC('c','o','r','d') -#define DMUS_FOURCC_CHORDTRACKHEADER_CHUNK mmioFOURCC('c','r','d','h') -#define DMUS_FOURCC_CHORDTRACKBODY_CHUNK mmioFOURCC('c','r','d','b') - -#define DMUS_FOURCC_COMMANDTRACK_CHUNK mmioFOURCC('c','m','n','d') - -#define DMUS_FOURCC_TOOLGRAPH_FORM mmioFOURCC('D','M','T','G') -#define DMUS_FOURCC_TOOL_LIST mmioFOURCC('t','o','l','l') -#define DMUS_FOURCC_TOOL_FORM mmioFOURCC('D','M','T','L') -#define DMUS_FOURCC_TOOL_CHUNK mmioFOURCC('t','o','l','h') - -#define DMUS_FOURCC_AUDIOPATH_FORM mmioFOURCC('D','M','A','P') - -#define DMUS_FOURCC_PORTCONFIGS_LIST mmioFOURCC('p','c','s','l') -#define DMUS_FOURCC_PORTCONFIG_LIST mmioFOURCC('p','c','f','l') -#define DMUS_FOURCC_PORTCONFIG_ITEM mmioFOURCC('p','c','f','h') -#define DMUS_FOURCC_PORTPARAMS_ITEM mmioFOURCC('p','p','r','h') -#define DMUS_FOURCC_DSBUFFER_LIST mmioFOURCC('d','b','f','l') -#define DMUS_FOURCC_DSBUFFATTR_ITEM mmioFOURCC('d','d','a','h') -#define DMUS_FOURCC_PCHANNELS_LIST mmioFOURCC('p','c','h','l') -#define DMUS_FOURCC_PCHANNELS_ITEM mmioFOURCC('p','c','h','h') - -#define DMUS_FOURCC_BANDTRACK_FORM mmioFOURCC('D','M','B','T') -#define DMUS_FOURCC_BANDTRACK_CHUNK mmioFOURCC('b','d','t','h') -#define DMUS_FOURCC_BANDS_LIST mmioFOURCC('l','b','d','l') -#define DMUS_FOURCC_BAND_LIST mmioFOURCC('l','b','n','d') -#define DMUS_FOURCC_BANDITEM_CHUNK mmioFOURCC('b','d','i','h') -#define DMUS_FOURCC_BANDITEM_CHUNK2 mmioFOURCC('b','d','2','h') - -#define DMUS_FOURCC_BAND_FORM mmioFOURCC('D','M','B','D') -#define DMUS_FOURCC_INSTRUMENTS_LIST mmioFOURCC('l','b','i','l') -#define DMUS_FOURCC_INSTRUMENT_LIST mmioFOURCC('l','b','i','n') -#define DMUS_FOURCC_INSTRUMENT_CHUNK mmioFOURCC('b','i','n','s') - -#define DMUS_FOURCC_WAVEHEADER_CHUNK mmioFOURCC('w','a','v','h') - -#define DMUS_FOURCC_WAVETRACK_LIST mmioFOURCC('w','a','v','t') -#define DMUS_FOURCC_WAVETRACK_CHUNK mmioFOURCC('w','a','t','h') -#define DMUS_FOURCC_WAVEPART_LIST mmioFOURCC('w','a','v','p') -#define DMUS_FOURCC_WAVEPART_CHUNK mmioFOURCC('w','a','p','h') -#define DMUS_FOURCC_WAVEITEM_LIST mmioFOURCC('w','a','v','i') -#define DMUS_FOURCC_WAVE_LIST mmioFOURCC('w','a','v','e') -#define DMUS_FOURCC_WAVEITEM_CHUNK mmioFOURCC('w','a','i','h') - -#define DMUS_FOURCC_CONTAINER_FORM mmioFOURCC('D','M','C','N') -#define DMUS_FOURCC_CONTAINER_CHUNK mmioFOURCC('c','o','n','h') -#define DMUS_FOURCC_CONTAINED_ALIAS_CHUNK mmioFOURCC('c','o','b','a') -#define DMUS_FOURCC_CONTAINED_OBJECT_CHUNK mmioFOURCC('c','o','b','h') -#define DMUS_FOURCC_CONTAINED_OBJECTS_LIST mmioFOURCC('c','o','s','l') -#define DMUS_FOURCC_CONTAINED_OBJECT_LIST mmioFOURCC('c','o','b','l') - -#define DMUS_FOURCC_SEGMENT_FORM mmioFOURCC('D','M','S','G') -#define DMUS_FOURCC_SEGMENT_CHUNK mmioFOURCC('s','e','g','h') -#define DMUS_FOURCC_TRACK_LIST mmioFOURCC('t','r','k','l') -#define DMUS_FOURCC_TRACK_FORM mmioFOURCC('D','M','T','K') -#define DMUS_FOURCC_TRACK_CHUNK mmioFOURCC('t','r','k','h') -#define DMUS_FOURCC_TRACK_EXTRAS_CHUNK mmioFOURCC('t','r','k','x') - -#define DMUS_FOURCC_SONG_FORM mmioFOURCC('D','M','S','O') -#define DMUS_FOURCC_SONG_CHUNK mmioFOURCC('s','n','g','h') -#define DMUS_FOURCC_SONGSEGMENTS_LIST mmioFOURCC('s','e','g','l') -#define DMUS_FOURCC_SONGSEGMENT_LIST mmioFOURCC('s','s','g','l') -#define DMUS_FOURCC_TOOLGRAPHS_LIST mmioFOURCC('t','l','g','l') -#define DMUS_FOURCC_SEGREFS_LIST mmioFOURCC('s','r','s','l') -#define DMUS_FOURCC_SEGREF_LIST mmioFOURCC('s','g','r','l') -#define DMUS_FOURCC_SEGREF_CHUNK mmioFOURCC('s','g','r','h') -#define DMUS_FOURCC_SEGTRANS_CHUNK mmioFOURCC('s','t','r','h') -#define DMUS_FOURCC_TRACKREFS_LIST mmioFOURCC('t','r','s','l') -#define DMUS_FOURCC_TRACKREF_LIST mmioFOURCC('t','k','r','l') -#define DMUS_FOURCC_TRACKREF_CHUNK mmioFOURCC('t','k','r','h') - -#define DMUS_FOURCC_REF_LIST mmioFOURCC('D','M','R','F') -#define DMUS_FOURCC_REF_CHUNK mmioFOURCC('r','e','f','h') -#define DMUS_FOURCC_DATE_CHUNK mmioFOURCC('d','a','t','e') -#define DMUS_FOURCC_NAME_CHUNK mmioFOURCC('n','a','m','e') -#define DMUS_FOURCC_FILE_CHUNK mmioFOURCC('f','i','l','e') - -#define DMUS_FOURCC_CHORDMAP_FORM mmioFOURCC('D','M','P','R') -#define DMUS_FOURCC_IOCHORDMAP_CHUNK mmioFOURCC('p','e','r','h') -#define DMUS_FOURCC_SUBCHORD_CHUNK mmioFOURCC('c','h','d','t') -#define DMUS_FOURCC_CHORDENTRY_CHUNK mmioFOURCC('c','h','e','h') -#define DMUS_FOURCC_SUBCHORDID_CHUNK mmioFOURCC('s','b','c','n') -#define DMUS_FOURCC_IONEXTCHORD_CHUNK mmioFOURCC('n','c','r','d') -#define DMUS_FOURCC_NEXTCHORDSEQ_CHUNK mmioFOURCC('n','c','s','q') -#define DMUS_FOURCC_IOSIGNPOST_CHUNK mmioFOURCC('s','p','s','h') -#define DMUS_FOURCC_CHORDNAME_CHUNK mmioFOURCC('I','N','A','M') - -#define DMUS_FOURCC_CHORDENTRY_LIST mmioFOURCC('c','h','o','e') -#define DMUS_FOURCC_CHORDMAP_LIST mmioFOURCC('c','m','a','p') -#define DMUS_FOURCC_CHORD_LIST mmioFOURCC('c','h','r','d') -#define DMUS_FOURCC_CHORDPALETTE_LIST mmioFOURCC('c','h','p','l') -#define DMUS_FOURCC_CADENCE_LIST mmioFOURCC('c','a','d','e') -#define DMUS_FOURCC_SIGNPOSTITEM_LIST mmioFOURCC('s','p','s','t') - -#define DMUS_FOURCC_SIGNPOST_LIST mmioFOURCC('s','p','s','q') - -#define DMUS_FOURCC_SCRIPT_FORM mmioFOURCC('D','M','S','C') -#define DMUS_FOURCC_SCRIPT_CHUNK mmioFOURCC('s','c','h','d') -#define DMUS_FOURCC_SCRIPTVERSION_CHUNK mmioFOURCC('s','c','v','e') -#define DMUS_FOURCC_SCRIPTLANGUAGE_CHUNK mmioFOURCC('s','c','l','a') -#define DMUS_FOURCC_SCRIPTSOURCE_CHUNK mmioFOURCC('s','c','s','r') - -#define DMUS_FOURCC_SIGNPOST_TRACK_CHUNK mmioFOURCC('s','g','n','p') - -#define DMUS_FOURCC_MUTE_CHUNK mmioFOURCC('m','u','t','e') - -#define DMUS_FOURCC_TIME_STAMP_CHUNK mmioFOURCC('s','t','m','p') - -#define DMUS_FOURCC_STYLE_TRACK_LIST mmioFOURCC('s','t','t','r') -#define DMUS_FOURCC_STYLE_REF_LIST mmioFOURCC('s','t','r','f') - -#define DMUS_FOURCC_PERS_TRACK_LIST mmioFOURCC('p','f','t','r') -#define DMUS_FOURCC_PERS_REF_LIST mmioFOURCC('p','f','r','f') - -#define DMUS_FOURCC_TEMPO_TRACK mmioFOURCC('t','e','t','r') - -#define DMUS_FOURCC_SEQ_TRACK mmioFOURCC('s','e','q','t') -#define DMUS_FOURCC_SEQ_LIST mmioFOURCC('e','v','t','l') -#define DMUS_FOURCC_CURVE_LIST mmioFOURCC('c','u','r','l') - -#define DMUS_FOURCC_SYSEX_TRACK mmioFOURCC('s','y','e','x') - -#define DMUS_FOURCC_TIMESIGNATURE_TRACK mmioFOURCC('t','i','m','s') - -#define DMUS_FOURCC_TIMESIGTRACK_LIST mmioFOURCC('T','I','M','S') -#define DMUS_FOURCC_TIMESIG_CHUNK DMUS_FOURCC_TIMESIGNATURE_TRACK - -#define DMUS_FOURCC_MARKERTRACK_LIST mmioFOURCC('M','A','R','K') -#define DMUS_FOURCC_VALIDSTART_CHUNK mmioFOURCC('v','a','l','s') -#define DMUS_FOURCC_PLAYMARKER_CHUNK mmioFOURCC('p','l','a','y') - -#define DMUS_FOURCC_SEGTRACK_LIST mmioFOURCC('s','e','g','t') -#define DMUS_FOURCC_SEGTRACK_CHUNK mmioFOURCC('s','g','t','h') -#define DMUS_FOURCC_SEGMENTS_LIST mmioFOURCC('l','s','g','l') -#define DMUS_FOURCC_SEGMENT_LIST mmioFOURCC('l','s','e','g') -#define DMUS_FOURCC_SEGMENTITEM_CHUNK mmioFOURCC('s','g','i','h') -#define DMUS_FOURCC_SEGMENTITEMNAME_CHUNK mmioFOURCC('s','n','a','m') - -#define DMUS_FOURCC_SCRIPTTRACK_LIST mmioFOURCC('s','c','r','t') -#define DMUS_FOURCC_SCRIPTTRACKEVENTS_LIST mmioFOURCC('s','c','r','l') -#define DMUS_FOURCC_SCRIPTTRACKEVENT_LIST mmioFOURCC('s','c','r','e') -#define DMUS_FOURCC_SCRIPTTRACKEVENTHEADER_CHUNK mmioFOURCC('s','c','r','h') -#define DMUS_FOURCC_SCRIPTTRACKEVENTNAME_CHUNK mmioFOURCC('s','c','r','n') - -#define DMUS_FOURCC_LYRICSTRACK_LIST mmioFOURCC('l','y','r','t') -#define DMUS_FOURCC_LYRICSTRACKEVENTS_LIST mmioFOURCC('l','y','r','l') -#define DMUS_FOURCC_LYRICSTRACKEVENT_LIST mmioFOURCC('l','y','r','e') -#define DMUS_FOURCC_LYRICSTRACKEVENTHEADER_CHUNK mmioFOURCC('l','y','r','h') -#define DMUS_FOURCC_LYRICSTRACKEVENTTEXT_CHUNK mmioFOURCC('l','y','r','n') - -#define DMUS_FOURCC_PARAMCONTROLTRACK_TRACK_LIST mmioFOURCC('p','r','m','t') -#define DMUS_FOURCC_PARAMCONTROLTRACK_OBJECT_LIST mmioFOURCC('p','r','o','l') -#define DMUS_FOURCC_PARAMCONTROLTRACK_OBJECT_CHUNK mmioFOURCC('p','r','o','h') -#define DMUS_FOURCC_PARAMCONTROLTRACK_PARAM_LIST mmioFOURCC('p','r','p','l') -#define DMUS_FOURCC_PARAMCONTROLTRACK_PARAM_CHUNK mmioFOURCC('p','r','p','h') -#define DMUS_FOURCC_PARAMCONTROLTRACK_CURVES_CHUNK mmioFOURCC('p','r','c','c') - -#define DMUS_FOURCC_MELODYFORM_TRACK_LIST mmioFOURCC('m','f','r','m') -#define DMUS_FOURCC_MELODYFORM_HEADER_CHUNK mmioFOURCC('m','l','f','h') -#define DMUS_FOURCC_MELODYFORM_BODY_CHUNK mmioFOURCC('m','l','f','b') - -#define DMUS_FOURCC_DSBC_FORM mmioFOURCC('D','S','B','C') -#define DMUS_FOURCC_DSBD_CHUNK mmioFOURCC('d','s','b','d') -#define DMUS_FOURCC_BSID_CHUNK mmioFOURCC('b','s','i','d') -#define DMUS_FOURCC_DS3D_CHUNK mmioFOURCC('d','s','3','d') -#define DMUS_FOURCC_DSBC_LIST mmioFOURCC('f','x','l','s') -#define DMUS_FOURCC_DSFX_FORM mmioFOURCC('D','S','F','X') -#define DMUS_FOURCC_DSFX_CHUNK mmioFOURCC('f','x','h','r') -#define DMUS_FOURCC_DSFX_DATA mmioFOURCC('d','a','t','a') /***************************************************************************** - * Definitons + * Flags */ -#define DMUS_VARIATIONF_MAJOR 0x0000007F -#define DMUS_VARIATIONF_MINOR 0x00003F80 -#define DMUS_VARIATIONF_OTHER 0x001FC000 -#define DMUS_VARIATIONF_ROOT_SCALE 0x00200000 -#define DMUS_VARIATIONF_ROOT_FLAT 0x00400000 -#define DMUS_VARIATIONF_ROOT_SHARP 0x00800000 -#define DMUS_VARIATIONF_TYPE_TRIAD 0x01000000 -#define DMUS_VARIATIONF_TYPE_6AND7 0x02000000 -#define DMUS_VARIATIONF_TYPE_COMPLEX 0x04000000 -#define DMUS_VARIATIONF_DEST_TO1 0x08000000 -#define DMUS_VARIATIONF_DEST_TO5 0x10000000 -#define DMUS_VARIATIONF_DEST_OTHER 0x40000000 -#define DMUS_VARIATIONF_MODES 0xE0000000 -#define DMUS_VARIATIONF_MODES_EX (0x20000000 | 0x80000000) -#define DMUS_VARIATIONF_IMA25_MODE 0x00000000 -#define DMUS_VARIATIONF_DMUS_MODE 0x20000000 +#define DMUS_BUFFERF_SHARED 0x1 +#define DMUS_BUFFERF_DEFINED 0x2 +#define DMUS_BUFFERF_MIXIN 0x8 -#define DMUS_PARTF_USE_MARKERS 0x1 -#define DMUS_PARTF_ALIGN_CHORDS 0x2 -#define DMUS_MARKERF_START 0x1 -#define DMUS_MARKERF_STOP 0x2 -#define DMUS_MARKERF_CHORD_ALIGN 0x4 -#define DMUS_PATTERNF_PERSIST_CONTROL 0x1 +#define DMUS_CHORDMAPF_VERSION8 0x1 -#define DMUS_PORTCONFIGF_DRUMSON10 1 -#define DMUS_PORTCONFIGF_USEDEFAULT 2 +#define DMUS_CONTAINED_OBJF_KEEP 0x1 -#define DMUS_BUFFERF_SHARED 1 -#define DMUS_BUFFERF_DEFINED 2 -#define DMUS_BUFFERF_MIXIN 8 +#define DMUS_CONTAINER_NOLOADS 0x2 -#define DMUS_IO_INST_PATCH 1 -#define DMUS_IO_INST_BANKSELECT 2 -#define DMUS_IO_INST_ASSIGN_PATCH 8 -#define DMUS_IO_INST_NOTERANGES 16 -#define DMUS_IO_INST_PAN 32 -#define DMUS_IO_INST_VOLUME 64 -#define DMUS_IO_INST_TRANSPOSE 128 -#define DMUS_IO_INST_GM 256 -#define DMUS_IO_INST_GS 512 -#define DMUS_IO_INST_XG 1024 -#define DMUS_IO_INST_CHANNEL_PRIORITY 2048 -#define DMUS_IO_INST_USE_DEFAULT_GM_SET 4096 -#define DMUS_IO_INST_PITCHBENDRANGE 8192 +#define DMUS_IO_INST_PATCH 0x0001 +#define DMUS_IO_INST_BANKSELECT 0x0002 +#define DMUS_IO_INST_ASSIGN_PATCH 0x0008 +#define DMUS_IO_INST_NOTERANGES 0x0010 +#define DMUS_IO_INST_PAN 0x0020 +#define DMUS_IO_INST_VOLUME 0x0040 +#define DMUS_IO_INST_TRANSPOSE 0x0080 +#define DMUS_IO_INST_GM 0x0100 +#define DMUS_IO_INST_GS 0x0200 +#define DMUS_IO_INST_XG 0x0400 +#define DMUS_IO_INST_CHANNEL_PRIORITY 0x0800 +#define DMUS_IO_INST_USE_DEFAULT_GM_SET 0x1000 +#define DMUS_IO_INST_PITCHBENDRANGE 0x2000 -#define DMUS_WAVETRACKF_SYNC_VAR 0x1 -#define DMUS_WAVETRACKF_PERSIST_CONTROL 0x2 +#define DMUS_IO_SCRIPTTRACKF_PREPARE 0x1 +#define DMUS_IO_SCRIPTTRACKF_QUEUE 0x2 +#define DMUS_IO_SCRIPTTRACKF_ATTIME 0x4 -#define DMUS_CONTAINED_OBJF_KEEP 1 -#define DMUS_CONTAINER_NOLOADS 2 +#define DMUS_MARKERF_START 0x1 +#define DMUS_MARKERF_STOP 0x2 +#define DMUS_MARKERF_CHORD_ALIGN 0x4 -#define DMUS_SEGIOF_REFLENGTH 1 +#define DMUS_PATTERNF_PERSIST_CONTROL 0x1 -#define DMUS_SONG_MAXSEGID 0x7FFFFFFF -#define DMUS_SONG_ANYSEG 0x80000000 -#define DMUS_SONG_NOSEG 0xFFFFFFFF -#define DMUS_SONG_NOFROMSEG 0x80000001 +#define DMUS_PARTF_USE_MARKERS 0x1 +#define DMUS_PARTF_ALIGN_CHORDS 0x2 -#define DMUS_SIGNPOSTF_A 1 -#define DMUS_SIGNPOSTF_B 2 -#define DMUS_SIGNPOSTF_C 4 -#define DMUS_SIGNPOSTF_D 8 -#define DMUS_SIGNPOSTF_E 0x10 -#define DMUS_SIGNPOSTF_F 0x20 -#define DMUS_SIGNPOSTF_LETTER (DMUS_SIGNPOSTF_A | DMUS_SIGNPOSTF_B | DMUS_SIGNPOSTF_C | DMUS_SIGNPOSTF_D | DMUS_SIGNPOSTF_E | DMUS_SIGNPOSTF_F) -#define DMUS_SIGNPOSTF_1 0x100 -#define DMUS_SIGNPOSTF_2 0x200 -#define DMUS_SIGNPOSTF_3 0x400 -#define DMUS_SIGNPOSTF_4 0x800 -#define DMUS_SIGNPOSTF_5 0x1000 -#define DMUS_SIGNPOSTF_6 0x2000 -#define DMUS_SIGNPOSTF_7 0x4000 -#define DMUS_SIGNPOSTF_ROOT (DMUS_SIGNPOSTF_1 | DMUS_SIGNPOSTF_2 | DMUS_SIGNPOSTF_3 | DMUS_SIGNPOSTF_4 | DMUS_SIGNPOSTF_5 | DMUS_SIGNPOSTF_6 | DMUS_SIGNPOSTF_7) -#define DMUS_SIGNPOSTF_CADENCE 0x8000 +#define DMUS_PORTCONFIGF_DRUMSON10 0x1 +#define DMUS_PORTCONFIGF_USEDEFAULT 0x2 -#define DMUS_CHORDMAPF_VERSION8 1 +#define DMUS_SCRIPTIOF_LOAD_ALL_CONTENT 0x1 +#define DMUS_SCRIPTIOF_DOWNLOAD_ALL_SEGMENTS 0x2 -#define DMUS_SPOSTCADENCEF_1 2 -#define DMUS_SPOSTCADENCEF_2 4 +#define DMUS_SEGIOF_REFLENGTH 0x1 +#define DMUS_SEGIOF_CLOCKTIME 0x2 + +#define DMUS_SEGMENTTRACKF_MOTIF 0x1 + +/* Song flags; MS doesn't support this in DX 9.0 anymore */ +#define DMUS_SONG_MAXSEGID 0x7FFFFFFF +#define DMUS_SONG_ANYSEG 0x80000000 +#define DMUS_SONG_NOSEG 0xFFFFFFFF +#define DMUS_SONG_NOFROMSEG 0x80000001 + +#define DMUS_SIGNPOSTF_A 0x0001 +#define DMUS_SIGNPOSTF_B 0x0002 +#define DMUS_SIGNPOSTF_C 0x0004 +#define DMUS_SIGNPOSTF_D 0x0008 +#define DMUS_SIGNPOSTF_E 0x0010 +#define DMUS_SIGNPOSTF_F 0x0020 +#define DMUS_SIGNPOSTF_1 0x0100 +#define DMUS_SIGNPOSTF_2 0x0200 +#define DMUS_SIGNPOSTF_3 0x0400 +#define DMUS_SIGNPOSTF_4 0x0800 +#define DMUS_SIGNPOSTF_5 0x1000 +#define DMUS_SIGNPOSTF_6 0x2000 +#define DMUS_SIGNPOSTF_7 0x4000 +#define DMUS_SIGNPOSTF_CADENCE 0x8000 +#define DMUS_SIGNPOSTF_LETTER (DMUS_SIGNPOSTF_A | DMUS_SIGNPOSTF_B | DMUS_SIGNPOSTF_C | DMUS_SIGNPOSTF_D | DMUS_SIGNPOSTF_E | DMUS_SIGNPOSTF_F) +#define DMUS_SIGNPOSTF_ROOT (DMUS_SIGNPOSTF_1 | DMUS_SIGNPOSTF_2 | DMUS_SIGNPOSTF_3 | DMUS_SIGNPOSTF_4 | DMUS_SIGNPOSTF_5 | DMUS_SIGNPOSTF_6 | DMUS_SIGNPOSTF_7) + +#define DMUS_SPOSTCADENCEF_1 0x2 +#define DMUS_SPOSTCADENCEF_2 0x4 + +#define DMUS_VARIATIONF_MAJOR 0x0000007F +#define DMUS_VARIATIONF_MINOR 0x00003F80 +#define DMUS_VARIATIONF_OTHER 0x001FC000 +#define DMUS_VARIATIONF_ROOT_SCALE 0x00200000 +#define DMUS_VARIATIONF_ROOT_FLAT 0x00400000 +#define DMUS_VARIATIONF_ROOT_SHARP 0x00800000 +#define DMUS_VARIATIONF_TYPE_TRIAD 0x01000000 +#define DMUS_VARIATIONF_TYPE_6AND7 0x02000000 +#define DMUS_VARIATIONF_TYPE_COMPLEX 0x04000000 +#define DMUS_VARIATIONF_DEST_TO1 0x08000000 +#define DMUS_VARIATIONF_DEST_TO5 0x10000000 +#define DMUS_VARIATIONF_DEST_OTHER 0x40000000 +#define DMUS_VARIATIONF_MODES 0xE0000000 +#define DMUS_VARIATIONF_MODES_EX (0x20000000 | 0x80000000) +#define DMUS_VARIATIONF_IMA25_MODE 0x00000000 +#define DMUS_VARIATIONF_DMUS_MODE 0x20000000 + +#define DMUS_WAVETRACKF_SYNC_VAR 0x1 +#define DMUS_WAVETRACKF_PERSIST_CONTROL 0x2 -#define DMUS_SCRIPTIOF_LOAD_ALL_CONTENT 1 -#define DMUS_SCRIPTIOF_DOWNLOAD_ALL_SEGMENTS 2 +/***************************************************************************** + * Enumerations + */ +/* typedef definitions */ +typedef enum enumDMUS_VARIATIONT_TYPES DMUS_VARIATIONT_TYPES; +typedef enum enumDMUS_EMBELLISHT_TYPES DMUS_EMBELLISHT_TYPES; +typedef enum enumDMUS_PATTERNT_TYPES DMUS_PATTERNT_TYPES; -#define DMUS_SEGMENTTRACKF_MOTIF 1 +/* actual enumerations */ +enum enumDMUS_VARIATIONT_TYPES { + DMUS_VARIATIONT_SEQUENTIAL = 0x0, + DMUS_VARIATIONT_RANDOM = 0x1, + DMUS_VARIATIONT_RANDOM_START = 0x2, + DMUS_VARIATIONT_NO_REPEAT = 0x3, + DMUS_VARIATIONT_RANDOM_ROW = 0x4 +}; + +enum enumDMUS_EMBELLISHT_TYPES { + DMUS_EMBELLISHT_NORMAL = 0x0000, + DMUS_EMBELLISHT_FILL = 0x0001, + DMUS_EMBELLISHT_BREAK = 0x0002, + DMUS_EMBELLISHT_INTRO = 0x0004, + DMUS_EMBELLISHT_END = 0x0008, + DMUS_EMBELLISHT_MOTIF = 0x0010, + DMUS_EMBELLISHT_ALL = 0xFFFF +}; + +enum enumDMUS_PATTERNT_TYPES { + DMUS_PATTERNT_RANDOM = 0x0, + DMUS_PATTERNT_REPEAT = 0x1, + DMUS_PATTERNT_SEQUENTIAL = 0x2, + DMUS_PATTERNT_RANDOM_START = 0x3, + DMUS_PATTERNT_NO_REPEAT = 0x4, + DMUS_PATTERNT_RANDOM_ROW = 0x5 +}; -#define DMUS_IO_SCRIPTTRACKF_PREPARE 1 -#define DMUS_IO_SCRIPTTRACKF_QUEUE 2 -#define DMUS_IO_SCRIPTTRACKF_ATTIME 4 /***************************************************************************** * Structures */ -typedef struct _DMUS_IO_SEQ_ITEM -{ - MUSIC_TIME mtTime; - MUSIC_TIME mtDuration; - DWORD dwPChannel; - short nOffset; - BYTE bStatus; - BYTE bByte1; - BYTE bByte2; -} DMUS_IO_SEQ_ITEM; - -typedef struct _DMUS_IO_CURVE_ITEM -{ - MUSIC_TIME mtStart; - MUSIC_TIME mtDuration; - MUSIC_TIME mtResetDuration; - DWORD dwPChannel; - short nOffset; - short nStartValue; - short nEndValue; - short nResetValue; - BYTE bType; - BYTE bCurveShape; - BYTE bCCData; - BYTE bFlags; - WORD wParamType; - WORD wMergeIndex; -} DMUS_IO_CURVE_ITEM; - -typedef struct _DMUS_IO_TEMPO_ITEM -{ - MUSIC_TIME lTime; - double dblTempo; -} DMUS_IO_TEMPO_ITEM; - -typedef struct _DMUS_IO_SYSEX_ITEM -{ - MUSIC_TIME mtTime; - DWORD dwPChannel; - DWORD dwSysExLength; -} DMUS_IO_SYSEX_ITEM; - -typedef DMUS_CHORD_KEY DMUS_CHORD_PARAM; - -typedef struct _DMUS_RHYTHM_PARAM -{ - DMUS_TIMESIGNATURE TimeSig; - DWORD dwRhythmPattern; -} DMUS_RHYTHM_PARAM; - -typedef struct _DMUS_TEMPO_PARAM -{ - MUSIC_TIME mtTime; - double dblTempo; -} DMUS_TEMPO_PARAM; - -typedef struct _DMUS_MUTE_PARAM -{ - DWORD dwPChannel; - DWORD dwPChannelMap; - BOOL fMute; -} DMUS_MUTE_PARAM; - - -typedef enum enumDMUS_VARIATIONT_TYPES -{ - DMUS_VARIATIONT_SEQUENTIAL = 0, - DMUS_VARIATIONT_RANDOM = 1, - DMUS_VARIATIONT_RANDOM_START = 2, - DMUS_VARIATIONT_NO_REPEAT = 3, - DMUS_VARIATIONT_RANDOM_ROW = 4 -} DMUS_VARIATIONT_TYPES; - -typedef struct _DMUS_IO_TIMESIG -{ - BYTE bBeatsPerMeasure; - BYTE bBeat; - WORD wGridsPerBeat; -} DMUS_IO_TIMESIG; - -typedef struct _DMUS_IO_STYLE -{ - DMUS_IO_TIMESIG timeSig; - double dblTempo; -} DMUS_IO_STYLE; - -typedef struct _DMUS_IO_VERSION -{ - DWORD dwVersionMS; - DWORD dwVersionLS; -} DMUS_IO_VERSION; - -typedef struct _DMUS_IO_PATTERN -{ - DMUS_IO_TIMESIG timeSig; - BYTE bGrooveBottom; - BYTE bGrooveTop; - WORD wEmbellishment; - WORD wNbrMeasures; - BYTE bDestGrooveBottom; - BYTE bDestGrooveTop; - DWORD dwFlags; -} DMUS_IO_PATTERN; - -typedef struct _DMUS_IO_STYLEPART -{ - DMUS_IO_TIMESIG timeSig; - DWORD dwVariationChoices[32]; - GUID guidPartID; - WORD wNbrMeasures; - BYTE bPlayModeFlags; - BYTE bInvertUpper; - BYTE bInvertLower; - BYTE bPad[3]; - DWORD dwFlags; -} DMUS_IO_STYLEPART; - -typedef struct _DMUS_IO_PARTREF -{ - GUID guidPartID; - WORD wLogicalPartID; - BYTE bVariationLockID; - BYTE bSubChordLevel; - BYTE bPriority; - BYTE bRandomVariation; - WORD wPad; - DWORD dwPChannel; -} DMUS_IO_PARTREF; - -typedef struct _DMUS_IO_STYLENOTE -{ - MUSIC_TIME mtGridStart; - DWORD dwVariation; - MUSIC_TIME mtDuration; - short nTimeOffset; - WORD wMusicValue; - BYTE bVelocity; - BYTE bTimeRange; - BYTE bDurRange; - BYTE bVelRange; - BYTE bInversionID; - BYTE bPlayModeFlags; - BYTE bNoteFlags; -} DMUS_IO_STYLENOTE; - -typedef struct _DMUS_IO_STYLECURVE -{ - MUSIC_TIME mtGridStart; - DWORD dwVariation; - MUSIC_TIME mtDuration; - MUSIC_TIME mtResetDuration; - short nTimeOffset; - short nStartValue; - short nEndValue; - short nResetValue; - BYTE bEventType; - BYTE bCurveShape; - BYTE bCCData; - BYTE bFlags; - WORD wParamType; - WORD wMergeIndex; -} DMUS_IO_STYLECURVE; - -typedef struct _DMUS_IO_STYLEMARKER -{ - MUSIC_TIME mtGridStart; - DWORD dwVariation; - WORD wMarkerFlags; -} DMUS_IO_STYLEMARKER; - -typedef struct _DMUS_IO_STYLERESOLUTION -{ - DWORD dwVariation; - WORD wMusicValue; - BYTE bInversionID; - BYTE bPlayModeFlags; -} DMUS_IO_STYLERESOLUTION; - -typedef struct _DMUS_IO_STYLE_ANTICIPATION -{ - MUSIC_TIME mtGridStart; - DWORD dwVariation; - short nTimeOffset; - BYTE bTimeRange; -} DMUS_IO_STYLE_ANTICIPATION; - -typedef struct _DMUS_IO_MOTIFSETTINGS -{ - DWORD dwRepeats; - MUSIC_TIME mtPlayStart; - MUSIC_TIME mtLoopStart; - MUSIC_TIME mtLoopEnd; - DWORD dwResolution; -} DMUS_IO_MOTIFSETTINGS; - - -typedef enum enumDMUS_PATTERNT_TYPES -{ - DMUS_PATTERNT_RANDOM = 0, - DMUS_PATTERNT_REPEAT = 1, - DMUS_PATTERNT_SEQUENTIAL = 2, - DMUS_PATTERNT_RANDOM_START = 3, - DMUS_PATTERNT_NO_REPEAT = 4, - DMUS_PATTERNT_RANDOM_ROW = 5 -} DMUS_PATTERNT_TYPES; - -typedef struct _DMUS_IO_CHORD -{ - WCHAR wszName[16]; - MUSIC_TIME mtTime; - WORD wMeasure; - BYTE bBeat; - BYTE bFlags; -} DMUS_IO_CHORD; - -typedef struct _DMUS_IO_SUBCHORD -{ - DWORD dwChordPattern; - DWORD dwScalePattern; - DWORD dwInversionPoints; - DWORD dwLevels; - BYTE bChordRoot; - BYTE bScaleRoot; -} DMUS_IO_SUBCHORD; - -typedef struct _DMUS_IO_COMMAND -{ - MUSIC_TIME mtTime; - WORD wMeasure; - BYTE bBeat; - BYTE bCommand; - BYTE bGrooveLevel; - BYTE bGrooveRange; - BYTE bRepeatMode; -} DMUS_IO_COMMAND; - - -typedef struct _DMUS_IO_TOOL_HEADER -{ - GUID guidClassID; - long lIndex; - DWORD cPChannels; - FOURCC ckid; - FOURCC fccType; - DWORD dwPChannels[1]; -} DMUS_IO_TOOL_HEADER; - - -typedef struct _DMUS_IO_PORTCONFIG_HEADER -{ - GUID guidPort; - DWORD dwPChannelBase; - DWORD dwPChannelCount; - DWORD dwFlags; -} DMUS_IO_PORTCONFIG_HEADER; - -typedef struct _DMUS_IO_PCHANNELTOBUFFER_HEADER -{ - DWORD dwPChannelBase; - DWORD dwPChannelCount; - DWORD dwBufferCount; - DWORD dwFlags; -} DMUS_IO_PCHANNELTOBUFFER_HEADER; - -typedef struct _DMUS_IO_BUFFER_ATTRIBUTES_HEADER -{ - GUID guidBufferID; - DWORD dwFlags; -} DMUS_IO_BUFFER_ATTRIBUTES_HEADER; - - -typedef struct _DMUS_IO_BAND_TRACK_HEADER -{ - BOOL bAutoDownload; -} DMUS_IO_BAND_TRACK_HEADER; - -typedef struct _DMUS_IO_BAND_ITEM_HEADER -{ - MUSIC_TIME lBandTime; -} DMUS_IO_BAND_ITEM_HEADER; - -typedef struct _DMUS_IO_BAND_ITEM_HEADER2 -{ - MUSIC_TIME lBandTimeLogical; - MUSIC_TIME lBandTimePhysical; -} DMUS_IO_BAND_ITEM_HEADER2; - - -typedef struct _DMUS_IO_INSTRUMENT -{ - DWORD dwPatch; - DWORD dwAssignPatch; - DWORD dwNoteRanges[4]; - DWORD dwPChannel; - DWORD dwFlags; - BYTE bPan; - BYTE bVolume; - short nTranspose; - DWORD dwChannelPriority; - short nPitchBendRange; -} DMUS_IO_INSTRUMENT; - - -typedef struct _DMUS_IO_WAVE_HEADER -{ - REFERENCE_TIME rtReadAhead; - DWORD dwFlags; -} DMUS_IO_WAVE_HEADER; - - -typedef struct _DMUS_IO_WAVE_TRACK_HEADER -{ - long lVolume; - DWORD dwFlags; -} DMUS_IO_WAVE_TRACK_HEADER; - -typedef struct _DMUS_IO_WAVE_PART_HEADER -{ - long lVolume; - DWORD dwVariations; - DWORD dwPChannel; - DWORD dwLockToPart; - DWORD dwFlags; - DWORD dwIndex; -} DMUS_IO_WAVE_PART_HEADER; - -typedef struct _DMUS_IO_WAVE_ITEM_HEADER -{ - long lVolume; - long lPitch; - DWORD dwVariations; - REFERENCE_TIME rtTime; - REFERENCE_TIME rtStartOffset; - REFERENCE_TIME rtReserved; - REFERENCE_TIME rtDuration; - MUSIC_TIME mtLogicalTime; - DWORD dwLoopStart; - DWORD dwLoopEnd; - DWORD dwFlags; -} DMUS_IO_WAVE_ITEM_HEADER; - - -typedef struct _DMUS_IO_CONTAINER_HEADER -{ - DWORD dwFlags; -} DMUS_IO_CONTAINER_HEADER; - -typedef struct _DMUS_IO_CONTAINED_OBJECT_HEADER -{ - GUID guidClassID; - DWORD dwFlags; - FOURCC ckid; - FOURCC fccType; -} DMUS_IO_CONTAINED_OBJECT_HEADER; - - -typedef struct _DMUS_IO_SEGMENT_HEADER -{ - DWORD dwRepeats; - MUSIC_TIME mtLength; - MUSIC_TIME mtPlayStart; - MUSIC_TIME mtLoopStart; - MUSIC_TIME mtLoopEnd; - DWORD dwResolution; - REFERENCE_TIME rtLength; - DWORD dwFlags; - DWORD dwReserved; -} DMUS_IO_SEGMENT_HEADER; - - -typedef struct _DMUS_IO_TRACK_HEADER -{ - GUID guidClassID; - DWORD dwPosition; - DWORD dwGroup; - FOURCC ckid; - FOURCC fccType; -} DMUS_IO_TRACK_HEADER; - -typedef struct _DMUS_IO_TRACK_EXTRAS_HEADER -{ - DWORD dwFlags; - DWORD dwPriority; -} DMUS_IO_TRACK_EXTRAS_HEADER; - - -typedef struct _DMUS_IO_SONG_HEADER -{ - DWORD dwFlags; - DWORD dwStartSegID; -} DMUS_IO_SONG_HEADER; - -typedef struct _DMUS_IO_SEGREF_HEADER -{ - DWORD dwID; - DWORD dwSegmentID; - DWORD dwToolGraphID; - DWORD dwFlags; - DWORD dwNextPlayID; -} DMUS_IO_SEGREF_HEADER; - - -typedef struct _DMUS_IO_TRACKREF_HEADER -{ - DWORD dwSegmentID; - DWORD dwFlags; -} DMUS_IO_TRACKREF_HEADER; - - -typedef struct _DMUS_IO_TRANSITION_DEF -{ - DWORD dwSegmentID; - DWORD dwTransitionID; - DWORD dwPlayFlags; -} DMUS_IO_TRANSITION_DEF; - - -typedef struct _DMUS_IO_REFERENCE -{ - GUID guidClassID; - DWORD dwValidData; -} DMUS_IO_REFERENCE; - - -typedef struct _DMUS_IO_CHORDMAP -{ - WCHAR wszLoadName[20]; - DWORD dwScalePattern; - DWORD dwFlags; -} DMUS_IO_CHORDMAP; - -typedef struct _DMUS_IO_CHORDMAP_SUBCHORD -{ - DWORD dwChordPattern; - DWORD dwScalePattern; - DWORD dwInvertPattern; - BYTE bChordRoot; - BYTE bScaleRoot; - WORD wCFlags; - DWORD dwLevels; -} DMUS_IO_CHORDMAP_SUBCHORD, DMUS_IO_PERS_SUBCHORD; - -typedef struct _DMUS_IO_CHORDENTRY -{ - DWORD dwFlags; - WORD wConnectionID; -} DMUS_IO_CHORDENTRY; - -typedef struct _DMUS_IO_NEXTCHORD -{ - DWORD dwFlags; - WORD nWeight; - WORD wMinBeats; - WORD wMaxBeats; - WORD wConnectionID; -} DMUS_IO_NEXTCHORD; - -typedef struct _DMUS_IO_CHORDMAP_SIGNPOST -{ - DWORD dwChords; - DWORD dwFlags; -} DMUS_IO_CHORDMAP_SIGNPOST, DMUS_IO_PERS_SIGNPOST; - - -typedef struct _DMUS_IO_SCRIPT_HEADER -{ - DWORD dwFlags; -} DMUS_IO_SCRIPT_HEADER; - - -typedef struct _DMUS_IO_SIGNPOST -{ - MUSIC_TIME mtTime; - DWORD dwChords; - WORD wMeasure; -} DMUS_IO_SIGNPOST; - - -typedef struct _DMUS_IO_MUTE -{ - MUSIC_TIME mtTime; - DWORD dwPChannel; - DWORD dwPChannelMap; -} DMUS_IO_MUTE; - - -typedef struct _DMUS_IO_TIMESIGNATURE_ITEM -{ - MUSIC_TIME lTime; - BYTE bBeatsPerMeasure; - BYTE bBeat; - WORD wGridsPerBeat; -} DMUS_IO_TIMESIGNATURE_ITEM; - - -typedef struct _DMUS_IO_VALID_START -{ - MUSIC_TIME mtTime; -} DMUS_IO_VALID_START; - -typedef struct _DMUS_IO_PLAY_MARKER -{ - MUSIC_TIME mtTime; -} DMUS_IO_PLAY_MARKER; - - -typedef struct _DMUS_IO_SEGMENT_TRACK_HEADER -{ - DWORD dwFlags; -} DMUS_IO_SEGMENT_TRACK_HEADER; - -typedef struct _DMUS_IO_SEGMENT_ITEM_HEADER -{ - MUSIC_TIME lTimeLogical; - MUSIC_TIME lTimePhysical; - DWORD dwPlayFlags; - DWORD dwFlags; -} DMUS_IO_SEGMENT_ITEM_HEADER; - - -typedef struct _DMUS_IO_SCRIPTTRACK_EVENTHEADER -{ - DWORD dwFlags; - MUSIC_TIME lTimeLogical; - MUSIC_TIME lTimePhysical; -} DMUS_IO_SCRIPTTRACK_EVENTHEADER; - - -typedef struct _DMUS_IO_LYRICSTRACK_EVENTHEADER -{ - DWORD dwFlags; - DWORD dwTimingFlags; - MUSIC_TIME lTimeLogical; - MUSIC_TIME lTimePhysical; -} DMUS_IO_LYRICSTRACK_EVENTHEADER; - - -typedef struct _DMUS_IO_PARAMCONTROLTRACK_OBJECTHEADER -{ - DWORD dwFlags; - GUID guidTimeFormat; +/* typedef definitions */ +typedef struct _DMUS_IO_SEQ_ITEM DMUS_IO_SEQ_ITEM, *LPDMUS_IO_SEQ_ITEM; +typedef struct _DMUS_IO_CURVE_ITEM DMUS_IO_CURVE_ITEM, *LPDMUS_IO_CURVE_ITEM; +typedef struct _DMUS_IO_TEMPO_ITEM DMUS_IO_TEMPO_ITEM, *LPDMUS_IO_TEMPO_ITEM; +typedef struct _DMUS_IO_SYSEX_ITEM DMUS_IO_SYSEX_ITEM, *LPDMUS_IO_SYSEX_ITEM; +typedef struct DMUS_CHORD_KEY DMUS_CHORD_PARAM, *LPDMUS_CHORD_PARAM; /* in dmusici.h */ +typedef struct _DMUS_RHYTHM_PARAM DMUS_RHYTHM_PARAM, *LPDMUS_RHYTHM_PARAM; +typedef struct _DMUS_TEMPO_PARAM DMUS_TEMPO_PARAM, *LPDMUS_TEMPO_PARAM; +typedef struct _DMUS_MUTE_PARAM DMUS_MUTE_PARAM, *LPDMUS_MUTE_PARAM; +typedef struct _DMUS_IO_TIMESIG DMUS_IO_TIMESIG, *LPDMUS_IO_TIMESIG; +typedef struct _DMUS_IO_STYLE DMUS_IO_STYLE, *LPDMUS_IO_STYLE; +typedef struct _DMUS_IO_VERSION DMUS_IO_VERSION, *LPDMUS_IO_VERSION; +typedef struct _DMUS_IO_PATTERN DMUS_IO_PATTERN, *LPDMUS_IO_PATTERN; +typedef struct _DMUS_IO_STYLEPART DMUS_IO_STYLEPART, *LPDMUS_IO_STYLEPART; +typedef struct _DMUS_IO_PARTREF DMUS_IO_PARTREF, *LPDMUS_IO_PARTREF; +typedef struct _DMUS_IO_STYLENOTE DMUS_IO_STYLENOTE, *LPDMUS_IO_STYLENOTE; +typedef struct _DMUS_IO_STYLECURVE DMUS_IO_STYLECURVE, *LPDMUS_IO_STYLECURVE; +typedef struct _DMUS_IO_STYLEMARKER DMUS_IO_STYLEMARKER, *LPDMUS_IO_STYLEMARKER; +typedef struct _DMUS_IO_STYLERESOLUTION DMUS_IO_STYLERESOLUTION, *LPDMUS_IO_STYLERESOLUTION; +typedef struct _DMUS_IO_STYLE_ANTICIPATION DMUS_IO_STYLE_ANTICIPATION, *LPDMUS_IO_STYLE_ANTICIPATION; +typedef struct _DMUS_IO_MOTIFSETTINGS DMUS_IO_MOTIFSETTINGS, *LPDMUS_IO_MOTIFSETTINGS; +typedef struct _DMUS_IO_CHORD DMUS_IO_CHORD, *LPDMUS_IO_CHORD; +typedef struct _DMUS_IO_SUBCHORD DMUS_IO_SUBCHORD, *LPDMUS_IO_SUBCHORD; +typedef struct _DMUS_IO_COMMAND DMUS_IO_COMMAND, *LPDMUS_IO_COMMAND; +typedef struct _DMUS_IO_TOOL_HEADER DMUS_IO_TOOL_HEADER, *LPDMUS_IO_TOOL_HEADER; +typedef struct _DMUS_IO_PORTCONFIG_HEADER DMUS_IO_PORTCONFIG_HEADER, *LPDMUS_IO_PORTCONFIG_HEADER; +typedef struct _DMUS_IO_PCHANNELTOBUFFER_HEADER DMUS_IO_PCHANNELTOBUFFER_HEADER, *LPDMUS_IO_PCHANNELTOBUFFER_HEADER; +typedef struct _DMUS_IO_BUFFER_ATTRIBUTES_HEADER DMUS_IO_BUFFER_ATTRIBUTES_HEADER, *LPDMUS_IO_BUFFER_ATTRIBUTES_HEADER; +typedef struct _DMUS_IO_BAND_TRACK_HEADER DMUS_IO_BAND_TRACK_HEADER, *LPDMUS_IO_BAND_TRACK_HEADER; +typedef struct _DMUS_IO_BAND_ITEM_HEADER DMUS_IO_BAND_ITEM_HEADER, *LPDMUS_IO_BAND_ITEM_HEADER; +typedef struct _DMUS_IO_BAND_ITEM_HEADER2 DMUS_IO_BAND_ITEM_HEADER2, *LPDMUS_IO_BAND_ITEM_HEADER2; +typedef struct _DMUS_IO_INSTRUMENT DMUS_IO_INSTRUMENT, *LPDMUS_IO_INSTRUMENT; +typedef struct _DMUS_IO_WAVE_HEADER DMUS_IO_WAVE_HEADER, *LPDMUS_IO_WAVE_HEADER; +typedef struct _DMUS_IO_WAVE_TRACK_HEADER DMUS_IO_WAVE_TRACK_HEADER, *LPDMUS_IO_WAVE_TRACK_HEADER; +typedef struct _DMUS_IO_WAVE_PART_HEADER DMUS_IO_WAVE_PART_HEADER, *LPDMUS_IO_WAVE_PART_HEADER; +typedef struct _DMUS_IO_WAVE_ITEM_HEADER DMUS_IO_WAVE_ITEM_HEADER, *LPDMUS_IO_WAVE_ITEM_HEADER; +typedef struct _DMUS_IO_CONTAINER_HEADER DMUS_IO_CONTAINER_HEADER, *LPDMUS_IO_CONTAINER_HEADER; +typedef struct _DMUS_IO_CONTAINED_OBJECT_HEADER DMUS_IO_CONTAINED_OBJECT_HEADER, *LPDMUS_IO_CONTAINED_OBJECT_HEADER; +typedef struct _DMUS_IO_SEGMENT_HEADER DMUS_IO_SEGMENT_HEADER, *LPDMUS_IO_SEGMENT_HEADER; +typedef struct _DMUS_IO_TRACK_HEADER DMUS_IO_TRACK_HEADER, *LPDMUS_IO_TRACK_HEADER; +typedef struct _DMUS_IO_TRACK_EXTRAS_HEADER DMUS_IO_TRACK_EXTRAS_HEADER, *LPDMUS_IO_TRACK_EXTRAS_HEADER; +typedef struct _DMUS_IO_REFERENCE DMUS_IO_REFERENCE, *LPDMUS_IO_REFERENCE; +typedef struct _DMUS_IO_CHORDMAP DMUS_IO_CHORDMAP, *LPDMUS_IO_CHORDMAP; +typedef struct _DMUS_IO_CHORDMAP_SUBCHORD DMUS_IO_CHORDMAP_SUBCHORD, *LPDMUS_IO_CHORDMAP_SUBCHORD; +typedef struct _DMUS_IO_CHORDMAP_SUBCHORD DMUS_IO_PERS_SUBCHORD, *LPDMUS_IO_PERS_SUBCHORD; +typedef struct _DMUS_IO_CHORDENTRY DMUS_IO_CHORDENTRY, *LPDMUS_IO_CHORDENTRY; +typedef struct _DMUS_IO_NEXTCHORD DMUS_IO_NEXTCHORD, *LPDMUS_IO_NEXTCHORD; +typedef struct _DMUS_IO_CHORDMAP_SIGNPOST DMUS_IO_CHORDMAP_SIGNPOST, *LPDMUS_IO_CHORDMAP_SIGNPOST; +typedef struct _DMUS_IO_CHORDMAP_SIGNPOST DMUS_IO_PERS_SIGNPOST, *LPDMUS_IO_PERS_SIGNPOST; +typedef struct _DMUS_IO_SCRIPT_HEADER DMUS_IO_SCRIPT_HEADER, *LPDMUS_IO_SCRIPT_HEADER; +typedef struct _DMUS_IO_SIGNPOST DMUS_IO_SIGNPOST, *LPDMUS_IO_SIGNPOST; +typedef struct _DMUS_IO_MUTE DMUS_IO_MUTE, *LPDMUS_IO_MUTE; +typedef struct _DMUS_IO_TIMESIGNATURE_ITEM DMUS_IO_TIMESIGNATURE_ITEM, *LPDMUS_IO_TIMESIGNATURE_ITEM; +typedef struct _DMUS_IO_VALID_START DMUS_IO_VALID_START, *LPDMUS_IO_VALID_START; +typedef struct _DMUS_IO_PLAY_MARKER DMUS_IO_PLAY_MARKER, *LPDMUS_IO_PLAY_MARKER; +typedef struct _DMUS_IO_SEGMENT_TRACK_HEADER DMUS_IO_SEGMENT_TRACK_HEADER, *LPDMUS_IO_SEGMENT_TRACK_HEADER; +typedef struct _DMUS_IO_SEGMENT_ITEM_HEADER DMUS_IO_SEGMENT_ITEM_HEADER, *LPDMUS_IO_SEGMENT_ITEM_HEADER; +typedef struct _DMUS_IO_SCRIPTTRACK_EVENTHEADER DMUS_IO_SCRIPTTRACK_EVENTHEADER, *LPDMUS_IO_SCRIPTTRACK_EVENTHEADER; +typedef struct _DMUS_IO_LYRICSTRACK_EVENTHEADER DMUS_IO_LYRICSTRACK_EVENTHEADER, *LPDMUS_IO_LYRICSTRACK_EVENTHEADER; +typedef struct _DMUS_IO_PARAMCONTROLTRACK_OBJECTHEADER DMUS_IO_PARAMCONTROLTRACK_OBJECTHEADER, *LPDMUS_IO_PARAMCONTROLTRACK_OBJECTHEADER; +typedef struct _DMUS_IO_PARAMCONTROLTRACK_PARAMHEADER DMUS_IO_PARAMCONTROLTRACK_PARAMHEADER, *LPDMUS_IO_PARAMCONTROLTRACK_PARAMHEADER; +typedef struct _DMUS_IO_PARAMCONTROLTRACK_CURVEINFO DMUS_IO_PARAMCONTROLTRACK_CURVEINFO, *LPDMUS_IO_PARAMCONTROLTRACK_CURVEINFO; +typedef struct _DSOUND_IO_DSBUFFERDESC DSOUND_IO_DSBUFFERDESC, *LPDSOUND_IO_DSBUFFERDESC; +typedef struct _DSOUND_IO_DSBUSID DSOUND_IO_DSBUSID, *LPDSOUND_IO_DSBUSID; +typedef struct _DSOUND_IO_3D DSOUND_IO_3D, *LPDSOUND_IO_3D; +typedef struct _DSOUND_IO_DXDMO_HEADER DSOUND_IO_DXDMO_HEADER, *LPDSOUND_IO_DXDMO_HEADER; +typedef struct _DSOUND_IO_DXDMO_DATA DSOUND_IO_DXDMO_DATA, *LPDSOUND_IO_DXDMO_DATA; + +/* actual structures */ +struct _DMUS_IO_SEQ_ITEM { + MUSIC_TIME mtTime; + MUSIC_TIME mtDuration; + DWORD dwPChannel; + short nOffset; + BYTE bStatus; + BYTE bByte1; + BYTE bByte2; +}; + +struct _DMUS_IO_CURVE_ITEM { + MUSIC_TIME mtStart; + MUSIC_TIME mtDuration; + MUSIC_TIME mtResetDuration; + DWORD dwPChannel; + short nOffset; + short nStartValue; + short nEndValue; + short nResetValue; + BYTE bType; + BYTE bCurveShape; + BYTE bCCData; + BYTE bFlags; + /* DX8 */ + WORD wParamType; + WORD wMergeIndex; +}; + +struct _DMUS_IO_TEMPO_ITEM { + MUSIC_TIME lTime; + double dblTempo; +}; + +struct _DMUS_IO_SYSEX_ITEM { + MUSIC_TIME mtTime; + DWORD dwPChannel; + DWORD dwSysExLength; +}; + +struct _DMUS_RHYTHM_PARAM { + DMUS_TIMESIGNATURE TimeSig; + DWORD dwRhythmPattern; +}; + +struct _DMUS_TEMPO_PARAM { + MUSIC_TIME mtTime; + double dblTempo; +}; + +struct _DMUS_MUTE_PARAM { + DWORD dwPChannel; + DWORD dwPChannelMap; + BOOL fMute; +}; + +#pragma pack(2) +struct _DMUS_IO_TIMESIG { + BYTE bBeatsPerMeasure; + BYTE bBeat; + WORD wGridsPerBeat; +}; + +struct _DMUS_IO_STYLE { + DMUS_IO_TIMESIG timeSig; + double dblTempo; +}; + +struct _DMUS_IO_VERSION { + DWORD dwVersionMS; + DWORD dwVersionLS; +}; + +struct _DMUS_IO_PATTERN { + DMUS_IO_TIMESIG timeSig; + BYTE bGrooveBottom; + BYTE bGrooveTop; + WORD wEmbellishment; + WORD wNbrMeasures; + BYTE bDestGrooveBottom; + BYTE bDestGrooveTop; + DWORD dwFlags; +}; + +struct _DMUS_IO_STYLEPART { + DMUS_IO_TIMESIG timeSig; + DWORD dwVariationChoices[32]; + GUID guidPartID; + WORD wNbrMeasures; + BYTE bPlayModeFlags; + BYTE bInvertUpper; + BYTE bInvertLower; + BYTE bPad[3]; + DWORD dwFlags; +}; + +struct _DMUS_IO_PARTREF { + GUID guidPartID; + WORD wLogicalPartID; + BYTE bVariationLockID; + BYTE bSubChordLevel; + BYTE bPriority; + BYTE bRandomVariation; + WORD wPad; + DWORD dwPChannel; +}; + + +struct _DMUS_IO_STYLENOTE { + MUSIC_TIME mtGridStart; + DWORD dwVariation; + MUSIC_TIME mtDuration; + short nTimeOffset; + WORD wMusicValue; + BYTE bVelocity; + BYTE bTimeRange; + BYTE bDurRange; + BYTE bVelRange; + BYTE bInversionID; + BYTE bPlayModeFlags; + /* DX8 */ + BYTE bNoteFlags; +}; + +struct _DMUS_IO_STYLECURVE { + MUSIC_TIME mtGridStart; + DWORD dwVariation; + MUSIC_TIME mtDuration; + MUSIC_TIME mtResetDuration; + short nTimeOffset; + short nStartValue; + short nEndValue; + short nResetValue; + BYTE bEventType; + BYTE bCurveShape; + BYTE bCCData; + BYTE bFlags; + /* DX8 */ + WORD wParamType; + WORD wMergeIndex; +}; + +struct _DMUS_IO_STYLEMARKER { + MUSIC_TIME mtGridStart; + DWORD dwVariation; + WORD wMarkerFlags; +}; + +struct _DMUS_IO_STYLERESOLUTION { + DWORD dwVariation; + WORD wMusicValue; + BYTE bInversionID; + BYTE bPlayModeFlags; +}; + +struct _DMUS_IO_STYLE_ANTICIPATION { + MUSIC_TIME mtGridStart; + DWORD dwVariation; + short nTimeOffset; + BYTE bTimeRange; +}; + +struct _DMUS_IO_MOTIFSETTINGS { + DWORD dwRepeats; + MUSIC_TIME mtPlayStart; + MUSIC_TIME mtLoopStart; + MUSIC_TIME mtLoopEnd; + DWORD dwResolution; +}; +#pragma pack() + +struct _DMUS_IO_CHORD { + WCHAR wszName[16]; + MUSIC_TIME mtTime; + WORD wMeasure; + BYTE bBeat; + BYTE bFlags; +}; + +struct _DMUS_IO_SUBCHORD { + DWORD dwChordPattern; + DWORD dwScalePattern; + DWORD dwInversionPoints; + DWORD dwLevels; + BYTE bChordRoot; + BYTE bScaleRoot; +}; + +struct _DMUS_IO_COMMAND { + MUSIC_TIME mtTime; + WORD wMeasure; + BYTE bBeat; + BYTE bCommand; + BYTE bGrooveLevel; + BYTE bGrooveRange; + BYTE bRepeatMode; +}; + +struct _DMUS_IO_TOOL_HEADER { + GUID guidClassID; + long lIndex; + DWORD cPChannels; + FOURCC ckid; + FOURCC fccType; + DWORD dwPChannels[1]; +}; + +struct _DMUS_IO_PORTCONFIG_HEADER { + GUID guidPort; + DWORD dwPChannelBase; + DWORD dwPChannelCount; + DWORD dwFlags; +}; + +struct _DMUS_IO_PCHANNELTOBUFFER_HEADER { + DWORD dwPChannelBase; + DWORD dwPChannelCount; + DWORD dwBufferCount; + DWORD dwFlags; +}; + +struct _DMUS_IO_BUFFER_ATTRIBUTES_HEADER { + GUID guidBufferID; + DWORD dwFlags; +}; + +struct _DMUS_IO_BAND_TRACK_HEADER { + BOOL bAutoDownload; +}; + +struct _DMUS_IO_BAND_ITEM_HEADER { + MUSIC_TIME lBandTime; +}; + +struct _DMUS_IO_BAND_ITEM_HEADER2 { + MUSIC_TIME lBandTimeLogical; + MUSIC_TIME lBandTimePhysical; +}; + +struct _DMUS_IO_INSTRUMENT { + DWORD dwPatch; + DWORD dwAssignPatch; + DWORD dwNoteRanges[4]; + DWORD dwPChannel; + DWORD dwFlags; + BYTE bPan; + BYTE bVolume; + short nTranspose; + DWORD dwChannelPriority; + short nPitchBendRange; +}; + +struct _DMUS_IO_WAVE_HEADER { + REFERENCE_TIME rtReadAhead; + DWORD dwFlags; +}; + +struct _DMUS_IO_WAVE_TRACK_HEADER { + long lVolume; + DWORD dwFlags; +}; + +struct _DMUS_IO_WAVE_PART_HEADER { + long lVolume; + DWORD dwVariations; DWORD dwPChannel; - DWORD dwStage; - DWORD dwBuffer; - GUID guidObject; - DWORD dwIndex; -} DMUS_IO_PARAMCONTROLTRACK_OBJECTHEADER; - -typedef struct _DMUS_IO_PARAMCONTROLTRACK_PARAMHEADER -{ + DWORD dwLockToPart; DWORD dwFlags; DWORD dwIndex; -} DMUS_IO_PARAMCONTROLTRACK_PARAMHEADER; +}; -typedef struct _DMUS_IO_PARAMCONTROLTRACK_CURVEINFO -{ - MUSIC_TIME mtStartTime; - MUSIC_TIME mtEndTime; - float fltStartValue; - float fltEndValue; - DWORD dwCurveType; - DWORD dwFlags; -} DMUS_IO_PARAMCONTROLTRACK_CURVEINFO; +struct _DMUS_IO_WAVE_ITEM_HEADER { + long lVolume; + long lPitch; + DWORD dwVariations; + REFERENCE_TIME rtTime; + REFERENCE_TIME rtStartOffset; + REFERENCE_TIME rtReserved; + REFERENCE_TIME rtDuration; + MUSIC_TIME mtLogicalTime; + DWORD dwLoopStart; + DWORD dwLoopEnd; + DWORD dwFlags; + WORD wVolumeRange; + WORD wPitchRange; +}; +struct _DMUS_IO_CONTAINER_HEADER { + DWORD dwFlags; +}; -typedef DMUS_CONNECTION_RULE DMUS_IO_CONNECTION_RULE; +struct _DMUS_IO_CONTAINED_OBJECT_HEADER { + GUID guidClassID; + DWORD dwFlags; + FOURCC ckid; + FOURCC fccType; +}; -typedef DMUS_MELODY_FRAGMENT DMUS_IO_MELODY_FRAGMENT; +struct _DMUS_IO_SEGMENT_HEADER { + DWORD dwRepeats; + MUSIC_TIME mtLength; + MUSIC_TIME mtPlayStart; + MUSIC_TIME mtLoopStart; + MUSIC_TIME mtLoopEnd; + DWORD dwResolution; + /* DX8 */ + REFERENCE_TIME rtLength; + DWORD dwFlags; + DWORD dwReserved; + /* DX9 */ + REFERENCE_TIME rtLoopStart; + REFERENCE_TIME rtLoopEnd; + REFERENCE_TIME rtPlayStart; +}; -typedef struct _DMUS_IO_MELFORM -{ - DWORD dwPlaymode; -} DMUS_IO_MELFORM; +struct _DMUS_IO_TRACK_HEADER { + GUID guidClassID; + DWORD dwPosition; + DWORD dwGroup; + FOURCC ckid; + FOURCC fccType; +}; +struct _DMUS_IO_TRACK_EXTRAS_HEADER { + DWORD dwFlags; + DWORD dwPriority; +}; -typedef struct _DSOUND_IO_DSBUFFERDESC -{ - DWORD dwFlags; - WORD nChannels; - LONG lVolume; - LONG lPan; - DWORD dwReserved; -} DSOUND_IO_DSBUFFERDESC; +struct _DMUS_IO_REFERENCE { + GUID guidClassID; + DWORD dwValidData; +}; -typedef struct _DSOUND_IO_DSBUSID -{ - DWORD busid[1]; -} DSOUND_IO_DSBUSID; +struct _DMUS_IO_CHORDMAP { + WCHAR wszLoadName[20]; + DWORD dwScalePattern; + DWORD dwFlags; +}; -typedef struct _DSOUND_IO_3D -{ - GUID guid3DAlgorithm; - DS3DBUFFER ds3d; -} DSOUND_IO_3D; +struct _DMUS_IO_CHORDMAP_SUBCHORD { + DWORD dwChordPattern; + DWORD dwScalePattern; + DWORD dwInvertPattern; + BYTE bChordRoot; + BYTE bScaleRoot; + WORD wCFlags; + DWORD dwLevels; +}; -typedef struct _DSOUND_IO_DXDMO_HEADER -{ - DWORD dwEffectFlags; - GUID guidDSFXClass; - GUID guidReserved; - GUID guidSendBuffer; - DWORD dwReserved; -} DSOUND_IO_DXDMO_HEADER; +struct _DMUS_IO_CHORDENTRY { + DWORD dwFlags; + WORD wConnectionID; +}; -typedef struct _DSOUND_IO_DXDMO_DATA -{ - DWORD data[1]; -} DSOUND_IO_DXDMO_DATA; +struct _DMUS_IO_NEXTCHORD { + DWORD dwFlags; + WORD nWeight; + WORD wMinBeats; + WORD wMaxBeats; + WORD wConnectionID; +}; + +struct _DMUS_IO_CHORDMAP_SIGNPOST { + DWORD dwChords; + DWORD dwFlags; +}; + +struct _DMUS_IO_SCRIPT_HEADER { + DWORD dwFlags; +}; + +struct _DMUS_IO_SIGNPOST { + MUSIC_TIME mtTime; + DWORD dwChords; + WORD wMeasure; +}; + +struct _DMUS_IO_MUTE { + MUSIC_TIME mtTime; + DWORD dwPChannel; + DWORD dwPChannelMap; +}; + +struct _DMUS_IO_TIMESIGNATURE_ITEM { + MUSIC_TIME lTime; + BYTE bBeatsPerMeasure; + BYTE bBeat; + WORD wGridsPerBeat; +}; + +struct _DMUS_IO_VALID_START { + MUSIC_TIME mtTime; +}; + +struct _DMUS_IO_PLAY_MARKER { + MUSIC_TIME mtTime; +}; + +struct _DMUS_IO_SEGMENT_TRACK_HEADER { + DWORD dwFlags; +}; + +struct _DMUS_IO_SEGMENT_ITEM_HEADER { + MUSIC_TIME llTimeLogical; + MUSIC_TIME lTimePhysical; + DWORD dwPlayFlags; + DWORD dwFlags; +}; + +struct _DMUS_IO_SCRIPTTRACK_EVENTHEADER { + DWORD dwFlags; + MUSIC_TIME lTimeLogical; + MUSIC_TIME lTimePhysical; +}; + +struct _DMUS_IO_LYRICSTRACK_EVENTHEADER { + DWORD dwFlags; + DWORD dwTimingFlags; + MUSIC_TIME lTimeLogical; + MUSIC_TIME lTimePhysical; +}; + +struct _DMUS_IO_PARAMCONTROLTRACK_OBJECTHEADER { + DWORD dwFlags; + GUID guidTimeFormat; + DWORD dwPChannel; + DWORD dwStage; + DWORD dwBuffer; + GUID guidObject; + DWORD dwIndex; +}; + +struct _DMUS_IO_PARAMCONTROLTRACK_PARAMHEADER { + DWORD dwFlags; + DWORD dwIndex; +}; + +struct _DMUS_IO_PARAMCONTROLTRACK_CURVEINFO { + MUSIC_TIME mtStartTime; + MUSIC_TIME mtEndTime; + float fltStartValue; + float fltEndValue; + DWORD dwCurveType; + DWORD dwFlags; +}; + +struct _DSOUND_IO_DSBUFFERDESC { + DWORD dwFlags; + WORD nChannels; + LONG lVolume; + LONG lPan; + DWORD dwReserved; +}; + +struct _DSOUND_IO_DSBUSID { + DWORD busid[1]; +}; + +struct _DSOUND_IO_3D { + GUID guid3DAlgorithm; + DS3DBUFFER ds3d; +}; + +struct _DSOUND_IO_DXDMO_HEADER { + DWORD dwEffectFlags; + GUID guidDSFXClass; + GUID guidReserved; + GUID guidSendBuffer; + DWORD dwReserved; +}; + +struct _DSOUND_IO_DXDMO_DATA { + DWORD data[1]; +}; #ifdef __cplusplus } #endif +#include + #endif /* __WINE_DMUSIC_FILEFORMATS_H */ diff --git a/include/dmusici.h b/include/dmusici.h index 12a22b18538..09e94974395 100644 --- a/include/dmusici.h +++ b/include/dmusici.h @@ -1,7 +1,7 @@ /* * DirectMusic Performance API * - * 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,258 +21,279 @@ #ifndef __WINE_DMUSIC_PERFORMANCE_H #define __WINE_DMUSIC_PERFORMANCE_H +#ifndef __WINESRC__ +#include +#else +#include /* VARIANT */ +#endif /* __WINESRC__ */ + #include #include - -#include +#include +#include +#include #ifdef __cplusplus extern "C" { #endif - -/***************************************************************************** - * Types - */ -typedef WORD TRANSITION_TYPE; -/* Already defined somewhere? */ -/* typedef __int64 REFERENCE_TIME; */ -typedef long MUSIC_TIME; - /***************************************************************************** * Predeclare the interfaces */ /* CLSIDs */ -DEFINE_GUID(CLSID_DirectMusicPerformance, 0xd2ac2881,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(CLSID_DirectMusicSegment, 0xd2ac2882,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(CLSID_DirectMusicSegmentState, 0xd2ac2883,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(CLSID_DirectMusicGraph, 0xd2ac2884,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(CLSID_DirectMusicStyle, 0xd2ac288a,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(CLSID_DirectMusicChordMap, 0xd2ac288f,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(CLSID_DirectMusicComposer, 0xd2ac2890,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(CLSID_DirectMusicLoader, 0xd2ac2892,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(CLSID_DirectMusicBand, 0x79ba9e00,0xb6ee,0x11d1,0x86,0xbe,0x0,0xc0,0x4f,0xbf,0x8f,0xef); -DEFINE_GUID(CLSID_DirectMusicPatternTrack, 0xd2ac2897,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(CLSID_DirectMusicScript, 0x810b5013,0xe88d,0x11d2,0x8b,0xc1,0x0,0x60,0x8,0x93,0xb1,0xb6); -DEFINE_GUID(CLSID_DirectMusicContainer, 0x9301e380,0x1f22,0x11d3,0x82,0x26,0xd2,0xfa,0x76,0x25,0x5d,0x47); -DEFINE_GUID(CLSID_DirectSoundWave, 0x8a667154,0xf9cb,0x11d2,0xad,0x8a,0x0,0x60,0xb0,0x57,0x5a,0xbc); -DEFINE_GUID(CLSID_DirectMusicSong, 0xaed5f0a5,0xd972,0x483d,0xa3,0x84,0x64,0x9d,0xfe,0xb9,0xc1,0x81); -DEFINE_GUID(CLSID_DirectMusicAudioPathConfig, 0xee0b9ca0,0xa81e,0x11d3,0x9b,0xd1,0x0,0x80,0xc7,0x15,0xa,0x74); -/* these CLSIDs aren't officially declared in any dmusic header, but are used by regsvr implementations*/ -DEFINE_GUID(CLSID_DirectMusicSynthSink, 0xaec17ce3,0xa514,0x11d1,0xaf,0xa6,0x00,0xaa,0x00,0x24,0xd8,0xb6); -DEFINE_GUID(CLSID_DirectMusicSection, 0x3f037241,0x414e,0x11d1,0xa7,0xce,0x00,0xa0,0xc9,0x13,0xf7,0x3c); -DEFINE_GUID(CLSID_DirectMusicAuditionTrack, 0xd2ac2897,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); -DEFINE_GUID(CLSID_DirectMusicSegTriggerTrack, 0xbae4d665,0x4ea1,0x11d3,0x8b,0xda,0x00,0x60,0x08,0x93,0xb1,0xb6); -DEFINE_GUID(CLSID_DirectMusicAudioPath, 0xee0b9ca0,0xa81e,0x11d3,0x9b,0xd1,0x00,0x80,0xc7,0x15,0x0a,0x74); -DEFINE_GUID(CLSID_DirectMusicTemplate, 0xd30bcc65,0x60e8,0x11d1,0xa7,0xce,0x00,0xa0,0xc9,0x13,0xf7,0x3c); -DEFINE_GUID(CLSID_DirectMusicScriptAutoImpSegment, 0x4062c116,0x0270,0x11d3,0x8b,0xcb,0x00,0x60,0x08,0x93,0xb1,0xb6); -DEFINE_GUID(CLSID_AudioVBScript, 0x4ee17959,0x931e,0x49e4,0xa2,0xc6,0x97,0x7e,0xcf,0x36,0x28,0xf3); -DEFINE_GUID(CLSID_DirectMusicScriptAutoImpPerformance, 0xa861c6e2,0xfcfc,0x11d2,0x8b,0xc9,0x00,0x60,0x08,0x93,0xb1,0xb6); -DEFINE_GUID(CLSID_DirectMusicScripSourceCodeLoader, 0xc70eb77f,0xefd4,0x4678,0xa2,0x7b,0xbf,0x16,0x48,0xf3,0x0d,0x04); /* [sic] */ -DEFINE_GUID(CLSID_DirectMusicScriptAutoImpSegmentState, 0xebf2320a,0x2502,0x11d3,0x8b,0xd1,0x00,0x60,0x08,0x93,0xb1,0xb6); -DEFINE_GUID(CLSID_DirectMusicScriptAutoImpAudioPathConfig, 0x1cebde3e,0x6b91,0x484a,0xaf,0x48,0x5e,0x4f,0x4e,0xd6,0xb1,0xe1); -DEFINE_GUID(CLSID_DirectMusicScriptAutoImpAudioPath, 0x2c5f9b72,0x7148,0x4d97,0xbf,0xc9,0x68,0xa0,0xe0,0x76,0xbe,0xbd); -DEFINE_GUID(CLSID_DirectMusicScriptAutoImpSong, 0xa16f1761,0xb6d8,0x42eb,0x8d,0x57,0x4a,0x44,0xfe,0xdd,0x3b,0xd2); +DEFINE_GUID(CLSID_DirectMusicAudioPathConfig, 0xee0b9ca0,0xa81e,0x11d3,0x9b,0xd1,0x00,0x80,0xc7,0x15,0x0a,0x74); +DEFINE_GUID(CLSID_DirectMusicBand, 0x79ba9e00,0xb6ee,0x11d1,0x86,0xbe,0x00,0xc0,0x4f,0xbf,0x8f,0xef); +DEFINE_GUID(CLSID_DirectMusicChordMap, 0xd2ac288f,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(CLSID_DirectMusicComposer, 0xd2ac2890,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(CLSID_DirectMusicContainer, 0x9301e380,0x1f22,0x11d3,0x82,0x26,0xd2,0xfa,0x76,0x25,0x5d,0x47); +DEFINE_GUID(CLSID_DirectMusicGraph, 0xd2ac2884,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(CLSID_DirectMusicLoader, 0xd2ac2892,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(CLSID_DirectMusicPatternTrack, 0xd2ac2897,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(CLSID_DirectMusicPerformance, 0xd2ac2881,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(CLSID_DirectMusicScript, 0x810b5013,0xe88d,0x11d2,0x8b,0xc1,0x00,0x60,0x08,0x93,0xb1,0xb6); +DEFINE_GUID(CLSID_DirectMusicSegment, 0xd2ac2882,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(CLSID_DirectMusicSegmentState, 0xd2ac2883,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(CLSID_DirectMusicStyle, 0xd2ac288a,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(CLSID_DirectSoundWave, 0x8a667154,0xf9cb,0x11d2,0xad,0x8a,0x00,0x60,0xb0,0x57,0x5a,0xbc); +/* MS doesn't support this in DX 9.0 and newer... but there's no harm in keeping it around */ +DEFINE_GUID(CLSID_DirectMusicSong, 0xaed5f0a5,0xd972,0x483d,0xa3,0x84,0x64,0x9d,0xfe,0xb9,0xc1,0x81); +/* these CLSIDs aren't officially declared in any dmusic header, but are used by wine's regsvr implementations*/ +DEFINE_GUID(CLSID_DirectMusicSynthSink, 0xaec17ce3,0xa514,0x11d1,0xaf,0xa6,0x00,0xaa,0x00,0x24,0xd8,0xb6); +DEFINE_GUID(CLSID_DirectMusicSection, 0x3f037241,0x414e,0x11d1,0xa7,0xce,0x00,0xa0,0xc9,0x13,0xf7,0x3c); +DEFINE_GUID(CLSID_DirectMusicAuditionTrack, 0xd2ac2897,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(CLSID_DirectMusicSegTriggerTrack, 0xbae4d665,0x4ea1,0x11d3,0x8b,0xda,0x00,0x60,0x08,0x93,0xb1,0xb6); +DEFINE_GUID(CLSID_DirectMusicAudioPath, 0xee0b9ca0,0xa81e,0x11d3,0x9b,0xd1,0x00,0x80,0xc7,0x15,0x0a,0x74); +DEFINE_GUID(CLSID_DirectMusicTemplate, 0xd30bcc65,0x60e8,0x11d1,0xa7,0xce,0x00,0xa0,0xc9,0x13,0xf7,0x3c); +DEFINE_GUID(CLSID_DirectMusicScriptAutoImpSegment, 0x4062c116,0x0270,0x11d3,0x8b,0xcb,0x00,0x60,0x08,0x93,0xb1,0xb6); +DEFINE_GUID(CLSID_AudioVBScript, 0x4ee17959,0x931e,0x49e4,0xa2,0xc6,0x97,0x7e,0xcf,0x36,0x28,0xf3); +DEFINE_GUID(CLSID_DirectMusicScriptAutoImpPerformance, 0xa861c6e2,0xfcfc,0x11d2,0x8b,0xc9,0x00,0x60,0x08,0x93,0xb1,0xb6); +DEFINE_GUID(CLSID_DirectMusicScripSourceCodeLoader, 0xc70eb77f,0xefd4,0x4678,0xa2,0x7b,0xbf,0x16,0x48,0xf3,0x0d,0x04); +DEFINE_GUID(CLSID_DirectMusicScriptAutoImpSegmentState, 0xebf2320a,0x2502,0x11d3,0x8b,0xd1,0x00,0x60,0x08,0x93,0xb1,0xb6); +DEFINE_GUID(CLSID_DirectMusicScriptAutoImpAudioPathConfig, 0x1cebde3e,0x6b91,0x484a,0xaf,0x48,0x5e,0x4f,0x4e,0xd6,0xb1,0xe1); +DEFINE_GUID(CLSID_DirectMusicScriptAutoImpAudioPath, 0x2c5f9b72,0x7148,0x4d97,0xbf,0xc9,0x68,0xa0,0xe0,0x76,0xbe,0xbd); +DEFINE_GUID(CLSID_DirectMusicScriptAutoImpSong, 0xa16f1761,0xb6d8,0x42eb,0x8d,0x57,0x4a,0x44,0xfe,0xdd,0x3b,0xd2); /* IIDs */ -DEFINE_GUID(IID_IDirectMusicAudioPath, 0xc87631f5,0x23be,0x4986,0x88,0x36,0x5,0x83,0x2f,0xcc,0x48,0xf9); -DEFINE_GUID(IID_IDirectMusicBand, 0xd2ac28c0,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(IID_IDirectMusicChordMap, 0xd2ac28be,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(IID_IDirectMusicComposer, 0xd2ac28bf,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(IID_IDirectMusicContainer, 0x9301e386,0x1f22,0x11d3,0x82,0x26,0xd2,0xfa,0x76,0x25,0x5d,0x47); -DEFINE_GUID(IID_IDirectMusicGetLoader, 0x68a04844,0xd13d,0x11d1,0xaf,0xa6,0x0,0xaa,0x0,0x24,0xd8,0xb6); -DEFINE_GUID(IID_IDirectMusicGraph, 0x2befc277,0x5497,0x11d2,0xbc,0xcb,0x0,0xa0,0xc9,0x22,0xe6,0xeb); -DEFINE_GUID(IID_IDirectMusicLoader, 0x2ffaaca2,0x5dca,0x11d2,0xaf,0xa6,0x0,0xaa,0x0,0x24,0xd8,0xb6); -DEFINE_GUID(IID_IDirectMusicLoader8, 0x19e7c08c,0xa44,0x4e6a,0xa1,0x16,0x59,0x5a,0x7c,0xd5,0xde,0x8c); -DEFINE_GUID(IID_IDirectMusicObject, 0xd2ac28b5,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(IID_IDirectMusicPatternTrack, 0x51c22e10,0xb49f,0x46fc,0xbe,0xc2,0xe6,0x28,0x8f,0xb9,0xed,0xe6); -DEFINE_GUID(IID_IDirectMusicPerformance, 0x7d43d03,0x6523,0x11d2,0x87,0x1d,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(IID_IDirectMusicPerformance2, 0x6fc2cae0,0xbc78,0x11d2,0xaf,0xa6,0x0,0xaa,0x0,0x24,0xd8,0xb6); -DEFINE_GUID(IID_IDirectMusicPerformance8, 0x679c4137,0xc62e,0x4147,0xb2,0xb4,0x9d,0x56,0x9a,0xcb,0x25,0x4c); -DEFINE_GUID(IID_IDirectMusicScript, 0x2252373a,0x5814,0x489b,0x82,0x9,0x31,0xfe,0xde,0xba,0xf1,0x37); -DEFINE_GUID(IID_IDirectMusicSegment, 0xf96029a2,0x4282,0x11d2,0x87,0x17,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(IID_IDirectMusicSegment2, 0xd38894d1,0xc052,0x11d2,0x87,0x2f,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(IID_IDirectMusicSegment8, 0xc6784488,0x41a3,0x418f,0xaa,0x15,0xb3,0x50,0x93,0xba,0x42,0xd4); -DEFINE_GUID(IID_IDirectMusicSegmentState, 0xa3afdcc7,0xd3ee,0x11d1,0xbc,0x8d,0x0,0xa0,0xc9,0x22,0xe6,0xeb); -DEFINE_GUID(IID_IDirectMusicSegmentState8, 0xa50e4730,0xae4,0x48a7,0x98,0x39,0xbc,0x4,0xbf,0xe0,0x77,0x72); -DEFINE_GUID(IID_IDirectMusicSong, 0xa862b2ec,0x3676,0x4982,0x85,0xa,0x78,0x42,0x77,0x5e,0x1d,0x86); -DEFINE_GUID(IID_IDirectMusicStyle, 0xd2ac28bd,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(IID_IDirectMusicStyle8, 0xfd24ad8a,0xa260,0x453d,0xbf,0x50,0x6f,0x93,0x84,0xf7,0x9,0x85); +DEFINE_GUID(IID_IDirectMusicAudioPath, 0xc87631f5,0x23be,0x4986,0x88,0x36,0x05,0x83,0x2f,0xcc,0x48,0xf9); +DEFINE_GUID(IID_IDirectMusicBand, 0xd2ac28c0,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(IID_IDirectMusicChordMap, 0xd2ac28be,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(IID_IDirectMusicComposer, 0xd2ac28bf,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(IID_IDirectMusicContainer, 0x9301e386,0x1f22,0x11d3,0x82,0x26,0xd2,0xfa,0x76,0x25,0x5d,0x47); +DEFINE_GUID(IID_IDirectMusicGetLoader, 0x68a04844,0xd13d,0x11d1,0xaf,0xa6,0x00,0xaa,0x00,0x24,0xd8,0xb6); +DEFINE_GUID(IID_IDirectMusicGraph, 0x2befc277,0x5497,0x11d2,0xbc,0xcb,0x00,0xa0,0xc9,0x22,0xe6,0xeb); +DEFINE_GUID(IID_IDirectMusicLoader, 0x2ffaaca2,0x5dca,0x11d2,0xaf,0xa6,0x00,0xaa,0x00,0x24,0xd8,0xb6); +DEFINE_GUID(IID_IDirectMusicLoader8, 0x19e7c08c,0x0a44,0x4e6a,0xa1,0x16,0x59,0x5a,0x7c,0xd5,0xde,0x8c); +DEFINE_GUID(IID_IDirectMusicObject, 0xd2ac28b5,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(IID_IDirectMusicPatternTrack, 0x51c22e10,0xb49f,0x46fc,0xbe,0xc2,0xe6,0x28,0x8f,0xb9,0xed,0xe6); +DEFINE_GUID(IID_IDirectMusicPerformance, 0x07d43d03,0x6523,0x11d2,0x87,0x1d,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(IID_IDirectMusicPerformance2, 0x6fc2cae0,0xbc78,0x11d2,0xaf,0xa6,0x00,0xaa,0x00,0x24,0xd8,0xb6); +DEFINE_GUID(IID_IDirectMusicPerformance8, 0x679c4137,0xc62e,0x4147,0xb2,0xb4,0x9d,0x56,0x9a,0xcb,0x25,0x4c); +DEFINE_GUID(IID_IDirectMusicScript, 0x2252373a,0x5814,0x489b,0x82,0x09,0x31,0xfe,0xde,0xba,0xf1,0x37); +DEFINE_GUID(IID_IDirectMusicSegment, 0xf96029a2,0x4282,0x11d2,0x87,0x17,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(IID_IDirectMusicSegment2, 0xd38894d1,0xc052,0x11d2,0x87,0x2f,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(IID_IDirectMusicSegment8, 0xc6784488,0x41a3,0x418f,0xaa,0x15,0xb3,0x50,0x93,0xba,0x42,0xd4); +DEFINE_GUID(IID_IDirectMusicSegmentState, 0xa3afdcc7,0xd3ee,0x11d1,0xbc,0x8d,0x00,0xa0,0xc9,0x22,0xe6,0xeb); +DEFINE_GUID(IID_IDirectMusicSegmentState8, 0xa50e4730,0x0ae4,0x48a7,0x98,0x39,0xbc,0x04,0xbf,0xe0,0x77,0x72); +DEFINE_GUID(IID_IDirectMusicStyle, 0xd2ac28bd,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(IID_IDirectMusicStyle8, 0xfd24ad8a,0xa260,0x453d,0xbf,0x50,0x6f,0x93,0x84,0xf7,0x09,0x85); /* IIDs of unchanged interfaces */ -#define IID_IDirectMusicAudioPath8 IID_IDirectMusicAudioPath -#define IID_IDirectMusicBand8 IID_IDirectMusicBand -#define IID_IDirectMusicChordMap8 IID_IDirectMusicChordMap -#define IID_IDirectMusicComposer8 IID_IDirectMusicComposer -#define IID_IDirectMusicContainer8 IID_IDirectMusicContainer -#define IID_IDirectMusicGetLoader8 IID_IDirectMusicGetLoader -#define IID_IDirectMusicGraph8 IID_IDirectMusicGraph -#define IID_IDirectMusicObject8 IID_IDirectMusicObject +#define IID_IDirectMusicAudioPath8 IID_IDirectMusicAudioPath +#define IID_IDirectMusicBand8 IID_IDirectMusicBand +#define IID_IDirectMusicChordMap8 IID_IDirectMusicChordMap +#define IID_IDirectMusicComposer8 IID_IDirectMusicComposer +#define IID_IDirectMusicContainer8 IID_IDirectMusicContainer +#define IID_IDirectMusicGetLoader8 IID_IDirectMusicGetLoader +#define IID_IDirectMusicGraph8 IID_IDirectMusicGraph +#define IID_IDirectMusicObject8 IID_IDirectMusicObject #define IID_IDirectMusicPatternTrack8 IID_IDirectMusicPatternTrack -#define IID_IDirectMusicScript8 IID_IDirectMusicScript -#define IID_IDirectMusicSong8 IID_IDirectMusicSong +#define IID_IDirectMusicScript8 IID_IDirectMusicScript /* typedef definitions */ -typedef struct IDirectMusicAudioPath IDirectMusicAudioPath, *LPDIRECTMUSICAUDIOPATH, IDirectMusicAudioPath8, *LPDIRECTMUSICAUDIOPATH8; -typedef struct IDirectMusicBand IDirectMusicBand, *LPDIRECTMUSICBAND, IDirectMusicBand8, *LPDIRECTMUSICBAND8, *LPDMUS_BAND; -typedef struct IDirectMusicChordMap IDirectMusicChordMap, *LPDIRECTMUSICCHORDMAP, IDirectMusicChordMap8, *LPDIRECTMUSICCHORDMAP8; -typedef struct IDirectMusicComposer IDirectMusicComposer, *LPDIRECTMUSICCOMPOSER; -typedef struct IDirectMusicContainer IDirectMusicContainer, *LPDIRECTMUSICCONTAINER, IDirectMusicContainer8, *LPDIRECTMUSICCONTAINER8; -typedef struct IDirectMusicGetLoader IDirectMusicGetLoader, *LPDIRECTMUSICGETLOADER, IDirectMusicGetLoader8, *LPDIRECTMUSICGETLOADER8; -typedef struct IDirectMusicGraph IDirectMusicGraph, *LPDIRECTMUSICGRAPH, IDirectMusicGraph8, *LPDIRECTMUSICGRAPH8; -typedef struct IDirectMusicLoader IDirectMusicLoader, *LPDIRECTMUSICLOADER, *LPDMUS_LOADER; -typedef struct IDirectMusicLoader8 IDirectMusicLoader8, *LPDIRECTMUSICLOADER8; -typedef struct IDirectMusicObject IDirectMusicObject, *LPDIRECTMUSICOBJECT, IDirectMusicObject8, *LPDIRECTMUSICOBJECT8, *LPDMUS_OBJECT; -typedef struct IDirectMusicPatternTrack IDirectMusicPatternTrack, *LPDIRECTMUSICPATTERNTRACK, IDirectMusicPatternTrack8, *LPDIRECTMUSICPATTERNTRACK8; -typedef struct IDirectMusicPerformance IDirectMusicPerformance, *LPDIRECTMUSICPERFORMANCE; -typedef struct IDirectMusicPerformance2 IDirectMusicPerformance2, *LPDIRECTMUSICPERFORMANCE2; -typedef struct IDirectMusicPerformance8 IDirectMusicPerformance8, *LPDIRECTMUSICPERFORMANCE8; -typedef struct IDirectMusicScript IDirectMusicScript, *LPDIRECTMUSICSCRIPT, IDirectMusicScript8, *LPDIRECTMUSICSCRIPT8; -typedef struct IDirectMusicSegment IDirectMusicSegment, *LPDIRECTMUSICSEGMENT; -typedef struct IDirectMusicSegment2 IDirectMusicSegment2, *LPDIRECTMUSICSEGMENT2; -typedef struct IDirectMusicSegment8 IDirectMusicSegment8, *LPDIRECTMUSICSEGMENT8; -typedef struct IDirectMusicSegmentState IDirectMusicSegmentState, *LPDIRECTMUSICSEGMENTSTATE; -typedef struct IDirectMusicSegmentState8 IDirectMusicSegmentState8, *LPDIRECTMUSICSEGMENTSTATE8; -typedef struct IDirectMusicSong IDirectMusicSong, *LPDIRECTMUSICSONG, IDirectMusicSong8, *LPDIRECTMUSICSONG8; -typedef struct IDirectMusicStyle IDirectMusicStyle, *LPDIRECTMUSICSTYLE; -typedef struct IDirectMusicStyle8 IDirectMusicStyle8, *LPDIRECTMUSICSTYLE8; -/* Imported from dmplugin.h */ -typedef struct IDirectMusicTool IDirectMusicTool, *LPDIRECTMUSICTOOL; -typedef struct IDirectMusicTool8 IDirectMusicTool8, *LPDIRECTMUSICTOOL8; -typedef struct IDirectMusicTrack IDirectMusicTrack, *LPDIRECTMUSICTRACK; -typedef struct IDirectMusicTrack8 IDirectMusicTrack8, *LPDIRECTMUSICTRACK8; +typedef struct IDirectMusicBand IDirectMusicBand, *LPDIRECTMUSICBAND; +typedef struct IDirectMusicBand IDirectMusicBand8, *LPDIRECTMUSICBAND8; +typedef struct IDirectMusicObject IDirectMusicObject, *LPDIRECTMUSICOBJECT; +typedef struct IDirectMusicObject IDirectMusicObject8, *LPDIRECTMUSICOBJECT8; +typedef struct IDirectMusicLoader IDirectMusicLoader, *LPDIRECTMUSICLOADER; +typedef struct IDirectMusicLoader IDirectMusicLoader8, *LPDIRECTMUSICLOADER8; +typedef struct IDirectMusicGetLoader IDirectMusicGetLoader, *LPDIRECTMUSICGETLOADER; +typedef struct IDirectMusicGetLoader IDirectMusicGetLoader8, *LPDIRECTMUSICGETLOADER8; +typedef struct IDirectMusicAudioPath IDirectMusicAudioPath, *LPDIRECTMUSICAUDIOPATH; +typedef struct IDirectMusicAudioPath IDirectMusicAudioPath8, *LPDIRECTMUSICAUDIOPATH8; +typedef struct IDirectMusicStyle IDirectMusicStyle, *LPDIRECTMUSICSTYLE; +typedef struct IDirectMusicStyle8 IDirectMusicStyle8, *LPDIRECTMUSICSTYLE8; +typedef struct IDirectMusicChordMap IDirectMusicChordMap, *LPDIRECTMUSICCHORDMAP; +typedef struct IDirectMusicChordMap IDirectMusicChordMap8, *LPDIRECTMUSICCHORDMAP8; +typedef struct IDirectMusicComposer IDirectMusicComposer, *LPDIRECTMUSICCOMPOSER; +typedef struct IDirectMusicComposer IDirectMusicComposer8, *LPDIRECTMUSICCOMPOSER8; +typedef struct IDirectMusicPatternTrack IDirectMusicPatternTrack, *LPDIRECTMUSICPATTERNTRACK; +typedef struct IDirectMusicPatternTrack IDirectMusicPatternTrack8, *LPDIRECTMUSICPATTERNTRACK8; +typedef struct IDirectMusicScript IDirectMusicScript, *LPDIRECTMUSICSCRIPT; +typedef struct IDirectMusicScript IDirectMusicScript8, *LPDIRECTMUSICSCRIPT8; +typedef struct IDirectMusicContainer IDirectMusicContainer, *LPDIRECTMUSICCONTAINER; +typedef struct IDirectMusicContainer IDirectMusicContainer8, *LPDIRECTMUSICCONTAINER8; -DEFINE_GUID(GUID_DirectMusicAllTypes, 0xd2ac2893,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); +/* RPC declarations */ +typedef struct IDirectMusicBand __RPC_FAR *LPDMUS_BAND; +typedef struct IDirectMusicLoader __RPC_FAR *LPDMUS_LOADER; +typedef struct IDirectMusicObject __RPC_FAR *LPDMUS_OBJECT; -DEFINE_GUID(GUID_NOTIFICATION_SEGMENT, 0xd2ac2899,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(GUID_NOTIFICATION_PERFORMANCE, 0x81f75bc5,0x4e5d,0x11d2,0xbc,0xc7,0x0,0xa0,0xc9,0x22,0xe6,0xeb); -DEFINE_GUID(GUID_NOTIFICATION_MEASUREANDBEAT, 0xd2ac289a,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(GUID_NOTIFICATION_CHORD, 0xd2ac289b,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(GUID_NOTIFICATION_COMMAND, 0xd2ac289c,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(GUID_NOTIFICATION_RECOMPOSE, 0xd348372b,0x945b,0x45ae,0xa5,0x22,0x45,0xf,0x12,0x5b,0x84,0xa5); - -DEFINE_GUID(GUID_CommandParam, 0xd2ac289d,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(GUID_CommandParam2, 0x28f97ef7,0x9538,0x11d2,0x97,0xa9,0x0,0xc0,0x4f,0xa3,0x6e,0x58); -DEFINE_GUID(GUID_CommandParamNext, 0x472afe7a,0x281b,0x11d3,0x81,0x7d,0x0,0xc0,0x4f,0xa3,0x6e,0x58); -DEFINE_GUID(GUID_ChordParam, 0xd2ac289e,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(GUID_RhythmParam, 0xd2ac289f,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(GUID_IDirectMusicStyle, 0xd2ac28a1,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(GUID_TimeSignature, 0xd2ac28a4,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(GUID_TempoParam, 0xd2ac28a5,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(GUID_Valid_Start_Time, 0x7f6b1760,0x1fdb,0x11d3,0x82,0x26,0x44,0x45,0x53,0x54,0x0,0x0); -DEFINE_GUID(GUID_Play_Marker, 0xd8761a41,0x801a,0x11d3,0x9b,0xd1,0xda,0xf7,0xe1,0xc3,0xd8,0x34); -DEFINE_GUID(GUID_BandParam, 0x2bb1938,0xcb8b,0x11d2,0x8b,0xb9,0x0,0x60,0x8,0x93,0xb1,0xb6); -DEFINE_GUID(GUID_IDirectMusicBand, 0xd2ac28ac,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(GUID_IDirectMusicChordMap, 0xd2ac28ad,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(GUID_MuteParam, 0xd2ac28af,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); - -DEFINE_GUID(GUID_Download, 0xd2ac28a7,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(GUID_Unload, 0xd2ac28a8,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(GUID_ConnectToDLSCollection, 0x1db1ae6b,0xe92e,0x11d1,0xa8,0xc5,0x0,0xc0,0x4f,0xa3,0x72,0x6e); -DEFINE_GUID(GUID_Enable_Auto_Download, 0xd2ac28a9,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(GUID_Disable_Auto_Download, 0xd2ac28aa,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(GUID_Clear_All_Bands, 0xd2ac28ab,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(GUID_StandardMIDIFile, 0x6621075,0xe92e,0x11d1,0xa8,0xc5,0x0,0xc0,0x4f,0xa3,0x72,0x6e); -#define GUID_IgnoreBankSelectForGM GUID_StandardMIDIFile - -DEFINE_GUID(GUID_DisableTimeSig, 0x45fc707b,0x1db4,0x11d2,0xbc,0xac,0x0,0xa0,0xc9,0x22,0xe6,0xeb); -DEFINE_GUID(GUID_EnableTimeSig, 0x45fc707c,0x1db4,0x11d2,0xbc,0xac,0x0,0xa0,0xc9,0x22,0xe6,0xeb); -DEFINE_GUID(GUID_DisableTempo, 0x45fc707d,0x1db4,0x11d2,0xbc,0xac,0x0,0xa0,0xc9,0x22,0xe6,0xeb); -DEFINE_GUID(GUID_EnableTempo, 0x45fc707e,0x1db4,0x11d2,0xbc,0xac,0x0,0xa0,0xc9,0x22,0xe6,0xeb); - -DEFINE_GUID(GUID_SeedVariations, 0x65b76fa5,0xff37,0x11d2,0x81,0x4e,0x0,0xc0,0x4f,0xa3,0x6e,0x58); -DEFINE_GUID(GUID_MelodyFragment, 0xb291c7f2,0xb616,0x11d2,0x97,0xfa,0x0,0xc0,0x4f,0xa3,0x6e,0x58); -DEFINE_GUID(GUID_Clear_All_MelodyFragments, 0x8509fee6,0xb617,0x11d2,0x97,0xfa,0x0,0xc0,0x4f,0xa3,0x6e,0x58); -DEFINE_GUID(GUID_Variations, 0x11f72cce,0x26e6,0x4ecd,0xaf,0x2e,0xd6,0x68,0xe6,0x67,0x7,0xd8); -DEFINE_GUID(GUID_DownloadToAudioPath, 0x9f2c0341,0xc5c4,0x11d3,0x9b,0xd1,0x44,0x45,0x53,0x54,0x0,0x0); -DEFINE_GUID(GUID_UnloadFromAudioPath, 0x9f2c0342,0xc5c4,0x11d3,0x9b,0xd1,0x44,0x45,0x53,0x54,0x0,0x0); - -DEFINE_GUID(GUID_PerfMasterTempo, 0xd2ac28b0,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(GUID_PerfMasterVolume, 0xd2ac28b1,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(GUID_PerfMasterGrooveLevel, 0xd2ac28b2,0xb39b,0x11d1,0x87,0x4,0x0,0x60,0x8,0x93,0xb1,0xbd); -DEFINE_GUID(GUID_PerfAutoDownload, 0xfb09565b,0x3631,0x11d2,0xbc,0xb8,0x0,0xa0,0xc9,0x22,0xe6,0xeb); - -DEFINE_GUID(GUID_DefaultGMCollection, 0xf17e8673,0xc3b4,0x11d1,0x87,0xb,0x0,0x60,0x8,0x93,0xb1,0xbd); - -DEFINE_GUID(GUID_Synth_Default, 0x26bb9432,0x45fe,0x48d3,0xa3,0x75,0x24,0x72,0xc5,0xe3,0xe7,0x86); - -DEFINE_GUID(GUID_Buffer_Reverb, 0x186cc541,0xdb29,0x11d3,0x9b,0xd1,0x0,0x80,0xc7,0x15,0xa,0x74); -DEFINE_GUID(GUID_Buffer_EnvReverb, 0x186cc542,0xdb29,0x11d3,0x9b,0xd1,0x0,0x80,0xc7,0x15,0xa,0x74); -DEFINE_GUID(GUID_Buffer_Stereo, 0x186cc545,0xdb29,0x11d3,0x9b,0xd1,0x0,0x80,0xc7,0x15,0xa,0x74); -DEFINE_GUID(GUID_Buffer_3D_Dry, 0x186cc546,0xdb29,0x11d3,0x9b,0xd1,0x0,0x80,0xc7,0x15,0xa,0x74); -DEFINE_GUID(GUID_Buffer_Mono, 0x186cc547,0xdb29,0x11d3,0x9b,0xd1,0x0,0x80,0xc7,0x15,0xa,0x74); +/* GUIDs - all types loader */ +DEFINE_GUID(GUID_DirectMusicAllTypes, 0xd2ac2893,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +/* GUIDs - notification */ +DEFINE_GUID(GUID_NOTIFICATION_CHORD, 0xd2ac289b,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(GUID_NOTIFICATION_COMMAND, 0xd2ac289c,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(GUID_NOTIFICATION_MEASUREANDBEAT, 0xd2ac289a,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(GUID_NOTIFICATION_PERFORMANCE, 0x81f75bc5,0x4e5d,0x11d2,0xbc,0xc7,0x00,0xa0,0xc9,0x22,0xe6,0xeb); +DEFINE_GUID(GUID_NOTIFICATION_RECOMPOSE, 0xd348372b,0x945b,0x45ae,0xa5,0x22,0x45,0x0f,0x12,0x5b,0x84,0xa5); +DEFINE_GUID(GUID_NOTIFICATION_SEGMENT, 0xd2ac2899,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +/* GUIDs - param types */ +DEFINE_GUID(GUID_BandParam, 0x02bb1938,0xcb8b,0x11d2,0x8b,0xb9,0x00,0x60,0x08,0x93,0xb1,0xb6); +DEFINE_GUID(GUID_ChordParam, 0xd2ac289e,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(GUID_CommandParam, 0xd2ac289d,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(GUID_CommandParam2, 0x28f97ef7,0x9538,0x11d2,0x97,0xa9,0x00,0xc0,0x4f,0xa3,0x6e,0x58); +DEFINE_GUID(GUID_CommandParamNext, 0x472afe7a,0x281b,0x11d3,0x81,0x7d,0x00,0xc0,0x4f,0xa3,0x6e,0x58); +DEFINE_GUID(GUID_IDirectMusicBand, 0xd2ac28ac,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(GUID_IDirectMusicChordMap, 0xd2ac28ad,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(GUID_IDirectMusicStyle, 0xd2ac28a1,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(GUID_MuteParam, 0xd2ac28af,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(GUID_Play_Marker, 0xd8761a41,0x801a,0x11d3,0x9b,0xd1,0xda,0xf7,0xe1,0xc3,0xd8,0x34); +DEFINE_GUID(GUID_RhythmParam, 0xd2ac289f,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(GUID_TempoParam, 0xd2ac28a5,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(GUID_TimeSignature, 0xd2ac28a4,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(GUID_Valid_Start_Time, 0x7f6b1760,0x1fdb,0x11d3,0x82,0x26,0x44,0x45,0x53,0x54,0x00,0x00); +/* GUIDs - param setting */ +DEFINE_GUID(GUID_Clear_All_Bands, 0xd2ac28ab,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(GUID_ConnectToDLSCollection, 0x1db1ae6b,0xe92e,0x11d1,0xa8,0xc5,0x00,0xc0,0x4f,0xa3,0x72,0x6e); +DEFINE_GUID(GUID_Disable_Auto_Download, 0xd2ac28aa,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(GUID_DisableTempo, 0x45fc707d,0x1db4,0x11d2,0xbc,0xac,0x00,0xa0,0xc9,0x22,0xe6,0xeb); +DEFINE_GUID(GUID_DisableTimeSig, 0x45fc707b,0x1db4,0x11d2,0xbc,0xac,0x00,0xa0,0xc9,0x22,0xe6,0xeb); +DEFINE_GUID(GUID_Download, 0xd2ac28a7,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(GUID_DownloadToAudioPath, 0x9f2c0341,0xc5c4,0x11d3,0x9b,0xd1,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(GUID_Enable_Auto_Download, 0xd2ac28a9,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(GUID_EnableTempo, 0x45fc707e,0x1db4,0x11d2,0xbc,0xac,0x00,0xa0,0xc9,0x22,0xe6,0xeb); +DEFINE_GUID(GUID_EnableTimeSig, 0x45fc707c,0x1db4,0x11d2,0xbc,0xac,0x00,0xa0,0xc9,0x22,0xe6,0xeb); +#define GUID_IgnoreBankSelectForGM GUID_StandardMIDIFile +DEFINE_GUID(GUID_SeedVariations, 0x65b76fa5,0xff37,0x11d2,0x81,0x4e,0x00,0xc0,0x4f,0xa3,0x6e,0x58); +DEFINE_GUID(GUID_StandardMIDIFile, 0x06621075,0xe92e,0x11d1,0xa8,0xc5,0x00,0xc0,0x4f,0xa3,0x72,0x6e); +DEFINE_GUID(GUID_Unload, 0xd2ac28a8,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(GUID_UnloadFromAudioPath, 0x9f2c0342,0xc5c4,0x11d3,0x9b,0xd1,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(GUID_Variations, 0x11f72cce,0x26e6,0x4ecd,0xaf,0x2e,0xd6,0x68,0xe6,0x67,0x07,0xd8); +/* GUIDs - global data */ +DEFINE_GUID(GUID_PerfMasterTempo, 0xd2ac28b0,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(GUID_PerfMasterVolume, 0xd2ac28b1,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(GUID_PerfMasterGrooveLevel, 0xd2ac28b2,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd); +DEFINE_GUID(GUID_PerfAutoDownload, 0xfb09565b,0x3631,0x11d2,0xbc,0xb8,0x00,0xa0,0xc9,0x22,0xe6,0xeb); +/* GUID - default DLS collection */ +DEFINE_GUID(GUID_DefaultGMCollection, 0xf17e8673,0xc3b4,0x11d1,0x87,0x0b,0x00,0x60,0x08,0x93,0xb1,0xbd); +/* GUID - default synthesizer */ +DEFINE_GUID(GUID_Synth_Default, 0x26bb9432,0x45fe,0x48d3,0xa3,0x75,0x24,0x72,0xc5,0xe3,0xe7,0x86); +/* GUIDs - define default buffer configuration */ +DEFINE_GUID(GUID_Buffer_Reverb, 0x186cc541,0xdb29,0x11d3,0x9b,0xd1,0x00,0x80,0xc7,0x15,0x0a,0x74); +DEFINE_GUID(GUID_Buffer_EnvReverb, 0x186cc542,0xdb29,0x11d3,0x9b,0xd1,0x00,0x80,0xc7,0x15,0x0a,0x74); +DEFINE_GUID(GUID_Buffer_Stereo, 0x186cc545,0xdb29,0x11d3,0x9b,0xd1,0x00,0x80,0xc7,0x15,0x0a,0x74); +DEFINE_GUID(GUID_Buffer_3D_Dry, 0x186cc546,0xdb29,0x11d3,0x9b,0xd1,0x00,0x80,0xc7,0x15,0x0a,0x74); +DEFINE_GUID(GUID_Buffer_Mono, 0x186cc547,0xdb29,0x11d3,0x9b,0xd1,0x00,0x80,0xc7,0x15,0x0a,0x74); /***************************************************************************** - * Definitions + * Typedef definitions + */ +typedef WORD TRANSITION_TYPE, *LPTRANSITION_TYPE; +/* + * typedef __int64 REFERENCE_TIME, *LPREFERENCE_TIME; + * typedef long MUSIC_TIME, *LPMUSIC_TIME; */ -#define MT_MIN 0x80000000 -#define MT_MAX 0x7FFFFFFF -#define DMUS_PPQ 768 -#define DMUS_PMSG_PART \ - DWORD dwSize; \ - REFERENCE_TIME rtTime; \ - MUSIC_TIME mtTime; \ - DWORD dwFlags; \ - DWORD dwPChannel; \ - DWORD dwVirtualTrackID; \ - IDirectMusicTool* pTool; \ - IDirectMusicGraph* pGraph; \ - DWORD dwType; \ - DWORD dwVoiceID; \ - DWORD dwGroupID; \ - IUnknown* punkUser; +/***************************************************************************** + * Flags + */ +#define DMUS_APATH_SHARED_STEREOPLUSREVERB 0x1 +#define DMUS_APATH_DYNAMIC_3D 0x6 +#define DMUS_APATH_DYNAMIC_MONO 0x7 +#define DMUS_APATH_DYNAMIC_STEREO 0x8 + +#define DMUS_AUDIOF_3D 0x01 +#define DMUS_AUDIOF_ENVIRON 0x02 +#define DMUS_AUDIOF_EAX 0x04 +#define DMUS_AUDIOF_DMOS 0x08 +#define DMUS_AUDIOF_STREAMING 0x10 +#define DMUS_AUDIOF_BUFFERS 0x20 +#define DMUS_AUDIOF_ALL 0x3F + +#define DMUS_AUDIOPARAMS_FEATURES 0x1 +#define DMUS_AUDIOPARAMS_VOICES 0x2 +#define DMUS_AUDIOPARAMS_SAMPLERATE 0x4 +#define DMUS_AUDIOPARAMS_DEFAULTSYNTH 0x8 + +#define DMUS_CURVET_PBCURVE 0x03 +#define DMUS_CURVET_CCCURVE 0x04 +#define DMUS_CURVET_MATCURVE 0x05 +#define DMUS_CURVET_PATCURVE 0x06 +#define DMUS_CURVET_RPNCURVE 0x07 +#define DMUS_CURVET_NRPNCURVE 0x08 + +#define DMUS_MASTERTEMPO_MAX 100.0f +#define DMUS_MASTERTEMPO_MIN 0.01f + +#define DMUS_MAX_NAME 0x40 +#define DMUS_MAX_CATEGORY 0x40 +#define DMUS_MAX_FILENAME MAX_PATH + +#define DMUS_MAXSUBCHORD 0x8 + +#define DMUS_NOTIFICATION_SEGSTART 0x0 +#define DMUS_NOTIFICATION_SEGEND 0x1 +#define DMUS_NOTIFICATION_SEGALMOSTEND 0x2 +#define DMUS_NOTIFICATION_SEGLOOP 0x3 +#define DMUS_NOTIFICATION_SEGABORT 0x4 +#define DMUS_NOTIFICATION_MUSICSTARTED 0x0 +#define DMUS_NOTIFICATION_MUSICSTOPPED 0x1 +#define DMUS_NOTIFICATION_MUSICALMOSTEND 0x2 +#define DMUS_NOTIFICATION_MEASUREBEAT 0x0 +#define DMUS_NOTIFICATION_CHORD 0x0 +#define DMUS_NOTIFICATION_GROOVE 0x0 +#define DMUS_NOTIFICATION_EMBELLISHMENT 0x1 +#define DMUS_NOTIFICATION_RECOMPOSE 0x0 + +#define DMUS_OBJ_OBJECT 0x001 +#define DMUS_OBJ_CLASS 0x002 +#define DMUS_OBJ_NAME 0x004 +#define DMUS_OBJ_CATEGORY 0x008 +#define DMUS_OBJ_FILENAME 0x010 +#define DMUS_OBJ_FULLPATH 0x020 +#define DMUS_OBJ_URL 0x040 +#define DMUS_OBJ_VERSION 0x080 +#define DMUS_OBJ_DATE 0x100 +#define DMUS_OBJ_LOADED 0x200 +#define DMUS_OBJ_MEMORY 0x400 +#define DMUS_OBJ_STREAM 0x800 + +#define DMUS_PATH_SEGMENT 0x1000 +#define DMUS_PATH_SEGMENT_TRACK 0x1100 +#define DMUS_PATH_SEGMENT_GRAPH 0x1200 +#define DMUS_PATH_SEGMENT_TOOL 0x1300 +#define DMUS_PATH_AUDIOPATH 0x2000 +#define DMUS_PATH_AUDIOPATH_GRAPH 0x2200 +#define DMUS_PATH_AUDIOPATH_TOOL 0x2300 +#define DMUS_PATH_PERFORMANCE 0x3000 +#define DMUS_PATH_PERFORMANCE_GRAPH 0x3200 +#define DMUS_PATH_PERFORMANCE_TOOL 0x3300 +#define DMUS_PATH_PORT 0x4000 +#define DMUS_PATH_BUFFER 0x6000 +#define DMUS_PATH_BUFFER_DMO 0x6100 +#define DMUS_PATH_MIXIN_BUFFER 0x7000 +#define DMUS_PATH_MIXIN_BUFFER_DMO 0x7100 +#define DMUS_PATH_PRIMARY_BUFFER 0x8000 #define DMUS_PCHANNEL_BROADCAST_PERFORMANCE 0xFFFFFFFF #define DMUS_PCHANNEL_BROADCAST_AUDIOPATH 0xFFFFFFFE #define DMUS_PCHANNEL_BROADCAST_SEGMENT 0xFFFFFFFD #define DMUS_PCHANNEL_BROADCAST_GROUPS 0xFFFFFFFC -#define DMUS_PCHANNEL_ALL 0xFFFFFFFB +#define DMUS_PCHANNEL_ALL 0xFFFFFFFB -#define DMUS_PATH_SEGMENT 0x1000 -#define DMUS_PATH_SEGMENT_TRACK 0x1100 -#define DMUS_PATH_SEGMENT_GRAPH 0x1200 -#define DMUS_PATH_SEGMENT_TOOL 0x1300 -#define DMUS_PATH_AUDIOPATH 0x2000 -#define DMUS_PATH_AUDIOPATH_GRAPH 0x2200 -#define DMUS_PATH_AUDIOPATH_TOOL 0x2300 -#define DMUS_PATH_PERFORMANCE 0x3000 -#define DMUS_PATH_PERFORMANCE_GRAPH 0x3200 -#define DMUS_PATH_PERFORMANCE_TOOL 0x3300 -#define DMUS_PATH_PORT 0x4000 -#define DMUS_PATH_BUFFER 0x6000 -#define DMUS_PATH_BUFFER_DMO 0x6100 -#define DMUS_PATH_MIXIN_BUFFER 0x7000 -#define DMUS_PATH_MIXIN_BUFFER_DMO 0x7100 -#define DMUS_PATH_PRIMARY_BUFFER 0x8000 - -#define DMUS_APATH_SHARED_STEREOPLUSREVERB 0x1 -#define DMUS_APATH_DYNAMIC_3D 0x6 -#define DMUS_APATH_DYNAMIC_MONO 0x7 -#define DMUS_APATH_DYNAMIC_STEREO 0x8 - -#define DMUS_AUDIOF_3D 0x1 -#define DMUS_AUDIOF_ENVIRON 0x2 -#define DMUS_AUDIOF_EAX 0x4 -#define DMUS_AUDIOF_DMOS 0x8 -#define DMUS_AUDIOF_STREAMING 0x10 -#define DMUS_AUDIOF_BUFFERS 0x20 -#define DMUS_AUDIOF_ALL 0x3F - -#define DMUS_AUDIOPARAMS_FEATURES 0x00000001 -#define DMUS_AUDIOPARAMS_VOICES 0x00000002 -#define DMUS_AUDIOPARAMS_SAMPLERATE 0x00000004 -#define DMUS_AUDIOPARAMS_DEFAULTSYNTH 0x00000008 - -#define DMUS_SEG_REPEAT_INFINITE 0xFFFFFFFF -#define DMUS_SEG_ALLTRACKS 0x80000000 -#define DMUS_SEG_ANYTRACK 0x80000000 - -#define DMUS_MAXSUBCHORD 8 - -#define DMUS_PLAYMODE_FIXED 0 +#define DMUS_PLAYMODE_FIXED 0x0 #define DMUS_PLAYMODE_FIXEDTOKEY DMUS_PLAYMODE_KEY_ROOT #define DMUS_PLAYMODE_FIXEDTOCHORD DMUS_PLAYMODE_CHORD_ROOT #define DMUS_PLAYMODE_PEDALPOINT (DMUS_PLAYMODE_KEY_ROOT | DMUS_PLAYMODE_SCALE_INTERVALS) @@ -285,531 +306,485 @@ DEFINE_GUID(GUID_Buffer_Mono, 0x186cc547,0xdb29,0x11d3,0x9b,0xd1,0x0,0x80 #define DMUS_PLAYMODE_SCALE_ROOT DMUS_PLAYMODE_KEY_ROOT #define DMUS_PLAYMODE_FIXEDTOSCALE DMUS_PLAYMODE_FIXEDTOKEY -#define DMUS_TEMPO_MAX 1000 -#define DMUS_TEMPO_MIN 1 +#define DMUS_PPQ 768 -#define DMUS_MASTERTEMPO_MAX 100.0f -#define DMUS_MASTERTEMPO_MIN 0.01f +#define DMUS_SEG_REPEAT_INFINITE 0xFFFFFFFF +#define DMUS_SEG_ALLTRACKS 0x80000000 +#define DMUS_SEG_ANYTRACK 0x80000000 -#define DMUS_CURVET_PBCURVE 0x03 -#define DMUS_CURVET_CCCURVE 0x04 -#define DMUS_CURVET_MATCURVE 0x05 -#define DMUS_CURVET_PATCURVE 0x06 -#define DMUS_CURVET_RPNCURVE 0x07 -#define DMUS_CURVET_NRPNCURVE 0x08 +#define DMUS_TEMPO_MAX 1000 +#define DMUS_TEMPO_MIN 1 -#define DMUS_NOTIFICATION_SEGSTART 0x0 -#define DMUS_NOTIFICATION_SEGEND 0x1 -#define DMUS_NOTIFICATION_SEGALMOSTEND 0x2 -#define DMUS_NOTIFICATION_SEGLOOP 0x3 -#define DMUS_NOTIFICATION_SEGABORT 0x4 +#define DMUS_TRACKCONFIG_OVERRIDE_ALL 0x00001 +#define DMUS_TRACKCONFIG_OVERRIDE_PRIMARY 0x00002 +#define DMUS_TRACKCONFIG_FALLBACK 0x00004 +#define DMUS_TRACKCONFIG_CONTROL_ENABLED 0x00008 +#define DMUS_TRACKCONFIG_PLAY_ENABLED 0x00010 +#define DMUS_TRACKCONFIG_NOTIFICATION_ENABLED 0x00020 +#define DMUS_TRACKCONFIG_PLAY_CLOCKTIME 0x00040 +#define DMUS_TRACKCONFIG_PLAY_COMPOSE 0x00080 +#define DMUS_TRACKCONFIG_LOOP_COMPOSE 0x00100 +#define DMUS_TRACKCONFIG_COMPOSING 0x00200 +#define DMUS_TRACKCONFIG_TRANS1_FROMSEGSTART 0x00400 +#define DMUS_TRACKCONFIG_TRANS1_FROMSEGCURRENT 0x00800 +#define DMUS_TRACKCONFIG_TRANS1_TOSEGSTART 0x01000 +#define DMUS_TRACKCONFIG_CONTROL_PLAY 0x10000 +#define DMUS_TRACKCONFIG_CONTROL_NOTIFICATION 0x20000 +#define DMUS_TRACKCONFIG_DEFAULT (DMUS_TRACKCONFIG_CONTROL_ENABLED | DMUS_TRACKCONFIG_PLAY_ENABLED | DMUS_TRACKCONFIG_NOTIFICATION_ENABLED) -#define DMUS_NOTIFICATION_MUSICSTARTED 0x0 -#define DMUS_NOTIFICATION_MUSICSTOPPED 0x1 -#define DMUS_NOTIFICATION_MUSICALMOSTEND 0x2 +#define DMUS_WAVEF_OFF 0x01 +#define DMUS_WAVEF_STREAMING 0x02 +#define DMUS_WAVEF_NOINVALIDATE 0x04 +#define DMUS_WAVEF_NOPREROLL 0x08 +#define DMUS_WAVEF_IGNORELOOPS 0x20 -#define DMUS_NOTIFICATION_MEASUREBEAT 0x0 +#define DMUSB_LOADED 0x1 +#define DMUSB_DEFAULT 0x2 -#define DMUS_NOTIFICATION_CHORD 0x0 +#define MT_MIN 0x80000000 +#define MT_MAX 0x7FFFFFFF -#define DMUS_NOTIFICATION_GROOVE 0x0 -#define DMUS_NOTIFICATION_EMBELLISHMENT 0x1 -#define DMUS_NOTIFICATION_RECOMPOSE 0x0 +/***************************************************************************** + * Definitions + */ +#define DMUS_PMSG_PART \ + DWORD dwSize; \ + REFERENCE_TIME rtTime; \ + MUSIC_TIME mtTime; \ + DWORD dwFlags; \ + DWORD dwPChannel; \ + DWORD dwVirtualTrackID; \ + IDirectMusicTool* pTool; \ + IDirectMusicGraph* pGraph; \ + DWORD dwType; \ + DWORD dwVoiceID; \ + DWORD dwGroupID; \ + IUnknown* punkUser; -#define DMUS_WAVEF_OFF 0x1 -#define DMUS_WAVEF_STREAMING 0x2 -#define DMUS_WAVEF_NOINVALIDATE 0x4 -#define DMUS_WAVEF_NOPREROLL 0x8 -#define DMUS_MAX_NAME 0x40 -#define DMUS_MAX_CATEGORY 0x40 -#define DMUS_MAX_FILENAME MAX_PATH +/***************************************************************************** + * Enumerations + */ +/* typedef definitions */ +typedef enum enumDMUS_STYLET_TYPES DMUS_STYLET_TYPES; +typedef enum enumDMUS_COMMANDT_TYPES DMUS_COMMANDT_TYPES; +typedef enum enumDMUS_SHAPET_TYPES DMUS_SHAPET_TYPES; +typedef enum enumDMUS_COMPOSEF_FLAGS DMUS_COMPOSEF_FLAGS; +typedef enum enumDMUS_PMSGF_FLAGS DMUS_PMSGF_FLAGS; +typedef enum enumDMUS_PMSGT_TYPES DMUS_PMSGT_TYPES; +typedef enum enumDMUS_SEGF_FLAGS DMUS_SEGF_FLAGS; +typedef enum enumDMUS_TIME_RESOLVE_FLAGS DMUS_TIME_RESOLVE_FLAGS; +typedef enum enumDMUS_CHORDKEYF_FLAGS DMUS_CHORDKEYF_FLAGS; +typedef enum enumDMUS_NOTEF_FLAGS DMUS_NOTEF_FLAGS; +typedef enum enumDMUS_PLAYMODE_FLAGS DMUS_PLAYMODE_FLAGS; +typedef enum enumDMUS_CURVE_FLAGS DMUS_CURVE_FLAGS; -#define DMUS_OBJ_OBJECT 0x001 -#define DMUS_OBJ_CLASS 0x002 -#define DMUS_OBJ_NAME 0x004 -#define DMUS_OBJ_CATEGORY 0x008 -#define DMUS_OBJ_FILENAME 0x010 -#define DMUS_OBJ_FULLPATH 0x020 -#define DMUS_OBJ_URL 0x040 -#define DMUS_OBJ_VERSION 0x080 -#define DMUS_OBJ_DATE 0x100 -#define DMUS_OBJ_LOADED 0x200 -#define DMUS_OBJ_MEMORY 0x400 -#define DMUS_OBJ_STREAM 0x800 -#define DMUS_TRACKCONFIG_OVERRIDE_ALL 0x00001 -#define DMUS_TRACKCONFIG_OVERRIDE_PRIMARY 0x00002 -#define DMUS_TRACKCONFIG_FALLBACK 0x00004 -#define DMUS_TRACKCONFIG_CONTROL_ENABLED 0x00008 -#define DMUS_TRACKCONFIG_PLAY_ENABLED 0x00010 -#define DMUS_TRACKCONFIG_NOTIFICATION_ENABLED 0x00020 -#define DMUS_TRACKCONFIG_PLAY_CLOCKTIME 0x00040 -#define DMUS_TRACKCONFIG_PLAY_COMPOSE 0x00080 -#define DMUS_TRACKCONFIG_LOOP_COMPOSE 0x00100 -#define DMUS_TRACKCONFIG_COMPOSING 0x00200 -#define DMUS_TRACKCONFIG_TRANS1_FROMSEGSTART 0x00400 -#define DMUS_TRACKCONFIG_TRANS1_FROMSEGCURRENT 0x00800 -#define DMUS_TRACKCONFIG_TRANS1_TOSEGSTART 0x01000 -#define DMUS_TRACKCONFIG_CONTROL_PLAY 0x10000 -#define DMUS_TRACKCONFIG_CONTROL_NOTIFICATION 0x20000 -#define DMUS_TRACKCONFIG_DEFAULT (DMUS_TRACKCONFIG_CONTROL_ENABLED | DMUS_TRACKCONFIG_PLAY_ENABLED | DMUS_TRACKCONFIG_NOTIFICATION_ENABLED) -#define DMUS_MAX_FRAGMENTLABEL 20 +/* actual enumerations */ +enum enumDMUS_STYLET_TYPES { + DMUS_STYLET_PATTERN = 0x0, + DMUS_STYLET_MOTIF = 0x1, +}; -#define DMUS_FRAGMENTF_USE_REPEAT 0x1 -#define DMUS_FRAGMENTF_REJECT_REPEAT 0x2 -#define DMUS_FRAGMENTF_USE_LABEL 0x4 +enum enumDMUS_COMMANDT_TYPES { + DMUS_COMMANDT_GROOVE = 0x0, + DMUS_COMMANDT_FILL = 0x1, + DMUS_COMMANDT_INTRO = 0x2, + DMUS_COMMANDT_BREAK = 0x3, + DMUS_COMMANDT_END = 0x4, + DMUS_COMMANDT_ENDANDINTRO = 0x5 +}; -#define DMUS_CONNECTIONF_INTERVALS 0x2 -#define DMUS_CONNECTIONF_OVERLAP 0x4 +enum enumDMUS_SHAPET_TYPES { + DMUS_SHAPET_FALLING = 0x0, + DMUS_SHAPET_LEVEL = 0x1, + DMUS_SHAPET_LOOPABLE = 0x2, + DMUS_SHAPET_LOUD = 0x3, + DMUS_SHAPET_QUIET = 0x4, + DMUS_SHAPET_PEAKING = 0x5, + DMUS_SHAPET_RANDOM = 0x6, + DMUS_SHAPET_RISING = 0x7, + DMUS_SHAPET_SONG = 0x8 +}; + +enum enumDMUS_COMPOSEF_FLAGS { + DMUS_COMPOSEF_NONE = 0x000000, + DMUS_COMPOSEF_ALIGN = 0x000001, + DMUS_COMPOSEF_OVERLAP = 0x000002, + DMUS_COMPOSEF_IMMEDIATE = 0x000004, + DMUS_COMPOSEF_GRID = 0x000008, + DMUS_COMPOSEF_BEAT = 0x000010, + DMUS_COMPOSEF_MEASURE = 0x000020, + DMUS_COMPOSEF_AFTERPREPARETIME = 0x000040, + DMUS_COMPOSEF_VALID_START_BEAT = 0x000080, + DMUS_COMPOSEF_VALID_START_GRID = 0x000100, + DMUS_COMPOSEF_VALID_START_TICK = 0x000200, + DMUS_COMPOSEF_SEGMENTEND = 0x000400, + DMUS_COMPOSEF_MARKER = 0x000800, + DMUS_COMPOSEF_MODULATE = 0x001000, + DMUS_COMPOSEF_LONG = 0x002000, + DMUS_COMPOSEF_ENTIRE_TRANSITION = 0x004000, + DMUS_COMPOSEF_1BAR_TRANSITION = 0x008000, + DMUS_COMPOSEF_ENTIRE_ADDITION = 0x010000, + DMUS_COMPOSEF_1BAR_ADDITION = 0x020000, + DMUS_COMPOSEF_VALID_START_MEASURE = 0x040000, + DMUS_COMPOSEF_DEFAULT = 0x080000, + DMUS_COMPOSEF_NOINVALIDATE = 0x100000, + DMUS_COMPOSEF_USE_AUDIOPATH = 0x200000, + DMUS_COMPOSEF_INVALIDATE_PRI = 0x400000 +}; + +enum enumDMUS_PMSGF_FLAGS { + DMUS_PMSGF_REFTIME = 1, + DMUS_PMSGF_MUSICTIME = 2, + DMUS_PMSGF_TOOL_IMMEDIATE = 4, + DMUS_PMSGF_TOOL_QUEUE = 8, + DMUS_PMSGF_TOOL_ATTIME = 0x10, + DMUS_PMSGF_TOOL_FLUSH = 0x20, + DMUS_PMSGF_LOCKTOREFTIME = 0x40, + DMUS_PMSGF_DX8 = 0x80 +}; + +enum enumDMUS_PMSGT_TYPES { + DMUS_PMSGT_MIDI = 0x00, + DMUS_PMSGT_NOTE = 0x01, + DMUS_PMSGT_SYSEX = 0x02, + DMUS_PMSGT_NOTIFICATION = 0x03, + DMUS_PMSGT_TEMPO = 0x04, + DMUS_PMSGT_CURVE = 0x05, + DMUS_PMSGT_TIMESIG = 0x06, + DMUS_PMSGT_PATCH = 0x07, + DMUS_PMSGT_TRANSPOSE = 0x08, + DMUS_PMSGT_CHANNEL_PRIORITY = 0x09, + DMUS_PMSGT_STOP = 0x0A, + DMUS_PMSGT_DIRTY = 0x0B, + DMUS_PMSGT_WAVE = 0x0C, + DMUS_PMSGT_LYRIC = 0x0D, + DMUS_PMSGT_SCRIPTLYRIC = 0x0E, + DMUS_PMSGT_USER = 0xFF +}; + +enum enumDMUS_SEGF_FLAGS { + DMUS_SEGF_REFTIME = 0x000040, + DMUS_SEGF_SECONDARY = 0x000080, + DMUS_SEGF_QUEUE = 0x000100, + DMUS_SEGF_CONTROL = 0x000200, + DMUS_SEGF_AFTERPREPARETIME = 0x000400, + DMUS_SEGF_GRID = 0x000800, + DMUS_SEGF_BEAT = 0x001000, + DMUS_SEGF_MEASURE = 0x002000, + DMUS_SEGF_DEFAULT = 0x004000, + DMUS_SEGF_NOINVALIDATE = 0x008000, + DMUS_SEGF_ALIGN = 0x0010000, + DMUS_SEGF_VALID_START_BEAT = 0x0020000, + DMUS_SEGF_VALID_START_GRID = 0x0040000, + DMUS_SEGF_VALID_START_TICK = 0x0080000, + DMUS_SEGF_AUTOTRANSITION = 0x0100000, + DMUS_SEGF_AFTERQUEUETIME = 0x0200000, + DMUS_SEGF_AFTERLATENCYTIME = 0x0400000, + DMUS_SEGF_SEGMENTEND = 0x0800000, + DMUS_SEGF_MARKER = 0x01000000, + DMUS_SEGF_TIMESIG_ALWAYS = 0x02000000, + DMUS_SEGF_USE_AUDIOPATH = 0x04000000, + DMUS_SEGF_VALID_START_MEASURE = 0x08000000, + DMUS_SEGF_INVALIDATE_PRI = 0x10000000 +}; + +enum enumDMUS_TIME_RESOLVE_FLAGS { + DMUS_TIME_RESOLVE_AFTERPREPARETIME = DMUS_SEGF_AFTERPREPARETIME, + DMUS_TIME_RESOLVE_AFTERQUEUETIME = DMUS_SEGF_AFTERQUEUETIME, + DMUS_TIME_RESOLVE_AFTERLATENCYTIME = DMUS_SEGF_AFTERLATENCYTIME, + DMUS_TIME_RESOLVE_GRID = DMUS_SEGF_GRID, + DMUS_TIME_RESOLVE_BEAT = DMUS_SEGF_BEAT, + DMUS_TIME_RESOLVE_MEASURE = DMUS_SEGF_MEASURE, + DMUS_TIME_RESOLVE_MARKER = DMUS_SEGF_MARKER, + DMUS_TIME_RESOLVE_SEGMENTEND = DMUS_SEGF_SEGMENTEND, +}; + +enum enumDMUS_CHORDKEYF_FLAGS { + DMUS_CHORDKEYF_SILENT = 0x1, +}; + +enum enumDMUS_NOTEF_FLAGS { + DMUS_NOTEF_NOTEON = 0x01, + /* DX8 */ + DMUS_NOTEF_NOINVALIDATE = 0x02, + DMUS_NOTEF_NOINVALIDATE_INSCALE = 0x04, + DMUS_NOTEF_NOINVALIDATE_INCHORD = 0x08, + DMUS_NOTEF_REGENERATE = 0x10, +}; + +enum enumDMUS_PLAYMODE_FLAGS { + DMUS_PLAYMODE_KEY_ROOT = 0x01, + DMUS_PLAYMODE_CHORD_ROOT = 0x02, + DMUS_PLAYMODE_SCALE_INTERVALS = 0x04, + DMUS_PLAYMODE_CHORD_INTERVALS = 0x08, + DMUS_PLAYMODE_NONE = 0x10, +}; + +enum enumDMUS_CURVE_FLAGS { + DMUS_CURVE_RESET = 0x1, + DMUS_CURVE_START_FROM_CURRENT = 0x2 +}; + +enum { + DMUS_CURVES_LINEAR = 0x0, + DMUS_CURVES_INSTANT = 0x1, + DMUS_CURVES_EXP = 0x2, + DMUS_CURVES_LOG = 0x3, + DMUS_CURVES_SINE = 0x4 +}; -#define DMUSB_LOADED 0x1 -#define DMUSB_DEFAULT 0x2 /***************************************************************************** * Structures */ -typedef enum enumDMUS_STYLET_TYPES -{ - DMUS_STYLET_PATTERN = 0, - DMUS_STYLET_MOTIF = 1, - DMUS_STYLET_FRAGMENT = 2, -} DMUS_STYLET_TYPES; +/* typedef definitions */ +/*typedef struct _DMUS_PMSG DMUS_PMSG, *LPDMUS_PMSG; */ +typedef struct _DMUS_AUDIOPARAMS DMUS_AUDIOPARAMS, *LPDMUS_AUDIOPARAMS; +typedef struct _DMUS_SUBCHORD DMUS_SUBCHORD, *LPDMUS_SUBCHORD; +typedef struct _DMUS_CHORD_KEY DMUS_CHORD_KEY, *LPDMUS_CHORD_KEY; +typedef struct _DMUS_NOTE_PMSG DMUS_NOTE_PMSG, *LPDMUS_NOTE_PMSG; +typedef struct _DMUS_MIDI_PMSG DMUS_MIDI_PMSG, *LPDMUS_MIDI_PMSG; +typedef struct _DMUS_PATCH_PMSG DMUS_PATCH_PMSG, *LPDMUS_PATCH_PMSG; +typedef struct _DMUS_TRANSPOSE_PMSG DMUS_TRANSPOSE_PMSG, *LPDMUS_TRANSPOSE_PMSG; +typedef struct _DMUS_CHANNEL_PRIORITY_PMSG DMUS_CHANNEL_PRIORITY_PMSG, *LPDMUS_CHANNEL_PRIORITY_PMSG; +typedef struct _DMUS_TEMPO_PMSG DMUS_TEMPO_PMSG, *LPDMUS_TEMPO_PMSG; +typedef struct _DMUS_SYSEX_PMSG DMUS_SYSEX_PMSG, *LPDMUS_SYSEX_PMSG; +typedef struct _DMUS_CURVE_PMSG DMUS_CURVE_PMSG, *LPDMUS_CURVE_PMSG; +typedef struct _DMUS_TIMESIG_PMSG DMUS_TIMESIG_PMSG, *LPDMUS_TIMESIG_PMSG; +typedef struct _DMUS_NOTIFICATION_PMSG DMUS_NOTIFICATION_PMSG, *LPDMUS_NOTIFICATION_PMSG; +typedef struct _DMUS_WAVE_PMSG DMUS_WAVE_PMSG, *LPDMUS_WAVE_PMSG; +typedef struct _DMUS_LYRIC_PMSG DMUS_LYRIC_PMSG, *LPDMUS_LYRIC_PMSG; +typedef struct _DMUS_VERSION DMUS_VERSION, *LPDMUS_VERSION; +typedef struct _DMUS_TIMESIGNATURE DMUS_TIMESIGNATURE, *LPDMUS_TIMESIGNATURE; +typedef struct _DMUS_VALID_START_PARAM DMUS_VALID_START_PARAM, *LPDMUS_VALID_START_PARAM; +typedef struct _DMUS_PLAY_MARKER_PARAM DMUS_PLAY_MARKER_PARAM, *LPDMUS_PLAY_MARKER_PARAM; +typedef struct _DMUS_OBJECTDESC DMUS_OBJECTDESC, *LPDMUS_OBJECTDESC; +typedef struct _DMUS_SCRIPT_ERRORINFO DMUS_SCRIPT_ERRORINFO, *LPDMUS_SCRIPT_ERRORINFO; +typedef struct _DMUS_COMMAND_PARAM DMUS_COMMAND_PARAM, *LPDMUS_COMMAND_PARAM; +typedef struct _DMUS_COMMAND_PARAM_2 DMUS_COMMAND_PARAM_2, *LPDMUS_COMMAND_PARAM_2; +typedef struct _DMUS_BAND_PARAM DMUS_BAND_PARAM, *LPDMUS_BAND_PARAM; +typedef struct _DMUS_VARIATIONS_PARAM DMUS_VARIATIONS_PARAM, *LPDMUS_VARIATIONS_PARAM; -typedef enum enumDMUS_COMMANDT_TYPES -{ - DMUS_COMMANDT_GROOVE = 0, - DMUS_COMMANDT_FILL = 1, - DMUS_COMMANDT_INTRO = 2, - DMUS_COMMANDT_BREAK = 3, - DMUS_COMMANDT_END = 4, - DMUS_COMMANDT_ENDANDINTRO = 5 -} DMUS_COMMANDT_TYPES; - -typedef enum enumDMUS_SHAPET_TYPES -{ - DMUS_SHAPET_FALLING = 0, - DMUS_SHAPET_LEVEL = 1, - DMUS_SHAPET_LOOPABLE = 2, - DMUS_SHAPET_LOUD = 3, - DMUS_SHAPET_QUIET = 4, - DMUS_SHAPET_PEAKING = 5, - DMUS_SHAPET_RANDOM = 6, - DMUS_SHAPET_RISING = 7, - DMUS_SHAPET_SONG = 8 -} DMUS_SHAPET_TYPES; - -typedef enum enumDMUS_COMPOSEF_FLAGS -{ - DMUS_COMPOSEF_NONE = 0x00000, - DMUS_COMPOSEF_ALIGN = 0x00001, - DMUS_COMPOSEF_OVERLAP = 0x00002, - DMUS_COMPOSEF_IMMEDIATE = 0x00004, - DMUS_COMPOSEF_GRID = 0x00008, - DMUS_COMPOSEF_BEAT = 0x00010, - DMUS_COMPOSEF_MEASURE = 0x00020, - DMUS_COMPOSEF_AFTERPREPARETIME = 0x00040, - DMUS_COMPOSEF_VALID_START_BEAT = 0x00080, - DMUS_COMPOSEF_VALID_START_GRID = 0x00100, - DMUS_COMPOSEF_VALID_START_TICK = 0x00200, - DMUS_COMPOSEF_SEGMENTEND = 0x00400, - DMUS_COMPOSEF_MARKER = 0x00800, - DMUS_COMPOSEF_MODULATE = 0x01000, - DMUS_COMPOSEF_LONG = 0x02000, - DMUS_COMPOSEF_ENTIRE_TRANSITION = 0x04000, - DMUS_COMPOSEF_1BAR_TRANSITION = 0x08000, - DMUS_COMPOSEF_ENTIRE_ADDITION = 0x10000, - DMUS_COMPOSEF_1BAR_ADDITION = 0x20000, - DMUS_COMPOSEF_VALID_START_MEASURE = 0x40000, - DMUS_COMPOSEF_DEFAULT = 0x80000, - DMUS_COMPOSEF_NOINVALIDATE = 0x100000, - DMUS_COMPOSEF_USE_AUDIOPATH = 0x200000, - DMUS_COMPOSEF_INVALIDATE_PRI = 0x400000 -} DMUS_COMPOSEF_FLAGS; - -typedef struct _DMUS_PMSG -{ +/* actual structures */ +struct _DMUS_PMSG { DMUS_PMSG_PART -} DMUS_PMSG; - -typedef struct _DMUS_AUDIOPARAMS -{ - DWORD dwSize; - BOOL fInitNow; - DWORD dwValidData; - DWORD dwFeatures; - DWORD dwVoices; - DWORD dwSampleRate; - CLSID clsidDefaultSynth; -} DMUS_AUDIOPARAMS; - -typedef enum enumDMUS_PMSGF_FLAGS -{ - DMUS_PMSGF_REFTIME = 0x01, - DMUS_PMSGF_MUSICTIME = 0x02, - DMUS_PMSGF_TOOL_IMMEDIATE = 0x04, - DMUS_PMSGF_TOOL_QUEUE = 0x08, - DMUS_PMSGF_TOOL_ATTIME = 0x10, - DMUS_PMSGF_TOOL_FLUSH = 0x20, - DMUS_PMSGF_LOCKTOREFTIME = 0x40, - DMUS_PMSGF_DX8 = 0x80 -} DMUS_PMSGF_FLAGS; - -typedef enum enumDMUS_PMSGT_TYPES -{ - DMUS_PMSGT_MIDI = 0, - DMUS_PMSGT_NOTE = 1, - DMUS_PMSGT_SYSEX = 2, - DMUS_PMSGT_NOTIFICATION = 3, - DMUS_PMSGT_TEMPO = 4, - DMUS_PMSGT_CURVE = 5, - DMUS_PMSGT_TIMESIG = 6, - DMUS_PMSGT_PATCH = 7, - DMUS_PMSGT_TRANSPOSE = 8, - DMUS_PMSGT_CHANNEL_PRIORITY = 9, - DMUS_PMSGT_STOP = 10, - DMUS_PMSGT_DIRTY = 11, - DMUS_PMSGT_WAVE = 12, - DMUS_PMSGT_LYRIC = 13, - DMUS_PMSGT_SCRIPTLYRIC = 14, - DMUS_PMSGT_USER = 255 -} DMUS_PMSGT_TYPES; - -typedef enum enumDMUS_SEGF_FLAGS -{ - DMUS_SEGF_REFTIME = 0x00000040, - DMUS_SEGF_SECONDARY = 0x00000080, - DMUS_SEGF_QUEUE = 0x00000100, - DMUS_SEGF_CONTROL = 0x00000200, - DMUS_SEGF_AFTERPREPARETIME = 0x00000400, - DMUS_SEGF_GRID = 0x00000800, - DMUS_SEGF_BEAT = 0x00001000, - DMUS_SEGF_MEASURE = 0x00002000, - DMUS_SEGF_DEFAULT = 0x00004000, - DMUS_SEGF_NOINVALIDATE = 0x00008000, - DMUS_SEGF_ALIGN = 0x00010000, - DMUS_SEGF_VALID_START_BEAT = 0x00020000, - DMUS_SEGF_VALID_START_GRID = 0x00040000, - DMUS_SEGF_VALID_START_TICK = 0x00080000, - DMUS_SEGF_AUTOTRANSITION = 0x00100000, - DMUS_SEGF_AFTERQUEUETIME = 0x00200000, - DMUS_SEGF_AFTERLATENCYTIME = 0x00400000, - DMUS_SEGF_SEGMENTEND = 0x00800000, - DMUS_SEGF_MARKER = 0x01000000, - DMUS_SEGF_TIMESIG_ALWAYS = 0x02000000, - DMUS_SEGF_USE_AUDIOPATH = 0x04000000, - DMUS_SEGF_VALID_START_MEASURE = 0x08000000, - DMUS_SEGF_INVALIDATE_PRI = 0x10000000 -} DMUS_SEGF_FLAGS; - -typedef enum enumDMUS_TIME_RESOLVE_FLAGS -{ - DMUS_TIME_RESOLVE_AFTERPREPARETIME = DMUS_SEGF_AFTERPREPARETIME, - DMUS_TIME_RESOLVE_AFTERQUEUETIME = DMUS_SEGF_AFTERQUEUETIME, - DMUS_TIME_RESOLVE_AFTERLATENCYTIME = DMUS_SEGF_AFTERLATENCYTIME, - DMUS_TIME_RESOLVE_GRID = DMUS_SEGF_GRID, - DMUS_TIME_RESOLVE_BEAT = DMUS_SEGF_BEAT, - DMUS_TIME_RESOLVE_MEASURE = DMUS_SEGF_MEASURE, - DMUS_TIME_RESOLVE_MARKER = DMUS_SEGF_MARKER, - DMUS_TIME_RESOLVE_SEGMENTEND = DMUS_SEGF_SEGMENTEND, -} DMUS_TIME_RESOLVE_FLAGS; - -typedef enum enumDMUS_CHORDKEYF_FLAGS -{ - DMUS_CHORDKEYF_SILENT = 1, -} DMUS_CHORDKEYF_FLAGS; - -typedef struct _DMUS_SUBCHORD -{ - DWORD dwChordPattern; - DWORD dwScalePattern; - DWORD dwInversionPoints; - DWORD dwLevels; - BYTE bChordRoot; - BYTE bScaleRoot; -} DMUS_SUBCHORD; - -typedef struct _DMUS_CHORD_KEY -{ - WCHAR wszName[16]; - WORD wMeasure; - BYTE bBeat; - BYTE bSubChordCount; - DMUS_SUBCHORD SubChordList[DMUS_MAXSUBCHORD]; - DWORD dwScale; - BYTE bKey; - BYTE bFlags; -} DMUS_CHORD_KEY; - -typedef struct _DMUS_NOTE_PMSG -{ - DMUS_PMSG_PART - - MUSIC_TIME mtDuration; - WORD wMusicValue; - WORD wMeasure; - short nOffset; - BYTE bBeat; - BYTE bGrid; - BYTE bVelocity; - BYTE bFlags; - BYTE bTimeRange; - BYTE bDurRange; - BYTE bVelRange; - BYTE bPlayModeFlags; - BYTE bSubChordLevel; - BYTE bMidiValue; - char cTranspose; -} DMUS_NOTE_PMSG; - -typedef enum enumDMUS_NOTEF_FLAGS -{ - DMUS_NOTEF_NOTEON = 0x01, - DMUS_NOTEF_NOINVALIDATE = 0x02, - DMUS_NOTEF_NOINVALIDATE_INSCALE = 0x04, - DMUS_NOTEF_NOINVALIDATE_INCHORD = 0x08, - DMUS_NOTEF_REGENERATE = 0x10, -} DMUS_NOTEF_FLAGS; - -typedef enum enumDMUS_PLAYMODE_FLAGS -{ - DMUS_PLAYMODE_KEY_ROOT = 0x01, - DMUS_PLAYMODE_CHORD_ROOT = 0x02, - DMUS_PLAYMODE_SCALE_INTERVALS = 0x04, - DMUS_PLAYMODE_CHORD_INTERVALS = 0x08, - DMUS_PLAYMODE_NONE = 0x10, -} DMUS_PLAYMODE_FLAGS; - -typedef struct _DMUS_MIDI_PMSG -{ - DMUS_PMSG_PART - - BYTE bStatus; - BYTE bByte1; - BYTE bByte2; - BYTE bPad[1]; -} DMUS_MIDI_PMSG; - -typedef struct _DMUS_PATCH_PMSG -{ - DMUS_PMSG_PART - - BYTE byInstrument; - BYTE byMSB; - BYTE byLSB; - BYTE byPad[1]; -} DMUS_PATCH_PMSG; - -typedef struct _DMUS_TRANSPOSE_PMSG -{ - DMUS_PMSG_PART - - short nTranspose; - WORD wMergeIndex; -} DMUS_TRANSPOSE_PMSG; - -typedef struct _DMUS_CHANNEL_PRIORITY_PMSG -{ - DMUS_PMSG_PART - - DWORD dwChannelPriority; -} DMUS_CHANNEL_PRIORITY_PMSG; - -typedef struct _DMUS_TEMPO_PMSG -{ - DMUS_PMSG_PART - - double dblTempo; -} DMUS_TEMPO_PMSG; - -typedef struct _DMUS_SYSEX_PMSG -{ - DMUS_PMSG_PART - - DWORD dwLen; - BYTE abData[1]; -} DMUS_SYSEX_PMSG; - -typedef struct _DMUS_CURVE_PMSG -{ - DMUS_PMSG_PART - - MUSIC_TIME mtDuration; - MUSIC_TIME mtOriginalStart; - MUSIC_TIME mtResetDuration; - short nStartValue; - short nEndValue; - short nResetValue; - WORD wMeasure; - short nOffset; - BYTE bBeat; - BYTE bGrid; - BYTE bType; - BYTE bCurveShape; - BYTE bCCData; - BYTE bFlags; - WORD wParamType; - WORD wMergeIndex; -} DMUS_CURVE_PMSG; - -typedef enum enumDMUS_CURVE_FLAGS -{ - DMUS_CURVE_RESET = 1, - DMUS_CURVE_START_FROM_CURRENT = 2 -} DMUS_CURVE_FLAGS; - -#define DMUS_CURVE_RESET 0x01 - -enum -{ - DMUS_CURVES_LINEAR = 0x0, - DMUS_CURVES_INSTANT = 0x1, - DMUS_CURVES_EXP = 0x2, - DMUS_CURVES_LOG = 0x3, - DMUS_CURVES_SINE = 0x4 }; -typedef struct _DMUS_TIMESIG_PMSG -{ - DMUS_PMSG_PART +struct _DMUS_AUDIOPARAMS { + DWORD dwSize; + BOOL fInitNow; + DWORD dwValidData; + DWORD dwFeatures; + DWORD dwVoices; + DWORD dwSampleRate; + CLSID clsidDefaultSynth; +}; - BYTE bBeatsPerMeasure; - BYTE bBeat; - WORD wGridsPerBeat; -} DMUS_TIMESIG_PMSG; +struct _DMUS_SUBCHORD { + DWORD dwChordPattern; + DWORD dwScalePattern; + DWORD dwInversionPoints; + DWORD dwLevels; + BYTE bChordRoot; + BYTE bScaleRoot; +}; -typedef struct _DMUS_NOTIFICATION_PMSG -{ - DMUS_PMSG_PART +struct _DMUS_CHORD_KEY { + WCHAR wszName[16]; + WORD wMeasure; + BYTE bBeat; + BYTE bSubChordCount; + DMUS_SUBCHORD SubChordList[DMUS_MAXSUBCHORD]; + DWORD dwScale; + BYTE bKey; + BYTE bFlags; +}; - GUID guidNotificationType; - DWORD dwNotificationOption; - DWORD dwField1; - DWORD dwField2; -} DMUS_NOTIFICATION_PMSG; +struct _DMUS_NOTE_PMSG { + DMUS_PMSG_PART + MUSIC_TIME mtDuration; + WORD wMusicValue; + WORD wMeasure; + short nOffset; + BYTE bBeat; + BYTE bGrid; + BYTE bVelocity; + BYTE bFlags; + BYTE bTimeRange; + BYTE bDurRange; + BYTE bVelRange; + BYTE bPlayModeFlags; + BYTE bSubChordLevel; + BYTE bMidiValue; + char cTranspose; +}; -typedef struct _DMUS_WAVE_PMSG -{ - DMUS_PMSG_PART +struct _DMUS_MIDI_PMSG { + DMUS_PMSG_PART + BYTE bStatus; + BYTE bByte1; + BYTE bByte2; + BYTE bPad[1]; +}; - REFERENCE_TIME rtStartOffset; - REFERENCE_TIME rtDuration; - long lOffset; - long lVolume; - long lPitch; - BYTE bFlags; -} DMUS_WAVE_PMSG; +struct _DMUS_PATCH_PMSG { + DMUS_PMSG_PART + BYTE byInstrument; + BYTE byMSB; + BYTE byLSB; + BYTE byPad[1]; +}; -typedef struct _DMUS_LYRIC_PMSG -{ - DMUS_PMSG_PART +struct _DMUS_TRANSPOSE_PMSG { + DMUS_PMSG_PART + short nTranspose; + /* DX8 */ + WORD wMergeIndex; +}; - WCHAR wszString[1]; -} DMUS_LYRIC_PMSG; +struct _DMUS_CHANNEL_PRIORITY_PMSG { + DMUS_PMSG_PART + DWORD dwChannelPriority; +}; -typedef struct _DMUS_VERSION { - DWORD dwVersionMS; - DWORD dwVersionLS; -} DMUS_VERSION, *LPDMUS_VERSION; +struct _DMUS_TEMPO_PMSG { + DMUS_PMSG_PART + double dblTempo; +}; -typedef struct _DMUS_TIMESIGNATURE -{ - MUSIC_TIME mtTime; - BYTE bBeatsPerMeasure; - BYTE bBeat; - WORD wGridsPerBeat; -} DMUS_TIMESIGNATURE; +struct _DMUS_SYSEX_PMSG { + DMUS_PMSG_PART + DWORD dwLen; + BYTE abData[1]; +}; -typedef struct _DMUS_VALID_START_PARAM -{ - MUSIC_TIME mtTime; -} DMUS_VALID_START_PARAM; +struct _DMUS_CURVE_PMSG { + DMUS_PMSG_PART + MUSIC_TIME mtDuration; + MUSIC_TIME mtOriginalStart; + MUSIC_TIME mtResetDuration; + short nStartValue; + short nEndValue; + short nResetValue; + WORD wMeasure; + short nOffset; + BYTE bBeat; + BYTE bGrid; + BYTE bType; + BYTE bCurveShape; + BYTE bCCData; + BYTE bFlags; + /* DX8 */ + WORD wParamType; + WORD wMergeIndex; +}; -typedef struct _DMUS_PLAY_MARKER_PARAM -{ - MUSIC_TIME mtTime; -} DMUS_PLAY_MARKER_PARAM; +struct _DMUS_TIMESIG_PMSG { + DMUS_PMSG_PART + BYTE bBeatsPerMeasure; + BYTE bBeat; + WORD wGridsPerBeat; +}; -typedef struct _DMUS_OBJECTDESC -{ - DWORD dwSize; - DWORD dwValidData; - GUID guidObject; - GUID guidClass; - FILETIME ftDate; - DMUS_VERSION vVersion; - WCHAR wszName[DMUS_MAX_NAME]; - WCHAR wszCategory[DMUS_MAX_CATEGORY]; - WCHAR wszFileName[DMUS_MAX_FILENAME]; - LONGLONG llMemLength; - LPBYTE pbMemData; - IStream * pStream; -} DMUS_OBJECTDESC, *LPDMUS_OBJECTDESC; +struct _DMUS_NOTIFICATION_PMSG { + DMUS_PMSG_PART + GUID guidNotificationType; + DWORD dwNotificationOption; + DWORD dwField1; + DWORD dwField2; +}; -typedef struct _DMUS_SCRIPT_ERRORINFO -{ - DWORD dwSize; - HRESULT hr; - ULONG ulLineNumber; - LONG ichCharPosition; - WCHAR wszSourceFile[DMUS_MAX_FILENAME]; - WCHAR wszSourceComponent[DMUS_MAX_FILENAME]; - WCHAR wszDescription[DMUS_MAX_FILENAME]; - WCHAR wszSourceLineText[DMUS_MAX_FILENAME]; -} DMUS_SCRIPT_ERRORINFO; +struct _DMUS_WAVE_PMSG { + DMUS_PMSG_PART + REFERENCE_TIME rtStartOffset; + REFERENCE_TIME rtDuration; + long lOffset; + long lVolume; + long lPitch; + BYTE bFlags; +}; -typedef struct _DMUS_COMMAND_PARAM -{ - BYTE bCommand; - BYTE bGrooveLevel; - BYTE bGrooveRange; - BYTE bRepeatMode; -} DMUS_COMMAND_PARAM; +struct _DMUS_LYRIC_PMSG { + DMUS_PMSG_PART + WCHAR wszString[1]; +}; -typedef struct _DMUS_COMMAND_PARAM_2 -{ +struct _DMUS_VERSION { + DWORD dwVersionMS; + DWORD dwVersionLS; +}; + +struct _DMUS_TIMESIGNATURE { MUSIC_TIME mtTime; - BYTE bCommand; - BYTE bGrooveLevel; - BYTE bGrooveRange; - BYTE bRepeatMode; -} DMUS_COMMAND_PARAM_2; + BYTE bBeatsPerMeasure; + BYTE bBeat; + WORD wGridsPerBeat; +}; -typedef struct _DMUS_CONNECTION_RULE -{ - DWORD dwFlags; - DWORD dwIntervals; -} DMUS_CONNECTION_RULE; +struct _DMUS_VALID_START_PARAM { + MUSIC_TIME mtTime; +}; -typedef struct _DMUS_MELODY_FRAGMENT -{ - MUSIC_TIME mtTime; - DWORD dwID; - WCHAR wszVariationLabel[DMUS_MAX_FRAGMENTLABEL]; - DWORD dwVariationFlags; - DWORD dwRepeatFragmentID; - DWORD dwFragmentFlags; - DWORD dwPlayModeFlags; - DWORD dwTransposeIntervals; - DMUS_COMMAND_PARAM Command; - DMUS_CONNECTION_RULE ConnectionArc; -} DMUS_MELODY_FRAGMENT; +struct _DMUS_PLAY_MARKER_PARAM { + MUSIC_TIME mtTime; +}; -typedef struct _DMUS_BAND_PARAM -{ - MUSIC_TIME mtTimePhysical; - IDirectMusicBand *pBand; -} DMUS_BAND_PARAM; +struct _DMUS_OBJECTDESC { + DWORD dwSize; + DWORD dwValidData; + GUID guidObject; + GUID guidClass; + FILETIME ftDate; + DMUS_VERSION vVersion; + WCHAR wszName[DMUS_MAX_NAME]; + WCHAR wszCategory[DMUS_MAX_CATEGORY]; + WCHAR wszFileName[DMUS_MAX_FILENAME]; + LONGLONG llMemLength; + LPBYTE pbMemData; + IStream* pStream; +}; +struct _DMUS_SCRIPT_ERRORINFO { + DWORD dwSize; + HRESULT hr; + ULONG ulLineNumber; + LONG ichCharPosition; + WCHAR wszSourceFile[DMUS_MAX_FILENAME]; + WCHAR wszSourceComponent[DMUS_MAX_FILENAME]; + WCHAR wszDescription[DMUS_MAX_FILENAME]; + WCHAR wszSourceLineText[DMUS_MAX_FILENAME]; +}; + +struct _DMUS_COMMAND_PARAM { + BYTE bCommand; + BYTE bGrooveLevel; + BYTE bGrooveRange; + BYTE bRepeatMode; +}; + +struct _DMUS_COMMAND_PARAM_2 { + MUSIC_TIME mtTime; + BYTE bCommand; + BYTE bGrooveLevel; + BYTE bGrooveRange; + BYTE bRepeatMode; +}; + +struct _DMUS_BAND_PARAM { + MUSIC_TIME mtTimePhysical; + IDirectMusicBand *pBand; +}; + +struct _DMUS_VARIATIONS_PARAM { + DWORD dwPChannelsUsed; + DWORD* padwPChannels; + DWORD* padwVariations; +}; -typedef struct _DMUS_VARIATIONS_PARAM -{ - DWORD dwPChannelsUsed; - DWORD* padwPChannels; - DWORD* padwVariations; -} DMUS_VARIATIONS_PARAM; /***************************************************************************** * IDirectMusicBand interface @@ -826,13 +801,13 @@ ICOM_DEFINE(IDirectMusicBand,IUnknown) #ifdef COBJMACROS /*** IUnknown methods ***/ -#define IDirectMusicBand_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectMusicBand_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectMusicBand_Release(p) (p)->lpVtbl->Release(p) +#define IDirectMusicBand_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectMusicBand_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectMusicBand_Release(p) (p)->lpVtbl->Release(p) /*** IDirectMusicBand methods ***/ -#define IDirectMusicBand_CreateSegment(p,a) (p)->lpVtbl->CreateSegment(p,a) -#define IDirectMusicBand_Download(p,a) (p)->lpVtbl->Download(p,a) -#define IDirectMusicBand_Unload(p,a) (p)->lpVtbl->Unload(p,a) +#define IDirectMusicBand_CreateSegment(p,a) (p)->lpVtbl->CreateSegment(p,a) +#define IDirectMusicBand_Download(p,a) (p)->lpVtbl->Download(p,a) +#define IDirectMusicBand_Unload(p,a) (p)->lpVtbl->Unload(p,a) #endif @@ -851,13 +826,13 @@ ICOM_DEFINE(IDirectMusicObject,IUnknown) #ifdef COBJMACROS /*** IUnknown methods ***/ -#define IDirectMusicObject_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectMusicObject_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectMusicObject_Release(p) (p)->lpVtbl->Release(p) +#define IDirectMusicObject_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectMusicObject_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectMusicObject_Release(p) (p)->lpVtbl->Release(p) /*** IDirectMusicObject methods ***/ -#define IDirectMusicObject_GetDescriptor(p,a) (p)->lpVtbl->GetDescriptor(p,a) -#define IDirectMusicObject_SetDescriptor(p,a) (p)->lpVtbl->SetDescriptor(p,a) -#define IDirectMusicObject_ParseDescriptor(p,a,b) (p)->lpVtbl->ParseDescriptor(p,a,b) +#define IDirectMusicObject_GetDescriptor(p,a) (p)->lpVtbl->GetDescriptor(p,a) +#define IDirectMusicObject_SetDescriptor(p,a) (p)->lpVtbl->SetDescriptor(p,a) +#define IDirectMusicObject_ParseDescriptor(p,a,b) (p)->lpVtbl->ParseDescriptor(p,a,b) #endif @@ -1089,15 +1064,15 @@ ICOM_DEFINE(IDirectMusicSegmentState,IUnknown) #ifdef COBJMACROS /*** IUnknown methods ***/ -#define IDirectMusicSegmentState_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectMusicSegmentState_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectMusicSegmentState_Release(p) (p)->lpVtbl->Release(p) +#define IDirectMusicSegmentState_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectMusicSegmentState_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectMusicSegmentState_Release(p) (p)->lpVtbl->Release(p) /*** IDirectMusicSegmentState methods ***/ -#define IDirectMusicSegmentState_GetRepeats(p,a) (p)->lpVtbl->GetRepeats(p,a) -#define IDirectMusicSegmentState_GetSegment(p,a) (p)->lpVtbl->GetSegment(p,a) -#define IDirectMusicSegmentState_GetStartTime(p,a) (p)->lpVtbl->GetStartTime(p,a) -#define IDirectMusicSegmentState_GetSeek(p,a) (p)->lpVtbl->GetSeek(p,a) -#define IDirectMusicSegmentState_GetStartPoint(p,a) (p)->lpVtbl->GetStartPoint(p,a) +#define IDirectMusicSegmentState_GetRepeats(p,a) (p)->lpVtbl->GetRepeats(p,a) +#define IDirectMusicSegmentState_GetSegment(p,a) (p)->lpVtbl->GetSegment(p,a) +#define IDirectMusicSegmentState_GetStartTime(p,a) (p)->lpVtbl->GetStartTime(p,a) +#define IDirectMusicSegmentState_GetSeek(p,a) (p)->lpVtbl->GetSeek(p,a) +#define IDirectMusicSegmentState_GetStartPoint(p,a) (p)->lpVtbl->GetStartPoint(p,a) #endif @@ -1146,14 +1121,14 @@ ICOM_DEFINE(IDirectMusicAudioPath,IUnknown) #ifdef COBJMACROS /*** IUnknown methods ***/ -#define IDirectMusicAudioPath_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectMusicAudioPath_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectMusicAudioPath_Release(p) (p)->lpVtbl->Release(p) +#define IDirectMusicAudioPath_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectMusicAudioPath_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectMusicAudioPath_Release(p) (p)->lpVtbl->Release(p) /*** IDirectMusicAudioPath methods ***/ -#define IDirectMusicAudioPath_GetObjectInPath(p,a,b,c,d,e,f,g) (p)->lpVtbl->GetObjectInPath(p,a,b,c,d,e,f,g) -#define IDirectMusicAudioPath_Activate(p,a) (p)->lpVtbl->Activate(p,a) -#define IDirectMusicAudioPath_SetVolume(p,a,b) (p)->lpVtbl->SetVolume(p,a,b) -#define IDirectMusicAudioPath_ConvertPChannel(p,a,b) (p)->lpVtbl->ConvertPChannel(p,a,b) +#define IDirectMusicAudioPath_GetObjectInPath(p,a,b,c,d,e,f,g) (p)->lpVtbl->GetObjectInPath(p,a,b,c,d,e,f,g) +#define IDirectMusicAudioPath_Activate(p,a) (p)->lpVtbl->Activate(p,a) +#define IDirectMusicAudioPath_SetVolume(p,a,b) (p)->lpVtbl->SetVolume(p,a,b) +#define IDirectMusicAudioPath_ConvertPChannel(p,a,b) (p)->lpVtbl->ConvertPChannel(p,a,b) #endif @@ -1210,51 +1185,51 @@ ICOM_DEFINE(IDirectMusicPerformance,IUnknown) #ifdef COBJMACROS /*** IUnknown methods ***/ -#define IDirectMusicPerformance_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectMusicPerformance_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectMusicPerformance_Release(p) (p)->lpVtbl->Release(p) +#define IDirectMusicPerformance_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectMusicPerformance_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectMusicPerformance_Release(p) (p)->lpVtbl->Release(p) /*** IDirectMusicPerformance methods ***/ -#define IDirectMusicPerformance_Init(p,a,b,c) (p)->lpVtbl->Init(p,a,b,c) -#define IDirectMusicPerformance_PlaySegment(p,a,b,c,d) (p)->lpVtbl->PlaySegment(p,a,b,c,d) -#define IDirectMusicPerformance_Stop(p,a,b,c,d) (p)->lpVtbl->Stop(p,a,b,c,d) -#define IDirectMusicPerformance_GetSegmentState(p,a,b) (p)->lpVtbl->GetSegmentState(p,a,b) -#define IDirectMusicPerformance_SetPrepareTime(p,a) (p)->lpVtbl->SetPrepareTime(p,a) -#define IDirectMusicPerformance_GetPrepareTime(p,a) (p)->lpVtbl->GetPrepareTime(p,a) -#define IDirectMusicPerformance_SetBumperLength(p,a) (p)->lpVtbl->SetBumperLength(p,a) -#define IDirectMusicPerformance_GetBumperLength(p,a) (p)->lpVtbl->GetBumperLength(p,a) -#define IDirectMusicPerformance_SendPMsg(p,a) (p)->lpVtbl->SendPMsg(p,a) -#define IDirectMusicPerformance_MusicToReferenceTime(p,a,b) (p)->lpVtbl->MusicToReferenceTime(p,a,b) -#define IDirectMusicPerformance_ReferenceToMusicTime(p,a,b) (p)->lpVtbl->ReferenceToMusicTime(p,a,b) -#define IDirectMusicPerformance_IsPlaying(p,a,b) (p)->lpVtbl->IsPlaying(p,a,b) -#define IDirectMusicPerformance_GetTime(p,a,b) (p)->lpVtbl->GetTime(p,a,b) -#define IDirectMusicPerformance_AllocPMsg(p,a,b) (p)->lpVtbl->AllocPMsg(p,a,b) -#define IDirectMusicPerformance_FreePMsg(p,a) (p)->lpVtbl->FreePMsg(p,a) -#define IDirectMusicPerformance_GetGraph(p,a) (p)->lpVtbl->GetGraph(p,a) -#define IDirectMusicPerformance_SetGraph(p,a) (p)->lpVtbl->SetGraph(p,a) -#define IDirectMusicPerformance_SetNotificationHandle(p,a,b) (p)->lpVtbl->SetNotificationHandle(p,a,b) -#define IDirectMusicPerformance_GetNotificationPMsg(p,a) (p)->lpVtbl->GetNotificationPMsg(p,a) -#define IDirectMusicPerformance_AddNotificationType(p,a) (p)->lpVtbl->AddNotificationType(p,a) -#define IDirectMusicPerformance_RemoveNotificationType(p,a) (p)->lpVtbl->RemoveNotificationType(p,a) -#define IDirectMusicPerformance_AddPort(p,a) (p)->lpVtbl->AddPort(p,a) -#define IDirectMusicPerformance_RemovePort(p,a) (p)->lpVtbl->RemovePort(p,a) -#define IDirectMusicPerformance_AssignPChannelBlock(p,a,b,c) (p)->lpVtbl->AssignPChannelBlock(p,a,b,c) -#define IDirectMusicPerformance_AssignPChannel(p,a,b,c,d) (p)->lpVtbl->AssignPChannel(p,a,b,c,d) -#define IDirectMusicPerformance_PChannelInfo(p,a,b,c,d) (p)->lpVtbl->PChannelInfo(p,a,b,c,d) -#define IDirectMusicPerformance_DownloadInstrument(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->DownloadInstrument(p,a,b,c,d,e,f,g,h) -#define IDirectMusicPerformance_Invalidate(p,a,b) (p)->lpVtbl->Invalidate(p,a,b) -#define IDirectMusicPerformance_GetParam(p,a,b,c,d,e,f) (p)->lpVtbl->GetParam(p,a,b,c,d,e,f) -#define IDirectMusicPerformance_SetParam(p,a,b,c,d,e) (p)->lpVtbl->SetParam(p,a,b,c,d,e) -#define IDirectMusicPerformance_GetGlobalParam(p,a,b,c) (p)->lpVtbl->GetGlobalParam(p,a,b,c) -#define IDirectMusicPerformance_SetGlobalParam(p,a,b,c) (p)->lpVtbl->SetGlobalParam(p,a,b,c) -#define IDirectMusicPerformance_GetLatencyTime(p,a) (p)->lpVtbl->GetLatencyTime(p,a) -#define IDirectMusicPerformance_GetQueueTime(p,a) (p)->lpVtbl->GetQueueTime(p,a) -#define IDirectMusicPerformance_AdjustTime(p,a) (p)->lpVtbl->AdjustTime(p,a) -#define IDirectMusicPerformance_CloseDown(p) (p)->lpVtbl->CloseDown(p) -#define IDirectMusicPerformance_GetResolvedTime(p,a,b,c) (p)->lpVtbl->GetResolvedTime(p,a,b,c) -#define IDirectMusicPerformance_MIDIToMusic(p,a,b,c,d,e) (p)->lpVtbl->MIDIToMusic(p,a,b,c,d,e) -#define IDirectMusicPerformance_MusicToMIDI(p,a,b,c,d,e) (p)->lpVtbl->MusicToMIDI(p,a,b,c,d,e) -#define IDirectMusicPerformance_TimeToRhythm(p,a,b,c,d,e,f) (p)->lpVtbl->TimeToRhythm(p,a,b,c,d,e,f) -#define IDirectMusicPerformance_RhythmToTime(p,a,b,c,d,e,f) (p)->lpVtbl->RhythmToTime(p,a,b,c,d,e,f) +#define IDirectMusicPerformance_Init(p,a,b,c) (p)->lpVtbl->Init(p,a,b,c) +#define IDirectMusicPerformance_PlaySegment(p,a,b,c,d) (p)->lpVtbl->PlaySegment(p,a,b,c,d) +#define IDirectMusicPerformance_Stop(p,a,b,c,d) (p)->lpVtbl->Stop(p,a,b,c,d) +#define IDirectMusicPerformance_GetSegmentState(p,a,b) (p)->lpVtbl->GetSegmentState(p,a,b) +#define IDirectMusicPerformance_SetPrepareTime(p,a) (p)->lpVtbl->SetPrepareTime(p,a) +#define IDirectMusicPerformance_GetPrepareTime(p,a) (p)->lpVtbl->GetPrepareTime(p,a) +#define IDirectMusicPerformance_SetBumperLength(p,a) (p)->lpVtbl->SetBumperLength(p,a) +#define IDirectMusicPerformance_GetBumperLength(p,a) (p)->lpVtbl->GetBumperLength(p,a) +#define IDirectMusicPerformance_SendPMsg(p,a) (p)->lpVtbl->SendPMsg(p,a) +#define IDirectMusicPerformance_MusicToReferenceTime(p,a,b) (p)->lpVtbl->MusicToReferenceTime(p,a,b) +#define IDirectMusicPerformance_ReferenceToMusicTime(p,a,b) (p)->lpVtbl->ReferenceToMusicTime(p,a,b) +#define IDirectMusicPerformance_IsPlaying(p,a,b) (p)->lpVtbl->IsPlaying(p,a,b) +#define IDirectMusicPerformance_GetTime(p,a,b) (p)->lpVtbl->GetTime(p,a,b) +#define IDirectMusicPerformance_AllocPMsg(p,a,b) (p)->lpVtbl->AllocPMsg(p,a,b) +#define IDirectMusicPerformance_FreePMsg(p,a) (p)->lpVtbl->FreePMsg(p,a) +#define IDirectMusicPerformance_GetGraph(p,a) (p)->lpVtbl->GetGraph(p,a) +#define IDirectMusicPerformance_SetGraph(p,a) (p)->lpVtbl->SetGraph(p,a) +#define IDirectMusicPerformance_SetNotificationHandle(p,a,b) (p)->lpVtbl->SetNotificationHandle(p,a,b) +#define IDirectMusicPerformance_GetNotificationPMsg(p,a) (p)->lpVtbl->GetNotificationPMsg(p,a) +#define IDirectMusicPerformance_AddNotificationType(p,a) (p)->lpVtbl->AddNotificationType(p,a) +#define IDirectMusicPerformance_RemoveNotificationType(p,a) (p)->lpVtbl->RemoveNotificationType(p,a) +#define IDirectMusicPerformance_AddPort(p,a) (p)->lpVtbl->AddPort(p,a) +#define IDirectMusicPerformance_RemovePort(p,a) (p)->lpVtbl->RemovePort(p,a) +#define IDirectMusicPerformance_AssignPChannelBlock(p,a,b,c) (p)->lpVtbl->AssignPChannelBlock(p,a,b,c) +#define IDirectMusicPerformance_AssignPChannel(p,a,b,c,d) (p)->lpVtbl->AssignPChannel(p,a,b,c,d) +#define IDirectMusicPerformance_PChannelInfo(p,a,b,c,d) (p)->lpVtbl->PChannelInfo(p,a,b,c,d) +#define IDirectMusicPerformance_DownloadInstrument(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->DownloadInstrument(p,a,b,c,d,e,f,g,h) +#define IDirectMusicPerformance_Invalidate(p,a,b) (p)->lpVtbl->Invalidate(p,a,b) +#define IDirectMusicPerformance_GetParam(p,a,b,c,d,e,f) (p)->lpVtbl->GetParam(p,a,b,c,d,e,f) +#define IDirectMusicPerformance_SetParam(p,a,b,c,d,e) (p)->lpVtbl->SetParam(p,a,b,c,d,e) +#define IDirectMusicPerformance_GetGlobalParam(p,a,b,c) (p)->lpVtbl->GetGlobalParam(p,a,b,c) +#define IDirectMusicPerformance_SetGlobalParam(p,a,b,c) (p)->lpVtbl->SetGlobalParam(p,a,b,c) +#define IDirectMusicPerformance_GetLatencyTime(p,a) (p)->lpVtbl->GetLatencyTime(p,a) +#define IDirectMusicPerformance_GetQueueTime(p,a) (p)->lpVtbl->GetQueueTime(p,a) +#define IDirectMusicPerformance_AdjustTime(p,a) (p)->lpVtbl->AdjustTime(p,a) +#define IDirectMusicPerformance_CloseDown(p) (p)->lpVtbl->CloseDown(p) +#define IDirectMusicPerformance_GetResolvedTime(p,a,b,c) (p)->lpVtbl->GetResolvedTime(p,a,b,c) +#define IDirectMusicPerformance_MIDIToMusic(p,a,b,c,d,e) (p)->lpVtbl->MIDIToMusic(p,a,b,c,d,e) +#define IDirectMusicPerformance_MusicToMIDI(p,a,b,c,d,e) (p)->lpVtbl->MusicToMIDI(p,a,b,c,d,e) +#define IDirectMusicPerformance_TimeToRhythm(p,a,b,c,d,e,f) (p)->lpVtbl->TimeToRhythm(p,a,b,c,d,e,f) +#define IDirectMusicPerformance_RhythmToTime(p,a,b,c,d,e,f) (p)->lpVtbl->RhythmToTime(p,a,b,c,d,e,f) #endif @@ -1279,61 +1254,61 @@ ICOM_DEFINE(IDirectMusicPerformance8,IDirectMusicPerformance) #ifdef COBJMACROS /*** IUnknown methods ***/ -#define IDirectMusicPerformance8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectMusicPerformance8_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectMusicPerformance8_Release(p) (p)->lpVtbl->Release(p) +#define IDirectMusicPerformance8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectMusicPerformance8_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectMusicPerformance8_Release(p) (p)->lpVtbl->Release(p) /*** IDirectMusicPerformance methods ***/ -#define IDirectMusicPerformance8_Init(p,a,b,c) (p)->lpVtbl->Init(p,a,b,c) -#define IDirectMusicPerformance8_PlaySegment(p,a,b,c,d) (p)->lpVtbl->PlaySegment(p,a,b,c,d) -#define IDirectMusicPerformance8_Stop(p,a,b,c,d) (p)->lpVtbl->Stop(p,a,b,c,d) -#define IDirectMusicPerformance8_GetSegmentState(p,a,b) (p)->lpVtbl->GetSegmentState(p,a,b) -#define IDirectMusicPerformance8_SetPrepareTime(p,a) (p)->lpVtbl->SetPrepareTime(p,a) -#define IDirectMusicPerformance8_GetPrepareTime(p,a) (p)->lpVtbl->GetPrepareTime(p,a) -#define IDirectMusicPerformance8_SetBumperLength(p,a) (p)->lpVtbl->SetBumperLength(p,a) -#define IDirectMusicPerformance8_GetBumperLength(p,a) (p)->lpVtbl->GetBumperLength(p,a) -#define IDirectMusicPerformance8_SendPMsg(p,a) (p)->lpVtbl->SendPMsg(p,a) -#define IDirectMusicPerformance8_MusicToReferenceTime(p,a,b) (p)->lpVtbl->MusicToReferenceTime(p,a,b) -#define IDirectMusicPerformance8_ReferenceToMusicTime(p,a,b) (p)->lpVtbl->ReferenceToMusicTime(p,a,b) -#define IDirectMusicPerformance8_IsPlaying(p,a,b) (p)->lpVtbl->IsPlaying(p,a,b) -#define IDirectMusicPerformance8_GetTime(p,a,b) (p)->lpVtbl->GetTime(p,a,b) -#define IDirectMusicPerformance8_AllocPMsg(p,a,b) (p)->lpVtbl->AllocPMsg(p,a,b) -#define IDirectMusicPerformance8_FreePMsg(p,a) (p)->lpVtbl->FreePMsg(p,a) -#define IDirectMusicPerformance8_GetGraph(p,a) (p)->lpVtbl->GetGraph(p,a) -#define IDirectMusicPerformance8_SetGraph(p,a) (p)->lpVtbl->SetGraph(p,a) -#define IDirectMusicPerformance8_SetNotificationHandle(p,a,b) (p)->lpVtbl->SetNotificationHandle(p,a,b) -#define IDirectMusicPerformance8_GetNotificationPMsg(p,a) (p)->lpVtbl->GetNotificationPMsg(p,a) -#define IDirectMusicPerformance8_AddNotificationType(p,a) (p)->lpVtbl->AddNotificationType(p,a) -#define IDirectMusicPerformance8_RemoveNotificationType(p,a) (p)->lpVtbl->RemoveNotificationType(p,a) -#define IDirectMusicPerformance8_AddPort(p,a) (p)->lpVtbl->AddPort(p,a) -#define IDirectMusicPerformance8_RemovePort(p,a) (p)->lpVtbl->RemovePort(p,a) -#define IDirectMusicPerformance8_AssignPChannelBlock(p,a,b,c) (p)->lpVtbl->AssignPChannelBlock(p,a,b,c) -#define IDirectMusicPerformance8_AssignPChannel(p,a,b,c,d) (p)->lpVtbl->AssignPChannel(p,a,b,c,d) -#define IDirectMusicPerformance8_PChannelInfo(p,a,b,c,d) (p)->lpVtbl->PChannelInfo(p,a,b,c,d) -#define IDirectMusicPerformance8_DownloadInstrument(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->DownloadInstrument(p,a,b,c,d,e,f,g,h) -#define IDirectMusicPerformance8_Invalidate(p,a,b) (p)->lpVtbl->Invalidate(p,a,b) -#define IDirectMusicPerformance8_GetParam(p,a,b,c,d,e,f) (p)->lpVtbl->GetParam(p,a,b,c,d,e,f) -#define IDirectMusicPerformance8_SetParam(p,a,b,c,d,e) (p)->lpVtbl->SetParam(p,a,b,c,d,e) -#define IDirectMusicPerformance8_GetGlobalParam(p,a,b,c) (p)->lpVtbl->GetGlobalParam(p,a,b,c) -#define IDirectMusicPerformance8_SetGlobalParam(p,a,b,c) (p)->lpVtbl->SetGlobalParam(p,a,b,c) -#define IDirectMusicPerformance8_GetLatencyTime(p,a) (p)->lpVtbl->GetLatencyTime(p,a) -#define IDirectMusicPerformance8_GetQueueTime(p,a) (p)->lpVtbl->GetQueueTime(p,a) -#define IDirectMusicPerformance8_AdjustTime(p,a) (p)->lpVtbl->AdjustTime(p,a) -#define IDirectMusicPerformance8_CloseDown(p) (p)->lpVtbl->CloseDown(p) -#define IDirectMusicPerformance8_GetResolvedTime(p,a,b,c) (p)->lpVtbl->GetResolvedTime(p,a,b,c) -#define IDirectMusicPerformance8_MIDIToMusic(p,a,b,c,d,e) (p)->lpVtbl->MIDIToMusic(p,a,b,c,d,e) -#define IDirectMusicPerformance8_MusicToMIDI(p,a,b,c,d,e) (p)->lpVtbl->MusicToMIDI(p,a,b,c,d,e) -#define IDirectMusicPerformance8_TimeToRhythm(p,a,b,c,d,e,f) (p)->lpVtbl->TimeToRhythm(p,a,b,c,d,e,f) -#define IDirectMusicPerformance8_RhythmToTime(p,a,b,c,d,e,f) (p)->lpVtbl->RhythmToTime(p,a,b,c,d,e,f) +#define IDirectMusicPerformance8_Init(p,a,b,c) (p)->lpVtbl->Init(p,a,b,c) +#define IDirectMusicPerformance8_PlaySegment(p,a,b,c,d) (p)->lpVtbl->PlaySegment(p,a,b,c,d) +#define IDirectMusicPerformance8_Stop(p,a,b,c,d) (p)->lpVtbl->Stop(p,a,b,c,d) +#define IDirectMusicPerformance8_GetSegmentState(p,a,b) (p)->lpVtbl->GetSegmentState(p,a,b) +#define IDirectMusicPerformance8_SetPrepareTime(p,a) (p)->lpVtbl->SetPrepareTime(p,a) +#define IDirectMusicPerformance8_GetPrepareTime(p,a) (p)->lpVtbl->GetPrepareTime(p,a) +#define IDirectMusicPerformance8_SetBumperLength(p,a) (p)->lpVtbl->SetBumperLength(p,a) +#define IDirectMusicPerformance8_GetBumperLength(p,a) (p)->lpVtbl->GetBumperLength(p,a) +#define IDirectMusicPerformance8_SendPMsg(p,a) (p)->lpVtbl->SendPMsg(p,a) +#define IDirectMusicPerformance8_MusicToReferenceTime(p,a,b) (p)->lpVtbl->MusicToReferenceTime(p,a,b) +#define IDirectMusicPerformance8_ReferenceToMusicTime(p,a,b) (p)->lpVtbl->ReferenceToMusicTime(p,a,b) +#define IDirectMusicPerformance8_IsPlaying(p,a,b) (p)->lpVtbl->IsPlaying(p,a,b) +#define IDirectMusicPerformance8_GetTime(p,a,b) (p)->lpVtbl->GetTime(p,a,b) +#define IDirectMusicPerformance8_AllocPMsg(p,a,b) (p)->lpVtbl->AllocPMsg(p,a,b) +#define IDirectMusicPerformance8_FreePMsg(p,a) (p)->lpVtbl->FreePMsg(p,a) +#define IDirectMusicPerformance8_GetGraph(p,a) (p)->lpVtbl->GetGraph(p,a) +#define IDirectMusicPerformance8_SetGraph(p,a) (p)->lpVtbl->SetGraph(p,a) +#define IDirectMusicPerformance8_SetNotificationHandle(p,a,b) (p)->lpVtbl->SetNotificationHandle(p,a,b) +#define IDirectMusicPerformance8_GetNotificationPMsg(p,a) (p)->lpVtbl->GetNotificationPMsg(p,a) +#define IDirectMusicPerformance8_AddNotificationType(p,a) (p)->lpVtbl->AddNotificationType(p,a) +#define IDirectMusicPerformance8_RemoveNotificationType(p,a) (p)->lpVtbl->RemoveNotificationType(p,a) +#define IDirectMusicPerformance8_AddPort(p,a) (p)->lpVtbl->AddPort(p,a) +#define IDirectMusicPerformance8_RemovePort(p,a) (p)->lpVtbl->RemovePort(p,a) +#define IDirectMusicPerformance8_AssignPChannelBlock(p,a,b,c) (p)->lpVtbl->AssignPChannelBlock(p,a,b,c) +#define IDirectMusicPerformance8_AssignPChannel(p,a,b,c,d) (p)->lpVtbl->AssignPChannel(p,a,b,c,d) +#define IDirectMusicPerformance8_PChannelInfo(p,a,b,c,d) (p)->lpVtbl->PChannelInfo(p,a,b,c,d) +#define IDirectMusicPerformance8_DownloadInstrument(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->DownloadInstrument(p,a,b,c,d,e,f,g,h) +#define IDirectMusicPerformance8_Invalidate(p,a,b) (p)->lpVtbl->Invalidate(p,a,b) +#define IDirectMusicPerformance8_GetParam(p,a,b,c,d,e,f) (p)->lpVtbl->GetParam(p,a,b,c,d,e,f) +#define IDirectMusicPerformance8_SetParam(p,a,b,c,d,e) (p)->lpVtbl->SetParam(p,a,b,c,d,e) +#define IDirectMusicPerformance8_GetGlobalParam(p,a,b,c) (p)->lpVtbl->GetGlobalParam(p,a,b,c) +#define IDirectMusicPerformance8_SetGlobalParam(p,a,b,c) (p)->lpVtbl->SetGlobalParam(p,a,b,c) +#define IDirectMusicPerformance8_GetLatencyTime(p,a) (p)->lpVtbl->GetLatencyTime(p,a) +#define IDirectMusicPerformance8_GetQueueTime(p,a) (p)->lpVtbl->GetQueueTime(p,a) +#define IDirectMusicPerformance8_AdjustTime(p,a) (p)->lpVtbl->AdjustTime(p,a) +#define IDirectMusicPerformance8_CloseDown(p) (p)->lpVtbl->CloseDown(p) +#define IDirectMusicPerformance8_GetResolvedTime(p,a,b,c) (p)->lpVtbl->GetResolvedTime(p,a,b,c) +#define IDirectMusicPerformance8_MIDIToMusic(p,a,b,c,d,e) (p)->lpVtbl->MIDIToMusic(p,a,b,c,d,e) +#define IDirectMusicPerformance8_MusicToMIDI(p,a,b,c,d,e) (p)->lpVtbl->MusicToMIDI(p,a,b,c,d,e) +#define IDirectMusicPerformance8_TimeToRhythm(p,a,b,c,d,e,f) (p)->lpVtbl->TimeToRhythm(p,a,b,c,d,e,f) +#define IDirectMusicPerformance8_RhythmToTime(p,a,b,c,d,e,f) (p)->lpVtbl->RhythmToTime(p,a,b,c,d,e,f) /* IDirectMusicPerformance8 methods*/ -#define IDirectMusicPerformance8_InitAudio(p,a,b,c,d,e,f,g) (p)->lpVtbl->InitAudio(p,a,b,c,d,e,f,g) -#define IDirectMusicPerformance8_PlaySegmentEx(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->PlaySegmentEx(p,a,b,c,d,e,f,g,h) -#define IDirectMusicPerformance8_StopEx(p,a,b,c) (p)->lpVtbl->StopEx(p,a,b,c) -#define IDirectMusicPerformance8_ClonePMsg(p,a,b) (p)->lpVtbl->ClonePMsg(p,a,b) -#define IDirectMusicPerformance8_CreateAudioPath(p,a,b,c) (p)->lpVtbl->CreateAudioPath(p,a,b,c) -#define IDirectMusicPerformance8_CreateStandardAudioPath(p,a,b,c,d) (p)->lpVtbl->CreateStandardAudioPath(p,a,b,c,d) -#define IDirectMusicPerformance8_SetDefaultAudioPath(p,a) (p)->lpVtbl->SetDefaultAudioPath(p,a) -#define IDirectMusicPerformance8_GetDefaultAudioPath(p,a) (p)->lpVtbl->GetDefaultAudioPath(p,a) -#define IDirectMusicPerformance8_GetParamEx(p,a,b,c,d,e,f,g) (p)->lpVtbl->GetParamEx(p,a,b,c,d,e,f,g) +#define IDirectMusicPerformance8_InitAudio(p,a,b,c,d,e,f,g) (p)->lpVtbl->InitAudio(p,a,b,c,d,e,f,g) +#define IDirectMusicPerformance8_PlaySegmentEx(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->PlaySegmentEx(p,a,b,c,d,e,f,g,h) +#define IDirectMusicPerformance8_StopEx(p,a,b,c) (p)->lpVtbl->StopEx(p,a,b,c) +#define IDirectMusicPerformance8_ClonePMsg(p,a,b) (p)->lpVtbl->ClonePMsg(p,a,b) +#define IDirectMusicPerformance8_CreateAudioPath(p,a,b,c) (p)->lpVtbl->CreateAudioPath(p,a,b,c) +#define IDirectMusicPerformance8_CreateStandardAudioPath(p,a,b,c,d) (p)->lpVtbl->CreateStandardAudioPath(p,a,b,c,d) +#define IDirectMusicPerformance8_SetDefaultAudioPath(p,a) (p)->lpVtbl->SetDefaultAudioPath(p,a) +#define IDirectMusicPerformance8_GetDefaultAudioPath(p,a) (p)->lpVtbl->GetDefaultAudioPath(p,a) +#define IDirectMusicPerformance8_GetParamEx(p,a,b,c,d,e,f,g) (p)->lpVtbl->GetParamEx(p,a,b,c,d,e,f,g) #endif @@ -1387,21 +1362,21 @@ ICOM_DEFINE(IDirectMusicStyle,IUnknown) #ifdef COBJMACROS /*** IUnknown methods ***/ -#define IDirectMusicStyle_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectMusicStyle_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectMusicStyle_Release(p) (p)->lpVtbl->Release(p) +#define IDirectMusicStyle_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectMusicStyle_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectMusicStyle_Release(p) (p)->lpVtbl->Release(p) /*** IDirectMusicStyle methods ***/ -#define IDirectMusicStyle_GetBand(p,a,b) (p)->lpVtbl->GetBand(p,a,b) -#define IDirectMusicStyle_EnumBand(p,a,b) (p)->lpVtbl->EnumBand(p,a,b) -#define IDirectMusicStyle_GetDefaultBand(p,a) (p)->lpVtbl->GetDefaultBand(p,a) -#define IDirectMusicStyle_EnumMotif(p,a,b) (p)->lpVtbl->EnumMotif(p,a,b) -#define IDirectMusicStyle_GetMotif(p,a,b) (p)->lpVtbl->GetMotif(p,a,b) -#define IDirectMusicStyle_GetDefaultChordMap(p,a) (p)->lpVtbl->GetDefaultChordMap(p,a) -#define IDirectMusicStyle_EnumChordMap(p,a,b) (p)->lpVtbl->EnumChordMap(p,a,b) -#define IDirectMusicStyle_GetChordMap(p,a,b) (p)->lpVtbl->GetChordMap(p,a,b) -#define IDirectMusicStyle_GetTimeSignature(p,a) (p)->lpVtbl->GetTimeSignature(p,a) -#define IDirectMusicStyle_GetEmbellishmentLength(p,a,b,c,d) (p)->lpVtbl->GetEmbellishmentLength(p,a,b,c,d) -#define IDirectMusicStyle_GetTempo(p,a) (p)->lpVtbl->GetTempo(p,a) +#define IDirectMusicStyle_GetBand(p,a,b) (p)->lpVtbl->GetBand(p,a,b) +#define IDirectMusicStyle_EnumBand(p,a,b) (p)->lpVtbl->EnumBand(p,a,b) +#define IDirectMusicStyle_GetDefaultBand(p,a) (p)->lpVtbl->GetDefaultBand(p,a) +#define IDirectMusicStyle_EnumMotif(p,a,b) (p)->lpVtbl->EnumMotif(p,a,b) +#define IDirectMusicStyle_GetMotif(p,a,b) (p)->lpVtbl->GetMotif(p,a,b) +#define IDirectMusicStyle_GetDefaultChordMap(p,a) (p)->lpVtbl->GetDefaultChordMap(p,a) +#define IDirectMusicStyle_EnumChordMap(p,a,b) (p)->lpVtbl->EnumChordMap(p,a,b) +#define IDirectMusicStyle_GetChordMap(p,a,b) (p)->lpVtbl->GetChordMap(p,a,b) +#define IDirectMusicStyle_GetTimeSignature(p,a) (p)->lpVtbl->GetTimeSignature(p,a) +#define IDirectMusicStyle_GetEmbellishmentLength(p,a,b,c,d) (p)->lpVtbl->GetEmbellishmentLength(p,a,b,c,d) +#define IDirectMusicStyle_GetTempo(p,a) (p)->lpVtbl->GetTempo(p,a) #endif @@ -1418,23 +1393,23 @@ ICOM_DEFINE(IDirectMusicStyle8,IDirectMusicStyle) #ifdef COBJMACROS /*** IUnknown methods ***/ -#define IDirectMusicStyle8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectMusicStyle8_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectMusicStyle8_Release(p) (p)->lpVtbl->Release(p) +#define IDirectMusicStyle8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectMusicStyle8_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectMusicStyle8_Release(p) (p)->lpVtbl->Release(p) /*** IDirectMusicStyle methods ***/ -#define IDirectMusicStyle8_GetBand(p,a,b) (p)->lpVtbl->GetBand(p,a,b) -#define IDirectMusicStyle8_EnumBand(p,a,b) (p)->lpVtbl->EnumBand(p,a,b) -#define IDirectMusicStyle8_GetDefaultBand(p,a) (p)->lpVtbl->GetDefaultBand(p,a) -#define IDirectMusicStyle8_EnumMotif(p,a,b) (p)->lpVtbl->EnumMotif(p,a,b) -#define IDirectMusicStyle8_GetMotif(p,a,b) (p)->lpVtbl->GetMotif(p,a,b) -#define IDirectMusicStyle8_GetDefaultChordMap(p,a) (p)->lpVtbl->GetDefaultChordMap(p,a) -#define IDirectMusicStyle8_EnumChordMap(p,a,b) (p)->lpVtbl->EnumChordMap(p,a,b) -#define IDirectMusicStyle8_GetChordMap(p,a,b) (p)->lpVtbl->GetChordMap(p,a,b) -#define IDirectMusicStyle8_GetTimeSignature(p,a) (p)->lpVtbl->GetTimeSignature(p,a) -#define IDirectMusicStyle8_GetEmbellishmentLength(p,a,b,c,d) (p)->lpVtbl->GetEmbellishmentLength(p,a,b,c,d) -#define IDirectMusicStyle8_GetTempo(p,a) (p)->lpVtbl->GetTempo(p,a) +#define IDirectMusicStyle8_GetBand(p,a,b) (p)->lpVtbl->GetBand(p,a,b) +#define IDirectMusicStyle8_EnumBand(p,a,b) (p)->lpVtbl->EnumBand(p,a,b) +#define IDirectMusicStyle8_GetDefaultBand(p,a) (p)->lpVtbl->GetDefaultBand(p,a) +#define IDirectMusicStyle8_EnumMotif(p,a,b) (p)->lpVtbl->EnumMotif(p,a,b) +#define IDirectMusicStyle8_GetMotif(p,a,b) (p)->lpVtbl->GetMotif(p,a,b) +#define IDirectMusicStyle8_GetDefaultChordMap(p,a) (p)->lpVtbl->GetDefaultChordMap(p,a) +#define IDirectMusicStyle8_EnumChordMap(p,a,b) (p)->lpVtbl->EnumChordMap(p,a,b) +#define IDirectMusicStyle8_GetChordMap(p,a,b) (p)->lpVtbl->GetChordMap(p,a,b) +#define IDirectMusicStyle8_GetTimeSignature(p,a) (p)->lpVtbl->GetTimeSignature(p,a) +#define IDirectMusicStyle8_GetEmbellishmentLength(p,a,b,c,d) (p)->lpVtbl->GetEmbellishmentLength(p,a,b,c,d) +#define IDirectMusicStyle8_GetTempo(p,a) (p)->lpVtbl->GetTempo(p,a) /*** IDirectMusicStyle8 methods ***/ -#define IDirectMusicStyle8_EnumPattern(p,a,b,c) (p)->lpVtbl->EnumPattern(p,a,b,c) +#define IDirectMusicStyle8_EnumPattern(p,a,b,c) (p)->lpVtbl->EnumPattern(p,a,b,c) #endif @@ -1505,13 +1480,13 @@ ICOM_DEFINE(IDirectMusicPatternTrack,IUnknown) #ifdef COBJMACROS /*** IUnknown methods ***/ -#define IDirectMusicPatternTrack_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectMusicPatternTrack_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectMusicPatternTrack_Release(p) (p)->lpVtbl->Release(p) +#define IDirectMusicPatternTrack_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectMusicPatternTrack_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectMusicPatternTrack_Release(p) (p)->lpVtbl->Release(p) /*** IDirectMusicPatternTrack methods ***/ -#define IDirectMusicPatternTrack_CreateSegment(p,a,b) (p)->lpVtbl->CreateSegment(p,a,b) -#define IDirectMusicPatternTrack_SetVariation(p,a,b,c) (p)->lpVtbl->SetVariation(p,a,b,c) -#define IDirectMusicPatternTrack_SetPatternByName(p,a,b,c,d,e) (p)->lpVtbl->SetPatternByName(p,a,b,c,d,e) +#define IDirectMusicPatternTrack_CreateSegment(p,a,b) (p)->lpVtbl->CreateSegment(p,a,b) +#define IDirectMusicPatternTrack_SetVariation(p,a,b,c) (p)->lpVtbl->SetVariation(p,a,b,c) +#define IDirectMusicPatternTrack_SetPatternByName(p,a,b,c,d,e) (p)->lpVtbl->SetPatternByName(p,a,b,c,d,e) #endif @@ -1537,20 +1512,20 @@ ICOM_DEFINE(IDirectMusicScript,IUnknown) #ifdef COBJMACROS /*** IUnknown methods ***/ -#define IDirectMusicScript_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectMusicScript_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectMusicScript_Release(p) (p)->lpVtbl->Release(p) +#define IDirectMusicScript_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectMusicScript_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectMusicScript_Release(p) (p)->lpVtbl->Release(p) /*** IDirectMusicScript methods ***/ -#define IDirectMusicPatternTrack_Init(p,a,b) (p)->lpVtbl->Init(p,a,b) -#define IDirectMusicPatternTrack_CallRoutine(p,a,b) (p)->lpVtbl->CallRoutine(p,a,b) -#define IDirectMusicPatternTrack_SetVariableVariant(p,a,b,c,d) (p)->lpVtbl->SetVariableVariant(p,a,b,c,d) -#define IDirectMusicPatternTrack_GetVariableVariant(p,a,b,c) (p)->lpVtbl->GetVariableVariant(p,a,b,c) -#define IDirectMusicPatternTrack_SetVariableNumber(p,a,b,c) (p)->lpVtbl->SetVariableNumber(p,a,b,c) -#define IDirectMusicPatternTrack_GetVariableNumber(p,a,b,c) (p)->lpVtbl->GetVariableNumber(p,a,b,c) -#define IDirectMusicPatternTrack_SetVariableObject(p,a,b,c) (p)->lpVtbl->SetVariableObject(p,a,b,c) -#define IDirectMusicPatternTrack_GetVariableObject(p,a,b,c,d) (p)->lpVtbl->GetVariableObject(p,a,b,c,d) -#define IDirectMusicPatternTrack_EnumRoutine(p,a,b) (p)->lpVtbl->EnumRoutine(p,a,b) -#define IDirectMusicPatternTrack_EnumVariable(p,a,b) (p)->lpVtbl->EnumVariable(p,a,b) +#define IDirectMusicPatternTrack_Init(p,a,b) (p)->lpVtbl->Init(p,a,b) +#define IDirectMusicPatternTrack_CallRoutine(p,a,b) (p)->lpVtbl->CallRoutine(p,a,b) +#define IDirectMusicPatternTrack_SetVariableVariant(p,a,b,c,d) (p)->lpVtbl->SetVariableVariant(p,a,b,c,d) +#define IDirectMusicPatternTrack_GetVariableVariant(p,a,b,c) (p)->lpVtbl->GetVariableVariant(p,a,b,c) +#define IDirectMusicPatternTrack_SetVariableNumber(p,a,b,c) (p)->lpVtbl->SetVariableNumber(p,a,b,c) +#define IDirectMusicPatternTrack_GetVariableNumber(p,a,b,c) (p)->lpVtbl->GetVariableNumber(p,a,b,c) +#define IDirectMusicPatternTrack_SetVariableObject(p,a,b,c) (p)->lpVtbl->SetVariableObject(p,a,b,c) +#define IDirectMusicPatternTrack_GetVariableObject(p,a,b,c,d) (p)->lpVtbl->GetVariableObject(p,a,b,c,d) +#define IDirectMusicPatternTrack_EnumRoutine(p,a,b) (p)->lpVtbl->EnumRoutine(p,a,b) +#define IDirectMusicPatternTrack_EnumVariable(p,a,b) (p)->lpVtbl->EnumVariable(p,a,b) #endif @@ -1567,48 +1542,18 @@ ICOM_DEFINE(IDirectMusicContainer,IUnknown) #ifdef COBJMACROS /*** IUnknown methods ***/ -#define IDirectMusicContainer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectMusicContainer_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectMusicContainer_Release(p) (p)->lpVtbl->Release(p) +#define IDirectMusicContainer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectMusicContainer_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectMusicContainer_Release(p) (p)->lpVtbl->Release(p) /*** IDirectMusicContainer methods ***/ -#define IDirectMusicContainer_EnumObject(p,a,b,c,d) (p)->lpVtbl->EnumObject(p,a,b,c,d) +#define IDirectMusicContainer_EnumObject(p,a,b,c,d) (p)->lpVtbl->EnumObject(p,a,b,c,d) #endif -/***************************************************************************** - * IDirectMusicSong interface - */ -#undef INTERFACE -#define INTERFACE IDirectMusicSong -#define IDirectMusicSong_METHODS \ - IUnknown_METHODS \ - STDMETHOD(Compose)(THIS) PURE; \ - STDMETHOD(GetParam)(THIS_ REFGUID rguidType, DWORD dwGroupBits, DWORD dwIndex, MUSIC_TIME mtTime, MUSIC_TIME *pmtNext, void *pParam) PURE; \ - STDMETHOD(GetSegment)(THIS_ WCHAR *pwzName, IDirectMusicSegment **ppSegment) PURE; \ - STDMETHOD(GetAudioPathConfig)(THIS_ IUnknown **ppAudioPathConfig) PURE; \ - STDMETHOD(Download)(THIS_ IUnknown *pAudioPath) PURE; \ - STDMETHOD(Unload)(THIS_ IUnknown *pAudioPath) PURE; \ - STDMETHOD(EnumSegment)(THIS_ DWORD dwIndex, IDirectMusicSegment **ppSegment) PURE; -ICOM_DEFINE(IDirectMusicSong,IUnknown) -#undef INTERFACE - -#ifdef COBJMACROS -/*** IUnknown methods ***/ -#define IDirectMusicSong_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectMusicSong_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectMusicSong_Release(p) (p)->lpVtbl->Release(p) -/*** IDirectMusicSong methods ***/ -#define IDirectMusicSong_Compose(p) (p)->lpVtbl->Compose(p) -#define IDirectMusicSong_GetParam(p,a,b,c,d,e,f) (p)->lpVtbl->GetParam(p,a,b,c,d,e,f) -#define IDirectMusicSong_GetSegment(p,a,b) (p)->lpVtbl->GetSegment(p,a,b) -#define IDirectMusicSong_GetAudioPathConfig(p,a) (p)->lpVtbl->GetAudioPathConfig(p,a) -#define IDirectMusicSong_Download(p,a) (p)->lpVtbl->Download(p,a) -#define IDirectMusicSong_Unload(p,a) (p)->lpVtbl->Unload(p,a) -#define IDirectMusicSong_EnumSegment(p,a,b) (p)->lpVtbl->EnumSegment(p,a,b) -#endif - #ifdef __cplusplus } #endif +#include + #endif /* __WINE_DMUSIC_PERFORMANCE_H */ diff --git a/include/dmusics.h b/include/dmusics.h index c4010295136..457dee29fbf 100644 --- a/include/dmusics.h +++ b/include/dmusics.h @@ -1,7 +1,7 @@ /* * DirectMusic Software Synth 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 @@ -23,28 +23,34 @@ #include - /***************************************************************************** - * Definitions + * Registry path */ -#define REGSTR_PATH_SOFTWARESYNTHS "Software\\Microsoft\\DirectMusic\\SoftwareSynths" -#define REFRESH_F_LASTBUFFER 0x00000001 +#define REGSTR_PATH_SOFTWARESYNTHS "Software\\Microsoft\\DirectMusic\\SoftwareSynths" /***************************************************************************** * Predeclare the interfaces */ +/* IIDs */ +DEFINE_GUID(IID_IDirectMusicSynth, 0x09823661,0x5c85,0x11d2,0xaf,0xa6,0x00,0xaa,0x00,0x24,0xd8,0xb6); +DEFINE_GUID(IID_IDirectMusicSynth8, 0x53cab625,0x2711,0x4c9f,0x9d,0xe7,0x1b,0x7f,0x92,0x5f,0x6f,0xc8); +DEFINE_GUID(IID_IDirectMusicSynthSink, 0x09823663,0x5c85,0x11d2,0xaf,0xa6,0x00,0xaa,0x00,0x24,0xd8,0xb6); -DEFINE_GUID(IID_IDirectMusicSynth, 0x9823661,0x5c85,0x11d2,0xaf,0xa6,0x0,0xaa,0x0,0x24,0xd8,0xb6); -DEFINE_GUID(IID_IDirectMusicSynth8, 0x53cab625,0x2711,0x4c9f,0x9d,0xe7,0x1b,0x7f,0x92,0x5f,0x6f,0xc8); -DEFINE_GUID(IID_IDirectMusicSynthSink, 0x9823663,0x5c85,0x11d2,0xaf,0xa6,0x0,0xaa, 0x0,0x24,0xd8,0xb6); - -typedef struct IDirectMusicSynth IDirectMusicSynth, *LPDIRECTMUSICSYNTH; -typedef struct IDirectMusicSynth8 IDirectMusicSynth8, *LPDIRECTMUSICSYNTH8; +/* typedef definitions */ +typedef struct IDirectMusicSynth IDirectMusicSynth, *LPDIRECTMUSICSYNTH; +typedef struct IDirectMusicSynth8 IDirectMusicSynth8, *LPDIRECTMUSICSYNTH8; typedef struct IDirectMusicSynthSink IDirectMusicSynthSink, *LPDIRECTMUSICSYNTHSINK; -DEFINE_GUID(GUID_DMUS_PROP_SetSynthSink, 0x0a3a5ba5,0x37b6,0x11d2,0xb9,0xf9,0x00,0x00,0xf8,0x75,0xac,0x12); -DEFINE_GUID(GUID_DMUS_PROP_SinkUsesDSound, 0xbe208857,0x8952,0x11d2,0xba,0x1c,0x00,0x00,0xf8,0x75,0xac,0x12); +/* GUIDs - property set */ +DEFINE_GUID(GUID_DMUS_PROP_SetSynthSink, 0x0a3a5ba5,0x37b6,0x11d2,0xb9,0xf9,0x00,0x00,0xf8,0x75,0xac,0x12); +DEFINE_GUID(GUID_DMUS_PROP_SinkUsesDSound, 0xbe208857,0x8952,0x11d2,0xba,0x1c,0x00,0x00,0xf8,0x75,0xac,0x12); + + +/***************************************************************************** + * Flags + */ +#define REFRESH_F_LASTBUFFER 0x1 /***************************************************************************** @@ -53,12 +59,14 @@ DEFINE_GUID(GUID_DMUS_PROP_SinkUsesDSound, 0xbe208857,0x8952,0x11d2,0xba,0x1c,0x #ifndef _DMUS_VOICE_STATE_DEFINED #define _DMUS_VOICE_STATE_DEFINED -typedef struct _DMUS_VOICE_STATE -{ - BOOL bExists; - SAMPLE_POSITION spPosition; -} DMUS_VOICE_STATE; +/* typedef definition */ +typedef struct _DMUS_VOICE_STATE DMUS_VOICE_STATE, *LPDMUS_VOICE_STATE; +/* actual structure */ +struct _DMUS_VOICE_STATE { + BOOL bExists; + SAMPLE_POSITION spPosition; +}; #endif /* _DMUS_VOICE_STATE_DEFINED */ diff --git a/libs/uuid/dxguid.c b/libs/uuid/dxguid.c index 7f260f94f53..83db7f986ce 100644 --- a/libs/uuid/dxguid.c +++ b/libs/uuid/dxguid.c @@ -38,10 +38,8 @@ #include "dsound.h" #include "dsdriver.h" #include "dsconf.h" -#include "dmusicc.h" #include "dmusici.h" #include "dmusics.h" -#include "dmplugin.h" #include "dplay.h" #include "dplobby.h" #include "dinput.h" diff --git a/winedefault.reg b/winedefault.reg index 9b2985516e7..66e73ae838a 100644 --- a/winedefault.reg +++ b/winedefault.reg @@ -2590,28 +2590,27 @@ [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Microsoft.DirectMusicMelodyFormulationTrack.1\CLSID] @="{B0684266-B57F-11D2-97F9-00C04FA36E58}" -# As far as I know, not yet available ## Microsoft DirectSound Wave -#[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{8A667154-F9CB-11D2-AD8A-0060B0575ABC}] -#@="Microsoft DirectSound Wave" -#[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{8A667154-F9CB-11D2-AD8A-0060B0575ABC}\InProcServer32] -#@="dswave.dll" -#"ThreadingModel"="Both" -#[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{8A667154-F9CB-11D2-AD8A-0060B0575ABC}\ProgID] -#@="Microsoft.DirectSoundWave.1" -#[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{8A667154-F9CB-11D2-AD8A-0060B0575ABC}\VersionIndependentProgID] -#@="Microsoft.DirectSoundWave" +[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{8A667154-F9CB-11D2-AD8A-0060B0575ABC}] +@="Microsoft DirectSound Wave" +[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{8A667154-F9CB-11D2-AD8A-0060B0575ABC}\InProcServer32] +@="dswave.dll" +"ThreadingModel"="Both" +[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{8A667154-F9CB-11D2-AD8A-0060B0575ABC}\ProgID] +@="Microsoft.DirectSoundWave.1" +[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{8A667154-F9CB-11D2-AD8A-0060B0575ABC}\VersionIndependentProgID] +@="Microsoft.DirectSoundWave" -#[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Microsoft.DirectSoundWave] -#@="Microsoft DirectSound Wave" -#[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Microsoft.DirectSoundWave\CLSID] -#@="{8A667154-F9CB-11D2-AD8A-0060B0575ABC}" -#[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Microsoft.DirectSoundWave\CurVer] -#@="Microsoft.DirectSoundWave.1" -#[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Microsoft.DirectSoundWave.1] -#@="Microsoft DirectSound Wave" -#[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Microsoft.DirectSoundWave.1\CLSID] -#@="{8A667154-F9CB-11D2-AD8A-0060B0575ABC}" +[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Microsoft.DirectSoundWave] +@="Microsoft DirectSound Wave" +[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Microsoft.DirectSoundWave\CLSID] +@="{8A667154-F9CB-11D2-AD8A-0060B0575ABC}" +[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Microsoft.DirectSoundWave\CurVer] +@="Microsoft.DirectSoundWave.1" +[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Microsoft.DirectSoundWave.1] +@="Microsoft DirectSound Wave" +[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Microsoft.DirectSoundWave.1\CLSID] +@="{8A667154-F9CB-11D2-AD8A-0060B0575ABC}" #