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
70b5a81a
Commit
70b5a81a
authored
Nov 25, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
{Tag,Song}Print, PlayerCommands: report song duration with milliseconds precision
parent
83fd822e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
4 deletions
+22
-4
NEWS
NEWS
+1
-0
protocol.xml
doc/protocol.xml
+9
-0
SongPrint.cxx
src/SongPrint.cxx
+4
-1
TagPrint.cxx
src/TagPrint.cxx
+4
-3
PlayerCommands.cxx
src/command/PlayerCommands.cxx
+4
-0
No files found.
NEWS
View file @
70b5a81a
...
...
@@ -2,6 +2,7 @@ ver 0.20 (not yet released)
* protocol
- "commands" returns playlist commands only if playlist_directory configured
- "search"/"find" have a "window" parameter
- report song duration with milliseconds precision
* tags
- ape: drop support for non-standard tag "album artist"
* output
...
...
doc/protocol.xml
View file @
70b5a81a
...
...
@@ -517,6 +517,15 @@
</listitem>
<listitem>
<para>
<varname>
duration
</varname>
:
<footnote
id=
"since_0_20"
><simpara>
Introduced with
<application>
MPD
</application>
0.20
</simpara></footnote>
<returnvalue>
Duration of the current song in seconds.
</returnvalue>
</para>
</listitem>
<listitem>
<para>
<varname>
bitrate
</varname>
:
<returnvalue>
instantaneous bitrate in
kbps
</returnvalue>
...
...
src/SongPrint.cxx
View file @
70b5a81a
...
...
@@ -122,5 +122,8 @@ song_print_info(Client &client, const DetachedSong &song, bool base)
const
auto
duration
=
song
.
GetDuration
();
if
(
!
duration
.
IsNegative
())
client_printf
(
client
,
"Time: %u
\n
"
,
duration
.
RoundS
());
client_printf
(
client
,
"Time: %i
\n
"
"duration: %1.3f
\n
"
,
duration
.
RoundS
(),
duration
.
ToDoubleS
());
}
src/TagPrint.cxx
View file @
70b5a81a
...
...
@@ -23,8 +23,6 @@
#include "tag/TagSettings.h"
#include "client/Client.hxx"
#define SONG_TIME "Time: "
void
tag_print_types
(
Client
&
client
)
{
int
i
;
...
...
@@ -53,7 +51,10 @@ tag_print_values(Client &client, const Tag &tag)
void
tag_print
(
Client
&
client
,
const
Tag
&
tag
)
{
if
(
!
tag
.
duration
.
IsNegative
())
client_printf
(
client
,
SONG_TIME
"%i
\n
"
,
tag
.
duration
.
RoundS
());
client_printf
(
client
,
"Time: %i
\n
"
"duration: %1.3f
\n
"
,
tag
.
duration
.
RoundS
(),
tag
.
duration
.
ToDoubleS
());
tag_print_values
(
client
,
tag
);
}
src/command/PlayerCommands.cxx
View file @
70b5a81a
...
...
@@ -182,6 +182,10 @@ handle_status(Client &client,
player_status
.
elapsed_time
.
ToDoubleS
(),
player_status
.
bit_rate
);
if
(
!
player_status
.
total_time
.
IsNegative
())
client_printf
(
client
,
"duration: %1.3f
\n
"
,
player_status
.
total_time
.
ToDoubleS
());
if
(
player_status
.
audio_format
.
IsDefined
())
{
struct
audio_format_string
af_string
;
...
...
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