Playlist: use std::chrono::duration for Seek*()
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
@@ -25,6 +25,8 @@
|
||||
#include <stdint.h>
|
||||
|
||||
class Client;
|
||||
class SongTime;
|
||||
class SignedSongTime;
|
||||
|
||||
bool
|
||||
check_uint32(Client &client, uint32_t *dst, const char *s);
|
||||
@@ -45,4 +47,10 @@ check_bool(Client &client, bool *value_r, const char *s);
|
||||
bool
|
||||
check_float(Client &client, float *value_r, const char *s);
|
||||
|
||||
bool
|
||||
ParseCommandArg(Client &client, SongTime &value_r, const char *s);
|
||||
|
||||
bool
|
||||
ParseCommandArg(Client &client, SignedSongTime &value_r, const char *s);
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user