From 39529204925c95c1ae38fee25df334f3c3a1a4a7 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 27 Aug 2014 19:11:55 +0200 Subject: Playlist: use std::chrono::duration for Seek*() --- src/command/PlayerCommands.cxx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/command') diff --git a/src/command/PlayerCommands.cxx b/src/command/PlayerCommands.cxx index f167b0edb..7b033368a 100644 --- a/src/command/PlayerCommands.cxx +++ b/src/command/PlayerCommands.cxx @@ -300,11 +300,12 @@ handle_clearerror(gcc_unused Client &client, CommandResult handle_seek(Client &client, gcc_unused unsigned argc, char *argv[]) { - unsigned song, seek_time; + unsigned song; + SongTime seek_time; if (!check_unsigned(client, &song, argv[1])) return CommandResult::ERROR; - if (!check_unsigned(client, &seek_time, argv[2])) + if (!ParseCommandArg(client, seek_time, argv[2])) return CommandResult::ERROR; PlaylistResult result = @@ -315,11 +316,12 @@ handle_seek(Client &client, gcc_unused unsigned argc, char *argv[]) CommandResult handle_seekid(Client &client, gcc_unused unsigned argc, char *argv[]) { - unsigned id, seek_time; + unsigned id; + SongTime seek_time; if (!check_unsigned(client, &id, argv[1])) return CommandResult::ERROR; - if (!check_unsigned(client, &seek_time, argv[2])) + if (!ParseCommandArg(client, seek_time, argv[2])) return CommandResult::ERROR; PlaylistResult result = @@ -332,8 +334,8 @@ handle_seekcur(Client &client, gcc_unused unsigned argc, char *argv[]) { const char *p = argv[1]; bool relative = *p == '+' || *p == '-'; - int seek_time; - if (!check_int(client, &seek_time, p)) + SignedSongTime seek_time; + if (!ParseCommandArg(client, seek_time, p)) return CommandResult::ERROR; PlaylistResult result = -- cgit v1.2.3