| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221 |
- // -----------------------------------------
- // 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
- {
- /// <summary>
- /// Represents the volume controls on the audio stream to or from an audio endpoint device.
- /// </summary>
- /// <remarks>
- /// MSDN Reference: http://msdn.microsoft.com/en-us/library/dd370892.aspx
- /// </remarks>
- public partial interface IAudioEndpointVolume
- {
- // Note: Any changes to this interface should be repeated in IAudioEndpointVolumeEx.
- /// <summary>
- /// Registers a client's notification callback interface.
- /// </summary>
- /// <param name="client">The <see cref="IAudioEndpointVolumeCallback"/> interface that is registering for notification callbacks.</param>
- /// <returns>An HRESULT code indicating whether the operation passed of failed.</returns>
- [PreserveSig]
- int RegisterControlChangeNotify(
- [In] [MarshalAs(UnmanagedType.Interface)] IAudioEndpointVolumeCallback client);
- /// <summary>
- /// Deletes the registration of a client's notification callback interface.
- /// </summary>
- /// <param name="client">The <see cref="IAudioEndpointVolumeCallback"/> interface that previously registered for notification callbacks.</param>
- /// <returns>An HRESULT code indicating whether the operation passed of failed.</returns>
- [PreserveSig]
- int UnregisterControlChangeNotify(
- [In] [MarshalAs(UnmanagedType.Interface)] IAudioEndpointVolumeCallback client);
- /// <summary>
- /// Gets a count of the channels in the audio stream.
- /// </summary>
- /// <param name="channelCount">The number of channels.</param>
- /// <returns>An HRESULT code indicating whether the operation passed of failed.</returns>
- [PreserveSig]
- int GetChannelCount(
- [Out] [MarshalAs(UnmanagedType.U4)] out UInt32 channelCount);
- /// <summary>
- /// Sets the master volume level of the audio stream, in decibels.
- /// </summary>
- /// <param name="level">The new master volume level in decibels.</param>
- /// <param name="eventContext">A user context value that is passed to the notification callback.</param>
- /// <returns>An HRESULT code indicating whether the operation passed of failed.</returns>
- [PreserveSig]
- int SetMasterVolumeLevel(
- [In] [MarshalAs(UnmanagedType.R4)] float level,
- [In] [MarshalAs(UnmanagedType.LPStruct)] Guid eventContext);
- /// <summary>
- /// Sets the master volume level, expressed as a normalized, audio-tapered value.
- /// </summary>
- /// <param name="level">The new master volume level expressed as a normalized value between 0.0 and 1.0.</param>
- /// <param name="eventContext">A user context value that is passed to the notification callback.</param>
- /// <returns>An HRESULT code indicating whether the operation passed of failed.</returns>
- [PreserveSig]
- int SetMasterVolumeLevelScalar(
- [In] [MarshalAs(UnmanagedType.R4)] float level,
- [In] [MarshalAs(UnmanagedType.LPStruct)] Guid eventContext);
- /// <summary>
- /// Gets the master volume level of the audio stream, in decibels.
- /// </summary>
- /// <param name="level">The volume level in decibels.</param>
- /// <returns>An HRESULT code indicating whether the operation passed of failed.</returns>
- [PreserveSig]
- int GetMasterVolumeLevel(
- [Out] [MarshalAs(UnmanagedType.R4)] out float level);
- /// <summary>
- /// Gets the master volume level, expressed as a normalized, audio-tapered value.
- /// </summary>
- /// <param name="level">The volume level expressed as a normalized value between 0.0 and 1.0.</param>
- /// <returns>An HRESULT code indicating whether the operation passed of failed.</returns>
- [PreserveSig]
- int GetMasterVolumeLevelScalar(
- [Out] [MarshalAs(UnmanagedType.R4)] out float level);
- /// <summary>
- /// Sets the volume level, in decibels, of the specified channel of the audio stream.
- /// </summary>
- /// <param name="channelNumber">The channel number.</param>
- /// <param name="level">The new volume level in decibels.</param>
- /// <param name="eventContext">A user context value that is passed to the notification callback.</param>
- /// <returns>An HRESULT code indicating whether the operation passed of failed.</returns>
- [PreserveSig]
- int SetChannelVolumeLevel(
- [In] [MarshalAs(UnmanagedType.U4)] UInt32 channelNumber,
- [In] [MarshalAs(UnmanagedType.R4)] float level,
- [In] [MarshalAs(UnmanagedType.LPStruct)] Guid eventContext);
- /// <summary>
- /// Sets the normalized, audio-tapered volume level of the specified channel in the audio stream.
- /// </summary>
- /// <param name="channelNumber">The channel number.</param>
- /// <param name="level">The new master volume level expressed as a normalized value between 0.0 and 1.0.</param>
- /// <param name="eventContext">A user context value that is passed to the notification callback.</param>
- /// <returns>An HRESULT code indicating whether the operation passed of failed.</returns>
- [PreserveSig]
- int SetChannelVolumeLevelScalar(
- [In] [MarshalAs(UnmanagedType.U4)] UInt32 channelNumber,
- [In] [MarshalAs(UnmanagedType.R4)] float level,
- [In] [MarshalAs(UnmanagedType.LPStruct)] Guid eventContext);
- /// <summary>
- /// Gets the volume level, in decibels, of the specified channel in the audio stream.
- /// </summary>
- /// <param name="channelNumber">The zero-based channel number.</param>
- /// <param name="level">The volume level in decibels.</param>
- /// <returns>An HRESULT code indicating whether the operation passed of failed.</returns>
- [PreserveSig]
- int GetChannelVolumeLevel(
- [In] [MarshalAs(UnmanagedType.U4)] UInt32 channelNumber,
- [Out] [MarshalAs(UnmanagedType.R4)] out float level);
- /// <summary>
- /// Gets the normalized, audio-tapered volume level of the specified channel of the audio stream.
- /// </summary>
- /// <param name="channelNumber">The zero-based channel number.</param>
- /// <param name="level">The volume level expressed as a normalized value between 0.0 and 1.0.</param>
- /// <returns>An HRESULT code indicating whether the operation passed of failed.</returns>
- [PreserveSig]
- int GetChannelVolumeLevelScalar(
- [In] [MarshalAs(UnmanagedType.U4)] UInt32 channelNumber,
- [Out] [MarshalAs(UnmanagedType.R4)] out float level);
- /// <summary>
- /// Sets the muting state of the audio stream.
- /// </summary>
- /// <param name="isMuted">True to mute the stream, or false to unmute the stream.</param>
- /// <param name="eventContext">A user context value that is passed to the notification callback.</param>
- /// <returns>An HRESULT code indicating whether the operation passed of failed.</returns>
- [PreserveSig]
- int SetMute(
- [In] [MarshalAs(UnmanagedType.Bool)] Boolean isMuted,
- [In] [MarshalAs(UnmanagedType.LPStruct)] Guid eventContext);
- /// <summary>
- /// Gets the muting state of the audio stream.
- /// </summary>
- /// <param name="isMuted">The muting state. True if the stream is muted, false otherwise.</param>
- /// <returns>An HRESULT code indicating whether the operation passed of failed.</returns>
- [PreserveSig]
- int GetMute(
- [Out] [MarshalAs(UnmanagedType.Bool)] out Boolean isMuted);
- /// <summary>
- /// Gets information about the current step in the volume range.
- /// </summary>
- /// <param name="step">The current zero-based step index.</param>
- /// <param name="stepCount">The total number of steps in the volume range.</param>
- /// <returns>An HRESULT code indicating whether the operation passed of failed.</returns>
- [PreserveSig]
- int GetVolumeStepInfo(
- [Out] [MarshalAs(UnmanagedType.U4)] out UInt32 step,
- [Out] [MarshalAs(UnmanagedType.U4)] out UInt32 stepCount);
- /// <summary>
- /// Increases the volume level by one step.
- /// </summary>
- /// <param name="eventContext">A user context value that is passed to the notification callback.</param>
- /// <returns>An HRESULT code indicating whether the operation passed of failed.</returns>
- [PreserveSig]
- int VolumeStepUp(
- [In] [MarshalAs(UnmanagedType.LPStruct)] Guid eventContext);
- /// <summary>
- /// Decreases the volume level by one step.
- /// </summary>
- /// <param name="eventContext">A user context value that is passed to the notification callback.</param>
- /// <returns>An HRESULT code indicating whether the operation passed of failed.</returns>
- [PreserveSig]
- int VolumeStepDown(
- [In] [MarshalAs(UnmanagedType.LPStruct)] Guid eventContext);
- /// <summary>
- /// Queries the audio endpoint device for its hardware-supported functions.
- /// </summary>
- /// <param name="hardwareSupportMask">A hardware support mask that indicates the capabilities of the endpoint.</param>
- /// <returns>An HRESULT code indicating whether the operation passed of failed.</returns>
- [PreserveSig]
- int QueryHardwareSupport(
- [Out] [MarshalAs(UnmanagedType.U4)] out UInt32 hardwareSupportMask);
- /// <summary>
- /// Gets the volume range of the audio stream, in decibels.
- /// </summary>
- /// <param name="volumeMin">The minimum volume level in decibels.</param>
- /// <param name="volumeMax">The maximum volume level in decibels.</param>
- /// <param name="volumeStep">The volume increment level in decibels.</param>
- /// <returns>An HRESULT code indicating whether the operation passed of failed.</returns>
- [PreserveSig]
- int GetVolumeRange(
- [Out] [MarshalAs(UnmanagedType.R4)] out float volumeMin,
- [Out] [MarshalAs(UnmanagedType.R4)] out float volumeMax,
- [Out] [MarshalAs(UnmanagedType.R4)] out float volumeStep);
- }
- }
|