Update the address of the Free Software Foundation.
[wine/gsoc_dplay.git] / dlls / dmcompos / dmcompos_private.h
blob4382e5be6830fafdf39d7976f6d8b189e81afafc
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
20 #ifndef __WINE_DMCOMPOS_PRIVATE_H
21 #define __WINE_DMCOMPOS_PRIVATE_H
23 #include <stdio.h>
24 #include <stdarg.h>
25 #include <string.h>
27 #define COBJMACROS
29 #include "windef.h"
30 #include "winbase.h"
31 #include "winnt.h"
32 #include "wingdi.h"
33 #include "winuser.h"
35 #include "wine/debug.h"
36 #include "wine/list.h"
37 #include "wine/unicode.h"
38 #include "winreg.h"
39 #include "objbase.h"
41 #include "dmusici.h"
42 #include "dmusicf.h"
43 #include "dmusics.h"
45 /*****************************************************************************
46 * Interfaces
48 typedef struct IDirectMusicChordMapImpl IDirectMusicChordMapImpl;
49 typedef struct IDirectMusicComposerImpl IDirectMusicComposerImpl;
50 typedef struct IDirectMusicChordMapTrack IDirectMusicChordMapTrack;
51 typedef struct IDirectMusicSignPostTrack IDirectMusicSignPostTrack;
53 /*****************************************************************************
54 * ClassFactory
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 {
65 /* IUnknown fields */
66 const IUnknownVtbl *UnknownVtbl;
67 const IDirectMusicChordMapVtbl *ChordMapVtbl;
68 const IDirectMusicObjectVtbl *ObjectVtbl;
69 const IPersistStreamVtbl *PersistStreamVtbl;
70 LONG ref;
72 /* IDirectMusicChordMapImpl fields */
73 LPDMUS_OBJECTDESC pDesc;
77 /* IUnknown: */
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);
83 /* IPersistStream: */
84 extern ULONG WINAPI IDirectMusicChordMapImpl_IPersistStream_AddRef (LPPERSISTSTREAM iface);
86 /*****************************************************************************
87 * IDirectMusicComposerImpl implementation structure
89 struct IDirectMusicComposerImpl {
90 /* IUnknown fields */
91 const IDirectMusicComposerVtbl *lpVtbl;
92 LONG ref;
94 /* IDirectMusicComposerImpl fields */
97 /* IUnknown: */
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;
109 LONG ref;
111 /* IDirectMusicChordMapTrack fields */
112 LPDMUS_OBJECTDESC pDesc;
115 /* IUnknown: */
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;
130 LONG ref;
132 /* IDirectMusicSignPostTrack fields */
133 LPDMUS_OBJECTDESC pDesc;
136 /* IUnknown: */
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 /*****************************************************************************
151 * Misc.
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) */
160 typedef struct {
161 DWORD val;
162 const char* name;
163 } flag_info;
165 typedef struct {
166 const GUID *guid;
167 const char* name;
168 } guid_info;
170 /* used for initialising structs (primarily for DMUS_OBJECTDESC) */
171 #define DM_STRUCT_INIT(x) \
172 do { \
173 memset((x), 0, sizeof(*(x))); \
174 (x)->dwSize = sizeof(*x); \
175 } while (0)
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 */