1 /* DirectMusicScript Private Include
3 * Copyright (C) 2003-2004 Rok Mandeljc
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Library General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
20 #ifndef __WINE_DMSCRIPT_PRIVATE_H
21 #define __WINE_DMSCRIPT_PRIVATE_H
35 #include "wine/debug.h"
36 #include "wine/list.h"
37 #include "wine/unicode.h"
45 /*****************************************************************************
48 typedef struct IDirectMusicScriptImpl IDirectMusicScriptImpl
;
50 typedef struct IDirectMusicScriptTrack IDirectMusicScriptTrack
;
52 /*****************************************************************************
55 extern HRESULT WINAPI
DMUSIC_CreateDirectMusicScriptImpl (LPCGUID lpcGUID
, LPVOID
* ppobj
, LPUNKNOWN pUnkOuter
);
57 extern HRESULT WINAPI
DMUSIC_CreateDirectMusicScriptTrack (LPCGUID lpcGUID
, LPVOID
* ppobj
, LPUNKNOWN pUnkOuter
);
59 /*****************************************************************************
60 * IDirectMusicScriptImpl implementation structure
62 struct IDirectMusicScriptImpl
{
64 const IUnknownVtbl
*UnknownVtbl
;
65 const IDirectMusicScriptVtbl
*ScriptVtbl
;
66 const IDirectMusicObjectVtbl
*ObjectVtbl
;
67 const IPersistStreamVtbl
*PersistStreamVtbl
;
70 /* IDirectMusicScriptImpl fields */
71 IDirectMusicPerformance
* pPerformance
;
72 LPDMUS_OBJECTDESC pDesc
;
73 DMUS_IO_SCRIPT_HEADER
* pHeader
;
74 DMUS_IO_VERSION
* pVersion
;
80 extern HRESULT WINAPI
IDirectMusicScriptImpl_IUnknown_QueryInterface (LPUNKNOWN iface
, REFIID riid
, LPVOID
*ppobj
);
81 extern ULONG WINAPI
IDirectMusicScriptImpl_IUnknown_AddRef (LPUNKNOWN iface
);
82 /* IDirectMusicScript: */
83 extern ULONG WINAPI
IDirectMusicScriptImpl_IDirectMusicScript_AddRef (LPDIRECTMUSICSCRIPT iface
);
84 /* IDirectMusicObject: */
85 extern ULONG WINAPI
IDirectMusicScriptImpl_IDirectMusicObject_AddRef (LPDIRECTMUSICOBJECT iface
);
87 extern ULONG WINAPI
IDirectMusicScriptImpl_IPersistStream_AddRef (LPPERSISTSTREAM iface
);
89 /*****************************************************************************
90 * IDirectMusicScriptTrack implementation structure
92 struct IDirectMusicScriptTrack
{
94 const IUnknownVtbl
*UnknownVtbl
;
95 const IDirectMusicTrack8Vtbl
*TrackVtbl
;
96 const IPersistStreamVtbl
*PersistStreamVtbl
;
99 /* IDirectMusicScriptTrack fields */
100 LPDMUS_OBJECTDESC pDesc
;
104 extern HRESULT WINAPI
IDirectMusicScriptTrack_IUnknown_QueryInterface (LPUNKNOWN iface
, REFIID riid
, LPVOID
*ppobj
);
105 extern ULONG WINAPI
IDirectMusicScriptTrack_IUnknown_AddRef (LPUNKNOWN iface
);
106 /* IDirectMusicTrack(8): */
107 extern ULONG WINAPI
IDirectMusicScriptTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface
);
108 /* IPersistStream: */
109 extern ULONG WINAPI
IDirectMusicScriptTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface
);
111 /**********************************************************************
112 * Dll lifetime tracking declaration for dmscript.dll
114 extern LONG DMSCRIPT_refCount
;
115 static inline void DMSCRIPT_LockModule(void) { InterlockedIncrement( &DMSCRIPT_refCount
); }
116 static inline void DMSCRIPT_UnlockModule(void) { InterlockedDecrement( &DMSCRIPT_refCount
); }
118 /*****************************************************************************
121 /* for simpler reading */
122 typedef struct _DMUS_PRIVATE_CHUNK
{
123 FOURCC fccID
; /* FOURCC ID of the chunk */
124 DWORD dwSize
; /* size of the chunk */
125 } DMUS_PRIVATE_CHUNK
, *LPDMUS_PRIVATE_CHUNK
;
127 /* used for generic dumping (copied from ddraw) */
138 /* used for initialising structs (primarily for DMUS_OBJECTDESC) */
139 #define DM_STRUCT_INIT(x) \
141 memset((x), 0, sizeof(*(x))); \
142 (x)->dwSize = sizeof(*x); \
145 #define FE(x) { x, #x }
146 #define GE(x) { &x, #x }
148 #define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
150 /* check whether the given DWORD is even (return 0) or odd (return 1) */
151 extern int even_or_odd (DWORD number
);
152 /* FOURCC to string conversion for debug messages */
153 extern const char *debugstr_fourcc (DWORD fourcc
);
154 /* DMUS_VERSION struct to string conversion for debug messages */
155 extern const char *debugstr_dmversion (LPDMUS_VERSION version
);
156 /* returns name of given GUID */
157 extern const char *debugstr_dmguid (const GUID
*id
);
158 /* returns name of given error code */
159 extern const char *debugstr_dmreturn (DWORD code
);
160 /* generic flags-dumping function */
161 extern const char *debugstr_flags (DWORD flags
, const flag_info
* names
, size_t num_names
);
162 extern const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask
);
163 /* dump whole DMUS_OBJECTDESC struct */
164 extern const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc
);
166 #endif /* __WINE_DMSCRIPT_PRIVATE_H */