IConnector.cs 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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. using Vannatech.CoreAudio.Enumerations;
  22. namespace Vannatech.CoreAudio.Interfaces
  23. {
  24. /// <summary>
  25. /// Represents a point of connection between components.
  26. /// </summary>
  27. /// <remarks>
  28. /// MSDN Reference: http://msdn.microsoft.com/en-us/library/dd371048.aspx
  29. /// </remarks>
  30. public partial interface IConnector
  31. {
  32. /// <summary>
  33. /// Gets the type of this connector.
  34. /// </summary>
  35. /// <param name="connectorType">Receives the connector type.</param>
  36. /// <returns>An HRESULT code indicating whether the operation succeeded of failed.</returns>
  37. [PreserveSig]
  38. int GetType(
  39. [Out] [MarshalAs(UnmanagedType.I4)] out ConnectorType connectorType);
  40. /// <summary>
  41. /// Gets the direction of data flow through this connector.
  42. /// </summary>
  43. /// <param name="dataFlow">Receives the data-flow direction.</param>
  44. /// <returns>An HRESULT code indicating whether the operation succeeded of failed.</returns>
  45. [PreserveSig]
  46. int GetDataFlow(
  47. [Out] [MarshalAs(UnmanagedType.I4)] out DataFlow dataFlow);
  48. /// <summary>
  49. /// Connects this connector to a connector in another device topology object.
  50. /// </summary>
  51. /// <param name="connector">The connector in the other device topology.</param>
  52. /// <returns>An HRESULT code indicating whether the operation succeeded of failed.</returns>
  53. [PreserveSig]
  54. int ConnectTo(
  55. [In] [MarshalAs(UnmanagedType.Interface)] IConnector connector);
  56. /// <summary>
  57. /// Disconnects this connector from another connector.
  58. /// </summary>
  59. /// <returns>An HRESULT code indicating whether the operation succeeded of failed.</returns>
  60. [PreserveSig]
  61. int Disconnect();
  62. /// <summary>
  63. /// Indicates whether this connector is connected to another connector.
  64. /// </summary>
  65. /// <param name="isConnected">Receives the connection state.</param>
  66. /// <returns>An HRESULT code indicating whether the operation succeeded of failed.</returns>
  67. [PreserveSig]
  68. int IsConnected(
  69. [Out] [MarshalAs(UnmanagedType.Bool)] out bool isConnected);
  70. /// <summary>
  71. /// Gets the connector to which this connector is connected.
  72. /// </summary>
  73. /// <param name="connector">Receives the connector that the current object is connected to.</param>
  74. /// <returns>An HRESULT code indicating whether the operation succeeded of failed.</returns>
  75. [PreserveSig]
  76. int GetConnectedTo(
  77. [Out] [MarshalAs(UnmanagedType.Interface)] out IConnector connector);
  78. /// <summary>
  79. /// Gets the global ID of the connector, if any, that this connector is connected to.
  80. /// </summary>
  81. /// <param name="connectorId">Receives the other connectors ID.</param>
  82. /// <returns>An HRESULT code indicating whether the operation succeeded of failed.</returns>
  83. [PreserveSig]
  84. int GetConnectorIdConnectedTo(
  85. [Out] [MarshalAs(UnmanagedType.LPWStr)] out string connectorId);
  86. /// <summary>
  87. /// Gets the device identifier of the audio device, if any, that this connector is connected to.
  88. /// </summary>
  89. /// <param name="deviceId">Receives a string that contains the device identifier of the connected device.</param>
  90. /// <returns>An HRESULT code indicating whether the operation succeeded of failed.</returns>
  91. [PreserveSig]
  92. int GetDeviceIdConnectedTo(
  93. [Out] [MarshalAs(UnmanagedType.LPWStr)] out string deviceId);
  94. }
  95. }