summaryrefslogtreecommitdiff
path: root/src/command
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2018-09-22 19:24:34 +0200
committerMax Kellermann <max@musicpd.org>2018-09-22 19:37:02 +0200
commit224400074c61f667fb6d0d89d7170a4d04ba39b4 (patch)
treeb02aae9496bf02c1596d7eb0275ea6ee3134173a /src/command
parent863722545f1d892ce4d30b91f6bf25bb08b48a19 (diff)
player/CrossFade: use std::chrono::duration
Diffstat (limited to 'src/command')
-rw-r--r--src/command/PlayerCommands.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/command/PlayerCommands.cxx b/src/command/PlayerCommands.cxx
index 27147f373..136baeb10 100644
--- a/src/command/PlayerCommands.cxx
+++ b/src/command/PlayerCommands.cxx
@@ -152,13 +152,13 @@ handle_status(Client &client, gcc_unused Request args, Response &r)
pc.GetMixRampDb(),
state);
- if (pc.GetCrossFade() > 0)
+ if (pc.GetCrossFade() > FloatDuration::zero())
r.Format(COMMAND_STATUS_CROSSFADE ": %lu\n",
- std::lround(pc.GetCrossFade()));
+ std::lround(pc.GetCrossFade().count()));
- if (pc.GetMixRampDelay() > 0)
+ if (pc.GetMixRampDelay() > FloatDuration::zero())
r.Format(COMMAND_STATUS_MIXRAMPDELAY ": %f\n",
- pc.GetMixRampDelay());
+ pc.GetMixRampDelay().count());
song = playlist.GetCurrentPosition();
if (song >= 0) {
@@ -316,8 +316,8 @@ handle_seekcur(Client &client, Request args, gcc_unused Response &r)
CommandResult
handle_crossfade(Client &client, Request args, gcc_unused Response &r)
{
- unsigned xfade_time = args.ParseUnsigned(0);
- client.GetPlayerControl().SetCrossFade(xfade_time);
+ FloatDuration duration{args.ParseUnsigned(0)};
+ client.GetPlayerControl().SetCrossFade(duration);
return CommandResult::OK;
}
@@ -332,7 +332,7 @@ handle_mixrampdb(Client &client, Request args, gcc_unused Response &r)
CommandResult
handle_mixrampdelay(Client &client, Request args, gcc_unused Response &r)
{
- float delay_secs = args.ParseFloat(0);
+ FloatDuration delay_secs{args.ParseFloat(0)};
client.GetPlayerControl().SetMixRampDelay(delay_secs);
return CommandResult::OK;
}