diff options
Diffstat (limited to 'src/player.h')
| -rw-r--r-- | src/player.h | 64 |
1 files changed, 26 insertions, 38 deletions
diff --git a/src/player.h b/src/player.h index 1e69d9e..f959542 100644 --- a/src/player.h +++ b/src/player.h @@ -4,19 +4,15 @@ #include "list.h" #include "util.h" -#include "mpd/client.h" - -#include <signal.h> - enum { - PLAYER_OK, - PLAYER_ERR + PLAYER_STATUS_OK, + PLAYER_STATUS_ERR }; enum { - PLAYER_MSG_NONE, - PLAYER_MSG_INFO, - PLAYER_MSG_ERR + PLAYER_STATUS_MSG_NONE, + PLAYER_STATUS_MSG_INFO, + PLAYER_STATUS_MSG_ERR }; enum { @@ -33,45 +29,41 @@ enum { }; struct player { - /* TODO move implementation details to source file */ - struct mpd_connection *conn; - - /* TODO combine with index */ - /* for navigating forward and backwards in time */ - struct list queue; - struct list history; + /* played track history */ + struct list history; /* struct ref -> struct track */ + struct link *history_sel; /* position in history */ - /* list of track refs to choose from on prev / next */ - struct list playlist; + /* queued tracks */ + struct list queue; /* struct ref -> struct track */ - /* last player track */ + /* selected track, not (yet) part of history or queue */ struct track *track; - /* player has a track loaded, - * not necessarily player->track */ - int loaded; + /* list of tracks to choose from on prev / next */ + struct list playlist; /* struct ref -> struct track */ + struct link *playlist_sel; /* position in playlist */ - /* stopped, paused or playing */ - int state; + /* a track is loaded, not necessarily player.track */ + bool loaded; /* automatically select new tracks when queue empty */ - int autoplay; + bool autoplay; - int shuffle; + /* randomize which track is chosen when queue empty */ + bool shuffle; - int action; - - /* number of frames to wait before unpausing after - * seek to prevent pause-play cycle noises */ - int seek_delay; + /* stopped, paused or playing */ + int state; + /* volume adjustment when possible */ int volume; + /* track position and duration */ unsigned int time_pos, time_end; /* status messaging */ - char *msg; - int msglvl; + char *status; + int status_lvl; }; void player_init(void); @@ -79,10 +71,6 @@ void player_deinit(void); void player_update(void); -void player_queue_clear(void); -void player_queue_append(struct track *track); -void player_queue_insert(struct track *track, size_t pos); - int player_play_track(struct track *track); int player_toggle_pause(void); @@ -96,5 +84,5 @@ int player_stop(void); int player_set_volume(unsigned int vol); -extern struct player *player; +extern struct player player; |
