Platform SDK: DirectX

DirectMusicPerformance.GetSegmentState

The DirectMusicPerformance.GetSegmentState method retrieves the DirectMusicSegmentState object representing the primary segment playing at a given time.

object.GetSegmentState(mtTime As Long) _
    As DirectMusicSegmentState

Parameters

object
Object expression that resolves to a DirectMusicPerformance object.
mtTime
Time for which the segment state is to be retrieved, in music time.

Return Values

If the method succeeds, it returns a DirectMusicSegmentState object.

Error Codes

If the method fails, it raises an error, and Err.Number can be set to DMUS_E_NOT_FOUND.

Remarks

To get the currently playing segment state, pass the time retrieved by the DirectMusicPerformance.GetMusicTime method. Currently playing in this context means that it is being called into to perform messages. Because of latency, the currently playing segment state is not necessarily the one actually being heard.

Because of latency, it is also a good idea to add 150 to mtTime if retrieving a segment state immediately after calling DirectMusicPerformance.PlaySegment.