devicetopology.idl 15 KB

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