Microsoft DirectX 8.0 (C++)

IDirectMusicPerformance8::ReferenceToMusicTime

Converts a performance time in REFERENCE_TIME format to a performance time in MUSIC_TIME format.

HRESULT ReferenceToMusicTime(
  REFERENCE_TIME rtTime,
  MUSIC_TIME* pmtTime
);

Parameters

rtTime
Time in REFERENCE_TIME format.
pmtTime
Address of a variable that receives the converted time in MUSIC_TIME format.

Return Values

If the method succeeds, the return value is S_OK.

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

E_POINTER
DMUS_E_NO_MASTER_CLOCK

Remarks

Because music time is less precise than reference time, rounding occurs.

This method converts a time offset from the start of the performance, not a duration. Because the ratio between music time and reference time units depends on the tempo, DirectMusic takes into account all tempo changes since the start of the performance when calculating prtTime.If a master tempo has been set for the performance, it is taken into account as well.

Requirements

  Header: Declared in dmusici.h.

See Also

IDirectMusicPerformance8::MusicToReferenceTime, Clock Time vs. Music Time