Add support for specific EOI PIC command.
[wine] / dlls / dmloader / dmloader_private.h
1 /* DirectMusicLoader Private Include
2  *
3  * Copyright (C) 2003 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_DMLOADER_PRIVATE_H
21 #define __WINE_DMLOADER_PRIVATE_H
22
23 #include "windef.h"
24 #include "wine/debug.h"
25 #include "winbase.h"
26 #include "winnt.h"
27 #include "dmusicc.h"
28 #include "dmusici.h"
29 #include "dmusics.h"
30 #include "dmplugin.h"
31 #include "dmusicf.h"
32 #include "dsound.h"
33
34
35 typedef struct _DMUS_PRIVATE_CACHE_ENTRY
36 {
37         GUID guidObject;
38         WCHAR pwzFileName[MAX_PATH];
39     IDirectMusicObject* pObject;
40 } DMUS_PRIVATE_CACHE_ENTRY, *LPDMUS_PRIVATE_CACHE_ENTRY;
41
42 typedef struct _DMUS_PRIVATE_OBJECT_REFERENCE DMUS_PRIVATE_OBJECT_REFERENCE;
43
44 struct _DMUS_PRIVATE_OBJECT_REFERENCE {
45     DMUS_PRIVATE_OBJECT_REFERENCE* pNext;
46         WCHAR pwsFileName[MAX_PATH];
47     GUID guidObject;
48     IDirectMusicObject* pObject;
49 };
50
51 /*****************************************************************************
52  * Interfaces
53  */
54 typedef struct IDirectMusicLoader8Impl IDirectMusicLoader8Impl;
55 typedef struct IDirectMusicContainerImpl IDirectMusicContainerImpl;
56
57 typedef struct IDirectMusicContainerObject IDirectMusicContainerObject;
58 typedef struct IDirectMusicContainerObjectStream IDirectMusicContainerObjectStream;
59
60 typedef struct ILoaderStream ILoaderStream;
61
62 /*****************************************************************************
63  * Predeclare the interface implementation structures
64  */
65 extern ICOM_VTABLE(IDirectMusicLoader8) DirectMusicLoader8_Vtbl;
66 extern ICOM_VTABLE(IDirectMusicContainer) DirectMusicContainer_Vtbl;
67
68 extern ICOM_VTABLE(IDirectMusicObject) DirectMusicContainerObject_Vtbl;
69 extern ICOM_VTABLE(IPersistStream) DirectMusicContainerObjectStream_Vtbl;
70
71 extern ICOM_VTABLE(IUnknown) LoaderStream_Unknown_Vtbl;
72 extern ICOM_VTABLE(IStream) LoaderStream_Stream_Vtbl;
73 extern ICOM_VTABLE(IDirectMusicGetLoader) LoaderStream_GetLoader_Vtbl;
74
75 /*****************************************************************************
76  * ClassFactory
77  */
78 /* can support IID_IDirectMusicLoader and IID_IDirectMusicLoader8
79  * return always an IDirectMusicLoader8Impl
80  */
81 extern HRESULT WINAPI DMUSIC_CreateDirectMusicLoader (LPCGUID lpcGUID, LPDIRECTMUSICLOADER8 *ppDMLoad, LPUNKNOWN pUnkOuter);
82 /* can support IID_IDirectMusicContainer
83  * return always an IDirectMusicContainerImpl
84  */
85 extern HRESULT WINAPI DMUSIC_CreateDirectMusicContainer (LPCGUID lpcGUID, LPDIRECTMUSICCONTAINER *ppDMCon, LPUNKNOWN pUnkOuter);
86
87 extern HRESULT WINAPI DMUSIC_CreateDirectMusicContainerObject (LPCGUID lpcGUID, LPDIRECTMUSICOBJECT* ppObject, LPUNKNOWN pUnkOuter);
88
89 extern HRESULT WINAPI DMUSIC_CreateLoaderStream (LPSTREAM *ppStream);
90
91 /*****************************************************************************
92  * IDirectMusicLoader8Impl implementation structure
93  */
94 struct IDirectMusicLoader8Impl
95 {
96   /* IUnknown fields */
97   ICOM_VFIELD(IDirectMusicLoader8);
98   DWORD          ref;
99
100   /* IDirectMusicLoaderImpl fields */
101   WCHAR wzSearchPath[MAX_PATH];
102         
103   /* simple cache */
104   LPDMUS_PRIVATE_CACHE_ENTRY pCache; /* cache entries */
105   DWORD dwCacheSize; /* nr. of entries */
106 };
107
108 /* IUnknown: */
109 extern HRESULT WINAPI IDirectMusicLoader8Impl_QueryInterface (LPDIRECTMUSICLOADER8 iface, REFIID riid, LPVOID *ppobj);
110 extern ULONG WINAPI   IDirectMusicLoader8Impl_AddRef (LPDIRECTMUSICLOADER8 iface);
111 extern ULONG WINAPI   IDirectMusicLoader8Impl_Release (LPDIRECTMUSICLOADER8 iface);
112 /* IDirectMusicLoader: */
113 extern HRESULT WINAPI IDirectMusicLoader8Impl_GetObject (LPDIRECTMUSICLOADER8 iface, LPDMUS_OBJECTDESC pDesc, REFIID riid, LPVOID*ppv);
114 extern HRESULT WINAPI IDirectMusicLoader8Impl_SetObject (LPDIRECTMUSICLOADER8 iface, LPDMUS_OBJECTDESC pDesc);
115 extern HRESULT WINAPI IDirectMusicLoader8Impl_SetSearchDirectory (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClass, WCHAR* pwzPath, BOOL fClear);
116 extern HRESULT WINAPI IDirectMusicLoader8Impl_ScanDirectory (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClass, WCHAR* pwzFileExtension, WCHAR* pwzScanFileName);
117 extern HRESULT WINAPI IDirectMusicLoader8Impl_CacheObject (LPDIRECTMUSICLOADER8 iface, IDirectMusicObject* pObject);
118 extern HRESULT WINAPI IDirectMusicLoader8Impl_ReleaseObject (LPDIRECTMUSICLOADER8 iface, IDirectMusicObject* pObject);
119 extern HRESULT WINAPI IDirectMusicLoader8Impl_ClearCache (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClass);
120 extern HRESULT WINAPI IDirectMusicLoader8Impl_EnableCache (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClass, BOOL fEnable);
121 extern HRESULT WINAPI IDirectMusicLoader8Impl_EnumObject (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClass, DWORD dwIndex, LPDMUS_OBJECTDESC pDesc);
122 /* IDirectMusicLoader8: */
123 extern void    WINAPI IDirectMusicLoader8Impl_CollectGarbage (LPDIRECTMUSICLOADER8 iface);
124 extern HRESULT WINAPI IDirectMusicLoader8Impl_ReleaseObjectByUnknown (LPDIRECTMUSICLOADER8 iface, IUnknown* pObject);
125 extern HRESULT WINAPI IDirectMusicLoader8Impl_LoadObjectFromFile (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClassID, REFIID iidInterfaceID, WCHAR* pwzFilePath, void** ppObject);
126
127 /*****************************************************************************
128  * IDirectMusicContainerImpl implementation structure
129  */
130 struct IDirectMusicContainerImpl
131 {
132   /* IUnknown fields */
133   ICOM_VFIELD(IDirectMusicContainer);
134   DWORD          ref;
135
136   /* IDirectMusicContainerImpl fields */
137   IDirectMusicContainerObject* pObject;
138 };
139
140 /* IUnknown: */
141 extern HRESULT WINAPI IDirectMusicContainerImpl_QueryInterface (LPDIRECTMUSICCONTAINER iface, REFIID riid, LPVOID *ppobj);
142 extern ULONG WINAPI   IDirectMusicContainerImpl_AddRef (LPDIRECTMUSICCONTAINER iface);
143 extern ULONG WINAPI   IDirectMusicContainerImpl_Release (LPDIRECTMUSICCONTAINER iface);
144 /* IDirectMusicContainer: */
145 extern HRESULT WINAPI IDirectMusicContainerImpl_EnumObject (LPDIRECTMUSICCONTAINER iface, REFGUID rguidClass, DWORD dwIndex, LPDMUS_OBJECTDESC pDesc, WCHAR* pwszAlias);
146
147
148 /*****************************************************************************
149  * IDirectMusicContainerObject implementation structure
150  */
151 struct IDirectMusicContainerObject
152 {
153   /* IUnknown fields */
154   ICOM_VFIELD(IDirectMusicObject);
155   DWORD          ref;
156
157   /* IDirectMusicObjectImpl fields */
158   LPDMUS_OBJECTDESC pDesc;
159   IDirectMusicContainerObjectStream* pStream;
160   IDirectMusicContainerImpl* pContainer;
161 };
162
163 /* IUnknown: */
164 extern HRESULT WINAPI IDirectMusicContainerObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj);
165 extern ULONG WINAPI   IDirectMusicContainerObject_AddRef (LPDIRECTMUSICOBJECT iface);
166 extern ULONG WINAPI   IDirectMusicContainerObject_Release (LPDIRECTMUSICOBJECT iface);
167 /* IDirectMusicObject: */
168 extern HRESULT WINAPI IDirectMusicContainerObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc);
169 extern HRESULT WINAPI IDirectMusicContainerObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc);
170 extern HRESULT WINAPI IDirectMusicContainerObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc);
171
172 /*****************************************************************************
173  * IDirectMusicContainerObjectStream implementation structure
174  */
175 struct IDirectMusicContainerObjectStream
176 {
177   /* IUnknown fields */
178   ICOM_VFIELD (IPersistStream);
179   DWORD          ref;
180
181   /* IPersistStreamImpl fields */
182   IDirectMusicContainerObject* pParentObject;
183 };
184
185 /* IUnknown: */
186 extern HRESULT WINAPI IDirectMusicContainerObjectStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject);
187 extern ULONG WINAPI IDirectMusicContainerObjectStream_AddRef (LPPERSISTSTREAM iface);
188 extern ULONG WINAPI IDirectMusicContainerObjectStream_Release (LPPERSISTSTREAM iface);
189 /* IPersist: */
190 extern HRESULT WINAPI IDirectMusicContainerObjectStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID);
191 /* IPersistStream: */
192 extern HRESULT WINAPI IDirectMusicContainerObjectStream_IsDirty (LPPERSISTSTREAM iface);
193 extern HRESULT WINAPI IDirectMusicContainerObjectStream_Load (LPPERSISTSTREAM iface, IStream* pStm);
194 extern HRESULT WINAPI IDirectMusicContainerObjectStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty);
195 extern HRESULT WINAPI IDirectMusicContainerObjectStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize);
196
197
198 /*****************************************************************************
199  * ILoaderStream implementation structure
200  */
201 struct ILoaderStream
202 {
203   /* IUnknown fields */
204   ICOM_VTABLE(IStream) *StreamVtbl;
205   ICOM_VTABLE(IDirectMusicGetLoader) *GetLoaderVtbl;
206   DWORD          ref;
207
208   /* ILoaderStream fields */
209   IDirectMusicLoader8Impl* pLoader;
210   HANDLE hFile;
211   WCHAR wzFileName[MAX_PATH]; /* for clone */
212 };
213
214 /* Custom: */
215 extern HRESULT WINAPI ILoaderStream_Attach (ILoaderStream* iface, LPCWSTR wzFile, IDirectMusicLoader *pLoader);
216 extern void WINAPI ILoaderStream_Detach (ILoaderStream* iface);
217 /* IDirectMusicGetLoader: */
218 extern HRESULT WINAPI ILoaderStream_IDirectMusicGetLoader_QueryInterface (LPDIRECTMUSICGETLOADER iface, REFIID riid, void** ppobj);
219 extern ULONG WINAPI ILoaderStream_IDirectMusicGetLoader_AddRef (LPDIRECTMUSICGETLOADER iface);
220 extern ULONG WINAPI ILoaderStream_IDirectMusicGetLoader_Release (LPDIRECTMUSICGETLOADER iface);
221 extern HRESULT WINAPI ILoaderStream_IDirectMusicGetLoader_GetLoader (LPDIRECTMUSICGETLOADER iface, IDirectMusicLoader **ppLoader);
222 /* IStream: */
223 extern HRESULT WINAPI ILoaderStream_IStream_QueryInterface (LPSTREAM iface, REFIID riid, void** ppobj);
224 extern ULONG WINAPI ILoaderStream_IStream_AddRef (LPSTREAM iface);
225 extern ULONG WINAPI ILoaderStream_IStream_Release (LPSTREAM iface);extern HRESULT WINAPI ILoaderStream_IStream_Read (IStream* iface, void* pv, ULONG cb, ULONG* pcbRead);
226 extern HRESULT WINAPI ILoaderStream_IStream_Write (LPSTREAM iface, const void* pv, ULONG cb, ULONG* pcbWritten);
227 extern HRESULT WINAPI ILoaderStream_IStream_Seek (LPSTREAM iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER* plibNewPosition);
228 extern HRESULT WINAPI ILoaderStream_IStream_SetSize (LPSTREAM iface, ULARGE_INTEGER libNewSize);
229 extern HRESULT WINAPI ILoaderStream_IStream_CopyTo (LPSTREAM iface, IStream* pstm, ULARGE_INTEGER cb, ULARGE_INTEGER* pcbRead, ULARGE_INTEGER* pcbWritten);
230 extern HRESULT WINAPI ILoaderStream_IStream_Commit (LPSTREAM iface, DWORD grfCommitFlags);
231 extern HRESULT WINAPI ILoaderStream_IStream_Revert (LPSTREAM iface);
232 extern HRESULT WINAPI ILoaderStream_IStream_LockRegion (LPSTREAM iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType);
233 extern HRESULT WINAPI ILoaderStream_IStream_UnlockRegion (LPSTREAM iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType);
234 extern HRESULT WINAPI ILoaderStream_IStream_Stat (LPSTREAM iface, STATSTG* pstatstg, DWORD grfStatFlag);
235 extern HRESULT WINAPI ILoaderStream_IStream_Clone (LPSTREAM iface, IStream** ppstm);
236
237 #endif  /* __WINE_DMLOADER_PRIVATE_H */