// ----------------------------------------- // 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.Constants; using Vannatech.CoreAudio.Externals; namespace Vannatech.CoreAudio.Interfaces { /// /// Represents an audio device. /// /// /// MSDN Reference: http://msdn.microsoft.com/en-us/library/dd371395.aspx /// public partial interface IMMDevice { /// /// Creates a COM object with the specified interface. /// /// The interface identifier. /// The execution context, defined by the COM CLSCTX enumeration. /// Set to NULL to activate Core Audio APIs. /// The address of the interface instance specified by parameter IID. /// An HRESULT code indicating whether the operation passed of failed. [PreserveSig] int Activate( [In] [MarshalAs(UnmanagedType.LPStruct)] Guid interfaceId, [In] [MarshalAs(UnmanagedType.U4)] UInt32 classContext, [In, Optional] IntPtr activationParams, // TODO: Update to use PROPVARIANT and test properly. [Out] [MarshalAs(UnmanagedType.IUnknown)] out object instancePtr); /// /// Gets an interface to the device's property store. /// /// The constant that indicates the storage mode. /// The device's property store. /// An HRESULT code indicating whether the operation passed of failed. /// /// Note that a client which is not running as administrator is restricted to read-only access. /// [PreserveSig] int OpenPropertyStore( [In] [MarshalAs(UnmanagedType.U4)] UInt32 accessMode, [Out] [MarshalAs(UnmanagedType.Interface)] out IPropertyStore properties); /// /// Retrieves an endpoint ID string that identifies the audio endpoint device. /// /// The endpoint device ID. /// An HRESULT code indicating whether the operation passed of failed. [PreserveSig] int GetId( [Out] [MarshalAs(UnmanagedType.LPWStr)] out string strId); /// /// Gets the current state of the device. /// /// The constant that indicates the current state. /// An HRESULT code indicating whether the operation passed of failed. [PreserveSig] int GetState( [Out] [MarshalAs(UnmanagedType.U4)] out UInt32 deviceState); } }