command: added new "status" line with more precise "elapsed time"

This commit is contained in:
Max Kellermann 2009-06-25 08:37:34 +02:00
parent 4ffd9bce5a
commit ce072b89d2
3 changed files with 14 additions and 0 deletions

2
NEWS
View File

@ -1,4 +1,6 @@
ver 0.16 (20??/??/??)
* commands:
- added new "status" line with more precise "elapsed time"
ver 0.15 (2009/06/23)

View File

@ -277,6 +277,16 @@
playing/paused song)</returnvalue>
</para>
</listitem>
<listitem>
<para>
<varname>elapsed</varname>:
<footnote id="since_0_16"><simpara>Since MPD 0.16</simpara></footnote>
<returnvalue>
Total time elapsed within the current song, but
with higher resolution.
</returnvalue>
</para>
</listitem>
<listitem>
<para>
<varname>bitrate</varname>:

View File

@ -501,9 +501,11 @@ handle_status(struct client *client,
const struct audio_format *af = player_get_audio_format();
client_printf(client,
COMMAND_STATUS_TIME ": %i:%i\n"
"elapsed: %1.3f\n"
COMMAND_STATUS_BITRATE ": %li\n"
COMMAND_STATUS_AUDIO ": %u:%u:%u\n",
getPlayerElapsedTime(), getPlayerTotalTime(),
pc.elapsed_time,
getPlayerBitRate(),
af->sample_rate, af->bits, af->channels);
}