aboutsummaryrefslogtreecommitdiffstats
path: root/src/player_control.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-08-25 08:44:31 +0200
committerMax Kellermann <max@duempel.org>2012-08-25 09:38:41 +0200
commitf351550534939478d7ddc791dc76aafd5f2a3503 (patch)
tree3672f6b43ee97f00ba7812cdfce92dda2c901437 /src/player_control.h
parent66ecf39efe703185b1d54775e052d1c6a3f76903 (diff)
downloadmpd-f351550534939478d7ddc791dc76aafd5f2a3503.tar.gz
mpd-f351550534939478d7ddc791dc76aafd5f2a3503.tar.xz
mpd-f351550534939478d7ddc791dc76aafd5f2a3503.zip
player_thread: disable cross-fading in "single" mode
This commit reimplements the core of the "single" mode. Instead of doing the detection in the playlist code from the outside, it is moved to the player thread, which gets a new option called "border_pause". It will now pause playback exactly at the beginning of the new song, making the feature more reliable. Now that the player thread knows what will happen, it can suppress cross-fading. Fixes mantis tickets 0003055 and 0003166.
Diffstat (limited to 'src/player_control.h')
-rw-r--r--src/player_control.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/player_control.h b/src/player_control.h
index 5a04ab0f9..a77d31ec5 100644
--- a/src/player_control.h
+++ b/src/player_control.h
@@ -115,6 +115,15 @@ struct player_control {
float mixramp_db;
float mixramp_delay_seconds;
double total_play_time;
+
+ /**
+ * If this flag is set, then the player will be auto-paused at
+ * the end of the song, before the next song starts to play.
+ *
+ * This is a copy of the queue's "single" flag most of the
+ * time.
+ */
+ bool border_pause;
};
struct player_control *
@@ -207,6 +216,12 @@ pc_set_pause(struct player_control *pc, bool pause_flag);
void
pc_pause(struct player_control *pc);
+/**
+ * Set the player's #border_pause flag.
+ */
+void
+pc_set_border_pause(struct player_control *pc, bool border_pause);
+
void
pc_kill(struct player_control *pc);