Add a stubbed out implementation of IAdviseSink and advise the
[wine] / dlls / dmcompos / dmcompos_private.h
1 /* DirectMusicComposer Private Include
2  *
3  * Copyright (C) 2003-2004 Rok Mandeljc
4  *
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.
9  *
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.
14  *
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.
18  */
19
20 #ifndef __WINE_DMCOMPOS_PRIVATE_H
21 #define __WINE_DMCOMPOS_PRIVATE_H
22
23 #include <stdio.h>
24 #include <stdarg.h>
25 #include <string.h>
26
27 #define COBJMACROS
28
29 #include "windef.h"
30 #include "winbase.h"
31 #include "winnt.h"
32 #include "wingdi.h"
33 #include "winuser.h"
34
35 #include "wine/debug.h"
36 #include "wine/list.h"
37 #include "wine/unicode.h"
38 #include "winreg.h"
39 #include "objbase.h"
40
41 #include "dmusici.h"
42 #include "dmusicf.h"
43 #include "dmusics.h"
44
45 /*****************************************************************************
46  * Interfaces
47  */
48 typedef struct IDirectMusicChordMapImpl IDirectMusicChordMapImpl;
49 typedef struct IDirectMusicComposerImpl IDirectMusicComposerImpl;
50 typedef struct IDirectMusicChordMapTrack IDirectMusicChordMapTrack;
51 typedef struct IDirectMusicSignPostTrack IDirectMusicSignPostTrack;
52         
53 /*****************************************************************************
54  * ClassFactory
55  */
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);
60
61 /*****************************************************************************
62  * IDirectMusicChordMapImpl implementation structure
63  */
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;
71
72   /* IDirectMusicChordMapImpl fields */
73   LPDMUS_OBJECTDESC pDesc;
74
75 };
76
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);
85
86 /*****************************************************************************
87  * IDirectMusicComposerImpl implementation structure
88  */
89 struct IDirectMusicComposerImpl {
90   /* IUnknown fields */
91   const IDirectMusicComposerVtbl *lpVtbl;
92   LONG  ref;
93
94   /* IDirectMusicComposerImpl fields */
95 };
96
97 /* IUnknown: */
98 extern ULONG WINAPI   IDirectMusicComposerImpl_AddRef (LPDIRECTMUSICCOMPOSER iface);
99
100
101 /*****************************************************************************
102  * IDirectMusicChordMapTrack implementation structure
103  */
104 struct IDirectMusicChordMapTrack {
105   /* IUnknown fields */
106   const IUnknownVtbl *UnknownVtbl;
107   const IDirectMusicTrack8Vtbl *TrackVtbl;
108   const IPersistStreamVtbl *PersistStreamVtbl;
109   LONG           ref;
110
111   /* IDirectMusicChordMapTrack fields */
112   LPDMUS_OBJECTDESC pDesc;
113 };
114
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);
121
122 /*****************************************************************************
123  * IDirectMusicSignPostTrack implementation structure
124  */
125 struct IDirectMusicSignPostTrack {
126   /* IUnknown fields */
127   const IUnknownVtbl *UnknownVtbl;
128   const IDirectMusicTrack8Vtbl *TrackVtbl;
129   const IPersistStreamVtbl *PersistStreamVtbl;
130   LONG           ref;
131
132   /* IDirectMusicSignPostTrack fields */
133   LPDMUS_OBJECTDESC pDesc;
134 };
135
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);
142
143 /**********************************************************************
144  * Dll lifetime tracking declaration for dmcompos.dll
145  */
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 ); }
149
150 /*****************************************************************************
151  * Misc.
152  */
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;
158
159 /* used for generic dumping (copied from ddraw) */
160 typedef struct {
161     DWORD val;
162     const char* name;
163 } flag_info;
164
165 typedef struct {
166     const GUID *guid;
167     const char* name;
168 } guid_info;
169
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)
176
177 #define FE(x) { x, #x } 
178 #define GE(x) { &x, #x }
179
180 #define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
181
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);
197
198 #endif  /* __WINE_DMCOMPOS_PRIVATE_H */