// ----------------------------------------- // 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; using Vannatech.CoreAudio.Constants; namespace Vannatech.CoreAudio.Interfaces { /// /// Provides methods for enumerating audio devices. /// /// /// MSDN Reference: http://msdn.microsoft.com/en-us/library/dd371399.aspx /// public partial interface IMMDeviceEnumerator { /// /// Generates a collection of audio endpoint devices that meet the specified criteria. /// /// The direction for the endpoint devices in the collection. /// One or more constants that indicate the state of the endpoints in the collection. /// The interface of the device-collection object. /// An HRESULT code indicating whether the operation passed of failed. [PreserveSig] int EnumAudioEndpoints( [In] [MarshalAs(UnmanagedType.I4)] EDataFlow dataFlow, [In] [MarshalAs(UnmanagedType.U4)] UInt32 stateMask, [Out] [MarshalAs(UnmanagedType.Interface)] out IMMDeviceCollection devices); /// /// Retrieves the default audio endpoint for the specified data-flow direction and role. /// /// The direction for the endpoint device. /// The of the endpoint device. /// The interface of the default audio endpoint device. /// An HRESULT code indicating whether the operation passed of failed. [PreserveSig] int GetDefaultAudioEndpoint( [In] [MarshalAs(UnmanagedType.I4)] EDataFlow dataFlow, [In] [MarshalAs(UnmanagedType.I4)] ERole role, [Out] [MarshalAs(UnmanagedType.Interface)] out IMMDevice device); /// /// Retrieves an endpoint device that is specified by an endpoint device-identification string. /// /// The endpoint ID. /// The interface for the specified device. /// An HRESULT code indicating whether the operation passed of failed. [PreserveSig] int GetDevice( [In] [MarshalAs(UnmanagedType.LPWStr)] string endpointId, [Out] [MarshalAs(UnmanagedType.Interface)] out IMMDevice device); /// /// Registers a client's notification callback interface. /// /// The interface that the client is registering for notification callbacks. /// An HRESULT code indicating whether the operation passed of failed. [PreserveSig] int RegisterEndpointNotificationCallback( [In] [MarshalAs(UnmanagedType.Interface)] IMMNotificationClient client); /// /// Deletes the registration of a notification interface that the client registered in a previous call /// to the method. /// /// A interface that was previously registered for notification callbacks. /// An HRESULT code indicating whether the operation passed of failed. [PreserveSig] int UnregisterEndpointNotificationCallback( [In] [MarshalAs(UnmanagedType.Interface)] IMMNotificationClient client); } }