Microsoft DirectX 8.1 (Visual Basic)

DirectMusicPerformance8.GetSegmentState

The GetSegmentState method retrieves an object representing the play state of the primary segment.

object.GetSegmentState( _
  mtTime As Long _
) As DirectMusicSegmentState8

Parts

object

Resolves to a DirectMusicPerformance8 object.

mtTime

Time for which the segment state is to be retrieved, in music time.

Return Values

Returns a DirectMusicSegmentState8 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 DirectMusicPerformance8.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.

Also because of latency, it is a good idea to add 150 to mtTime if retrieving a segment state immediately after calling DirectMusicPerformance8.PlaySegmentEx.