From e23e1ffcb78c88a84514c4038a0e999f102d25c2 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Thu, 28 May 2009 10:29:25 +0000 Subject: Added Audio::Timestamp::addMsecs method svn-id: r40957 --- sound/timestamp.cpp | 6 ++++++ sound/timestamp.h | 3 +++ 2 files changed, 9 insertions(+) (limited to 'sound') diff --git a/sound/timestamp.cpp b/sound/timestamp.cpp index 8b0f660385..13de41ff06 100644 --- a/sound/timestamp.cpp +++ b/sound/timestamp.cpp @@ -53,6 +53,12 @@ Timestamp Timestamp::addFrames(int frames) const { return timestamp; } +Timestamp Timestamp::addMsecs(int ms) const { + Timestamp timestamp(*this); + timestamp._msecs += ms; + return timestamp; +} + int Timestamp::frameDiff(const Timestamp &b) const { assert(_frameRate == b._frameRate); diff --git a/sound/timestamp.h b/sound/timestamp.h index deb86bc2d7..72671aaa77 100644 --- a/sound/timestamp.h +++ b/sound/timestamp.h @@ -56,6 +56,9 @@ public: /** Adds a number of frames to a timestamp. */ Timestamp addFrames(int frames) const; + /** Adds a number of milliseconds to a timestamp. */ + Timestamp addMsecs(int ms) const; + /** Computes the difference (# of frames) between this timestamp and b. */ int frameDiff(const Timestamp &b) const; -- cgit v1.2.3