// -----------------------------------------
// 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
{
///
/// Represents a part (connector or subunit) of a device topology.
///
///
/// MSDN Reference: http://msdn.microsoft.com/en-us/library/dd371429.aspx
///
public partial interface IPart
{
///
/// Gets the friendly name of this part.
///
/// Receives the friendly name of this part.
/// An HRESULT code indicating whether the operation succeeded of failed.
[PreserveSig]
int GetName(
[Out] [MarshalAs(UnmanagedType.LPWStr)] out string name);
///
/// Gets the local ID of this part.
///
/// Receives the local ID of this part.
/// An HRESULT code indicating whether the operation succeeded of failed.
[PreserveSig]
int GetLocalId(
[Out] [MarshalAs(UnmanagedType.U4)] out UInt32 localId);
///
/// Gets the global ID of this part.
///
/// Receives a string that contains the global ID.
/// An HRESULT code indicating whether the operation succeeded of failed.
[PreserveSig]
int GetGlobalId(
[Out] [MarshalAs(UnmanagedType.LPWStr)] out string globalId);
///
/// Gets the part type of this part.
///
/// Receives the method writes the part type.
/// An HRESULT code indicating whether the operation succeeded of failed.
[PreserveSig]
int GetPartType(
[Out] out PartType partType);
///
/// Gets the part subtype of this part.
///
/// Receives the subtype ID for this part.
/// An HRESULT code indicating whether the operation succeeded of failed.
[PreserveSig]
int GetSubType(
[Out] out Guid subType);
///
/// Gets the number of control interfaces that this part supports.
///
/// Receives the number of control interfaces on this part.
/// An HRESULT code indicating whether the operation succeeded of failed.
[PreserveSig]
int GetControlInterfaceCount(
[Out] [MarshalAs(UnmanagedType.U4)] out UInt32 count);
///
/// Gets a reference to the specified control interface, if this part supports it.
///
/// The zero-based index of the control interface.
/// Receives the interface of the specified audio function.
/// An HRESULT code indicating whether the operation succeeded of failed.
[PreserveSig]
int GetControlInterface(
[In] [MarshalAs(UnmanagedType.U4)] UInt32 index,
[Out] [MarshalAs(UnmanagedType.Interface)] out IControlInterface control);
///
/// Retrieves a list of all the parts that reside on data paths that are upstream from this part.
///
/// Receives an interface that encapsulates the list of parts that are immediately upstream from this part.
/// An HRESULT code indicating whether the operation succeeded of failed.
[PreserveSig]
int EnumPartsIncoming(
[Out] [MarshalAs(UnmanagedType.Interface)] out IPartsList partList);
///
/// Retrieves a list of all the parts that reside on data paths that are downstream from this part.
///
/// Receives an interface that encapsulates the list of parts that are immediately downstream from this part.
/// An HRESULT code indicating whether the operation succeeded of failed.
[PreserveSig]
int EnumPartsOutgoing(
[Out] [MarshalAs(UnmanagedType.Interface)] out IPartsList partList);
///
/// Gets a reference to the interface of the device topology object that contains this part.
///
/// Receives the interface of the device topology object.
/// An HRESULT code indicating whether the operation succeeded of failed.
[PreserveSig]
int GetTopologyObject(
[Out] [MarshalAs(UnmanagedType.Interface)] out IDeviceTopology deviceTopology);
///
/// Activates an interface on a connector or subunit.
///
/// The execution context in which the code that manages the newly created object will run.
/// The interface ID for the requested control function.
/// Receives the address of an instance implementing the interface specified by the interfaceId parameter.
/// An HRESULT code indicating whether the operation succeeded of failed.
[PreserveSig]
int Activate(
[In] UInt32 classContext,
[In] ref Guid interfaceId,
[Out, Optional] [MarshalAs(UnmanagedType.IUnknown)] out object instancePtr);
///
/// Registers the interface, which the client implements to receive notifications of status changes in this part.
///
/// The function-specific control interface that is to be monitored for control changes.
/// A client object that implements the interface.
/// An HRESULT code indicating whether the operation succeeded of failed.
[PreserveSig]
int RegisterControlChangeCallback(
[In] ref Guid interfaceId,
[In] IControlChangeNotify client);
///
/// Removes a previous registration of an interface.
///
/// The client whose registration is to be removed.
/// An HRESULT code indicating whether the operation succeeded of failed.
[PreserveSig]
int UnregisterControlChangeCallback(
[In] IControlChangeNotify client);
}
}