summaryrefslogtreecommitdiff
path: root/src/Partition.hxx
diff options
context:
space:
mode:
authorPatryk HachuĊ‚a <hahiserw@gmail.com>2018-02-05 17:13:00 +0100
committerMax Kellermann <max@musicpd.org>2018-02-25 09:50:03 +0100
commit1628d801f9534ab33a711d337cdd691dca2c5710 (patch)
tree2cd898e2769fe9a897b7c67acf13ac7422df4ed2 /src/Partition.hxx
parent1fb358249b2a4f63d82103348d2904fcef608353 (diff)
playlist/Queue: add one-shot to single mode
Diffstat (limited to 'src/Partition.hxx')
-rw-r--r--src/Partition.hxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/Partition.hxx b/src/Partition.hxx
index 94056522d..e2e15351d 100644
--- a/src/Partition.hxx
+++ b/src/Partition.hxx
@@ -28,6 +28,7 @@
#include "player/Control.hxx"
#include "player/Listener.hxx"
#include "ReplayGainMode.hxx"
+#include "SingleMode.hxx"
#include "Chrono.hxx"
#include "Compiler.h"
@@ -46,6 +47,7 @@ class ClientListener;
struct Partition final : QueueListener, PlayerListener, MixerListener {
static constexpr unsigned TAG_MODIFIED = 0x1;
static constexpr unsigned SYNC_WITH_PLAYER = 0x2;
+ static constexpr unsigned BORDER_PAUSE = 0x4;
Instance &instance;
@@ -184,7 +186,7 @@ struct Partition final : QueueListener, PlayerListener, MixerListener {
playlist.SetRandom(pc, new_value);
}
- void SetSingle(bool new_value) {
+ void SetSingle(SingleMode new_value) {
playlist.SetSingle(pc, new_value);
}
@@ -237,6 +239,12 @@ struct Partition final : QueueListener, PlayerListener, MixerListener {
*/
void SyncWithPlayer();
+ /**
+ * Border pause has just been enabled. Change single mode to off
+ * if it was one-shot.
+ */
+ void BorderPause();
+
private:
/* virtual methods from class QueueListener */
void OnQueueModified() override;
@@ -246,6 +254,7 @@ private:
/* virtual methods from class PlayerListener */
void OnPlayerSync() noexcept override;
void OnPlayerTagModified() noexcept override;
+ void OnBorderPause() noexcept override;
/* virtual methods from class MixerListener */
void OnMixerVolumeChanged(Mixer &mixer, int volume) override;