From dd76e2bda0e33ad78c8c7dd8c998c6e51c8a04ca Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 6 Jan 2010 15:56:04 +0000 Subject: Rename some Timestamp methods: getNumberOfFrames -> numberOfFrames and getFramerate -> framerate svn-id: r47083 --- sound/audiostream.cpp | 2 +- sound/timestamp.cpp | 10 +++++----- sound/timestamp.h | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) (limited to 'sound') 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: -- cgit v1.2.3