Logo Search packages:      
Sourcecode: scummvm version File versions

Audio::Timestamp::Timestamp ( uint  msecs = 0,
uint  framerate = 1 
)

Set up a timestamp with a given time and framerate.

Parameters:
msecsstarting time in milliseconds
frameratenumber of frames per second (must be > 0)

Definition at line 31 of file timestamp.cpp.

References _framerate, _framerateFactor, _numFrames, and _secs.

                                     {
      assert(fr > 0);

      _secs = ms / 1000;
      _framerateFactor = 1000 / Common::gcd<uint>(1000, fr);
      _framerate = fr * _framerateFactor;

      // Note that _framerate is always divisible by 1000.
      _numFrames = (ms % 1000) * (_framerate / 1000);
}

Generated by  Doxygen 1.6.0   Back to index