aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorMax Horn2009-05-28 10:29:25 +0000
committerMax Horn2009-05-28 10:29:25 +0000
commite23e1ffcb78c88a84514c4038a0e999f102d25c2 (patch)
tree4892ac4dbd69a45039a474fb21170ebb98bc4b2c /sound
parent01252c4aaf77b461928b71617d87c8ef7da83105 (diff)
downloadscummvm-rg350-e23e1ffcb78c88a84514c4038a0e999f102d25c2.tar.gz
scummvm-rg350-e23e1ffcb78c88a84514c4038a0e999f102d25c2.tar.bz2
scummvm-rg350-e23e1ffcb78c88a84514c4038a0e999f102d25c2.zip
Added Audio::Timestamp::addMsecs method
svn-id: r40957
Diffstat (limited to 'sound')
-rw-r--r--sound/timestamp.cpp6
-rw-r--r--sound/timestamp.h3
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;