aboutsummaryrefslogtreecommitdiffstats
path: root/src/player_control.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-10-08 20:48:07 +0200
committerMax Kellermann <max@duempel.org>2009-10-08 20:48:07 +0200
commit76953a9748e367442fe7c961845ee36b9a0e1596 (patch)
tree9aad3078411e170a56e11e31158a66f26734298a /src/player_control.h
parent128a5fa4a599b72e6cb9c9f3954aec62dd3b3181 (diff)
downloadmpd-76953a9748e367442fe7c961845ee36b9a0e1596.tar.gz
mpd-76953a9748e367442fe7c961845ee36b9a0e1596.tar.xz
mpd-76953a9748e367442fe7c961845ee36b9a0e1596.zip
player_control: bundle "get" functions in pc_get_status()
The new player_status struct replaces a bunch of playerGetX() functions. When we add proper locking to the player_control struct, we will only need to lock once for the "status" command.
Diffstat (limited to 'src/player_control.h')
-rw-r--r--src/player_control.h21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/player_control.h b/src/player_control.h
index 9cf5b1377..e6b19ee68 100644
--- a/src/player_control.h
+++ b/src/player_control.h
@@ -60,6 +60,14 @@ enum player_error {
PLAYER_ERROR_FILENOTFOUND,
};
+struct player_status {
+ enum player_state state;
+ uint16_t bit_rate;
+ struct audio_format audio_format;
+ float total_time;
+ float elapsed_time;
+};
+
struct player_control {
unsigned buffer_chunks;
@@ -112,11 +120,8 @@ void playerPause(void);
void playerKill(void);
-int getPlayerTotalTime(void);
-
-int getPlayerElapsedTime(void);
-
-unsigned long getPlayerBitRate(void);
+void
+pc_get_status(struct player_status *status);
enum player_state getPlayerState(void);
@@ -151,12 +156,6 @@ float getPlayerCrossFade(void);
double getPlayerTotalPlayTime(void);
-static inline const struct audio_format *
-player_get_audio_format(void)
-{
- return &pc.audio_format;
-}
-
void playerInit(void);
#endif