From dea5d4ba5b891a24bd220c18412135617ca6f496 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Mon, 12 Apr 2010 23:45:45 +0200 Subject: [PATCH 1/6] Update docs to reflect that the gstreamer branch has been merged --- docs/api/backends.rst | 10 ++++++---- docs/changes.rst | 5 ++++- docs/development/roadmap.rst | 5 ++--- mopidy/backends/gstreamer.py | 7 +++++++ 4 files changed, 19 insertions(+), 8 deletions(-) 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/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 b9a5cc02..ee074eee 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/mopidy/backends/gstreamer.py b/mopidy/backends/gstreamer.py index 1e84af57..25c6cca7 100644 --- a/mopidy/backends/gstreamer.py +++ b/mopidy/backends/gstreamer.py @@ -21,6 +21,12 @@ GStreamerMessages().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) @@ -93,6 +99,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 From a98b384c7b0234c872198a3381f425eba05b7e76 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Mon, 12 Apr 2010 23:48:46 +0200 Subject: [PATCH 2/6] docs: Improve mixer's synopsis --- docs/api/mixers.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 From 80f8fa6549f63ef33c1b3b9869e91b728cd62a54 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Tue, 13 Apr 2010 00:36:26 +0200 Subject: [PATCH 3/6] Formatting --- tests/backends/gstreamer_test.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/tests/backends/gstreamer_test.py b/tests/backends/gstreamer_test.py index 0ba64c99..1836fb46 100644 --- a/tests/backends/gstreamer_test.py +++ b/tests/backends/gstreamer_test.py @@ -5,7 +5,7 @@ from mopidy.models import Playlist, Track from mopidy.backends.gstreamer import GStreamerBackend from tests.backends.base import (BasePlaybackControllerTest, - BaseCurrentPlaylistControllerTest) + BaseCurrentPlaylistControllerTest) folder = os.path.dirname(__file__) folder = os.path.join(folder, '..', 'data') @@ -14,15 +14,13 @@ song = os.path.join(folder, 'song%s.mp3') song = 'file://' + song # FIXME can be switched to generic test -class GStreamerCurrentPlaylistHandlerTest(BaseCurrentPlaylistControllerTest, unittest.TestCase): +class GStreamerCurrentPlaylistHandlerTest(BaseCurrentPlaylistControllerTest, + unittest.TestCase): tracks = [Track(uri=song % i, id=i, length=4464) for i in range(1, 4)] - backend_class = GStreamerBackend -class GStreamerPlaybackControllerTest(BasePlaybackControllerTest, unittest.TestCase): + +class GStreamerPlaybackControllerTest(BasePlaybackControllerTest, + unittest.TestCase): tracks = [Track(uri=song % i, id=i, length=4464) for i in range(1, 4)] - backend_class = GStreamerBackend - -if __name__ == '__main__': - unittest.main() From 1b9f3fd257e546512648839bb60bcd2107728ee9 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Tue, 20 Apr 2010 19:27:47 +0200 Subject: [PATCH 4/6] libspotify: Handle dates out of range --- mopidy/backends/libspotify.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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), From 6a049a1ec624e4a93e3adce075b4e872e02ab383 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Sat, 24 Apr 2010 12:56:18 +0200 Subject: [PATCH 5/6] despotify r507 is required because of changes by Spotify --- docs/installation/despotify.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 From 3228731733486f03a5d965754a71a1bcdf7b741e Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Sun, 25 Apr 2010 15:36:19 +0200 Subject: [PATCH 6/6] Update libspotify installation instructions to work with libspotify 0.0.4 --- docs/installation/libspotify.rst | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) 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 ===================================