Platform SDK: DirectX |
The DirectMusicPerformance.GetSegmentState method retrieves the DirectMusicSegmentState object representing the primary segment playing at a given time.
object.GetSegmentState(mtTime As Long) _ As DirectMusicSegmentState
If the method succeeds, it returns a DirectMusicSegmentState object.
If the method fails, it raises an error, and Err.Number can be set to DMUS_E_NOT_FOUND.
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.