From b7546eed0b24af8bdf18116e175bad927fe75211 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Thu, 11 Apr 2013 23:58:42 +0200 Subject: [PATCH] docs: Move MPD to ext registry --- docs/ext/mpd.rst | 107 +++++++++++++++++++++++++++++++ mopidy/frontends/mpd/__init__.py | 103 ++--------------------------- mopidy/frontends/mpd/ext.conf | 7 ++ 3 files changed, 119 insertions(+), 98 deletions(-) create mode 100644 docs/ext/mpd.rst create mode 100644 mopidy/frontends/mpd/ext.conf diff --git a/docs/ext/mpd.rst b/docs/ext/mpd.rst new file mode 100644 index 00000000..fc5a3082 --- /dev/null +++ b/docs/ext/mpd.rst @@ -0,0 +1,107 @@ +.. _ext-mpd: + +********** +Mopidy-MPD +********** + +This extension implements an MPD server to make Mopidy available to :ref:`MPD +clients `. + +MPD stands for Music Player Daemon, which is also the name of the `original MPD +server project `_. Mopidy does not depend on the +original MPD server, but implements the MPD protocol itself, and is thus +compatible with clients for the original MPD server. + +For more details on our MPD server implementation, see +:mod:`mopidy.frontends.mpd`. + + +Known issues +============ + +https://github.com/mopidy/mopidy/issues?labels=MPD+frontend + + +Limitations +=========== + +This is a non exhaustive list of MPD features that Mopidy doesn't support. +Items on this list will probably not be supported in the near future. + +- Toggling of audio outputs is not supported +- Channels for client-to-client communication are not supported +- Stickers are not supported +- Crossfade is not supported +- Replay gain is not supported +- ``count`` does not provide any statistics +- ``stats`` does not provide any statistics +- ``list`` does not support listing tracks by genre +- ``decoders`` does not provide information about available decoders + +The following items are currently not supported, but should be added in the +near future: + +- Modifying stored playlists is not supported +- ``tagtypes`` is not supported +- Browsing the file system is not supported +- Live update of the music database is not supported + + +Dependencies +============ + +None. The extension just needs Mopidy. + + +Configuration values +==================== + +.. confval:: mpd/enabled + + If the MPD extension should be enabled or not. + +.. confval:: mpd/hostname + + Which address the MPD server should bind to. + + ``127.0.0.1`` + Listens only on the IPv4 loopback interface + ``::1`` + Listens only on the IPv6 loopback interface + ``0.0.0.0`` + Listens on all IPv4 interfaces + ``::`` + Listens on all interfaces, both IPv4 and IPv6 + +.. confval:: mpd/port + + Which TCP port the MPD server should listen to. + +.. confval:: mpd/password + + The password required for connecting to the MPD server. If blank, no + password is required. + +.. confval:: mpd/max_connections + + The maximum number of concurrent connections the MPD server will accept. + +.. confval:: mpd/connection_timeout + + Number of seconds an MPD client can stay inactive before the connection is + closed by the server. + + +Default configuration +===================== + +.. literalinclude:: ../../mopidy/frontends/mpd/ext.conf + :language: ini + + +Usage +===== + +The extension is enabled by default. To connect to the server, use an :ref:`MPD +client `. If you want to connect to the server from another host, +you'll need to adjust the value of :confval:`mpd/hostname`. diff --git a/mopidy/frontends/mpd/__init__.py b/mopidy/frontends/mpd/__init__.py index 69297374..d0f082ae 100644 --- a/mopidy/frontends/mpd/__init__.py +++ b/mopidy/frontends/mpd/__init__.py @@ -1,104 +1,10 @@ from __future__ import unicode_literals +import os + import mopidy from mopidy import ext -from mopidy.utils import config, formatting - - -default_config = """ -[mpd] -enabled = true -hostname = 127.0.0.1 -port = 6600 -password = -max_connections = 20 -connection_timeout = 60 -""" - -__doc__ = """The MPD server frontend. - -MPD stands for Music Player Daemon. MPD is an independent project and server. -Mopidy implements the MPD protocol, and is thus compatible with clients for the -original MPD server. - -**Issues** - -https://github.com/mopidy/mopidy/issues?labels=MPD+frontend - -**Dependencies** - -None - -**Configuration** - -.. confval:: mpd/enabled - - If the MPD extension should be enabled or not. - -.. confval:: mpd/hostname - - Which address the MPD server should bind to. - - ``127.0.0.1`` - Listens only on the IPv4 loopback interface - ``::1`` - Listens only on the IPv6 loopback interface - ``0.0.0.0`` - Listens on all IPv4 interfaces - ``::`` - Listens on all interfaces, both IPv4 and IPv6 - -.. confval:: mpd/port - - Which TCP port the MPD server should listen to. - -.. confval:: mpd/password - - The password required for connecting to the MPD server. If blank, no - password is required. - -.. confval:: mpd/max_connections - - The maximum number of concurrent connections the MPD server will accept. - -.. confval:: mpd/connection_timeout - - Number of seconds an MPD client can stay inactive before the connection is - closed by the server. - -**Default config** - -.. code-block:: ini - -%(config)s - -**Usage:** - -The frontend is enabled by default. - -**Limitations:** - -This is a non exhaustive list of MPD features that Mopidy doesn't support. -Items on this list will probably not be supported in the near future. - -- Toggling of audio outputs is not supported -- Channels for client-to-client communication are not supported -- Stickers are not supported -- Crossfade is not supported -- Replay gain is not supported -- ``count`` does not provide any statistics -- ``stats`` does not provide any statistics -- ``list`` does not support listing tracks by genre -- ``decoders`` does not provide information about available decoders - -The following items are currently not supported, but should be added in the -near future: - -- Modifying stored playlists is not supported -- ``tagtypes`` is not supported -- Browsing the file system is not supported -- Live update of the music database is not supported -""" % {'config': formatting.indent(default_config)} +from mopidy.utils import config class Extension(ext.Extension): @@ -108,7 +14,8 @@ class Extension(ext.Extension): version = mopidy.__version__ def get_default_config(self): - return default_config + conf_file = os.path.join(os.path.dirname(__file__), 'ext.conf') + return open(conf_file).read() def get_config_schema(self): schema = config.ExtensionConfigSchema() diff --git a/mopidy/frontends/mpd/ext.conf b/mopidy/frontends/mpd/ext.conf new file mode 100644 index 00000000..bf77100c --- /dev/null +++ b/mopidy/frontends/mpd/ext.conf @@ -0,0 +1,7 @@ +[mpd] +enabled = true +hostname = 127.0.0.1 +port = 6600 +password = +max_connections = 20 +connection_timeout = 60