summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2017-02-17 23:59:06 +0100
committerMax Kellermann <max@musicpd.org>2017-02-17 23:59:06 +0100
commit3b84b998048e59b9d845b0b6f8e31c52a8989d1e (patch)
treeb11ade4ccedbf205ce232b803d15676e07cce5e1 /src
parent1786f9b1bbf079d96041e1d27d7324a16b3b3f85 (diff)
IdleFlags: add a "partition" event
Diffstat (limited to 'src')
-rw-r--r--src/IdleFlags.cxx1
-rw-r--r--src/IdleFlags.hxx3
-rw-r--r--src/command/PartitionCommands.cxx3
3 files changed, 7 insertions, 0 deletions
diff --git a/src/IdleFlags.cxx b/src/IdleFlags.cxx
index 84b49add3..731b2075e 100644
--- a/src/IdleFlags.cxx
+++ b/src/IdleFlags.cxx
@@ -42,6 +42,7 @@ static const char *const idle_names[] = {
"message",
"neighbor",
"mount",
+ "partition",
nullptr
};
diff --git a/src/IdleFlags.hxx b/src/IdleFlags.hxx
index 423ad272d..e6a221477 100644
--- a/src/IdleFlags.hxx
+++ b/src/IdleFlags.hxx
@@ -67,6 +67,9 @@ static constexpr unsigned IDLE_NEIGHBOR = 0x800;
/** the mount list has changed */
static constexpr unsigned IDLE_MOUNT = 0x1000;
+/** the partition list has changed */
+static constexpr unsigned IDLE_PARTITION = 0x2000;
+
/**
* Get idle names
*/
diff --git a/src/command/PartitionCommands.cxx b/src/command/PartitionCommands.cxx
index 873b1dbe0..e8072811c 100644
--- a/src/command/PartitionCommands.cxx
+++ b/src/command/PartitionCommands.cxx
@@ -22,6 +22,7 @@
#include "Request.hxx"
#include "Instance.hxx"
#include "Partition.hxx"
+#include "IdleFlags.hxx"
#include "client/Client.hxx"
#include "client/Response.hxx"
#include "player/Thread.hxx"
@@ -102,5 +103,7 @@ handle_newpartition(Client &client, Request request, Response &response)
StartPlayerThread(partition.pc);
partition.pc.LockUpdateAudio();
+ instance.EmitIdle(IDLE_PARTITION);
+
return CommandResult::OK;
}