// ----------------------------------------- // 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; using Vannatech.CoreAudio.Enumerations; namespace Vannatech.CoreAudio.Interfaces { /// /// Provides notifications of session-related events such as changes in the volume level, display name, and session state. /// /// /// MSDN Reference: http://msdn.microsoft.com/en-us/library/dd368289.aspx /// public partial interface IAudioSessionEvents { /// /// Notifies the client that the display name for the session has changed. /// /// The new display name for the session. /// A user context value that is passed to the notification callback. /// An HRESULT code indicating whether the operation succeeded of failed. [PreserveSig] int OnDisplayNameChanged( [In] [MarshalAs(UnmanagedType.LPWStr)] string displayName, [In] ref Guid eventContext); /// /// Notifies the client that the display icon for the session has changed. /// /// The path for the new display icon for the session. /// A user context value that is passed to the notification callback. /// An HRESULT code indicating whether the operation succeeded of failed. [PreserveSig] int OnIconPathChanged( [In] [MarshalAs(UnmanagedType.LPWStr)] string iconPath, [In] ref Guid eventContext); /// /// Notifies the client that the volume level or muting state of the session has changed. /// /// The new volume level for the audio session. /// The new muting state. /// A user context value that is passed to the notification callback. /// An HRESULT code indicating whether the operation succeeded of failed. [PreserveSig] int OnSimpleVolumeChanged( [In] [MarshalAs(UnmanagedType.R4)] float volume, [In] [MarshalAs(UnmanagedType.Bool)] bool isMuted, [In] ref Guid eventContext); /// /// Notifies the client that the volume level of an audio channel in the session submix has changed. /// /// The channel count. /// An array of volumnes cooresponding with each channel index. /// The number of the channel whose volume level changed. /// A user context value that is passed to the notification callback. /// An HRESULT code indicating whether the operation succeeded of failed. [PreserveSig] int OnChannelVolumeChanged( [In] [MarshalAs(UnmanagedType.U4)] UInt32 channelCount, [In] [MarshalAs(UnmanagedType.SysInt)] IntPtr newVolumes, // Pointer to float array [In] [MarshalAs(UnmanagedType.U4)] UInt32 channelIndex, [In] ref Guid eventContext); /// /// Notifies the client that the grouping parameter for the session has changed. /// /// The new grouping parameter for the session. /// A user context value that is passed to the notification callback. /// An HRESULT code indicating whether the operation succeeded of failed. [PreserveSig] int OnGroupingParamChanged( [In] ref Guid groupingId, [In] ref Guid eventContext); /// /// Notifies the client that the stream-activity state of the session has changed. /// /// The new session state. /// An HRESULT code indicating whether the operation succeeded of failed. [PreserveSig] int OnStateChanged( [In] AudioSessionState state); /// /// Notifies the client that the session has been disconnected. /// /// The reason that the audio session was disconnected. /// An HRESULT code indicating whether the operation succeeded of failed. [PreserveSig] int OnSessionDisconnected( [In] AudioSessionDisconnectReason disconnectReason); } }