diff options
author | Max Kellermann <max@duempel.org> | 2014-08-27 19:11:55 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-08-28 06:42:19 +0200 |
commit | 39529204925c95c1ae38fee25df334f3c3a1a4a7 (patch) | |
tree | 80265280e7557858814158b7ea0a6f5f65be8847 /src/protocol/ArgParser.cxx | |
parent | c2001a725978b665f0b22a4ad3865293754efd38 (diff) | |
download | mpd-39529204925c95c1ae38fee25df334f3c3a1a4a7.tar.gz mpd-39529204925c95c1ae38fee25df334f3c3a1a4a7.tar.xz mpd-39529204925c95c1ae38fee25df334f3c3a1a4a7.zip |
Playlist: use std::chrono::duration for Seek*()
Diffstat (limited to '')
-rw-r--r-- | src/protocol/ArgParser.cxx | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/protocol/ArgParser.cxx b/src/protocol/ArgParser.cxx index d2c40bbd6..709d12962 100644 --- a/src/protocol/ArgParser.cxx +++ b/src/protocol/ArgParser.cxx @@ -20,6 +20,7 @@ #include "config.h" #include "ArgParser.hxx" #include "Result.hxx" +#include "Chrono.hxx" #include <limits> @@ -186,3 +187,25 @@ check_float(Client &client, float *value_r, const char *s) *value_r = value; return true; } + +bool +ParseCommandArg(Client &client, SongTime &value_r, const char *s) +{ + unsigned value; + bool success = check_unsigned(client, &value, s); + if (success) + value_r = SongTime::FromS(value); + + return success; +} + +bool +ParseCommandArg(Client &client, SignedSongTime &value_r, const char *s) +{ + int value; + bool success = check_int(client, &value, s); + if (success) + value_r = SignedSongTime::FromS(value); + + return success; +} |