IAcpHal::Connect Method

Connects to the ACP.

Syntax

public:
HRESULT Connect(
         UINT32 numCommands,
         UINT32 numMessages
)  

Parameters

numCommands
Type: UINT32 

Specifies the number of commands to allocate in the ACP command queue. This value must be greater than zero, and should be enough to handle the number of commands that are issued for each 2.67ms audio frame.

numMessages
Type: UINT32 

Specifies the number of messages to allocate in the ACP message queue. This value can be zero if the title does not process received messages. If command completed messages (refer to ACP_MESSAGE_TYPE ) have been registered for then there will be at least as many messages as there are commands. Typically this message queue is processed less frequently than once per audio frame, so several frame’s worth of messages should be catered for.

Return value

Type: HRESULT 

If the method succeeds, it returns S_OK. If it fails, possible return codes include, but are not limited to, the values shown in the following table.

Return codes
Return code Description
E_INVALIDARG One or more of the arguments are invalid, or the parameter numCommands is set to zero.
E_OUTOFMEMORY There has been a memory allocation failure.

Remarks

This method should be called before calling any other methods in this interface. However, after calling Disconnect this method may be called again.

Requirements

Header: Declared in acphal.h.

Library: Use acphal.lib.