ReactOS 0.4.15-dev-8061-g57b775e
dmobject.h
Go to the documentation of this file.
1/*
2 * Base IDirectMusicObject Implementation
3 * Keep in sync with the master in dlls/dmusic/dmobject.h
4 *
5 * Copyright (C) 2014 Michael Stefaniuc
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 */
21
22#pragma once
23
24#include "wine/debug.h"
25
26/* RIFF stream parsing */
27struct chunk_entry;
31 FOURCC type; /* valid only for LIST and RIFF chunks */
32 ULARGE_INTEGER offset; /* chunk offset from start of stream */
33 const struct chunk_entry *parent; /* enclosing RIFF or LIST chunk */
34};
35
39
44
46{
48
49 offset.QuadPart = chunk->offset.QuadPart + sizeof(FOURCC) + sizeof(DWORD);
50 if (chunk->id == FOURCC_RIFF || chunk->id == FOURCC_LIST)
51 offset.QuadPart += sizeof(FOURCC);
52
53 return IStream_Seek(stream, offset, STREAM_SEEK_SET, NULL);
54}
55
57{
59
60 offset.QuadPart = chunk->offset.QuadPart;
61
62 return IStream_Seek(stream, offset, STREAM_SEEK_SET, NULL);
63}
64
65const char *debugstr_chunk(const struct chunk_entry *chunk) DECLSPEC_HIDDEN;
66
67
68/* IDirectMusicObject base object */
69struct dmobject {
70 IDirectMusicObject IDirectMusicObject_iface;
74};
75
76void dmobject_init(struct dmobject *dmobj, const GUID *class, IUnknown *outer_unk) DECLSPEC_HIDDEN;
77
78/* Generic IDirectMusicObject methods */
80 void **ret_iface) DECLSPEC_HIDDEN;
87
88/* Helper for IDirectMusicObject::ParseDescriptor */
91/* Additional supported flags for dmobj_parsedescriptor.
92 DMUS_OBJ_NAME is 'UNAM' chunk in UNFO list */
93#define DMUS_OBJ_NAME_INAM 0x1000 /* 'INAM' chunk in UNFO list */
94#define DMUS_OBJ_NAME_INFO 0x2000 /* 'INAM' chunk in INFO list */
95
96/* Generic IPersistStream methods */
98 void **ret_iface) DECLSPEC_HIDDEN;
102
103/* IPersistStream methods not implemented in native */
105 CLSID *class) DECLSPEC_HIDDEN;
108 BOOL clear_dirty) DECLSPEC_HIDDEN;
#define NULL
Definition: types.h:112
#define DECLSPEC_HIDDEN
Definition: precomp.h:8
DWORD FOURCC
Definition: dmdls.h:25
HRESULT WINAPI dmobj_IDirectMusicObject_SetDescriptor(IDirectMusicObject *iface, DMUS_OBJECTDESC *desc) DECLSPEC_HIDDEN
Definition: dmobject.c:215
HRESULT stream_next_chunk(IStream *stream, struct chunk_entry *chunk) DECLSPEC_HIDDEN
Definition: dmobject.c:130
static HRESULT stream_reset_chunk_data(IStream *stream, const struct chunk_entry *chunk)
Definition: dmobject.h:45
HRESULT WINAPI dmobj_IDirectMusicObject_QueryInterface(IDirectMusicObject *iface, REFIID riid, void **ret_iface) DECLSPEC_HIDDEN
Definition: dmobject.c:181
HRESULT stream_chunk_get_wstr(IStream *stream, const struct chunk_entry *chunk, WCHAR *str, ULONG size) DECLSPEC_HIDDEN
Definition: dmobject.c:155
const char * debugstr_chunk(const struct chunk_entry *chunk) DECLSPEC_HIDDEN
Definition: dmobject.c:48
HRESULT stream_get_chunk(IStream *stream, struct chunk_entry *chunk) DECLSPEC_HIDDEN
Definition: dmobject.c:76
void dmobject_init(struct dmobject *dmobj, const GUID *class, IUnknown *outer_unk) DECLSPEC_HIDDEN
Definition: dmobject.c:407
ULONG WINAPI dmobj_IDirectMusicObject_AddRef(IDirectMusicObject *iface) DECLSPEC_HIDDEN
Definition: dmobject.c:188
HRESULT WINAPI unimpl_IPersistStream_IsDirty(IPersistStream *iface) DECLSPEC_HIDDEN
Definition: dmobject.c:387
HRESULT WINAPI unimpl_IPersistStream_Save(IPersistStream *iface, IStream *stream, BOOL clear_dirty) DECLSPEC_HIDDEN
Definition: dmobject.c:393
HRESULT WINAPI unimpl_IPersistStream_GetSizeMax(IPersistStream *iface, ULARGE_INTEGER *size) DECLSPEC_HIDDEN
Definition: dmobject.c:400
HRESULT WINAPI dmobj_IPersistStream_QueryInterface(IPersistStream *iface, REFIID riid, void **ret_iface) DECLSPEC_HIDDEN
Definition: dmobject.c:347
static HRESULT stream_reset_chunk_start(IStream *stream, const struct chunk_entry *chunk)
Definition: dmobject.h:56
HRESULT WINAPI dmobj_IPersistStream_GetClassID(IPersistStream *iface, CLSID *class) DECLSPEC_HIDDEN
Definition: dmobject.c:366
ULONG WINAPI dmobj_IDirectMusicObject_Release(IDirectMusicObject *iface) DECLSPEC_HIDDEN
Definition: dmobject.c:194
HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff, DMUS_OBJECTDESC *desc, DWORD supported) DECLSPEC_HIDDEN
Definition: dmobject.c:296
ULONG WINAPI dmobj_IPersistStream_Release(IPersistStream *iface) DECLSPEC_HIDDEN
Definition: dmobject.c:360
HRESULT WINAPI unimpl_IPersistStream_GetClassID(IPersistStream *iface, CLSID *class) DECLSPEC_HIDDEN
Definition: dmobject.c:381
HRESULT stream_chunk_get_data(IStream *stream, const struct chunk_entry *chunk, void *data, ULONG size) DECLSPEC_HIDDEN
Definition: dmobject.c:143
HRESULT WINAPI dmobj_IDirectMusicObject_GetDescriptor(IDirectMusicObject *iface, DMUS_OBJECTDESC *desc) DECLSPEC_HIDDEN
Definition: dmobject.c:200
HRESULT stream_skip_chunk(IStream *stream, struct chunk_entry *chunk) DECLSPEC_HIDDEN
Definition: dmobject.c:121
ULONG WINAPI dmobj_IPersistStream_AddRef(IPersistStream *iface) DECLSPEC_HIDDEN
Definition: dmobject.c:354
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLsizeiptr size
Definition: glext.h:5919
GLintptr offset
Definition: glext.h:5920
REFIID riid
Definition: atlbase.h:39
#define FOURCC(a, b, c, d)
Definition: memtrack.h:4
#define FOURCC_RIFF
Definition: mmsystem.h:564
#define FOURCC_LIST
Definition: mmsystem.h:565
static const WCHAR desc[]
Definition: protectdata.c:36
#define REFIID
Definition: guiddef.h:118
const WCHAR * str
Definition: dmobject.h:28
DWORD size
Definition: dmobject.h:30
FOURCC id
Definition: dmobject.h:29
FOURCC type
Definition: dmobject.h:31
const struct chunk_entry * parent
Definition: dmobject.h:33
ULARGE_INTEGER offset
Definition: dmobject.h:32
uint64_t offset
Definition: btrfs_drv.h:564
IPersistStream IPersistStream_iface
Definition: dmobject.h:71
DMUS_OBJECTDESC desc
Definition: dmobject.h:73
IUnknown * outer_unk
Definition: dmobject.h:72
IDirectMusicObject IDirectMusicObject_iface
Definition: dmobject.h:70
Definition: parse.h:23
uint32_t ULONG
Definition: typedefs.h:59
#define WINAPI
Definition: msvc.h:6
__wchar_t WCHAR
Definition: xmlstorage.h:180