IAudioSessionManager.cs 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. /// Enables a client to access the session controls and volume controls for both cross-process and process-specific audio sessions.
  25. /// </summary>
  26. /// <remarks>
  27. /// MSDN Reference: http://msdn.microsoft.com/en-us/library/dd370948.aspx
  28. /// </remarks>
  29. public partial interface IAudioSessionManager
  30. {
  31. // Note: Any changes to this interface should be repeated in IAudioSessionManager2.
  32. /// <summary>
  33. /// Retrieves an audio session control.
  34. /// </summary>
  35. /// <param name="sessionId">A new or existing session ID.</param>
  36. /// <param name="streamFlags">Audio session flags.</param>
  37. /// <param name="sessionControl">Receives an <see cref="IAudioSessionControl"/> interface for the audio session.</param>
  38. /// <returns>An HRESULT code indicating whether the operation succeeded of failed.</returns>
  39. [PreserveSig]
  40. int GetAudioSessionControl(
  41. [In, Optional] [MarshalAs(UnmanagedType.LPStruct)] Guid sessionId,
  42. [In] [MarshalAs(UnmanagedType.U4)] UInt32 streamFlags,
  43. [Out] [MarshalAs(UnmanagedType.Interface)] out IAudioSessionControl sessionControl);
  44. /// <summary>
  45. /// Retrieves a simple audio volume control.
  46. /// </summary>
  47. /// <param name="sessionId">A new or existing session ID.</param>
  48. /// <param name="streamFlags">Audio session flags.</param>
  49. /// <param name="audioVolume">Receives an <see cref="ISimpleAudioVolume"/> interface for the audio session.</param>
  50. /// <returns>An HRESULT code indicating whether the operation succeeded of failed.</returns>
  51. [PreserveSig]
  52. int GetSimpleAudioVolume(
  53. [In, Optional] [MarshalAs(UnmanagedType.LPStruct)] Guid sessionId,
  54. [In] [MarshalAs(UnmanagedType.U4)] UInt32 streamFlags,
  55. [Out] [MarshalAs(UnmanagedType.Interface)] out ISimpleAudioVolume audioVolume);
  56. }
  57. }