// ----------------------------------------- // SoundScribe (TM) and related software. // // Copyright (C) 2007-2011 Vannatech // http://www.vannatech.com // All rights reserved. // // This source code is subject to the MIT License. // http://www.opensource.org/licenses/mit-license.php // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // ----------------------------------------- using System; using System.Runtime.InteropServices; namespace Vannatech.CoreAudio.Interfaces { /// /// Enables an application to manage submixes for the audio device. /// /// /// MSDN Reference: http://msdn.microsoft.com/en-us/library/dd370950.aspx /// public partial interface IAudioSessionManager2 { // Note: We can't derive from IAudioSessionControl, as that will produce the wrong vtable. #region IAudioSessionManager Methods /// /// Retrieves an audio session control. /// /// A new or existing session ID. /// Audio session flags. /// Receives an interface for the audio session. /// An HRESULT code indicating whether the operation succeeded of failed. [PreserveSig] int GetAudioSessionControl( [In, Optional] [MarshalAs(UnmanagedType.LPStruct)] Guid sessionId, [In] [MarshalAs(UnmanagedType.U4)] UInt32 streamFlags, [Out] [MarshalAs(UnmanagedType.Interface)] out IAudioSessionControl sessionControl); /// /// Retrieves a simple audio volume control. /// /// A new or existing session ID. /// Audio session flags. /// Receives an interface for the audio session. /// An HRESULT code indicating whether the operation succeeded of failed. [PreserveSig] int GetSimpleAudioVolume( [In, Optional] [MarshalAs(UnmanagedType.LPStruct)] Guid sessionId, [In] [MarshalAs(UnmanagedType.U4)] UInt32 streamFlags, [Out] [MarshalAs(UnmanagedType.Interface)] out ISimpleAudioVolume audioVolume); #endregion /// /// Gets a pointer to the audio session enumerator object used to enumerate sessions. /// /// Receives the session enumerator object that the client can use to enumerate audio sessions on the audio device. /// An HRESULT code indicating whether the operation succeeded of failed. [PreserveSig] int GetSessionEnumerator( [Out] [MarshalAs(UnmanagedType.Interface)] out IAudioSessionEnumerator sessionList); /// /// Registers the application to receive a notification when a session is created. /// /// The client to be called when session events are raised. /// An HRESULT code indicating whether the operation succeeded of failed. [PreserveSig] int RegisterSessionNotification( [In] IAudioSessionNotification client); /// /// Deletes the registration to receive a notification when a session is created. /// /// Removes the client from the callback list for session events. /// An HRESULT code indicating whether the operation succeeded of failed. [PreserveSig] int UnregisterSessionNotification( [In] IAudioSessionNotification client); /// /// Registers the application to receive ducking notifications. /// /// A session instance identifier. /// The client to be called when ducking events are raised. /// An HRESULT code indicating whether the operation succeeded of failed. [PreserveSig] int RegisterDuckNotification( [In] [MarshalAs(UnmanagedType.LPWStr)] string sessionId, [In] IAudioVolumeDuckNotification client); /// /// Deletes the registration to receive ducking notifications. /// /// Removes the client from the callback list for ducking events. /// An HRESULT code indicating whether the operation succeeded of failed. [PreserveSig] int UnregisterDuckNotification( [In] IAudioVolumeDuckNotification client); } }