64fac3b34b43281d7095149c49d039148f5bdd03
[reactos.git] / reactos / include / ddk / dmusicks.h
1 #ifndef _DMUSICKS_
2 #define _DMUSICKS_
3
4 #define DONT_HOLD_FOR_SEQUENCING 0x8000000000000000
5
6 #ifndef REFERENCE_TIME
7 typedef LONGLONG REFERENCE_TIME;
8 #endif
9
10 typedef struct _DMUS_KERNEL_EVENT
11 {
12 BYTE bReserved;
13 BYTE cbStruct;
14 USHORT cbEvent;
15 USHORT usChannelGroup;
16 USHORT usFlags;
17 REFERENCE_TIME ullPresTime100ns;
18 ULONGLONG ullBytePosition;
19 struct _DMUS_KERNEL_EVENT *pNextEvt;
20 union
21 {
22 BYTE abData[sizeof(PBYTE)];
23 PBYTE pbData;
24 struct _DMUS_KERNEL_EVENT *pPackageEvt;
25 }uData;
26 }DMUS_KERNEL_EVENT, *PDMUS_KERNEL_EVENT;
27
28 typedef enum
29 {
30 DMUS_STREAM_MIDI_INVALID = -1,
31 DMUS_STREAM_MIDI_RENDER = 0,
32 DMUS_STREAM_MIDI_CAPTURE,
33 DMUS_STREAM_WAVE_SINK
34 }DMUS_STREAM_TYPE;
35
36 DEFINE_GUID(CLSID_MiniportDriverDMusUART, 0xd3f0ce1c, 0xFFFC, 0x11D1, 0x81, 0xB0, 0x00, 0x60, 0x08, 0x33, 0x16, 0xC1);
37 DEFINE_GUID(CLSID_MiniportDriverDMusUARTCapture, 0xD3F0CE1D, 0xFFFC, 0x11D1, 0x81, 0xB0, 0x00, 0x60, 0x08, 0x33, 0x16, 0xC1);
38
39 /* ===============================================================
40 IMasterClock Interface
41 */
42
43 #undef INTERFACE
44 #define INTERFACE IMasterClock
45
46 DECLARE_INTERFACE_(IMasterClock,IUnknown)
47 {
48 DEFINE_ABSTRACT_UNKNOWN()
49
50 STDMETHOD_(NTSTATUS,GetTime)( THIS_
51 OUT REFERENCE_TIME * pTime
52 ) PURE;
53 };
54
55 typedef IMasterClock *PMASTERCLOCK;
56
57 #define IMP_IMasterClock \
58 STDMETHODIMP_(NTSTATUS) GetTime( \
59 OUT REFERENCE_TIME * pTime \
60 )
61
62 /* ===============================================================
63 IMXF Interface
64 */
65
66 #undef INTERFACE
67 #define INTERFACE IMXF
68
69 struct IMXF;
70 typedef struct IMXF *PMXF;
71
72 #define DEFINE_ABSTRACT_IMXF() \
73 STDMETHOD_(NTSTATUS,SetState)(THIS_ \
74 IN KSSTATE State \
75 ) PURE; \
76 STDMETHOD_(NTSTATUS,PutMessage) \
77 ( THIS_ \
78 IN PDMUS_KERNEL_EVENT pDMKEvt \
79 ) PURE; \
80 STDMETHOD_(NTSTATUS,ConnectOutput) \
81 ( THIS_ \
82 IN PMXF sinkMXF \
83 ) PURE; \
84 STDMETHOD_(NTSTATUS,DisconnectOutput) \
85 ( THIS_ \
86 IN PMXF sinkMXF \
87 ) PURE;
88
89 #define IMP_IMXF \
90 STDMETHODIMP_(NTSTATUS) SetState \
91 ( \
92 IN KSSTATE State \
93 ); \
94 STDMETHODIMP_(NTSTATUS) PutMessage \
95 ( THIS_ \
96 IN PDMUS_KERNEL_EVENT pDMKEvt \
97 ); \
98 STDMETHODIMP_(NTSTATUS) ConnectOutput \
99 ( THIS_ \
100 IN PMXF sinkMXF \
101 ); \
102 STDMETHODIMP_(NTSTATUS) DisconnectOutput \
103 ( THIS_ \
104 IN PMXF sinkMXF \
105 )
106
107
108 DECLARE_INTERFACE_(IMXF,IUnknown)
109 {
110 DEFINE_ABSTRACT_UNKNOWN()
111
112 DEFINE_ABSTRACT_IMXF()
113 };
114
115 /* ===============================================================
116 IAllocatorMXF Interface
117 */
118
119 #undef INTERFACE
120 #define INTERFACE IAllocatorMXF
121
122 struct IAllocatorMXF;
123 typedef struct IAllocatorMXF *PAllocatorMXF;
124
125 #define STATIC_IID_IAllocatorMXF\
126 0xa5f0d62c, 0xb30f, 0x11d2, 0xb7, 0xa3, 0x00, 0x60, 0x08, 0x33, 0x16, 0xc1
127 DEFINE_GUIDSTRUCT("a5f0d62c-b30f-11d2-b7a3-0060083316c1", IID_IAllocatorMXF);
128 #define IID_IAllocatorMXF DEFINE_GUIDNAMED(IID_IAllocatorMXF)
129
130
131 DECLARE_INTERFACE_(IAllocatorMXF, IMXF)
132 {
133 DEFINE_ABSTRACT_UNKNOWN()
134
135 DEFINE_ABSTRACT_IMXF()
136
137 STDMETHOD_(NTSTATUS,GetMessage)(THIS_
138 OUT PDMUS_KERNEL_EVENT * ppDMKEvt
139 ) PURE;
140
141 STDMETHOD_(USHORT,GetBufferSize)(THIS) PURE;
142
143 STDMETHOD_(NTSTATUS,GetBuffer)(THIS_
144 OUT PBYTE * ppBuffer
145 )PURE;
146
147 STDMETHOD_(NTSTATUS,PutBuffer)(THIS_
148 IN PBYTE pBuffer
149 ) PURE;
150 };
151
152 #define IMP_IAllocatorMXF \
153 IMP_IMXF; \
154 STDMETHODIMP_(NTSTATUS) GetMessage( \
155 OUT PDMUS_KERNEL_EVENT * ppDMKEvt \
156 ); \
157 \
158 STDMETHODIMP_(USHORT) GetBufferSize(void); \
159 \
160 STDMETHODIMP_(NTSTATUS) GetBuffer( \
161 OUT PBYTE * ppBuffer \
162 ); \
163 \
164 STDMETHODIMP_(NTSTATUS) PutBuffer( \
165 IN PBYTE pBuffer \
166 )
167
168 #undef INTERFACE
169 #define INTERFACE IPortDMus
170
171 DEFINE_GUID(IID_IPortDMus, 0xc096df9c, 0xfb09, 0x11d1, 0x81, 0xb0, 0x00, 0x60, 0x08, 0x33, 0x16, 0xc1);
172 DEFINE_GUID(CLSID_PortDMus, 0xb7902fe9, 0xfb0a, 0x11d1, 0x81, 0xb0, 0x00, 0x60, 0x08, 0x33, 0x16, 0xc1);
173
174 DECLARE_INTERFACE_(IPortDMus, IPort)
175 {
176 DEFINE_ABSTRACT_UNKNOWN()
177
178 DEFINE_ABSTRACT_PORT()
179
180 STDMETHOD_(void,Notify)(THIS_
181 IN PSERVICEGROUP ServiceGroup OPTIONAL
182 )PURE;
183
184 STDMETHOD_(void,RegisterServiceGroup)(THIS_
185 IN PSERVICEGROUP ServiceGroup
186 ) PURE;
187 };
188 typedef IPortDMus *PPORTDMUS;
189
190 #define IMP_IPortDMus \
191 IMP_IPort; \
192 STDMETHODIMP_(void) Notify( \
193 IN PSERVICEGROUP ServiceGroup OPTIONAL \
194 ); \
195 \
196 STDMETHODIMP_(void) RegisterServiceGroup( \
197 IN PSERVICEGROUP ServiceGroup \
198 )
199
200 #undef INTERFACE
201 #define INTERFACE IMiniportDMus
202
203 DEFINE_GUID(IID_IMiniportDMus, 0xc096df9d, 0xfb09, 0x11d1, 0x81, 0xb0, 0x00, 0x60, 0x08, 0x33, 0x16, 0xc1);
204 DECLARE_INTERFACE_(IMiniportDMus, IMiniport)
205 {
206 DEFINE_ABSTRACT_UNKNOWN()
207
208 DEFINE_ABSTRACT_MINIPORT()
209
210
211 STDMETHOD_(NTSTATUS,Init)(THIS_
212 IN PUNKNOWN UnknownAdapter,
213 IN PRESOURCELIST ResourceList,
214 IN PPORTDMUS Port,
215 OUT PSERVICEGROUP * ServiceGroup
216 ) PURE;
217
218 STDMETHOD_(void,Service)(THIS) PURE;
219
220 STDMETHOD_(NTSTATUS,NewStream)(THIS_
221 OUT PMXF * MXF,
222 IN PUNKNOWN OuterUnknown OPTIONAL,
223 IN POOL_TYPE PoolType,
224 IN ULONG PinID,
225 IN DMUS_STREAM_TYPE StreamType,
226 IN PKSDATAFORMAT DataFormat,
227 OUT PSERVICEGROUP * ServiceGroup,
228 IN PAllocatorMXF AllocatorMXF,
229 IN PMASTERCLOCK MasterClock,
230 OUT PULONGLONG SchedulePreFetch
231 ) PURE;
232 };
233
234 typedef IMiniportDMus *PMINIPORTDMUS;
235 #undef INTERFACE
236
237 #define IMP_IMiniportDMus \
238 IMP_IMiniport; \
239 STDMETHODIMP_(NTSTATUS) Init( \
240 IN PUNKNOWN UnknownAdapter, \
241 IN PRESOURCELIST ResourceList, \
242 IN PPORTDMUS Port, \
243 OUT PSERVICEGROUP * ServiceGroup \
244 ); \
245 \
246 STDMETHODIMP_(void) Service(THIS); \
247 \
248 STDMETHODIMP_(NTSTATUS) NewStream( \
249 OUT PMXF * MXF, \
250 IN PUNKNOWN OuterUnknown, \
251 IN POOL_TYPE PoolType, \
252 IN ULONG PinID, \
253 IN DMUS_STREAM_TYPE StreamType, \
254 IN PKSDATAFORMAT DataFormat, \
255 OUT PSERVICEGROUP * ServiceGroup, \
256 IN PAllocatorMXF AllocatorMXF, \
257 IN PMASTERCLOCK MasterClock, \
258 OUT PULONGLONG SchedulePreFetch \
259 )
260
261 #endif