Jump to content

View more

Image of the Day

Working on an auto spawn system. #gamedev #indiedev #screenshotsaturday https://t.co/Mm2kfekz7b
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

DirectMusic

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
1 reply to this topic

#1 slickj345   Members   

122
Like
Likes
Like

Posted 02 December 1999 - 01:06 PM

How would one go about finding out the remaining time in seconds of a playing midi file/segment.

Jeremy


#2 Kentamanos   Members   

122
Like
Likes
Like

Posted 02 December 1999 - 01:06 PM

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





Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.