Commit 5de75219 authored by Max Kellermann's avatar Max Kellermann

player: added player_get_audio_format()

player_get_audio_format() replaces getPlayerSampleRate(), getPlayerBits(), getPlayerChannels().
parent 0b4dfae2
...@@ -399,15 +399,16 @@ static int commandStatus(struct client *client, ...@@ -399,15 +399,16 @@ static int commandStatus(struct client *client,
COMMAND_STATUS_SONGID ": %i\n", COMMAND_STATUS_SONGID ": %i\n",
song, getPlaylistSongId(song)); song, getPlaylistSongId(song));
} }
if (getPlayerState() != PLAYER_STATE_STOP) { if (getPlayerState() != PLAYER_STATE_STOP) {
const struct audio_format *af = player_get_audio_format();
client_printf(client, client_printf(client,
COMMAND_STATUS_TIME ": %i:%i\n" COMMAND_STATUS_TIME ": %i:%i\n"
COMMAND_STATUS_BITRATE ": %li\n" COMMAND_STATUS_BITRATE ": %li\n"
COMMAND_STATUS_AUDIO ": %u:%u:%u\n", COMMAND_STATUS_AUDIO ": %u:%u:%u\n",
getPlayerElapsedTime(), getPlayerTotalTime(), getPlayerElapsedTime(), getPlayerTotalTime(),
getPlayerBitRate(), getPlayerBitRate(),
getPlayerSampleRate(), getPlayerBits(), af->sample_rate, af->bits, af->channels);
getPlayerChannels());
} }
if ((updateJobId = isUpdatingDB())) { if ((updateJobId = isUpdatingDB())) {
......
...@@ -254,21 +254,6 @@ double getPlayerTotalPlayTime(void) ...@@ -254,21 +254,6 @@ double getPlayerTotalPlayTime(void)
return pc.totalPlayTime; return pc.totalPlayTime;
} }
unsigned int getPlayerSampleRate(void)
{
return pc.audio_format.sample_rate;
}
unsigned getPlayerBits(void)
{
return pc.audio_format.bits;
}
unsigned getPlayerChannels(void)
{
return pc.audio_format.channels;
}
/* this actually creates a dupe of the current metadata */ /* this actually creates a dupe of the current metadata */
struct song * struct song *
playerCurrentDecodeSong(void) playerCurrentDecodeSong(void)
......
...@@ -154,11 +154,11 @@ void setPlayerSoftwareVolume(int volume); ...@@ -154,11 +154,11 @@ void setPlayerSoftwareVolume(int volume);
double getPlayerTotalPlayTime(void); double getPlayerTotalPlayTime(void);
unsigned int getPlayerSampleRate(void); static inline const struct audio_format *
player_get_audio_format(void)
unsigned getPlayerBits(void); {
return &pc.audio_format;
unsigned getPlayerChannels(void); }
struct song * struct song *
playerCurrentDecodeSong(void); playerCurrentDecodeSong(void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment