aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorMax Horn2010-01-06 15:56:04 +0000
committerMax Horn2010-01-06 15:56:04 +0000
commitdd76e2bda0e33ad78c8c7dd8c998c6e51c8a04ca (patch)
treeb88749e1df71ca22d4ce7b66a2d64a296fbb2cd7 /sound
parent297a95557946555e5cc51279abafc0dc362af5f7 (diff)
downloadscummvm-rg350-dd76e2bda0e33ad78c8c7dd8c998c6e51c8a04ca.tar.gz
scummvm-rg350-dd76e2bda0e33ad78c8c7dd8c998c6e51c8a04ca.tar.bz2
scummvm-rg350-dd76e2bda0e33ad78c8c7dd8c998c6e51c8a04ca.zip
Rename some Timestamp methods: getNumberOfFrames -> numberOfFrames and getFramerate -> framerate
svn-id: r47083
Diffstat (limited to 'sound')
-rw-r--r--sound/audiostream.cpp2
-rw-r--r--sound/timestamp.cpp10
-rw-r--r--sound/timestamp.h10
3 files changed, 11 insertions, 11 deletions
diff --git a/sound/audiostream.cpp b/sound/audiostream.cpp
index a3a00a4eba..748e480c61 100644
--- a/sound/audiostream.cpp
+++ b/sound/audiostream.cpp
@@ -110,7 +110,7 @@ inline int32 calculatePlayTime(int rate, int samples) {
uint32 calculateSampleOffset(const Timestamp &where, int rate) {
const Timestamp whereRate = where.convertToFramerate(rate);
- return whereRate.secs() * rate + whereRate.getNumberOfFrames();
+ return whereRate.secs() * rate + whereRate.numberOfFrames();
}
/**
diff --git a/sound/timestamp.cpp b/sound/timestamp.cpp
index 9d95fbe556..f6ac56bfad 100644
--- a/sound/timestamp.cpp
+++ b/sound/timestamp.cpp
@@ -36,12 +36,12 @@ static uint gcd(uint a, uint b) {
return b;
}
-Timestamp::Timestamp(uint32 ms, int framerate) {
- assert(framerate > 0);
+Timestamp::Timestamp(uint32 ms, int fr) {
+ assert(fr > 0);
_secs = ms / 1000;
- _framerateFactor = 1000 / gcd(1000, framerate);
- _framerate = framerate * _framerateFactor;
+ _framerateFactor = 1000 / gcd(1000, fr);
+ _framerate = fr * _framerateFactor;
_numberOfFrames = (ms % 1000) * _framerate / 1000;
}
@@ -50,7 +50,7 @@ Timestamp::Timestamp(uint32 ms, int framerate) {
Timestamp Timestamp::convertToFramerate(int newFramerate) const {
Timestamp ts(*this);
- if (ts.getFramerate() != newFramerate) {
+ if (ts.framerate() != newFramerate) {
ts._framerateFactor = 1000 / gcd(1000, newFramerate);
ts._framerate = newFramerate * ts._framerateFactor;
diff --git a/sound/timestamp.h b/sound/timestamp.h
index a027570469..fcfa8cf5fc 100644
--- a/sound/timestamp.h
+++ b/sound/timestamp.h
@@ -126,19 +126,19 @@ public:
*/
uint32 msecs() const;
- /** Return the framerate used by this timestamp. */
- int getFramerate() const { return _framerate / _framerateFactor; }
-
/**
* Determines the time in seconds described by this timestamp,
* rounded down.
*/
- uint32 secs() const { return _secs; }
+ inline uint32 secs() const { return _secs; }
/**
* Determines the frames described by this timestamp.
*/
- int getNumberOfFrames() const { return _numberOfFrames / _framerateFactor; }
+ inline int numberOfFrames() const { return _numberOfFrames / _framerateFactor; }
+
+ /** Return the framerate used by this timestamp. */
+ inline int framerate() const { return _framerate / _framerateFactor; }
protected: