aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-10 14:51:22 +0200
committerMax Kellermann <max@duempel.org>2008-10-10 14:51:22 +0200
commit5de7521900285dab2ffa8b9a0af6f883494686b5 (patch)
tree4edb7857ca57684bdb774bbb7c43f4f7b5dab831 /src
parent0b4dfae22e883d376bc44e1e2d78f201d045970b (diff)
downloadmpd-5de7521900285dab2ffa8b9a0af6f883494686b5.tar.gz
mpd-5de7521900285dab2ffa8b9a0af6f883494686b5.tar.xz
mpd-5de7521900285dab2ffa8b9a0af6f883494686b5.zip
player: added player_get_audio_format()
player_get_audio_format() replaces getPlayerSampleRate(), getPlayerBits(), getPlayerChannels().
Diffstat (limited to '')
-rw-r--r--src/command.c5
-rw-r--r--src/player_control.c15
-rw-r--r--src/player_control.h10
3 files changed, 8 insertions, 22 deletions
diff --git a/src/command.c b/src/command.c
index 2557e86a4..14ba2c300 100644
--- a/src/command.c
+++ b/src/command.c
@@ -399,15 +399,16 @@ static int commandStatus(struct client *client,
COMMAND_STATUS_SONGID ": %i\n",
song, getPlaylistSongId(song));
}
+
if (getPlayerState() != PLAYER_STATE_STOP) {
+ const struct audio_format *af = player_get_audio_format();
client_printf(client,
COMMAND_STATUS_TIME ": %i:%i\n"
COMMAND_STATUS_BITRATE ": %li\n"
COMMAND_STATUS_AUDIO ": %u:%u:%u\n",
getPlayerElapsedTime(), getPlayerTotalTime(),
getPlayerBitRate(),
- getPlayerSampleRate(), getPlayerBits(),
- getPlayerChannels());
+ af->sample_rate, af->bits, af->channels);
}
if ((updateJobId = isUpdatingDB())) {
diff --git a/src/player_control.c b/src/player_control.c
index efdab7208..bab119684 100644
--- a/src/player_control.c
+++ b/src/player_control.c
@@ -254,21 +254,6 @@ double getPlayerTotalPlayTime(void)
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 */
struct song *
playerCurrentDecodeSong(void)
diff --git a/src/player_control.h b/src/player_control.h
index b763cc389..5b3c4a5d2 100644
--- a/src/player_control.h
+++ b/src/player_control.h
@@ -154,11 +154,11 @@ void setPlayerSoftwareVolume(int volume);
double getPlayerTotalPlayTime(void);
-unsigned int getPlayerSampleRate(void);
-
-unsigned getPlayerBits(void);
-
-unsigned getPlayerChannels(void);
+static inline const struct audio_format *
+player_get_audio_format(void)
+{
+ return &pc.audio_format;
+}
struct song *
playerCurrentDecodeSong(void);