1 /* DirectMusicComposer 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 #ifndef __WINE_DMCOMPOS_PRIVATE_H
21 #define __WINE_DMCOMPOS_PRIVATE_H
35 #include "wine/debug.h"
36 #include "wine/list.h"
37 #include "wine/unicode.h"
45 /*****************************************************************************
48 typedef struct IDirectMusicChordMapImpl IDirectMusicChordMapImpl
;
49 typedef struct IDirectMusicComposerImpl IDirectMusicComposerImpl
;
50 typedef struct IDirectMusicChordMapTrack IDirectMusicChordMapTrack
;
51 typedef struct IDirectMusicSignPostTrack IDirectMusicSignPostTrack
;
53 /*****************************************************************************
56 extern HRESULT WINAPI
DMUSIC_CreateDirectMusicChordMapImpl (LPCGUID lpcGUID
, LPVOID
* ppobj
, LPUNKNOWN pUnkOuter
);
57 extern HRESULT WINAPI
DMUSIC_CreateDirectMusicComposerImpl (LPCGUID lpcGUID
, LPVOID
* ppobj
, LPUNKNOWN pUnkOuter
);
58 extern HRESULT WINAPI
DMUSIC_CreateDirectMusicChordMapTrack (LPCGUID lpcGUID
, LPVOID
* ppobj
, LPUNKNOWN pUnkOuter
);
59 extern HRESULT WINAPI
DMUSIC_CreateDirectMusicSignPostTrack (LPCGUID lpcGUID
, LPVOID
* ppobj
, LPUNKNOWN pUnkOuter
);
61 /*****************************************************************************
62 * IDirectMusicChordMapImpl implementation structure
64 struct IDirectMusicChordMapImpl
{
66 const IUnknownVtbl
*UnknownVtbl
;
67 const IDirectMusicChordMapVtbl
*ChordMapVtbl
;
68 const IDirectMusicObjectVtbl
*ObjectVtbl
;
69 const IPersistStreamVtbl
*PersistStreamVtbl
;
72 /* IDirectMusicChordMapImpl fields */
73 LPDMUS_OBJECTDESC pDesc
;
78 extern ULONG WINAPI
IDirectMusicChordMapImpl_IUnknown_AddRef (LPUNKNOWN iface
);
79 /* IDirectMusicChordMap: */
80 extern ULONG WINAPI
IDirectMusicChordMapImpl_IDirectMusicChordMap_AddRef (LPDIRECTMUSICCHORDMAP iface
);
81 /* IDirectMusicObject: */
82 extern ULONG WINAPI
IDirectMusicChordMapImpl_IDirectMusicObject_AddRef (LPDIRECTMUSICOBJECT iface
);
84 extern ULONG WINAPI
IDirectMusicChordMapImpl_IPersistStream_AddRef (LPPERSISTSTREAM iface
);
86 /*****************************************************************************
87 * IDirectMusicComposerImpl implementation structure
89 struct IDirectMusicComposerImpl
{
91 const IDirectMusicComposerVtbl
*lpVtbl
;
94 /* IDirectMusicComposerImpl fields */
98 extern ULONG WINAPI
IDirectMusicComposerImpl_AddRef (LPDIRECTMUSICCOMPOSER iface
);
101 /*****************************************************************************
102 * IDirectMusicChordMapTrack implementation structure
104 struct IDirectMusicChordMapTrack
{
105 /* IUnknown fields */
106 const IUnknownVtbl
*UnknownVtbl
;
107 const IDirectMusicTrack8Vtbl
*TrackVtbl
;
108 const IPersistStreamVtbl
*PersistStreamVtbl
;
111 /* IDirectMusicChordMapTrack fields */
112 LPDMUS_OBJECTDESC pDesc
;
116 extern ULONG WINAPI
IDirectMusicChordMapTrack_IUnknown_AddRef (LPUNKNOWN iface
);
117 /* IDirectMusicTrack(8): */
118 extern ULONG WINAPI
IDirectMusicChordMapTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface
);
119 /* IPersistStream: */
120 extern ULONG WINAPI
IDirectMusicChordMapTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface
);
122 /*****************************************************************************
123 * IDirectMusicSignPostTrack implementation structure
125 struct IDirectMusicSignPostTrack
{
126 /* IUnknown fields */
127 const IUnknownVtbl
*UnknownVtbl
;
128 const IDirectMusicTrack8Vtbl
*TrackVtbl
;
129 const IPersistStreamVtbl
*PersistStreamVtbl
;
132 /* IDirectMusicSignPostTrack fields */
133 LPDMUS_OBJECTDESC pDesc
;
137 extern ULONG WINAPI
IDirectMusicSignPostTrack_IUnknown_AddRef (LPUNKNOWN iface
);
138 /* IDirectMusicTrack(8): */
139 extern ULONG WINAPI
IDirectMusicSignPostTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface
);
140 /* IPersistStream: */
141 extern ULONG WINAPI
IDirectMusicSignPostTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface
);
143 /**********************************************************************
144 * Dll lifetime tracking declaration for dmcompos.dll
146 extern LONG DMCOMPOS_refCount
;
147 static inline void DMCOMPOS_LockModule(void) { InterlockedIncrement( &DMCOMPOS_refCount
); }
148 static inline void DMCOMPOS_UnlockModule(void) { InterlockedDecrement( &DMCOMPOS_refCount
); }
150 /*****************************************************************************
153 /* for simpler reading */
154 typedef struct _DMUS_PRIVATE_CHUNK
{
155 FOURCC fccID
; /* FOURCC ID of the chunk */
156 DWORD dwSize
; /* size of the chunk */
157 } DMUS_PRIVATE_CHUNK
, *LPDMUS_PRIVATE_CHUNK
;
159 /* used for generic dumping (copied from ddraw) */
170 /* used for initialising structs (primarily for DMUS_OBJECTDESC) */
171 #define DM_STRUCT_INIT(x) \
173 memset((x), 0, sizeof(*(x))); \
174 (x)->dwSize = sizeof(*x); \
177 #define FE(x) { x, #x }
178 #define GE(x) { &x, #x }
180 #define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
182 /* check whether the given DWORD is even (return 0) or odd (return 1) */
183 extern int even_or_odd (DWORD number
);
184 /* FOURCC to string conversion for debug messages */
185 extern const char *debugstr_fourcc (DWORD fourcc
);
186 /* DMUS_VERSION struct to string conversion for debug messages */
187 extern const char *debugstr_dmversion (LPDMUS_VERSION version
);
188 /* returns name of given GUID */
189 extern const char *debugstr_dmguid (const GUID
*id
);
190 /* returns name of given error code */
191 extern const char *debugstr_dmreturn (DWORD code
);
192 /* generic flags-dumping function */
193 extern const char *debugstr_flags (DWORD flags
, const flag_info
* names
, size_t num_names
);
194 extern const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask
);
195 /* dump whole DMUS_OBJECTDESC struct */
196 extern const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc
);
198 #endif /* __WINE_DMCOMPOS_PRIVATE_H */