ntdll: Copy some missing math functions from msvcrt.
[wine] / dlls / dmstyle / dmstyle_private.h
1 /* DirectMusicStyle Private Include
2  *
3  * Copyright (C) 2003-2004 Rok Mandeljc
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (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 GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18  */
19
20 #ifndef __WINE_DMSTYLE_PRIVATE_H
21 #define __WINE_DMSTYLE_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 IDirectMusicStyle8Impl IDirectMusicStyle8Impl;
49
50 typedef struct IDirectMusicAuditionTrack IDirectMusicAuditionTrack;
51 typedef struct IDirectMusicChordTrack IDirectMusicChordTrack;
52 typedef struct IDirectMusicCommandTrack IDirectMusicCommandTrack;
53 typedef struct IDirectMusicMelodyFormulationTrack IDirectMusicMelodyFormulationTrack;
54 typedef struct IDirectMusicMotifTrack IDirectMusicMotifTrack;
55 typedef struct IDirectMusicMuteTrack IDirectMusicMuteTrack;
56 typedef struct IDirectMusicStyleTrack IDirectMusicStyleTrack;
57         
58 /*****************************************************************************
59  * ClassFactory
60  */
61 extern HRESULT WINAPI DMUSIC_CreateDirectMusicStyleImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN;
62
63 /*****************************************************************************
64  * Auxiliary definitions
65  */
66 typedef struct _DMUS_PRIVATE_STYLE_BAND {
67   struct list entry; /* for listing elements */
68   IDirectMusicBand* pBand;
69 } DMUS_PRIVATE_STYLE_BAND, *LPDMUS_PRIVATE_STYLE_BAND;
70
71 typedef struct _DMUS_PRIVATE_STYLE_PARTREF_ITEM {
72   struct list entry; /* for listing elements */
73   DMUS_OBJECTDESC desc;
74   DMUS_IO_PARTREF part_ref;
75 } DMUS_PRIVATE_STYLE_PARTREF_ITEM, *LPDMUS_PRIVATE_STYLE_PARTREF_ITEM;
76
77 typedef struct _DMUS_PRIVATE_STYLE_MOTIF {
78   struct list entry; /* for listing elements */
79   DWORD dwRhythm;
80   DMUS_IO_PATTERN pattern;
81   DMUS_OBJECTDESC desc;
82   /** optional for motifs */
83   DMUS_IO_MOTIFSETTINGS settings;
84   IDirectMusicBand* pBand;
85
86   struct list Items;
87 } DMUS_PRIVATE_STYLE_MOTIF, *LPDMUS_PRIVATE_STYLE_MOTIF;
88
89 typedef struct _DMUS_PRIVATE_STYLE_ITEM {
90   struct list entry; /* for listing elements */
91   DWORD dwTimeStamp;
92   IDirectMusicStyle8* pObject;
93 } DMUS_PRIVATE_STYLE_ITEM, *LPDMUS_PRIVATE_STYLE_ITEM;
94
95 extern HRESULT WINAPI DMUSIC_CreateDirectMusicAuditionTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN;
96 extern HRESULT WINAPI DMUSIC_CreateDirectMusicChordTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN;
97 extern HRESULT WINAPI DMUSIC_CreateDirectMusicCommandTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN;
98 extern HRESULT WINAPI DMUSIC_CreateDirectMusicMotifTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN;
99 extern HRESULT WINAPI DMUSIC_CreateDirectMusicMuteTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN;
100 extern HRESULT WINAPI DMUSIC_CreateDirectMusicStyleTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN;
101
102 /*****************************************************************************
103  * IDirectMusicStyle8Impl implementation structure
104  */
105 struct IDirectMusicStyle8Impl {
106   /* IUnknown fields */
107   const IUnknownVtbl *UnknownVtbl;
108   const IDirectMusicStyle8Vtbl *StyleVtbl;
109   const IDirectMusicObjectVtbl *ObjectVtbl;
110   const IPersistStreamVtbl *PersistStreamVtbl;
111   LONG           ref;
112
113   /* IDirectMusicStyle8Impl fields */
114   LPDMUS_OBJECTDESC pDesc;
115   DMUS_IO_STYLE style;
116
117   /* data */
118   struct list Motifs;
119   struct list Bands;
120 };
121
122 /*****************************************************************************
123  * IDirectMusicAuditionTrack implementation structure
124  */
125 struct IDirectMusicAuditionTrack {
126   /* IUnknown fields */
127   const IUnknownVtbl *UnknownVtbl;
128   const IDirectMusicTrack8Vtbl *TrackVtbl;
129   const IPersistStreamVtbl *PersistStreamVtbl;
130   LONG           ref;
131
132   /* IDirectMusicAuditionTrack fields */
133   LPDMUS_OBJECTDESC pDesc;
134 };
135
136 /*****************************************************************************
137  * IDirectMusicChordTrack implementation structure
138  */
139 struct IDirectMusicChordTrack {
140   /* IUnknown fields */
141   const IUnknownVtbl *UnknownVtbl;
142   const IDirectMusicTrack8Vtbl *TrackVtbl;
143   const IPersistStreamVtbl *PersistStreamVtbl;
144   LONG           ref;
145
146   /* IDirectMusicChordTrack fields */
147   LPDMUS_OBJECTDESC pDesc;
148   DWORD dwScale;
149 };
150
151 typedef struct _DMUS_PRIVATE_COMMAND {
152         struct list entry; /* for listing elements */
153         DMUS_IO_COMMAND pCommand;
154         IDirectMusicCollection* ppReferenceCollection;
155 } DMUS_PRIVATE_COMMAND, *LPDMUS_PRIVATE_COMMAND;
156
157 /*****************************************************************************
158  * IDirectMusicCommandTrack implementation structure
159  */
160 struct IDirectMusicCommandTrack {
161   /* IUnknown fields */
162   const IUnknownVtbl *UnknownVtbl;
163   const IDirectMusicTrack8Vtbl *TrackVtbl;
164   const IPersistStreamVtbl *PersistStreamVtbl;
165   LONG           ref;
166
167   /* IDirectMusicCommandTrack fields */
168   LPDMUS_OBJECTDESC pDesc;
169   /* track data */
170   struct list Commands;
171 };
172
173 /*****************************************************************************
174  * IDirectMusicMelodyFormulationTrack implementation structure
175  */
176 struct IDirectMusicMelodyFormulationTrack {
177   /* IUnknown fields */
178   const IUnknownVtbl *UnknownVtbl;
179   const IDirectMusicTrack8Vtbl *TrackVtbl;
180   const IPersistStreamVtbl *PersistStreamVtbl;
181   LONG           ref;
182
183   /* IDirectMusicMelodyFormulationTrack fields */
184   LPDMUS_OBJECTDESC pDesc;
185 };
186
187 /* IUnknown: */
188 extern HRESULT WINAPI IDirectMusicMelodyFormulationTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) DECLSPEC_HIDDEN;
189 extern ULONG WINAPI   IDirectMusicMelodyFormulationTrack_IUnknown_AddRef (LPUNKNOWN iface) DECLSPEC_HIDDEN;
190 /* IDirectMusicTrack(8): */
191 extern ULONG WINAPI   IDirectMusicMelodyFormulationTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface) DECLSPEC_HIDDEN;
192 /* IPersistStream: */
193 extern ULONG WINAPI   IDirectMusicMelodyFormulationTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface) DECLSPEC_HIDDEN;
194
195 /*****************************************************************************
196  * IDirectMusicMotifTrack implementation structure
197  */
198 struct IDirectMusicMotifTrack {
199   /* IUnknown fields */
200   const IUnknownVtbl *UnknownVtbl;
201   const IDirectMusicTrack8Vtbl *TrackVtbl;
202   const IPersistStreamVtbl *PersistStreamVtbl;
203   LONG           ref;
204
205   /* IDirectMusicMotifTrack fields */
206   LPDMUS_OBJECTDESC pDesc;
207 };
208
209 /*****************************************************************************
210  * IDirectMusicMuteTrack implementation structure
211  */
212 struct IDirectMusicMuteTrack {
213   /* IUnknown fields */
214   const IUnknownVtbl *UnknownVtbl;
215   const IDirectMusicTrack8Vtbl *TrackVtbl;
216   const IPersistStreamVtbl *PersistStreamVtbl;
217   LONG           ref;
218
219   /* IDirectMusicMuteTrack fields */
220   LPDMUS_OBJECTDESC pDesc;
221 };
222
223 /*****************************************************************************
224  * IDirectMusicStyleTrack implementation structure
225  */
226 struct IDirectMusicStyleTrack {
227   /* IUnknown fields */
228   const IUnknownVtbl *UnknownVtbl;
229   const IDirectMusicTrack8Vtbl *TrackVtbl;
230   const IPersistStreamVtbl *PersistStreamVtbl;
231   LONG           ref;
232
233   /* IDirectMusicStyleTrack fields */
234   LPDMUS_OBJECTDESC pDesc;
235   
236   struct list Items;
237 };
238
239 /**********************************************************************
240  * Dll lifetime tracking declaration for dmstyle.dll
241  */
242 extern LONG DMSTYLE_refCount DECLSPEC_HIDDEN;
243 static inline void DMSTYLE_LockModule(void) { InterlockedIncrement( &DMSTYLE_refCount ); }
244 static inline void DMSTYLE_UnlockModule(void) { InterlockedDecrement( &DMSTYLE_refCount ); }
245
246 /*****************************************************************************
247  * Misc.
248  */
249 #include "dmutils.h"
250
251 #endif  /* __WINE_DMSTYLE_PRIVATE_H */