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