wined3d: Don't depend on device internals in fragment_pipeline.alloc_private().
[wine] / include / devicetopology.idl
1 /*
2  * Core Audio device topology definitions
3  *
4  * Copyright 2009 Maarten Lankhorst
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  *
20  */
21
22 interface IPart;
23 interface IControlInterface;
24 interface IDeviceTopology;
25 interface IControlChangeNotify;
26
27 import "oaidl.idl";
28 import "ocidl.idl";
29 import "propidl.idl";
30
31 cpp_quote("#ifndef E_NOTFOUND")
32 cpp_quote("#define E_NOTFOUND HRESULT_FROM_WIN32(ERROR_NOT_FOUND)")
33 cpp_quote("#endif")
34
35 cpp_quote("#define DEVTOPO_HARDWARE_INITIATED_EVENTCONTEXT 0x64726148 /* 'draH' */")
36 cpp_quote("DEFINE_GUID(EVENTCONTEXT_VOLUMESLIDER, 0xe2c2e9de, 0x09b1, 0x4b04,0x84,0xe5, 0x07, 0x93, 0x12, 0x25, 0xee, 0x04);")
37
38 cpp_quote("#define _IKsControl_")
39 cpp_quote("#include <ks.h>")
40 cpp_quote("#include <ksmedia.h>")
41 cpp_quote("#ifndef _KS_")
42
43 typedef struct {
44     ULONG FormatSize;
45     ULONG Flags;
46     ULONG SampleSize;
47     ULONG Reserved;
48     GUID MajorFormat;
49     GUID SubFormat;
50     GUID Specifier;
51 } KSDATAFORMAT;
52
53 typedef KSDATAFORMAT *PKSDATAFORMAT;
54
55 typedef struct
56 {
57     union
58     {
59         struct {
60             GUID Set;
61             ULONG Id;
62             ULONG Flags;
63         };
64         LONGLONG Alignment;
65     };
66 } KSIDENTIFIER;
67
68 typedef KSIDENTIFIER KSPROPERTY, *PKSPROPERTY;
69 typedef KSIDENTIFIER KSMETHOD, *PKSMETHOD;
70 typedef KSIDENTIFIER KSEVENT, *PKSEVENT;
71
72 typedef enum
73 {
74     eConnTypeUnknown = 0,
75     eConnType3Point5mm,
76     eConnTypeQuarter,
77     eConnTypeAtapiInternal,
78     eConnTypeRCA,
79     eConnTypeOptical,
80     eConnTypeOtherDigital,
81     eConnTypeOtherAnalog,
82     eConnTypeMultichannelAnalogDIN,
83     eConnTypeXlrProfessional,
84     eConnTypeRj11Modem,
85     eConnTypeCombination
86 } EPcxConnectionType;
87
88 typedef enum
89 {
90     eGeoLocRear = 1,
91     eGeoLocFront,
92     eGeoLocLeft,
93     eGeoLocRight,
94     eGeoLocTop,
95     eGeoLocBottom,
96     eGeoLocRearPanel,
97     eGeoLocRiser,
98     eGeoLocInsideMobileLid,
99     eGeoLocDrivebay,
100     eGeoLocHDMI,
101     eGeoLocOutsideMobileLid,
102     eGeoLocATAPI,
103     eGeoLocReserved5,
104     eGeoLocReserved6
105 } EPcxGeoLocation;
106
107 typedef enum
108 {
109     eGenLocPrimaryBox = 0,
110     eGenLocInternal,
111     eGenLocSeparate,
112     eGenLocOther
113 } EPcxGenLocation;
114
115 typedef enum
116 {
117     ePortConnJack = 0,
118     ePortConnIntegratedDevice,
119     ePortConnBothIntegratedAndJack,
120     ePortConnUnknown
121 } EPxcPortConnection;
122
123 typedef struct
124 {
125     DWORD ChannelMapping;
126     COLORREF Color;
127     EPcxConnectionType ConnectionType;
128     EPcxGeoLocation GeoLocation;
129     EPcxGenLocation GenLocation;
130     EPxcPortConnection PortConnection;
131     BOOL IsConnected;
132 } KSJACK_DESCRIPTION;
133
134 typedef KSJACK_DESCRIPTION *PKSJACK_DESCRIPTION;
135
136 typedef struct _LUID
137 {
138     DWORD LowPart;
139     LONG HighPart;
140 } LUID;
141
142 typedef struct _LUID *PLUID;
143
144 typedef enum
145 {
146     KSJACK_SINK_CONNECTIONTYPE_HDMI = 0,
147     KSJACK_SINK_CONNECTIONTYPE_DISPLAYPORT
148 } KSJACK_SINK_CONNECTIONTYPE;
149
150 typedef struct _tagKSJACK_SINK_INFORMATION
151 {
152     KSJACK_SINK_CONNECTIONTYPE ConnType;
153     WORD ManufacturerId;
154     WORD ProductId;
155     WORD AudioLatency;
156     BOOL HDCPCapable;
157     BOOL AICapable;
158     UCHAR SinkDescriptionLength;
159     WCHAR SinkDescription[32];
160     LUID PortId;
161 } KSJACK_SINK_INFORMATION;
162
163 typedef struct _tagKSJACK_DESCRIPTION2
164 {
165     DWORD DeviceStateInfo;
166     DWORD JackCapabilities;
167 } KSJACK_DESCRIPTION2;
168
169 typedef struct _tagKSJACK_DESCRIPTION2 *PKSJACK_DESCRIPTION2;
170
171 cpp_quote("#endif")
172
173 typedef enum
174 {
175     In = 0,
176     Out
177 } DataFlow;
178
179 typedef enum
180 {
181     Connector = 0,
182     Subunit
183 } PartType;
184
185 typedef enum
186 {
187     Unknown_Connector = 0,
188     Physical_Internal,
189     Physical_External,
190     Software_IO,
191     Software_Fixed,
192     Network
193 } ConnectorType;
194
195 [
196     pointer_default(unique),
197     nonextensible,
198     uuid(28f54685-06fd-11d2-b27a-00a0c9223196),
199     local,
200     object
201 ]
202 interface IKsControl : IUnknown
203 {
204     HRESULT KsProperty(
205         [in] PKSPROPERTY Property,
206         [in] ULONG PropertyLength,
207         [in,out] void *PropertyData,
208         [in] ULONG DataLength,
209         [out] ULONG *BytesReturned
210     );
211     HRESULT KsMethod(
212         [in] PKSMETHOD Method,
213         [in] ULONG MethodLength,
214         [in,out] void *MethodData,
215         [in] ULONG DataLength,
216         [out] ULONG *BytesReturned
217     );
218     HRESULT KsEvent(
219         [in] PKSEVENT Event,
220         [in] ULONG EventLength,
221         [in,out] void *EventData,
222         [in] ULONG DataLength,
223         [out] ULONG *BytesReturned
224     );
225 }
226
227 [
228     pointer_default(unique),
229     nonextensible,
230     uuid(c2f8e001-f205-4bc9-99bc-c13b1e048ccb),
231     local,
232     object
233 ]
234 interface IPerChannelDbLevel : IUnknown
235 {
236     HRESULT GetChannelCount(
237         [out] UINT *pcChannels
238     );
239     HRESULT GetLevelRange(
240         [in] UINT nChannel,
241         [out] float *pfMinLevelDB,
242         [out] float *pfMaxLevelDB,
243         [out] float *pfStepping
244     );
245     HRESULT GetLevel(
246         [in] UINT nChannel,
247         [out] float *pfLevelDB
248     );
249     HRESULT SetLevel(
250         [in] UINT nChannel,
251         [in] float fLevelDB,
252         [in,unique] LPCGUID pguidEventContext
253     );
254     HRESULT SetLevelUniform(
255         [in] float fLevelDB,
256         [in,unique] LPCGUID pguidEventContext
257     );
258     HRESULT SetLevelAllChannels(
259         [size_is(cChannels),in] float *aLevelsDB,
260         [in] ULONG cChannels,
261         [in] LPCGUID pguidEventContext
262     );
263 }
264
265 [
266     pointer_default(unique),
267     nonextensible,
268     uuid(7fb7b48f-531d-44a2-bcb3-5ad5a134b3dc),
269     local,
270     object
271 ]
272 interface IAudioVolumeLevel : IPerChannelDbLevel
273 {
274     /* Empty */
275 }
276
277 [
278     pointer_default(unique),
279     nonextensible,
280     uuid(bb11c46f-ec28-493c-b88a-5db88062ce98),
281     local,
282     object
283 ]
284 interface IAudioChannelConfig : IUnknown
285 {
286     HRESULT SetChannelConfig(
287         [in] DWORD dwConfig,
288         [in] LPCGUID pguidEventContext
289     );
290     HRESULT GetChannelConfig(
291         [in] DWORD dwConfig,
292         [retval,out] DWORD *pdwConfig
293     );
294 }
295
296 [
297     pointer_default(unique),
298     nonextensible,
299     uuid(7d8b1437-dd53-4350-9c1b-1ee2890bf938),
300     local,
301     object
302 ]
303 interface IAudioLoudness : IUnknown
304 {
305     HRESULT GetEnabled(
306         [out] BOOL *pbEnabled
307     );
308     HRESULT SetEnabled(
309         [in] BOOL bEnabled,
310         [in] LPCGUID pguidEventContext
311     );
312 }
313
314 [
315     pointer_default(unique),
316     nonextensible,
317     uuid(4f03dc02-5e6e-4653-8f72-a030c123d598),
318     local,
319     object
320 ]
321 interface IAudioInputSelector : IUnknown
322 {
323     HRESULT GetSelection(
324         [out] UINT *pnIdSelected
325     );
326     HRESULT SetSelection(
327         [in] UINT nIdSelect,
328         [unique,in] LPCGUID pguidEventContext
329     );
330 }
331
332 [
333     pointer_default(unique),
334     nonextensible,
335     uuid(bb515f69-94a7-429e-8b9c-271b3f11a3ab),
336     local,
337     object
338 ]
339 interface IAudioOutputSelector : IUnknown
340 {
341     HRESULT GetSelection(
342         [out] UINT *pnIdSelected
343     );
344     HRESULT SetSelection(
345         [in] UINT nIdSelect,
346         [unique,in] LPCGUID pguidEventContext
347     );
348 }
349
350 [
351     pointer_default(unique),
352     nonextensible,
353     uuid(bb515f69-94a7-429e-8b9c-271b3f11a3ab),
354     local,
355     object
356 ]
357 interface IAudioMute : IUnknown
358 {
359     HRESULT SetMute(
360         [in] BOOL bMute,
361         [unique,in] LPCGUID pguidEventContext
362     );
363     HRESULT GetMute(
364         [out] BOOL *pbMute
365     );
366 }
367
368 [
369     pointer_default(unique),
370     nonextensible,
371     uuid(a2b1a1d9-4db3-425d-a2b2-bd335cb3e2e5),
372     local,
373     object
374 ]
375 interface IAudioBass : IPerChannelDbLevel
376 {
377     /* Empty */
378 }
379
380 [
381     pointer_default(unique),
382     nonextensible,
383     uuid(5e54b6d7-b44b-40d9-9a9e-e691d9ce6edf),
384     local,
385     object
386 ]
387 interface IAudioMidRange : IPerChannelDbLevel
388 {
389     /* Empty */
390 }
391
392 [
393     pointer_default(unique),
394     nonextensible,
395     uuid(0a717812-694e-4907-b74b-bafa5cfdca7b),
396     local,
397     object
398 ]
399 interface IAudioTreble : IPerChannelDbLevel
400 {
401     /* Empty */
402 }
403
404 [
405     pointer_default(unique),
406     nonextensible,
407     uuid(bb515f69-94a7-429e-8b9c-271b3f11a3ab),
408     local,
409     object
410 ]
411 interface IAudioAutoGainControl : IUnknown
412 {
413     HRESULT GetEnabled(
414         [in] BOOL bEnabled,
415         [unique,in] LPCGUID pguidEventContext
416     );
417     HRESULT GetMute(
418         [out] BOOL *pbEnabled
419     );
420 }
421
422 [
423     pointer_default(unique),
424     nonextensible,
425     uuid(dd79923c-0599-45e0-b8b6-c8df7db6e796),
426     local,
427     object
428 ]
429 interface IAudioPeakMeter : IUnknown
430 {
431     HRESULT GetChannelCount(
432         [out] UINT *pcChannels
433     );
434     HRESULT GetLevel(
435         [in] UINT nChannel,
436         [out] float *pfLevel
437     );
438 }
439
440 [
441     pointer_default(unique),
442     nonextensible,
443     uuid(3b22bcbf-2586-4af0-8583-205d391b807c),
444     local,
445     object
446 ]
447 interface IDeviceSpecificProperty : IUnknown
448 {
449     HRESULT GetType(
450         [out] VARTYPE *pVType
451     );
452     HRESULT GetValue(
453         [out] VARTYPE *pvType,
454         [out,in] DWORD *pcbValue
455     );
456     HRESULT SetValue(
457         [in] void *pvValue,
458         [in] DWORD cbValue,
459         [in] LPCGUID pguidEventContext
460     );
461     HRESULT Get4BRange(
462         [out] LONG *plMin,
463         [out] LONG *plMax,
464         [out] LONG *plStepping
465     );
466 }
467
468 [
469     pointer_default(unique),
470     nonextensible,
471     uuid(3cb4a69d-bb6f-4d2b-95b7-452d2c155db5),
472     local,
473     object
474 ]
475 interface IKsFormatSupport : IUnknown
476 {
477     HRESULT IsFormatSupported(
478         [size_is(cbFormat),in] PKSDATAFORMAT pKsFormat,
479         [in] DWORD cbFormat,
480         [out] BOOL *pbSupported
481     );
482     HRESULT GetDevicePreferredFormat(
483         [out] PKSDATAFORMAT *ppKsFormat
484     );
485 }
486
487 [
488     pointer_default(unique),
489     nonextensible,
490     uuid(4509f757-2d46-4637-8e62-ce7db944f57b),
491     local,
492     object
493 ]
494 interface IKsJackDescription : IUnknown
495 {
496     HRESULT GetJackCount(
497         [out] UINT *pcJacks
498     );
499     HRESULT GetJackDescription(
500         [in] UINT nJack,
501         [out] KSJACK_DESCRIPTION *pDescription
502     );
503 }
504
505 [
506     pointer_default(unique),
507     nonextensible,
508     uuid(478f3a9b-e0c9-4827-9228-6f5505ffe76a),
509     local,
510     object
511 ]
512 interface IKsJackDescription2 : IUnknown
513 {
514     HRESULT GetJackCount(
515         [out] UINT *pcJacks
516     );
517     HRESULT GetJackDescription2(
518         [in] UINT nJack,
519         [out] KSJACK_DESCRIPTION2 *pDescription2
520     );
521 }
522
523 [
524     pointer_default(unique),
525     nonextensible,
526     uuid(d9bd72ed-290f-4581-9ff3-61027a8fe532),
527     local,
528     object
529 ]
530 interface IKsJackSinkInformation : IUnknown
531 {
532     HRESULT GetJackSinkInformation(
533         [out] KSJACK_SINK_INFORMATION *pJackSinkInformation
534     );
535 }
536
537 [
538     pointer_default(unique),
539     nonextensible,
540     uuid(6daa848c-5eb0-45cc-aea5-998a2cda1ffb),
541     local,
542     object
543 ]
544 interface IPartsList : IUnknown
545 {
546     HRESULT GetCount(
547         [out] UINT *pCount
548     );
549     HRESULT GetPart(
550         [in] UINT nIndex,
551         [out] IPart **ppPart
552     );
553 }
554
555 [
556     pointer_default(unique),
557     nonextensible,
558     uuid(ae2de0e4-5bca-4f2d-aa46-5d13f8fdb3a9),
559     local,
560     object
561 ]
562 interface IPart : IUnknown
563 {
564     HRESULT GetName(
565         [out] LPWSTR *ppwstrName
566     );
567     HRESULT GetLocalId(
568         [out] UINT *pnId
569     );
570     HRESULT GetGlobalId(
571         [out] LPWSTR *ppwstrGlobalId
572     );
573     HRESULT GetPartType(
574         [out] PartType *pPartType
575     );
576     HRESULT GetSubType(
577         [out] GUID *pSubType
578     );
579     HRESULT GetControlInterfaceCount(
580         [out] UINT *pCount
581     );
582     HRESULT GetControlInterface(
583         [in] UINT nIndex,
584         [out] IControlInterface **ppInterfaceDesc
585     );
586     HRESULT EnumPartsIncoming(
587         [out] IPartsList **ppParts
588     );
589     HRESULT EnumPartsOutgoing(
590         [out] IPartsList **ppParts
591     );
592     HRESULT GetTopologyObjects(
593         [out] IDeviceTopology **ppTopology
594     );
595     HRESULT Activate(
596         [in] DWORD dwClsContext,
597         [in] REFIID refiid,
598         [iid_is(refiid),out] void **ppvObject
599     );
600     HRESULT RegisterControlChangeCallback(
601         [in] REFGUID riid,
602         [in] IControlChangeNotify *pNotify
603     );
604     HRESULT UnregisterControlChangeCallback(
605         [in] IControlChangeNotify *pNotify
606     );
607 };
608
609 [
610     pointer_default(unique),
611     nonextensible,
612     uuid(9c2c4058-23f5-41de-877a-df3af236a09e),
613     local,
614     object
615 ]
616 interface IConnector : IUnknown
617 {
618     HRESULT GetType(
619         [out] ConnectorType *pType
620     );
621     HRESULT GetDataFlow(
622         [out] DataFlow *pFlow
623     );
624     HRESULT ConnectTo(
625         [in] IConnector *pConnectTo
626     );
627     HRESULT Disconnect(void);
628     HRESULT IsConnected(
629         [out] BOOL *pbConnected
630     );
631     HRESULT GetConnectedTo(
632         [out] IConnector **ppConTo
633     );
634     HRESULT GetConnectorIdConnectedTo(
635         [out] LPWSTR *ppwstrConnectorId
636     );
637     HRESULT GetDeviceIdConnectedTo(
638         [out] LPWSTR *ppwstrDeviceId
639     );
640 }
641
642 [
643     pointer_default(unique),
644     nonextensible,
645     uuid(82149a85-dba6-4487-86bb-ea8f7fefcc71),
646     local,
647     object
648 ]
649 interface ISubUnit: IUnknown
650 {
651     /* Empty IUnknown interface.. */
652 }
653
654 [
655     pointer_default(unique),
656     nonextensible,
657     uuid(45d37c3f-5140-444a-ae24-400789f3cbf3),
658     local,
659     object
660 ]
661 interface IControlInterface : IUnknown
662 {
663     HRESULT GetName(
664         [out] LPWSTR *ppwstrName
665     );
666     HRESULT GetIID(
667         [out] GUID *pIID
668     );
669 }
670
671 [
672     pointer_default(unique),
673     nonextensible,
674     uuid(a09513ed-c709-4d21-bd7b-5f34c47f3947),
675     local,
676     object
677 ]
678 interface IControlChangeNotify : IUnknown
679 {
680     HRESULT OnNotify(
681         [in] DWORD dwSenderProcessId,
682         [in] LPCGUID ppguidEventContext
683     );
684 }
685
686 [
687     pointer_default(unique),
688     nonextensible,
689     uuid(2a07407e-6497-4a18-9787-32f79bd0d98f),
690     local,
691     object
692 ]
693 interface IDeviceTopology : IUnknown
694 {
695     HRESULT GetConnectorCount(
696         [out] UINT *pCount
697     );
698     HRESULT GetConnector(
699         [in] UINT nIndex,
700         [out] IConnector **ppConnector
701     );
702     HRESULT GetSubunitCount(
703         [out] UINT *pCount
704     );
705     HRESULT GetSubunit(
706         [in] UINT nIndex,
707         [out] ISubUnit **ppConnector
708     );
709     HRESULT GetPartById(
710         [in] UINT nId,
711         [out] IPart **ppPart
712     );
713     HRESULT GetDeviceId(
714         [out] LPWSTR *ppwstrDeviceId
715     );
716     HRESULT GetSignalPath(
717         [in] IPart *pIPartFrom,
718         [in] IPart *pIPartTo,
719         [in] BOOL bRejectMixedPaths,
720         [out] IPartsList **ppParts
721     );
722 }
723
724 [
725     version(1.0)
726 ]
727 library DevTopologyLib
728 {
729     [
730         uuid(1df639d0-5ec1-47aa-9379-828dc1aa8c59),
731     ]
732     coclass DeviceTopology
733     {
734         interface IDeviceTopology;
735     }
736 }