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