diff --git a/docs/api/backends.rst b/docs/api/backends.rst index e099fbf8..0db463f5 100644 --- a/docs/api/backends.rst +++ b/docs/api/backends.rst @@ -62,8 +62,10 @@ Other backends :members: -GStreamer backend ------------------ +:mod:`mopidy.backends.gstreamer` -- GStreamer backend +----------------------------------------------------- -``GstreamerBackend`` is pending merge from `adamcik/mopidy/gstreamer -`_. +.. automodule:: mopidy.backends.gstreamer + :synopsis: Backend for playing music from a local music archive using the + GStreamer library. + :members: diff --git a/docs/api/mixers.rst b/docs/api/mixers.rst index aa5998d0..26f4dc40 100644 --- a/docs/api/mixers.rst +++ b/docs/api/mixers.rst @@ -39,7 +39,7 @@ in the settings, Mopidy will choose one for you based upon what OS you run. See --------------------------------------- .. automodule:: mopidy.mixers.alsa - :synopsis: ALSA mixer + :synopsis: ALSA mixer for Linux. :members: .. inheritance-diagram:: mopidy.mixers.alsa.AlsaMixer @@ -49,7 +49,7 @@ in the settings, Mopidy will choose one for you based upon what OS you run. See ----------------------------------------- .. automodule:: mopidy.mixers.dummy - :synopsis: Dummy mixer + :synopsis: Dummy mixer for testing. :members: .. inheritance-diagram:: mopidy.mixers.dummy @@ -59,7 +59,7 @@ in the settings, Mopidy will choose one for you based upon what OS you run. See ------------------------------------- .. automodule:: mopidy.mixers.osa - :synopsis: Osa mixer + :synopsis: Osa mixer for OS X. :members: .. inheritance-diagram:: mopidy.mixers.osa @@ -80,7 +80,7 @@ choose. --------------------------------------------------- .. automodule:: mopidy.mixers.denon - :synopsis: Denon amplifier mixer + :synopsis: Denon amplifier mixer. :members: .. inheritance-diagram:: mopidy.mixers.denon @@ -90,7 +90,7 @@ choose. ----------------------------------------------- .. automodule:: mopidy.mixers.nad - :synopsis: NAD amplifier mixer + :synopsis: NAD amplifier mixer. :members: .. inheritance-diagram:: mopidy.mixers.nad diff --git a/docs/changes.rst b/docs/changes.rst index 54cd8b1f..f0953d7a 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -7,7 +7,10 @@ This change log is used to track all major changes to Mopidy. 0.1.0a1 (unreleased) ==================== -- Changed backend API for get/filter/find_exact/search. +- Merged the ``gstreamer`` branch from Thomas Adamcik, bringing more than a + hundred new tests, several bugfixes and a new backend for playing music from + a local music archive. +- **[WIP]** Changed backend API for get/filter/find_exact/search. 0.1.0a0 (2010-03-27) diff --git a/docs/development/roadmap.rst b/docs/development/roadmap.rst index 7b3f0a56..b3188a40 100644 --- a/docs/development/roadmap.rst +++ b/docs/development/roadmap.rst @@ -24,9 +24,8 @@ Stuff we really want to do, but just not right now - Replace libspotify with `openspotify `_ for the ``LibspotifyBackend``. -- A backend for playback from local disk. Quite a bit of work on a `gstreamer - `_ backend has already been done by Thomas - Adamcik. +- **[WIP]** A backend for playback from local disk. Quite a bit of work on + :mod:`mopidy.backends.gstreamer` has already been done by Thomas Adamcik. - Support multiple backends at the same time. It would be really nice to have tracks from local disk and Spotify tracks in the same playlist. - **[Done]** Package Mopidy as a `Python package diff --git a/docs/installation/despotify.rst b/docs/installation/despotify.rst index ef47ca64..d77bdefb 100644 --- a/docs/installation/despotify.rst +++ b/docs/installation/despotify.rst @@ -30,9 +30,9 @@ Installing despotify sudo port install libvorbis libtool ncursesw libao -*All OS:* Check out revision 503 of the despotify source code:: +*All OS:* Check out revision 507 of the despotify source code:: - svn checkout https://despotify.svn.sourceforge.net/svnroot/despotify@503 + svn checkout https://despotify.svn.sourceforge.net/svnroot/despotify@507 *OS X, MacPorts:* Copy ``despotify/src/Makefile.local.mk.dist`` to ``despotify/src/Makefile.local.mk`` and uncomment the last two lines of the new diff --git a/docs/installation/libspotify.rst b/docs/installation/libspotify.rst index 6fbe57f5..3dfd8f5a 100644 --- a/docs/installation/libspotify.rst +++ b/docs/installation/libspotify.rst @@ -16,11 +16,16 @@ To use the libspotify backend you must install libspotify and Installing libspotify ===================== -As libspotify's installation script at the moment is somewhat broken (see this -`GetSatisfaction thread `_ -for details), it is easiest to use the libspotify files bundled with pyspotify. -The files bundled with pyspotify are for 64-bit, so if you run a 32-bit OS, you -must get libspotify from https://developer.spotify.com/en/libspotify/. +Download and install libspotify 0.0.4 for your OS and CPU architecture from +https://developer.spotify.com/en/libspotify/. + +For 64-bit Linux the process is as follows:: + + wget http://developer.spotify.com/download/libspotify/libspotify-0.0.4-linux6-x86_64.tar.gz + tar zxfv libspotify-0.0.4-linux6-x86_64.tar.gz + cd libspotify-0.0.4-linux6-x86_64/ + sudo make install prefix=/usr/local + sudo ldconfig Installing pyspotify @@ -32,9 +37,8 @@ Install pyspotify's dependencies. At Debian/Ubuntu systems:: Check out the pyspotify code, and install it:: - git clone git://github.com/winjer/pyspotify.git + git clone git://github.com/jodal/pyspotify.git cd pyspotify - export LD_LIBRARY_PATH=$PWD/lib sudo python setup.py develop Apply for an application key at @@ -49,12 +53,6 @@ Test your libspotify setup:: examples/example1.py -u USERNAME -p PASSWORD -.. note:: - - Until Spotify fixes their installation script, you'll have to set - ``LD_LIBRARY_PATH`` every time you are going to use libspotify (in other - words before starting Mopidy). - Setting up Mopidy to use libspotify =================================== diff --git a/mopidy/backends/gstreamer.py b/mopidy/backends/gstreamer.py index de595726..8a79ff11 100644 --- a/mopidy/backends/gstreamer.py +++ b/mopidy/backends/gstreamer.py @@ -29,6 +29,12 @@ message_thread.daemon = True message_thread.start() class GStreamerBackend(BaseBackend): + """ + A backend for playing music from a local music archive. + + Uses the `GStreamer `_ library. + """ + def __init__(self, *args, **kwargs): super(GStreamerBackend, self).__init__(*args, **kwargs) @@ -104,6 +110,7 @@ class GStreamerPlaybackController(BasePlaybackController): bus.remove_signal_watch() bin.get_state() bin.set_state(gst.STATE_NULL) + bus.set_flushing(True) del bus del bin diff --git a/mopidy/backends/libspotify.py b/mopidy/backends/libspotify.py index 67b65318..04ff4ffc 100644 --- a/mopidy/backends/libspotify.py +++ b/mopidy/backends/libspotify.py @@ -134,13 +134,17 @@ class LibspotifyTranslator(object): if not spotify_track.is_loaded(): return Track(name=u'[loading...]') uri = str(Link.from_track(spotify_track, 0)) + if dt.MINYEAR <= int(spotify_track.album().year()) <= dt.MAXYEAR: + date = dt.date(spotify_track.album().year(), 1, 1) + else: + date = None return Track( uri=uri, name=spotify_track.name().decode(ENCODING), artists=[cls.to_mopidy_artist(a) for a in spotify_track.artists()], album=cls.to_mopidy_album(spotify_track.album()), track_no=spotify_track.index(), - date=dt.date(spotify_track.album().year(), 1, 1), + date=date, length=spotify_track.duration(), bitrate=320, id=cls.to_mopidy_id(uri), diff --git a/tests/backends/gstreamer_test.py b/tests/backends/gstreamer_test.py index f49d847c..71e92a53 100644 --- a/tests/backends/gstreamer_test.py +++ b/tests/backends/gstreamer_test.py @@ -25,7 +25,6 @@ class GStreamerCurrentPlaylistHandlerTest(BaseCurrentPlaylistControllerTest, uni class GStreamerPlaybackControllerTest(BasePlaybackControllerTest, unittest.TestCase): tracks = [Track(uri=generate_song(i), id=i, length=4464) for i in range(1, 4)] - backend_class = GStreamerBackend def add_track(self, file):