Commit 1a2012a9 authored by Max Kellermann's avatar Max Kellermann

player/Control: convert `total_play_time` to `FloatDuration`

parent 90f4e977
......@@ -120,7 +120,7 @@ stats_print(Response &r, const Partition &partition)
#else
(unsigned)std::chrono::duration_cast<std::chrono::seconds>(std::chrono::steady_clock::now() - start_time).count(),
#endif
(unsigned long)(partition.pc.GetTotalPlayTime() + 0.5));
(unsigned long)(partition.pc.GetTotalPlayTime().count() + 0.5));
#ifdef ENABLE_DATABASE
const Database *db = partition.instance.database;
......
......@@ -231,7 +231,7 @@ class PlayerControl final : public AudioOutputClient {
const ReplayGainConfig replay_gain_config;
double total_play_time = 0;
FloatDuration total_play_time = FloatDuration::zero();
public:
PlayerControl(PlayerListener &_listener,
......@@ -580,7 +580,7 @@ public:
replay_gain_mode = _mode;
}
double GetTotalPlayTime() const noexcept {
auto GetTotalPlayTime() const noexcept {
return total_play_time;
}
......
......@@ -766,7 +766,7 @@ PlayerControl::PlayChunk(DetachedSong &song, MusicChunkPtr chunk,
const double chunk_length(chunk->length);
outputs.Play(std::move(chunk));
total_play_time += chunk_length / format.GetTimeToSize();
total_play_time += FloatDuration(chunk_length / format.GetTimeToSize());
}
inline bool
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment