Share via


IDirectMusicPerformance::IsPlaying

This method determines whether a particular segment or segment state is currently being heard from the speakers.

HRESULT IsPlaying(
  IDirectMusicSegment* pSegment,
  IDirectMusicSegmentState* pSegState
);

Parameters

  • pSegment
    Segment to check. If NULL, check only pSegState.
  • pSegState
    Segment state to check. If NULL, check only pSegment.

Return Values

If the method succeeds and the requested segment or segment state is playing, the return value is S_OK. If neither is playing or only one was requested and it is not playing, the return value is S_FALSE.

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

E_POINTER
DMUS_E_NO_MASTER_CLOCK

Remarks

The IDirectMusic::IsPlaying method best suited for situations when you are certain that a segment has already begun playing and you want to know if is still playing.

You should not use this method if your application needs to know if a segment has begun playing immediately after a call to IDirectMusicPerformance::PlaySegment. There is always some delay between the time that an application calls IDirectMusicPerformance::PlaySegment and the time that a user hears a sound from the speakers. This delay is usually less than 300ms and is caused by internal housecleaning tasks that DirectMusic must perform as it prepares to play the segment. A call to IDirectMusic::IsPlaying during this delay period will return S_FALSE even though DirectMusic is actually beginning the process of playing the segment.

If your application needs to know if a segment has begun playing immediately after a call to IDirectMusicPerformance::PlaySegment then you should set up a DirectMusic notification and wait for DMUS_NOTIFICATION_SEGSTART.

Requirements

OS Versions: Windows CE .NET 4.0 and Windows CE .NET 4.1.
Header: Dmusici.h.
Link Library: Dmusic.lib.

 Last updated on Monday, April 12, 2004

© 1992-2002 Microsoft Corporation. All rights reserved.