Archived

This topic is now archived and is closed to further replies.

Time In DirectMusic (DX7)

This topic is 6539 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello all. I am doing some experimentation with DirectMusic, and writing a midi player. I am attempting to keep track of the time passed playing a segment... this is the code I have. When the segment is started (called only once): REFERENCE_TIME m_rmusicstart; MUSIC_TIME m_mmusicstart; ... m_segmentstate->GetStartTime(&m_mmusicstart); m_perf->MusicToReferenceTime( m_mmusicstart, &m_rmusicstart); then I have on a loop to compute the time: REFERENCE_TIME m_prtNow; MUSIC_TIME m_pmtNow; m_perf->GetTime(&m_prtNow, &m_pmtNow); m_prtNow =- m_rmusicstart; m_pmtNow =- m_mmusicstart; Then I would do my conversion into HH:MM:SS (Hours minutes and seconds). All that is suposed to work nicely (and in the MIDI Player sample from the DX7 SDK, it does,) but in my sample, as the values from GetTime() get larger, m_rmusicstart and m_rmusicstart get equally smaller, making the time elapsed always appear to be 0. Im not sure why any of this happens, because my code never modifies m_rmusicstart or m_mmusicstart after GetStartTime() is called for the segment. Any ideas, or other methods to keep track of time? Fungame

Share this post


Link to post
Share on other sites