75 *ret_iface = &
This->dmobj.IDirectMusicObject_iface;
77 *ret_iface = &
This->dmobj.IPersistStream_iface;
84 IUnknown_AddRef((
IUnknown*)*ret_iface);
115 DWORD patch, IDirectMusicInstrument **instrument)
122 TRACE(
"(%p/%p)->(%u, %p)\n", iface,
This, patch, instrument);
127 if (patch == inst_patch) {
131 TRACE(
": returning instrument %p\n", *instrument);
136 TRACE(
": instrument not found\n");
202 desc->guidClass = CLSID_DirectMusicCollection;
205 TRACE(
"returning descriptor:\n");
225 DWORD StreamSize, StreamCount, ListSize[2], ListCount[2];
227 ULARGE_INTEGER dlibCollectionPosition, dlibInstrumentPosition, dlibWavePoolPosition;
231 IStream_Seek(
stream, liMove, STREAM_SEEK_CUR, &dlibCollectionPosition);
232 This->liCollectionPosition.QuadPart = dlibCollectionPosition.
QuadPart;
239 TRACE_(dmfile)(
": unexpected chunk; loading failed)\n");
241 IStream_Seek(
stream, liMove, STREAM_SEEK_CUR,
NULL);
251 TRACE_(dmfile)(
": unexpected chunk; loading failed)\n");
253 IStream_Seek(
stream, liMove, STREAM_SEEK_CUR,
NULL);
257 TRACE_(dmfile)(
": collection form\n");
262 switch (
chunk.fccID) {
264 TRACE_(dmfile)(
": collection header chunk\n");
270 TRACE_(dmfile)(
": DLID (GUID) chunk\n");
276 TRACE_(dmfile)(
": version chunk\n");
282 TRACE_(dmfile)(
": pool table chunk\n");
295 switch (
chunk.fccID) {
297 TRACE_(dmfile)(
": INFO list\n");
302 switch (
chunk.fccID) {
305 TRACE_(dmfile)(
": name chunk\n");
312 IStream_Seek(
stream, liMove, STREAM_SEEK_CUR,
NULL);
317 TRACE_(dmfile)(
": artist chunk (ignored)\n");
323 IStream_Seek(
stream, liMove, STREAM_SEEK_CUR,
NULL);
327 TRACE_(dmfile)(
": copyright chunk\n");
333 IStream_Seek(
stream, liMove, STREAM_SEEK_CUR,
NULL);
338 TRACE_(dmfile)(
": subject chunk (ignored)\n");
344 IStream_Seek(
stream, liMove, STREAM_SEEK_CUR,
NULL);
348 TRACE_(dmfile)(
": comment chunk (ignored)\n");
354 IStream_Seek(
stream, liMove, STREAM_SEEK_CUR,
NULL);
358 TRACE_(dmfile)(
": unknown chunk (irrelevant & skipping)\n");
364 IStream_Seek(
stream, liMove, STREAM_SEEK_CUR,
NULL);
368 TRACE_(dmfile)(
": ListCount[0] = %d < ListSize[0] = %d\n", ListCount[0], ListSize[0]);
369 }
while (ListCount[0] < ListSize[0]);
373 TRACE_(dmfile)(
": wave pool list (mark & skip)\n");
375 IStream_Seek(
stream, liMove, STREAM_SEEK_CUR, &dlibWavePoolPosition);
376 This->liWavePoolTablePosition.QuadPart = dlibWavePoolPosition.
QuadPart;
378 IStream_Seek(
stream, liMove, STREAM_SEEK_CUR,
NULL);
382 TRACE_(dmfile)(
": instruments list\n");
387 switch (
chunk.fccID) {
393 switch (
chunk.fccID) {
396 TRACE_(dmfile)(
": instrument list\n");
403 IStream_Seek(
stream, liMove, STREAM_SEEK_CUR, &dlibInstrumentPosition);
405 instrument->
length = ListSize[1];
410 switch (
chunk.fccID) {
412 TRACE_(dmfile)(
": instrument header chunk\n");
417 TRACE_(dmfile)(
": DLID (GUID) chunk\n");
424 switch (
chunk.fccID) {
426 TRACE_(dmfile)(
": unknown (skipping)\n");
428 IStream_Seek(
stream, liMove, STREAM_SEEK_CUR,
NULL);
435 TRACE_(dmfile)(
": unknown chunk (irrelevant & skipping)\n");
437 IStream_Seek(
stream, liMove, STREAM_SEEK_CUR,
NULL);
441 TRACE_(dmfile)(
": ListCount[1] = %d < ListSize[1] = %d\n", ListCount[1], ListSize[1]);
442 }
while (ListCount[1] < ListSize[1]);
445 TRACE(
"*** IDirectMusicInstrument (%p) ***\n", instrument);
448 TRACE(
" - Instrument header:\n");
450 TRACE(
" - Locale:\n");
463 TRACE_(dmfile)(
": unknown chunk (irrelevant & skipping)\n");
465 IStream_Seek(
stream, liMove, STREAM_SEEK_CUR,
NULL);
469 TRACE_(dmfile)(
": ListCount[0] = %d < ListSize[0] = %d\n", ListCount[0], ListSize[0]);
470 }
while (ListCount[0] < ListSize[0]);
474 TRACE_(dmfile)(
": unknown (skipping)\n");
476 IStream_Seek(
stream, liMove, STREAM_SEEK_CUR,
NULL);
483 TRACE_(dmfile)(
": unknown chunk (irrelevant & skipping)\n");
485 IStream_Seek(
stream, liMove, STREAM_SEEK_CUR,
NULL);
489 TRACE_(dmfile)(
": StreamCount = %d < StreamSize = %d\n", StreamCount, StreamSize);
490 }
while (StreamCount < StreamSize);
492 TRACE_(dmfile)(
": reading finished\n");
499 struct list *listEntry;
501 TRACE(
"*** IDirectMusicCollection (%p) ***\n", &
This->IDirectMusicCollection_iface);
504 TRACE(
" - Collection header:\n");
505 TRACE(
" - cInstruments: %d\n",
This->pHeader->cInstruments);
506 TRACE(
" - Instruments:\n");
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
static void list_init(struct list_entry *head)
static ULONG WINAPI IDirectMusicCollectionImpl_AddRef(IDirectMusicCollection *iface)
static HRESULT WINAPI col_IDirectMusicObject_ParseDescriptor(IDirectMusicObject *iface, IStream *stream, DMUS_OBJECTDESC *desc)
static IDirectMusicCollectionImpl * impl_from_IDirectMusicCollection(IDirectMusicCollection *iface)
static const IDirectMusicCollectionVtbl DirectMusicCollection_Collection_Vtbl
static IDirectMusicCollectionImpl * impl_from_IPersistStream(IPersistStream *iface)
static ULONG WINAPI IDirectMusicCollectionImpl_Release(IDirectMusicCollection *iface)
static const IDirectMusicObjectVtbl dmobject_vtbl
HRESULT WINAPI DMUSIC_CreateDirectMusicCollectionImpl(LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter)
static const IPersistStreamVtbl persiststream_vtbl
static HRESULT WINAPI IDirectMusicCollectionImpl_GetInstrument(IDirectMusicCollection *iface, DWORD patch, IDirectMusicInstrument **instrument)
static HRESULT WINAPI IDirectMusicCollectionImpl_EnumInstrument(IDirectMusicCollection *iface, DWORD index, DWORD *patch, LPWSTR name, DWORD name_length)
static HRESULT WINAPI IDirectMusicCollectionImpl_QueryInterface(IDirectMusicCollection *iface, REFIID riid, void **ret_iface)
static HRESULT WINAPI IPersistStreamImpl_Load(IPersistStream *iface, IStream *stream)
static struct dmobject * impl_from_IDirectMusicObject(IDirectMusicObject *iface)
#define HeapFree(x, y, z)
#define WINE_DECLARE_DEBUG_CHANNEL(x)
#define MultiByteToWideChar
struct _POOLTABLE POOLTABLE
#define DMUS_E_NOTADLSCOL
#define DMUS_E_INVALIDPATCH
HRESULT WINAPI dmobj_IDirectMusicObject_GetDescriptor(IDirectMusicObject *iface, DMUS_OBJECTDESC *desc)
void dmobject_init(struct dmobject *dmobj, const GUID *class, IUnknown *outer_unk)
ULONG WINAPI dmobj_IPersistStream_Release(IPersistStream *iface)
ULONG WINAPI dmobj_IDirectMusicObject_Release(IDirectMusicObject *iface)
HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff, DMUS_OBJECTDESC *desc, DWORD supported)
HRESULT WINAPI dmobj_IDirectMusicObject_QueryInterface(IDirectMusicObject *iface, REFIID riid, void **ret_iface)
HRESULT stream_skip_chunk(IStream *stream, struct chunk_entry *chunk)
HRESULT WINAPI unimpl_IPersistStream_GetClassID(IPersistStream *iface, CLSID *class)
HRESULT WINAPI unimpl_IPersistStream_GetSizeMax(IPersistStream *iface, ULARGE_INTEGER *size)
HRESULT WINAPI dmobj_IDirectMusicObject_SetDescriptor(IDirectMusicObject *iface, DMUS_OBJECTDESC *desc)
const char * debugstr_chunk(const struct chunk_entry *chunk)
ULONG WINAPI dmobj_IPersistStream_AddRef(IPersistStream *iface)
HRESULT WINAPI dmobj_IPersistStream_QueryInterface(IPersistStream *iface, REFIID riid, void **ret_iface)
ULONG WINAPI dmobj_IDirectMusicObject_AddRef(IDirectMusicObject *iface)
HRESULT stream_get_chunk(IStream *stream, struct chunk_entry *chunk)
HRESULT WINAPI unimpl_IPersistStream_IsDirty(IPersistStream *iface)
HRESULT WINAPI unimpl_IPersistStream_Save(IPersistStream *iface, IStream *stream, BOOL clear_dirty)
#define DMUS_OBJ_NAME_INFO
int even_or_odd(DWORD number)
DWORD MIDILOCALE2Patch(const MIDILOCALE *pLocale)
void dump_DMUS_OBJECTDESC(LPDMUS_OBJECTDESC desc)
const char * debugstr_dmguid(const GUID *id)
static void DMUSIC_UnlockModule(void)
static IDirectMusicInstrumentImpl * impl_from_IDirectMusicInstrument(IDirectMusicInstrument *iface)
static void DMUSIC_LockModule(void)
HRESULT DMUSIC_CreateDirectMusicInstrumentImpl(LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN
HRESULT IDirectMusicInstrumentImpl_CustomLoad(IDirectMusicInstrument *iface, IStream *stream) DECLSPEC_HIDDEN
#define IDirectMusicCollection_QueryInterface(p, a, b)
#define IDirectMusicInstrument_GetPatch(p, a)
#define IDirectMusicInstrument_AddRef(p)
#define IDirectMusicCollection_Release(p)
#define DMUS_FOURCC_INFO_LIST
#define list_entry(ptr, type, member)
GLdouble GLdouble GLdouble r
GLuint GLsizei GLsizei * length
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define FOURCC(a, b, c, d)
#define memcpy(s1, s2, n)
#define mmioFOURCC(c0, c1, c2, c3)
static const WCHAR desc[]
static const char * debugstr_fourcc(DWORD fourcc)
static const WCHAR szName[]
const GUID IID_IPersistStream
#define IsEqualGUID(rguid1, rguid2)
#define IsEqualIID(riid1, riid2)
#define LIST_FOR_EACH(cursor, list)
LARGE_INTEGER liCollectionPosition
LARGE_INTEGER liWavePoolTablePosition
IDirectMusicCollection IDirectMusicCollection_iface
LARGE_INTEGER liInstrumentPosition
WCHAR wszName[DMUS_MAX_NAME]
IDirectMusicInstrument * pInstrument
IDirectMusicObject IDirectMusicObject_iface
#define CONTAINING_RECORD(address, type, field)
#define CLASS_E_NOAGGREGATION