Previous Next

IDirectMusicSynth::GetPortCaps

The GetPortCaps method retrieves the capabilities of a DirectMusic "port", which is a DirectMusic term for a device that sends or receives music data.

HRESULT
  GetPortCaps(
    LPDMUS_PORTCAPS  pCaps
    );

Parameters

pCaps
Pointer to a DMUS_PORTCAPS structure (described in the Platform SDK documentation). The method writes the capabilities of the DirectMusic "port" into this structure.

Return Values

GetPortCaps returns S_OK if the call was successful. Otherwise, the method returns an appropriate error code. The following table shows some of the possible return status codes.

Error Code Description
E_POINTER Indicates a bad pCaps pointer.

Headers

Declared in dmusics.h. Include dmusics.h.

Comments

When an application enumerates the available DirectMusic "ports" with a call to IDirectMusic::EnumPort (described in the Platform SDK documentation), DirectMusic calls each registered device's GetPortCaps method.

This means that the additional overhead of creating and initializing the synthesizer occurs with this call. It is a good idea to keep the overhead of simply creating a synthesizer to a minimum, because there is a chance that it is being created only so that its capabilities can be obtained, and then it will be released.

Avoid confusing the term DirectMusic "port" with a DMus port driver. A DirectMusic port corresponds to a render or capture pin on a DirectMusic filter. For more information on DirectMusic ports, see the description of the IDirectMusicPort interface in the Platform SDK documentation.