IMMNotificationClient.cs 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. using Vannatech.CoreAudio.Externals;
  23. using Vannatech.CoreAudio.Constants;
  24. namespace Vannatech.CoreAudio.Interfaces
  25. {
  26. /// <summary>
  27. /// Provides notifications when an audio endpoint device is added or removed, when the state
  28. /// or properties of a device change, or when there is a change in the default role assigned to a device.
  29. /// </summary>
  30. /// <remarks>
  31. /// MSDN Reference: http://msdn.microsoft.com/en-us/library/dd371417.aspx
  32. /// </remarks>
  33. public partial interface IMMNotificationClient
  34. {
  35. /// <summary>
  36. /// Notifies the client that the default audio endpoint device for a particular role has changed.
  37. /// </summary>
  38. /// <param name="deviceId">The endpoint ID string that identifies the audio endpoint device.</param>
  39. /// <param name="newState">The <see cref="DEVICE_STATE_XXX"/> constant that indicates the new state.</param>
  40. void OnDeviceStateChanged(
  41. [MarshalAs(UnmanagedType.LPWStr)] string deviceId,
  42. [MarshalAs(UnmanagedType.U4)] UInt32 newState);
  43. /// <summary>
  44. /// Indicates that a new audio endpoint device has been added.
  45. /// </summary>
  46. /// <param name="deviceId">The endpoint ID string that identifies the audio endpoint device.</param>
  47. void OnDeviceAdded(
  48. [MarshalAs(UnmanagedType.LPWStr)] string deviceId);
  49. /// <summary>
  50. /// Indicates that an audio endpoint device has been removed.
  51. /// </summary>
  52. /// <param name="deviceId">The endpoint ID string that identifies the audio endpoint device.</param>
  53. void OnDeviceRemoved(
  54. [MarshalAs(UnmanagedType.LPWStr)] string deviceId);
  55. /// <summary>
  56. /// Notifies the client that the default audio endpoint device for a particular role has changed.
  57. /// </summary>
  58. /// <param name="dataFlow">The data-flow direction of the endpoint device.</param>
  59. /// <param name="deviceRole">The device role of the audio endpoint device.</param>
  60. /// <param name="defaultDeviceId">The endpoint ID string that identifies the audio endpoint device.</param>
  61. void OnDefaultDeviceChanged(
  62. [MarshalAs(UnmanagedType.I4)] EDataFlow dataFlow,
  63. [MarshalAs(UnmanagedType.I4)] ERole deviceRole,
  64. [MarshalAs(UnmanagedType.LPWStr)] string defaultDeviceId);
  65. /// <summary>
  66. /// Indicates that the value of a property belonging to an audio endpoint device has changed.
  67. /// </summary>
  68. /// <param name="deviceId">The endpoint ID string that identifies the audio endpoint device.</param>
  69. /// <param name="propertyKey">A <see cref="PROPERTYKEY"/> that specifies the type of property.</param>
  70. void OnPropertyValueChanged(
  71. [MarshalAs(UnmanagedType.LPWStr)] string deviceId, PROPERTYKEY propertyKey);
  72. }
  73. }