{Tag,Song}Print, PlayerCommands: report song duration with milliseconds precision
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user