IDeviceTopology.cs 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. // -----------------------------------------
  2. // SoundScribe (TM) and related software.
  3. //
  4. // Copyright (C) 2007-2011 Vannatech
  5. // http://www.vannatech.com
  6. // All rights reserved.
  7. //
  8. // This source code is subject to the MIT License.
  9. // http://www.opensource.org/licenses/mit-license.php
  10. //
  11. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  15. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  16. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  17. // THE SOFTWARE.
  18. // -----------------------------------------
  19. using System;
  20. using System.Runtime.InteropServices;
  21. namespace Vannatech.CoreAudio.Interfaces
  22. {
  23. /// <summary>
  24. /// Provides access to the topology of an audio device.
  25. /// </summary>
  26. /// <remarks>
  27. /// MSDN Reference: http://msdn.microsoft.com/en-us/library/dd371376.aspx
  28. /// </remarks>
  29. public partial interface IDeviceTopology
  30. {
  31. /// <summary>
  32. /// Gets the number of connectors in the device-topology object.
  33. /// </summary>
  34. /// <param name="count">Receives the connector count.</param>
  35. /// <returns>An HRESULT code indicating whether the operation succeeded of failed.</returns>
  36. [PreserveSig]
  37. int GetConnectorCount(
  38. [Out] [MarshalAs(UnmanagedType.U4)] out UInt32 count);
  39. /// <summary>
  40. /// Gets the connector that is specified by a connector number.
  41. /// </summary>
  42. /// <param name="index">The zero-based index of the connector.</param>
  43. /// <param name="connector">Receives the <see cref="IConnector"/> interface of the connector object.</param>
  44. /// <returns>An HRESULT code indicating whether the operation succeeded of failed.</returns>
  45. [PreserveSig]
  46. int GetConnector(
  47. [In] [MarshalAs(UnmanagedType.U4)] UInt32 index,
  48. [Out] [MarshalAs(UnmanagedType.Interface)] out IConnector connector);
  49. /// <summary>
  50. /// Gets the number of subunits in the device topology.
  51. /// </summary>
  52. /// <param name="subunitCount">Receives the subunit count.</param>
  53. /// <returns>An HRESULT code indicating whether the operation succeeded of failed.</returns>
  54. [PreserveSig]
  55. int GetSubunitCount(
  56. [Out] [MarshalAs(UnmanagedType.U4)] out UInt32 subunitCount);
  57. /// <summary>
  58. /// Gets the subunit that is specified by a subunit number.
  59. /// </summary>
  60. /// <param name="subunitIndex">The zero-based index of the subunit.</param>
  61. /// <param name="subunit">Receives the <see cref="ISubunit"/> interface of the object.</param>
  62. /// <returns>An HRESULT code indicating whether the operation succeeded of failed.</returns>
  63. [PreserveSig]
  64. int GetSubunit(
  65. [In] [MarshalAs(UnmanagedType.U4)] UInt32 subunitIndex,
  66. [Out] [MarshalAs(UnmanagedType.Interface)] out ISubunit subunit);
  67. /// <summary>
  68. /// Gets a part that is identified by its local ID.
  69. /// </summary>
  70. /// <param name="partId">The ID of the part to get.</param>
  71. /// <param name="part">Receives the <see cref="IPart"/> interface of the part object.</param>
  72. /// <returns>An HRESULT code indicating whether the operation succeeded of failed.</returns>
  73. [PreserveSig]
  74. int GetPartById(
  75. [In] [MarshalAs(UnmanagedType.U4)] UInt32 partId,
  76. [Out] [MarshalAs(UnmanagedType.Interface)] out IPart part);
  77. /// <summary>
  78. /// Gets the device identifier of the device that is represented by the device-topology object.
  79. /// </summary>
  80. /// <param name="deviceId">Receives a string containing the device ID.</param>
  81. /// <returns>An HRESULT code indicating whether the operation succeeded of failed.</returns>
  82. [PreserveSig]
  83. int GetDeviceId(
  84. [Out] [MarshalAs(UnmanagedType.LPWStr)] out string deviceId);
  85. /// <summary>
  86. /// Gets a list of parts in the signal path that links two parts, if the path exists.
  87. /// </summary>
  88. /// <param name="partFrom">The part at the beginning of the signal path.</param>
  89. /// <param name="partTo">The part at the end of the signal path.</param>
  90. /// <param name="rejectMixedPaths">Specifies whether to reject paths that contain mixed data.</param>
  91. /// <param name="partList">Receives an <see cref="IPartsList"/> interface instance.</param>
  92. /// <returns>An HRESULT code indicating whether the operation succeeded of failed.</returns>
  93. [PreserveSig]
  94. int GetSignalPath(
  95. [In] [MarshalAs(UnmanagedType.Interface)] IPart partFrom,
  96. [In] [MarshalAs(UnmanagedType.Interface)] IPart partTo,
  97. [In] [MarshalAs(UnmanagedType.Bool)] bool rejectMixedPaths,
  98. [Out] [MarshalAs(UnmanagedType.Interface)] out IPartsList partList);
  99. }
  100. }