Implement asn.1 encoding/decoding of times, with tests.
[wine] / dlls / dmband / dmband_private.h
1 /* DirectMusicBand 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_DMBAND_PRIVATE_H
21 #define __WINE_DMBAND_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 IDirectMusicBandImpl IDirectMusicBandImpl;
49         
50 typedef struct IDirectMusicBandTrack IDirectMusicBandTrack;
51         
52 /*****************************************************************************
53  * ClassFactory
54  */
55 extern HRESULT WINAPI DMUSIC_CreateDirectMusicBandImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter);
56
57 extern HRESULT WINAPI DMUSIC_CreateDirectMusicBandTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter);
58
59
60 /*****************************************************************************
61  * Auxiliary definitions
62  */
63 /* i don't like M$'s idea about two different band item headers, so behold: universal one */
64 typedef struct _DMUS_PRIVATE_BAND_ITEM_HEADER {
65         DWORD dwVersion; /* 1 or 2 */
66         /* v.1 */
67         MUSIC_TIME lBandTime;
68         /* v.2 */
69         MUSIC_TIME lBandTimeLogical;
70         MUSIC_TIME lBandTimePhysical;
71 } DMUS_PRIVATE_BAND_ITEM_HEADER;
72
73 typedef struct _DMUS_PRIVATE_INSTRUMENT {
74         struct list entry; /* for listing elements */
75         DMUS_IO_INSTRUMENT pInstrument;
76         IDirectMusicCollection* ppReferenceCollection;
77 } DMUS_PRIVATE_INSTRUMENT, *LPDMUS_PRIVATE_INSTRUMENT;
78
79 typedef struct _DMUS_PRIVATE_BAND {
80         struct list entry; /* for listing elements */
81         DMUS_PRIVATE_BAND_ITEM_HEADER pBandHeader;
82         IDirectMusicBandImpl* ppBand;
83 } DMUS_PRIVATE_BAND, *LPDMUS_PRIVATE_BAND;
84
85
86 /*****************************************************************************
87  * IDirectMusicBandImpl implementation structure
88  */
89 struct IDirectMusicBandImpl {
90   /* IUnknown fields */
91   const IUnknownVtbl *UnknownVtbl;
92   const IDirectMusicBandVtbl *BandVtbl;
93   const IDirectMusicObjectVtbl *ObjectVtbl;
94   const IPersistStreamVtbl *PersistStreamVtbl;
95   DWORD          ref;
96
97   /* IDirectMusicBandImpl fields */
98   LPDMUS_OBJECTDESC pDesc;
99   /* data */
100   struct list Instruments;
101 };
102
103 /* IUnknown: */
104 extern ULONG WINAPI   IDirectMusicBandImpl_IUnknown_AddRef (LPUNKNOWN iface);
105 /* IDirectMusicBand: */
106 extern ULONG WINAPI   IDirectMusicBandImpl_IDirectMusicBand_AddRef (LPDIRECTMUSICBAND iface);
107 /* IDirectMusicObject: */
108 extern ULONG WINAPI   IDirectMusicBandImpl_IDirectMusicObject_AddRef (LPDIRECTMUSICOBJECT iface);
109 /* IPersistStream: */
110 extern ULONG WINAPI   IDirectMusicBandImpl_IPersistStream_AddRef (LPPERSISTSTREAM iface);
111
112 /*****************************************************************************
113  * IDirectMusicBandTrack implementation structure
114  */
115 struct IDirectMusicBandTrack {
116   /* IUnknown fields */
117   const IUnknownVtbl *UnknownVtbl;
118   const IDirectMusicTrack8Vtbl *TrackVtbl;
119   const IPersistStreamVtbl *PersistStreamVtbl;
120   DWORD          ref;
121
122   /* IDirectMusicBandTrack fields */
123   LPDMUS_OBJECTDESC pDesc;
124   DMUS_IO_BAND_TRACK_HEADER header;
125         
126   /* data */
127   struct list Bands;
128 };
129
130 /* IUnknown: */
131 extern ULONG WINAPI   IDirectMusicBandTrack_IUnknown_AddRef (LPUNKNOWN iface);
132 /* IDirectMusicTrack(8): */
133 extern ULONG WINAPI   IDirectMusicBandTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface);
134 /* IPersistStream: */
135 extern ULONG WINAPI   IDirectMusicBandTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface);
136
137 /**********************************************************************
138  * Dll lifetime tracking declaration for dmband.dll
139  */
140 extern LONG DMBAND_refCount;
141 static inline void DMBAND_LockModule() { InterlockedIncrement( &DMBAND_refCount ); }
142 static inline void DMBAND_UnlockModule() { InterlockedDecrement( &DMBAND_refCount ); }
143
144 /*****************************************************************************
145  * Misc.
146  */
147
148 #include "dmutils.h"
149
150 #endif  /* __WINE_DMBAND_PRIVATE_H */