Added protocol type constants.
[wine.git] / dlls / dmband / dmband_private.h
bloba4fed77e5ad7a410b970ef18729c995d53b07ced
1 /* DirectMusicBand 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_DMBAND_PRIVATE_H
21 #define __WINE_DMBAND_PRIVATE_H
23 #include <stdio.h>
24 #include <stdarg.h>
25 #include <string.h>
27 #include "windef.h"
28 #include "winbase.h"
29 #include "winnt.h"
30 #include "wingdi.h"
31 #include "winuser.h"
33 #include "wine/debug.h"
34 #include "wine/list.h"
35 #include "wine/unicode.h"
36 #include "winreg.h"
38 #include "dmusici.h"
39 #include "dmusicf.h"
40 #include "dmusics.h"
42 /*****************************************************************************
43 * Interfaces
45 typedef struct IDirectMusicBandImpl IDirectMusicBandImpl;
47 typedef struct IDirectMusicBandTrack IDirectMusicBandTrack;
49 /*****************************************************************************
50 * Predeclare the interface implementation structures
52 extern ICOM_VTABLE(IUnknown) DirectMusicBand_Uknown_Vtbl;
53 extern ICOM_VTABLE(IDirectMusicBand) DirectMusicBand_Band_Vtbl;
54 extern ICOM_VTABLE(IDirectMusicObject) DirectMusicBand_Object_Vtbl;
55 extern ICOM_VTABLE(IPersistStream) DirectMusicBand_PeristStream_Vtbl;
57 extern ICOM_VTABLE(IUnknown) DirectMusicBandTrack_Unknown_Vtbl;
58 extern ICOM_VTABLE(IDirectMusicTrack8) DirectMusicBandTrack_DirectMusicTrack_Vtbl;
59 extern ICOM_VTABLE(IPersistStream) DirectMusicBandTrack_PersistStream_Vtbl;
61 /*****************************************************************************
62 * ClassFactory
64 extern HRESULT WINAPI DMUSIC_CreateDirectMusicBandImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter);
66 extern HRESULT WINAPI DMUSIC_CreateDirectMusicBandTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter);
69 /*****************************************************************************
70 * Auxiliary definitions
72 /* i don't like M$'s idea about two different band item headers, so behold: universal one */
73 typedef struct _DMUS_PRIVATE_BAND_ITEM_HEADER {
74 DWORD dwVersion; /* 1 or 2 */
75 /* v.1 */
76 MUSIC_TIME lBandTime;
77 /* v.2 */
78 MUSIC_TIME lBandTimeLogical;
79 MUSIC_TIME lBandTimePhysical;
80 } DMUS_PRIVATE_BAND_ITEM_HEADER;
82 typedef struct _DMUS_PRIVATE_INSTRUMENT {
83 struct list entry; /* for listing elements */
84 DMUS_IO_INSTRUMENT pInstrument;
85 IDirectMusicCollection* ppReferenceCollection;
86 } DMUS_PRIVATE_INSTRUMENT, *LPDMUS_PRIVATE_INSTRUMENT;
88 typedef struct _DMUS_PRIVATE_BAND {
89 struct list entry; /* for listing elements */
90 DMUS_PRIVATE_BAND_ITEM_HEADER pBandHeader;
91 IDirectMusicBandImpl* ppBand;
92 } DMUS_PRIVATE_BAND, *LPDMUS_PRIVATE_BAND;
95 /*****************************************************************************
96 * IDirectMusicBandImpl implementation structure
98 struct IDirectMusicBandImpl {
99 /* IUnknown fields */
100 ICOM_VTABLE(IUnknown) *UnknownVtbl;
101 ICOM_VTABLE(IDirectMusicBand) *BandVtbl;
102 ICOM_VTABLE(IDirectMusicObject) *ObjectVtbl;
103 ICOM_VTABLE(IPersistStream) *PersistStreamVtbl;
104 DWORD ref;
106 /* IDirectMusicBandImpl fields */
107 LPDMUS_OBJECTDESC pDesc;
108 /* data */
109 struct list Instruments;
112 /* IUnknown: */
113 extern HRESULT WINAPI IDirectMusicBandImpl_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj);
114 extern ULONG WINAPI IDirectMusicBandImpl_IUnknown_AddRef (LPUNKNOWN iface);
115 extern ULONG WINAPI IDirectMusicBandImpl_IUnknown_Release (LPUNKNOWN iface);
116 /* IDirectMusicBand: */
117 extern HRESULT WINAPI IDirectMusicBandImpl_IDirectMusicBand_QueryInterface (LPDIRECTMUSICBAND iface, REFIID riid, LPVOID *ppobj);
118 extern ULONG WINAPI IDirectMusicBandImpl_IDirectMusicBand_AddRef (LPDIRECTMUSICBAND iface);
119 extern ULONG WINAPI IDirectMusicBandImpl_IDirectMusicBand_Release (LPDIRECTMUSICBAND iface);
120 extern HRESULT WINAPI IDirectMusicBandImpl_IDirectMusicBand_CreateSegment (LPDIRECTMUSICBAND iface, IDirectMusicSegment** ppSegment);
121 extern HRESULT WINAPI IDirectMusicBandImpl_IDirectMusicBand_Download (LPDIRECTMUSICBAND iface, IDirectMusicPerformance* pPerformance);
122 extern HRESULT WINAPI IDirectMusicBandImpl_IDirectMusicBand_Unload (LPDIRECTMUSICBAND iface, IDirectMusicPerformance* pPerformance);
123 /* IDirectMusicObject: */
124 extern HRESULT WINAPI IDirectMusicBandImpl_IDirectMusicObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj);
125 extern ULONG WINAPI IDirectMusicBandImpl_IDirectMusicObject_AddRef (LPDIRECTMUSICOBJECT iface);
126 extern ULONG WINAPI IDirectMusicBandImpl_IDirectMusicObject_Release (LPDIRECTMUSICOBJECT iface);
127 extern HRESULT WINAPI IDirectMusicBandImpl_IDirectMusicObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc);
128 extern HRESULT WINAPI IDirectMusicBandImpl_IDirectMusicObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc);
129 extern HRESULT WINAPI IDirectMusicBandImpl_IDirectMusicObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc);
130 /* IPersistStream: */
131 extern HRESULT WINAPI IDirectMusicBandImpl_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject);
132 extern ULONG WINAPI IDirectMusicBandImpl_IPersistStream_AddRef (LPPERSISTSTREAM iface);
133 extern ULONG WINAPI IDirectMusicBandImpl_IPersistStream_Release (LPPERSISTSTREAM iface);
134 extern HRESULT WINAPI IDirectMusicBandImpl_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID);
135 extern HRESULT WINAPI IDirectMusicBandImpl_IPersistStream_IsDirty (LPPERSISTSTREAM iface);
136 extern HRESULT WINAPI IDirectMusicBandImpl_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm);
137 extern HRESULT WINAPI IDirectMusicBandImpl_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty);
138 extern HRESULT WINAPI IDirectMusicBandImpl_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize);
141 /*****************************************************************************
142 * IDirectMusicBandTrack implementation structure
144 struct IDirectMusicBandTrack {
145 /* IUnknown fields */
146 ICOM_VTABLE(IUnknown) *UnknownVtbl;
147 ICOM_VTABLE(IDirectMusicTrack8) *TrackVtbl;
148 ICOM_VTABLE(IPersistStream) *PersistStreamVtbl;
149 DWORD ref;
151 /* IDirectMusicBandTrack fields */
152 LPDMUS_OBJECTDESC pDesc;
153 DMUS_IO_BAND_TRACK_HEADER* pHeader;
155 /* data */
156 struct list Bands;
159 /* IUnknown: */
160 extern HRESULT WINAPI IDirectMusicBandTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj);
161 extern ULONG WINAPI IDirectMusicBandTrack_IUnknown_AddRef (LPUNKNOWN iface);
162 extern ULONG WINAPI IDirectMusicBandTrack_IUnknown_Release (LPUNKNOWN iface);
163 /* IDirectMusicTrack(8): */
164 extern HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj);
165 extern ULONG WINAPI IDirectMusicBandTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface);
166 extern ULONG WINAPI IDirectMusicBandTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface);
167 extern HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment);
168 extern HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags);
169 extern HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData);
170 extern HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID);
171 extern HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam);
172 extern HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam);
173 extern HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType);
174 extern HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType);
175 extern HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType);
176 extern HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack);
177 extern HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID);
178 extern HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags);
179 extern HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags);
180 extern HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack);
181 extern HRESULT WINAPI IDirectMusicBandTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack);
182 /* IPersistStream: */
183 extern HRESULT WINAPI IDirectMusicBandTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject);
184 extern ULONG WINAPI IDirectMusicBandTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface);
185 extern ULONG WINAPI IDirectMusicBandTrack_IPersistStream_Release (LPPERSISTSTREAM iface);
186 extern HRESULT WINAPI IDirectMusicBandTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID);
187 extern HRESULT WINAPI IDirectMusicBandTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface);
188 extern HRESULT WINAPI IDirectMusicBandTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm);
189 extern HRESULT WINAPI IDirectMusicBandTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty);
190 extern HRESULT WINAPI IDirectMusicBandTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize);
193 /*****************************************************************************
194 * Misc.
196 /* for simpler reading */
197 typedef struct _DMUS_PRIVATE_CHUNK {
198 FOURCC fccID; /* FOURCC ID of the chunk */
199 DWORD dwSize; /* size of the chunk */
200 } DMUS_PRIVATE_CHUNK, *LPDMUS_PRIVATE_CHUNK;
202 /* used for generic dumping (copied from ddraw) */
203 typedef struct {
204 DWORD val;
205 const char* name;
206 } flag_info;
208 typedef struct {
209 const GUID *guid;
210 const char* name;
211 } guid_info;
213 /* used for initialising structs (primarily for DMUS_OBJECTDESC) */
214 #define DM_STRUCT_INIT(x) \
215 do { \
216 memset((x), 0, sizeof(*(x))); \
217 (x)->dwSize = sizeof(*x); \
218 } while (0)
220 #define FE(x) { x, #x }
221 #define GE(x) { &x, #x }
223 /* check whether the given DWORD is even (return 0) or odd (return 1) */
224 extern int even_or_odd (DWORD number);
225 /* FOURCC to string conversion for debug messages */
226 extern const char *debugstr_fourcc (DWORD fourcc);
227 /* DMUS_VERSION struct to string conversion for debug messages */
228 extern const char *debugstr_dmversion (LPDMUS_VERSION version);
229 /* returns name of given GUID */
230 extern const char *debugstr_dmguid (const GUID *id);
231 /* returns name of given error code */
232 extern const char *debugstr_dmreturn (DWORD code);
233 /* generic flags-dumping function */
234 extern const char *debugstr_flags (DWORD flags, const flag_info* names, size_t num_names);
235 extern const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask);
236 /* dump whole DMUS_OBJECTDESC struct */
237 extern const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc);
239 #endif /* __WINE_DMBAND_PRIVATE_H */