diff options
-rw-r--r-- | sound/timestamp.cpp | 6 | ||||
-rw-r--r-- | sound/timestamp.h | 3 |
2 files changed, 9 insertions, 0 deletions
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; |