1 /* Debug and Helper Functions
3 * Copyright (C) 2004 Rok Mandeljc
4 * Copyright (C) 2004 Raphael Junqueira
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
33 #include "wine/debug.h"
43 WINE_DEFAULT_DEBUG_CHANNEL(dmfile
);
45 HRESULT
IDirectMusicUtils_IPersistStream_ParseDescGeneric (DMUS_PRIVATE_CHUNK
* pChunk
, IStream
* pStm
, LPDMUS_OBJECTDESC pDesc
) {
47 switch (pChunk
->fccID
) {
48 case DMUS_FOURCC_GUID_CHUNK
: {
49 TRACE(": GUID chunk\n");
50 pDesc
->dwValidData
|= DMUS_OBJ_OBJECT
;
51 IStream_Read (pStm
, &pDesc
->guidObject
, pChunk
->dwSize
, NULL
);
54 case DMUS_FOURCC_DATE_CHUNK
: {
55 TRACE(": file date chunk\n");
56 pDesc
->dwValidData
|= DMUS_OBJ_DATE
;
57 IStream_Read (pStm
, &pDesc
->ftDate
, pChunk
->dwSize
, NULL
);
60 case DMUS_FOURCC_NAME_CHUNK
: {
61 TRACE(": name chunk\n");
62 pDesc
->dwValidData
|= DMUS_OBJ_NAME
;
63 IStream_Read (pStm
, pDesc
->wszName
, pChunk
->dwSize
, NULL
);
66 case DMUS_FOURCC_FILE_CHUNK
: {
67 TRACE(": file name chunk\n");
68 pDesc
->dwValidData
|= DMUS_OBJ_FILENAME
;
69 IStream_Read (pStm
, pDesc
->wszFileName
, pChunk
->dwSize
, NULL
);
72 case DMUS_FOURCC_VERSION_CHUNK
: {
73 TRACE(": version chunk\n");
74 pDesc
->dwValidData
|= DMUS_OBJ_VERSION
;
75 IStream_Read (pStm
, &pDesc
->vVersion
, pChunk
->dwSize
, NULL
);
78 case DMUS_FOURCC_CATEGORY_CHUNK
: {
79 TRACE(": category chunk\n");
80 pDesc
->dwValidData
|= DMUS_OBJ_CATEGORY
;
81 IStream_Read (pStm
, pDesc
->wszCategory
, pChunk
->dwSize
, NULL
);
92 HRESULT
IDirectMusicUtils_IPersistStream_ParseUNFOGeneric (DMUS_PRIVATE_CHUNK
* pChunk
, IStream
* pStm
, LPDMUS_OBJECTDESC pDesc
) {
94 LARGE_INTEGER liMove
; /* used when skipping chunks */
97 * don't ask me why, but M$ puts INFO elements in UNFO list sometimes
98 * (though strings seem to be valid unicode)
100 switch (pChunk
->fccID
) {
102 case mmioFOURCC('I','N','A','M'):
103 case DMUS_FOURCC_UNAM_CHUNK
: {
104 TRACE(": name chunk\n");
105 pDesc
->dwValidData
|= DMUS_OBJ_NAME
;
106 IStream_Read (pStm
, pDesc
->wszName
, pChunk
->dwSize
, NULL
);
107 TRACE(" - wszName: %s\n", debugstr_w(pDesc
->wszName
));
111 case mmioFOURCC('I','A','R','T'):
112 case DMUS_FOURCC_UART_CHUNK
: {
113 TRACE(": artist chunk (ignored)\n");
114 liMove
.QuadPart
= pChunk
->dwSize
;
115 IStream_Seek (pStm
, liMove
, STREAM_SEEK_CUR
, NULL
);
118 case mmioFOURCC('I','C','O','P'):
119 case DMUS_FOURCC_UCOP_CHUNK
: {
120 TRACE(": copyright chunk (ignored)\n");
121 liMove
.QuadPart
= pChunk
->dwSize
;
122 IStream_Seek (pStm
, liMove
, STREAM_SEEK_CUR
, NULL
);
125 case mmioFOURCC('I','S','B','J'):
126 case DMUS_FOURCC_USBJ_CHUNK
: {
127 TRACE(": subject chunk (ignored)\n");
128 liMove
.QuadPart
= pChunk
->dwSize
;
129 IStream_Seek (pStm
, liMove
, STREAM_SEEK_CUR
, NULL
);
132 case mmioFOURCC('I','C','M','T'):
133 case DMUS_FOURCC_UCMT_CHUNK
: {
134 TRACE(": comment chunk (ignored)\n");
135 liMove
.QuadPart
= pChunk
->dwSize
;
136 IStream_Seek (pStm
, liMove
, STREAM_SEEK_CUR
, NULL
);