core audio apis库的函数排列顺序非常重要

在使用MFPACK库时,core audio apis库的函数排列顺序非常重要,要与MSDN的说明一致。

如:IPart/IDeviceTopology 的声明函数顺序应该与MSDN中说明顺序相同,否则调用时会产生错误 $80004003(Para error) or $8004007(Pointer Error)。

下面为正确顺序:

DeviceTopology = interface(IUnknown)
    ['{2A07407E-6497-4A18-9787-32F79BD0D98F}']

    function GetConnectorCount(out pCount: UINT): HRESULT; stdcall;

    function GetConnector(const nIndex: UINT; out ppConnector: IConnector): HRESULT; stdcall;

    function GetSubunitCount(out pCount: UINT): HRESULT; stdcall;

    function GetSubunit(const nIndex: UINT; out ppSubunit: ISubUnit): HRESULT; stdcall;

    function GetPartById(const nId: UINT; out ppPart: IPart): HRESULT; stdcall;

    function GetDeviceId(out ppwstrDeviceId: LPWSTR): HRESULT; stdcall;

    function GetSignalPath(pIPartFrom: IPart; pIPartTo: IPart; const bRejectMixedPaths: BOOL; out ppParts: IPartsList): HRESULT; stdcall;

  end;

    IPart = interface(IUnknown)
    ['{AE2DE0E4-5BCA-4F2D-AA46-5D13F8FDB3A9}']
    // The interface id for the requested control function.
    // The client should set this parameter to one of the following REFIID values:
    // IID_IAudioAutoGainControl, IID_IAudioBass, IID_IAudioChannelConfig, IID_IAudioInputSelector, IID_IAudioLoudness
    // IID_IAudioMidrange, IID_IAudioMute, IID_IAudioOutputSelector, IID_IAudioPeakMeter, IID_IAudioTreble, IID_IAudioVolumeLevel
    // IID_IDeviceSpecificProperty, IID_IKsFormatSupport, IID_IKsJackDescription

    function GetName(out ppwstrName: LPWSTR): HRESULT; stdcall;
    // Description:
    // Gets the name of this Part.
    // Parameters:
    // ppwstrName - [out] The name of this Part
    // Remarks:
    // The returned string must be freed by the caller using CoTaskMemFree.
    // Return values:
    // S_OK if successful
    // E_NOTFOUND if the part does not have a name
    //
    function GetLocalId(out pnId: UINT): HRESULT; stdcall;
    // Description:
    // Gets the local ID of this Part
    // Parameters:
    // pnId - [out] The local ID of this Part.  This ID is only valid in the context of the parent DeviceTopology object.
    // Return values:
    // S_OK if successful
    //

    function GetGlobalId(out ppwstrGlobalId: LPWSTR): HRESULT; stdcall;
    // Description:
    // Gets the global ID of this Part
    // Parameters:
    // ppwstrId - [out] The global ID of this Part.
    // This ID is globally unique and can be used to get an interface to a Part on
    // any DeviceTopology object.
    // Remarks:
    // The returned string must be freed by the caller using CoTaskMemFree.
    // Return values:
    // S_OK if successful
    //

    function GetPartType(out PPartType: PartType): HRESULT; stdcall;
    // Description:
    // Gets the type of this Part (Connector or Subunit)
    // Parameters:
    // pPartType - [out] The type of this Part (Connector or Subunit)
    // Return values:
    // S_OK if successful
    //

    function GetSubType(out pSubType: TGUID): HRESULT; stdcall;

    function GetControlInterfaceCount(out pCount: UINT): HRESULT; stdcall;

    function GetControlInterface(const nIndex: UINT; out ppFunction: IControlInterface): HRESULT; stdcall;

    function EnumPartsIncoming(out ppParts: IPartsList): HRESULT; stdcall;

    function EnumPartsOutgoing(out ppParts: IPartsList): HRESULT; stdcall;

    function GetTopologyObject(out ppTopology: IDeviceTopology): HRESULT; stdcall;

    function Activate(const dwClsContext: DWORD; const refiid: refiid; out ppvObject): HRESULT; stdcall;

    function UnregisterControlChangeCallback(pNotify: IControlChangeNotify): HRESULT; stdcall;

    function RegisterControlChangeCallback(const riid: REFGUID; pNotify: IControlChangeNotify): HRESULT; stdcall;

  end;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值