aboutsummaryrefslogtreecommitdiffstats
path: root/src/Chrono.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-08-29 12:22:25 +0200
committerMax Kellermann <max@duempel.org>2014-08-29 12:23:09 +0200
commit3ac1475262c2ef8f2a76aac371daac2d01bc2383 (patch)
treeb450bfef194c2a63e360b6abf376b44e80c8c10b /src/Chrono.hxx
parentad64bab5b225028c65f341c6c44369ab5e636edf (diff)
downloadmpd-3ac1475262c2ef8f2a76aac371daac2d01bc2383.tar.gz
mpd-3ac1475262c2ef8f2a76aac371daac2d01bc2383.tar.xz
mpd-3ac1475262c2ef8f2a76aac371daac2d01bc2383.zip
Chrono: add methods ToS(), RoundS()
Diffstat (limited to '')
-rw-r--r--src/Chrono.hxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/Chrono.hxx b/src/Chrono.hxx
index db7605726..e72975ea8 100644
--- a/src/Chrono.hxx
+++ b/src/Chrono.hxx
@@ -58,6 +58,14 @@ public:
return SongTime(ms);
}
+ constexpr rep ToS() const {
+ return count() / rep(1000);
+ }
+
+ constexpr rep RoundS() const {
+ return (count() + 500) / rep(1000);
+ }
+
constexpr rep ToMS() const {
return count();
}
@@ -129,6 +137,14 @@ public:
return SignedSongTime(ms);
}
+ constexpr rep ToS() const {
+ return count() / rep(1000);
+ }
+
+ constexpr rep RoundS() const {
+ return (count() + 500) / rep(1000);
+ }
+
constexpr rep ToMS() const {
return count();
}