player/Control: convert `total_play_time` to `FloatDuration`
This commit is contained in:
parent
90f4e97751
commit
1a2012a97e
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue