Advertisement

DirectMusic

Started by December 02, 1999 07:06 PM
0 comments, last by slickj345 25 years, 2 months ago
How would one go about finding out the remaining time in seconds of a playing midi file/segment.

Jeremy

Not sure if you can exactly get that, but...

I see you can get the length of the segment (IDirectMusicPerformance::GetLength). You know what reference time you started it at (when you called IDirectMusicPerformance::Play). Given these two, you should be able to calculate when it will end.

GetLength will return MUSIC_TIME, so if you did not use MUSIC_TIME when you started, you might have to convert MUSIC_TIME to REFERENCE_TIME (IDirectMusicPerformance::MusicToReferenceTime).

You could also get a notification when it's done and almost done (see DMUS_NOTIFICATION_SEGALMOSTEND and DMUS_NOTIFICATION_SEGEND).

I have not tried this all out, but it should work. Cool to see someone else actually trying out DirectMusic!

Good luck,

------------------

-Kentamanos

-Kentamanos

This topic is closed to new replies.

Advertisement