docs: Start splitting controllers into controllers and providers

This commit is contained in:
Stein Magnus Jodal 2010-10-31 23:23:40 +01:00
parent 545ad9486c
commit acda478ed3

View File

@ -6,29 +6,43 @@
:synopsis: Backend API
The backend and its controllers
===============================
The backend, controller, and provider concepts
==============================================
.. graph:: backend_relations
Backend:
The backend is mostly for convenience. It is a container that holds
references to all the controllers.
Controllers:
Each controller has responsibility for a given part of the backend
functionality. Most, but not all, controllers delegates some work to one or
more providers. The controllers are responsible for choosing the right
provider for any given task based upon i.e. the track's URI.
Providers:
Anything specific to i.e. Spotify integration or local storage is contained
in the providers. To integrate with new music sources, you just add new
providers.
backend -- current_playlist
backend -- library
backend -- playback
backend -- stored_playlists
.. digraph:: backend_relations
Backend -> "Current\nplaylist\ncontroller"
Backend -> "Library\ncontroller"
"Library\ncontroller" -> "Library\nproviders"
Backend -> "Playback\ncontroller"
"Playback\ncontroller" -> "Playback\nproviders"
Backend -> "Stored\nplaylists\ncontroller"
"Stored\nplaylists\ncontroller" -> "Stored\nplaylist\nproviders"
Backend -> Mixer
.. _backend-api:
Backend API
===========
.. note::
Currently this only documents the API that is available for use by
frontends like :mod:`mopidy.frontends.mpd`, and not what is required to
implement your own backend. :class:`mopidy.backends.base.BaseBackend` and
its controllers implements many of these methods in a matter that should be
independent of most concrete backend implementations, so you should
generally just implement or override a few of these methods yourself to
create a new backend with a complete feature set.
The backend API is the interface that is used by frontends like
:mod:`mopidy.frontends.mpd`. If you want to implement your own backend, see
the :ref:`provider-api`.
.. autoclass:: mopidy.backends.base.BaseBackend
:members:
@ -82,6 +96,26 @@ Manages the music library, e.g. searching for tracks to be added to a playlist.
:undoc-members:
.. _provider-api:
Provider API
============
.. note::
The provider API is the interface that must be implemented when you create
a backend. If you are working on a frontend and need to access the backend,
see the :ref:`backend-api`.
Playback provider
-----------------
.. autoclass:: mopidy.backends.base.BasePlaybackProvider
:members:
:undoc-members:
Backend implementations
=======================