Commit Graph

15 Commits

Author SHA1 Message Date
Max Horn
590481b12d Improve support for negative Timestamps, and add + and - operators
svn-id: r47244
2010-01-11 10:17:55 +00:00
Max Horn
4a832ceb01 Fix Timestamp::addMsecs; some cleanup
svn-id: r47212
2010-01-09 22:36:32 +00:00
Max Horn
32ec5746be Add Timestamp::totalNumberOfFrames() method, clarify some comments
svn-id: r47120
2010-01-07 15:12:20 +00:00
Johannes Schickel
f32aeb01bf Add a constructor to Timestamp, which allows for specifying seconds + start frames directly.
svn-id: r47091
2010-01-06 20:24:56 +00:00
Max Horn
dd76e2bda0 Rename some Timestamp methods: getNumberOfFrames -> numberOfFrames and getFramerate -> framerate
svn-id: r47083
2010-01-06 15:56:04 +00:00
Johannes Schickel
e72707b04e - Add some functionallity to query the seconds and number of frames stored in a Timestamp.
- Add tests for these

svn-id: r47081
2010-01-06 15:33:54 +00:00
Max Horn
1c6ccf8000 Add more comparision operators to Timestamp
svn-id: r47071
2010-01-06 12:15:05 +00:00
Max Horn
5b635fd610 Change the way Timestamp stores its data.
Instead of storing milliseconds and frames (which causes rounding errors,
and causes ambiguity in how a given time is stored), we now do things
differently: We store a number of seconds, and frames. To make sure that
we can still handle milliseconds accurately, though, we change the
framerate to the least common multiple of the original framerate and
1000. So 60 becomes 6000, and 44100 becomes 441000. There are no visible
changes for client code, except for the increased accuracy.

svn-id: r47070
2010-01-06 12:09:14 +00:00
Max Horn
4ae9412a3a Make some improvements for Audio::Timestamp.
* Add convertToFramerate() method
* Add framerate() method
* Add operator == and !=
* Improve frameDiff() to work for two timestamps with distinct framerates
* Improve Doxygen comments

svn-id: r46994
2010-01-04 22:48:28 +00:00
Johannes Schickel
b2355cac9f - Remove unsafe default constructor of Audio::Timestamp.
- Add an assert which prevents the _frameRate from being 0 in the Audio::Timestamp constructor.

svn-id: r46958
2010-01-03 22:41:35 +00:00
Max Horn
e23e1ffcb7 Added Audio::Timestamp::addMsecs method
svn-id: r40957
2009-05-28 10:29:25 +00:00
Johannes Schickel
b3c6751b9b Strip trailing whitespaces in the whole code base.
svn-id: r40867
2009-05-24 15:17:42 +00:00
Max Horn
77b40251ca Added some more Audio::Timestamp unit tests
svn-id: r39262
2009-03-09 16:15:25 +00:00
Max Horn
7cd40da1be Added some comments to Audio::Timestamp
svn-id: r39257
2009-03-09 03:45:40 +00:00
Max Horn
673a21b249 Added Audio::Timestamp class, based on SCI's sfx_timestamp_t; also provide a unit test for it, based on the old (and very outdated) timetest.cpp. To be used by Audio::Mixer one day...
svn-id: r39112
2009-03-04 06:58:28 +00:00