Platform SDK: DirectX

IDirectMusicPerformance::AddPort

The IDirectMusicPerformance::AddPort method assigns a port to the performance.

HRESULT AddPort(
  IDirectMusicPort* pPort
);

Parameters

pPort
Address of a variable that contains the port to add. If NULL, the default port is added. See Remarks.

Return Values

If the method succeeds, the return value is S_OK.

If it fails, the method can return one of the following error values:

DMUS_E_NOT_INIT
DMUS_E_CANNOT_OPEN_PORT
E_OUTOFMEMORY
E_POINTER

Remarks

If you want to pass NULL to this method, you must first pass NULL to IDirectMusicPerformance::Init.

When the default port is specified by passing NULL in pPort, it is assigned one channel group. If no PChannels have been set up for any other port, PChannels from 0 through 15 are assigned to MIDI channels from 0 through 15.

If pPort is not NULL, the port must be activated by a call to IDirectMusicPort::Activate, and a block of channels must be assigned by a call to IDirectMusicPerformance::AssignPChannelBlock.

This method creates a reference to IDirectMusicPort that is released by IDirectMusicPerformance::RemovePort or IDirectMusicPerformance::CloseDown.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in dmusici.h.

See Also

IDirectMusicPerformance::RemovePort, Default Port