Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
1a2012a9
Commit
1a2012a9
authored
Sep 21, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
player/Control: convert `total_play_time` to `FloatDuration`
parent
90f4e977
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
Stats.cxx
src/Stats.cxx
+1
-1
Control.hxx
src/player/Control.hxx
+2
-2
Thread.cxx
src/player/Thread.cxx
+1
-1
No files found.
src/Stats.cxx
View file @
1a2012a9
...
...
@@ -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
;
...
...
src/player/Control.hxx
View file @
1a2012a9
...
...
@@ -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
;
}
...
...
src/player/Thread.cxx
View file @
1a2012a9
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment