diff options
author | Max Kellermann <max@duempel.org> | 2014-01-18 16:36:42 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-01-26 00:10:05 +0100 |
commit | 5c4a42caa088335868342b25a834962cbc0d08a2 (patch) | |
tree | 388c039572317877f798e0f0c25d9e3c04ddcae3 /src/command/AllCommands.cxx | |
parent | e847788569bd91ca136160694a49665097c0e8ab (diff) | |
download | mpd-5c4a42caa088335868342b25a834962cbc0d08a2.tar.gz mpd-5c4a42caa088335868342b25a834962cbc0d08a2.tar.xz mpd-5c4a42caa088335868342b25a834962cbc0d08a2.zip |
neighbor: new subsystem to detect file servers on the local network
This commit adds the NeighborPlugin API which can be used to detect
nearby file servers that can be used by input plugins. This list of
servers is exported using the new "listneighbors" command. The idle
even "neighbor" notifies interested clients when a new neighbor is
found or an existing one is lost.
There's a lot missing currently: protocol&user documentation, and a
way to "mount" remote servers into the music database. Obviously,
some code from the UPnP database plugin can be moved to a neighbor
plugin.
Diffstat (limited to 'src/command/AllCommands.cxx')
-rw-r--r-- | src/command/AllCommands.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/command/AllCommands.cxx b/src/command/AllCommands.cxx index ce753b300..750fd1219 100644 --- a/src/command/AllCommands.cxx +++ b/src/command/AllCommands.cxx @@ -27,6 +27,7 @@ #include "FileCommands.hxx" #include "OutputCommands.hxx" #include "MessageCommands.hxx" +#include "NeighborCommands.hxx" #include "OtherCommands.hxx" #include "Permission.hxx" #include "tag/TagType.h" @@ -99,6 +100,9 @@ static const struct command commands[] = { { "list", PERMISSION_READ, 1, -1, handle_list }, { "listall", PERMISSION_READ, 0, 1, handle_listall }, { "listallinfo", PERMISSION_READ, 0, 1, handle_listallinfo }, +#ifdef ENABLE_NEIGHBOR_PLUGINS + { "listneighbors", PERMISSION_READ, 0, 0, handle_listneighbors }, +#endif { "listplaylist", PERMISSION_READ, 1, 1, handle_listplaylist }, { "listplaylistinfo", PERMISSION_READ, 1, 1, handle_listplaylistinfo }, { "listplaylists", PERMISSION_READ, 0, 0, handle_listplaylists }, @@ -179,6 +183,11 @@ command_available(gcc_unused const struct command *cmd) return sticker_enabled(); #endif +#ifdef ENABLE_NEIGHBOR_PLUGINS + if (strcmp(cmd->cmd, "listneighbors") == 0) + return neighbor_commands_available(); +#endif + return true; } |