IDirectMusicTool::Flush

The IDirectMusicTool::Flush method is called for each message in the queue when the performance stops. The tool can use the method to do whatever is necessary to flush the message. For instance, the output tool uses this method to ensure that any pending note-off messages are immediately processed.

HRESULT Flush(
  IDirectMusicPerformance* pPerf, 
  DMUS_PMSG* pPMSG,
  REFERENCE_TIME rtTime
);
 

Parameters

pPerf
Pointer to the IDirectMusicPerformance interface.
pPMSG
Pointer to the message to flush.
rtTime
Time at which to flush.

Return Values

Return values are determined by the implementation. If the method succeeds, the return value should be one of the following:

DMUS_S_REQUEUE
DMUS_S_FREE
S_OK

If it fails, the method may return E_POINTER.

Remarks

The message will have DMUS_PMSGF_TOOL_FLUSH set in its dwFlags member. See DMUS_PMSG.

If the method returns DMUS_S_REQUEUE, the tool wants the message to be requeued. This allows the tool to put a new timestamp and parameters on the message and requeue it, or to requeue the message with a different delivery type.

If the return value is DMUS_S_FREE, the tool wants the message freed automatically, and does not wish to requeue the message.

If S_OK is returned, the tool does not wish the message to be freed automatically. Perhaps the tool is holding onto the message for some reason, or has freed it itself.

Care must be taken not to create a circular reference to the performance represented by pPerf. For more information, see DirectMusic Tools.

QuickInfo

  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.