IDeviceSpecificProperty.cs 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 control value of a device-specific hardware control.
  25. /// </summary>
  26. /// <remarks>
  27. /// MSDN Reference: http://msdn.microsoft.com/en-us/library/dd371121.aspx
  28. /// </remarks>
  29. public partial interface IDeviceSpecificProperty
  30. {
  31. /// <summary>
  32. /// Gets the data type of the device-specific property.
  33. /// </summary>
  34. /// <param name="dataType">Receives the data type of the device-specific property value.</param>
  35. /// <returns>An HRESULT code indicating whether the operation succeeded of failed.</returns>
  36. [PreserveSig]
  37. int GetType(
  38. [Out] [MarshalAs(UnmanagedType.SysInt)] out IntPtr dataType); // TODO: Fix this, C++ is (VARTYPE *)
  39. /// <summary>
  40. /// Gets the value of the device-specific property.
  41. /// </summary>
  42. /// <param name="propertyValue">Receives the property value.</param>
  43. /// <param name="propertySize">Sends the size in bytes of the property value, then receives the actual size of the property value written to the buffer.</param>
  44. /// <returns>An HRESULT code indicating whether the operation succeeded of failed.</returns>
  45. [PreserveSig]
  46. int GetValue(
  47. [Out] [MarshalAs(UnmanagedType.SysInt)] out IntPtr propertyValue,
  48. [In, Out] [MarshalAs(UnmanagedType.U4)] ref UInt32 propertySize);
  49. /// <summary>
  50. /// Sets the value of the device-specific property.
  51. /// </summary>
  52. /// <param name="propertyValue">The property value.</param>
  53. /// <param name="propertySize">The property value size.</param>
  54. /// <param name="eventContext">A user context value that is passed to the notification callback.</param>
  55. /// <returns>An HRESULT code indicating whether the operation succeeded of failed.</returns>
  56. [PreserveSig]
  57. int SetValue(
  58. [In] [MarshalAs(UnmanagedType.SysInt)] IntPtr propertyValue,
  59. [In] [MarshalAs(UnmanagedType.U4)] UInt32 propertySize,
  60. [In, Optional] [MarshalAs(UnmanagedType.LPStruct)] Guid eventContext);
  61. /// <summary>
  62. /// Gets the 4-byte range of the device-specific property.
  63. /// </summary>
  64. /// <param name="propertyMin">Receives the minimum property value.</param>
  65. /// <param name="propertyMax">Receives the maximum property value.</param>
  66. /// <param name="propertyInc">Receives the stepping value between consecutive property values in the range.</param>
  67. /// <returns>An HRESULT code indicating whether the operation succeeded of failed.</returns>
  68. [PreserveSig]
  69. int Get4BRange(
  70. [Out] [MarshalAs(UnmanagedType.I4)] out Int32 propertyMin,
  71. [Out] [MarshalAs(UnmanagedType.I4)] out Int32 propertyMax,
  72. [Out] [MarshalAs(UnmanagedType.I4)] out Int32 propertyInc);
  73. }
  74. }