[ scummvm-Patches-892455 ] getElapsedTime() for sounds

SourceForge.net noreply at sourceforge.net
Sat Feb 7 17:39:34 CET 2004


Patches item #892455, was opened at 2004-02-07 17:39
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=418822&aid=892455&group_id=37116

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Torbjörn Andersson (eriktorbjorn)
Assigned to: Nobody/Anonymous (nobody)
Summary: getElapsedTime() for sounds

Initial Comment:
This patch adds the getElapsedTime() function that we
discussed recently.

I had originally envisioned it as being part of the
AudioStream class, but that turned out to be
impractical for several reasons. Most importantly, the
mixer may call readBuffer() several times in rapid
succession in order to buffer up sound, which made it
hard to get a reliable value for the number of samples
that had actually been consumed. Instead, it is now
part of the Channel class, and accessed through a
method in the SoundMixer class.

Converting the Broken Sword cutscene animation to use
this function instead of the current method should be
trivial. (I did it for half of the BS2 code for a test
case, but that isn't included in the patch.)

If this patch is accepted, we can probably get rid of
getSamplesPlayed(). I think it's only used by the
Broken Sword games, and it's not working very well.

There are a few things in the code that could probably
be cleaned up a bit. For instance, getElapsedTime()
needs to access the get_msecs() function, and currently
does so through g_system.

Also, there is nothing to handle the case where sound
is paused.


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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=418822&aid=892455&group_id=37116




More information about the Scummvm-tracker mailing list