Merge branch 'master' into gstreamer
Conflicts: tests/backends/gstreamer_test.py
This commit is contained in:
commit
edc2eb0760
@ -62,8 +62,10 @@ Other backends
|
||||
:members:
|
||||
|
||||
|
||||
GStreamer backend
|
||||
-----------------
|
||||
:mod:`mopidy.backends.gstreamer` -- GStreamer backend
|
||||
-----------------------------------------------------
|
||||
|
||||
``GstreamerBackend`` is pending merge from `adamcik/mopidy/gstreamer
|
||||
<http://github.com/adamcik/mopidy/tree/gstreamer>`_.
|
||||
.. automodule:: mopidy.backends.gstreamer
|
||||
:synopsis: Backend for playing music from a local music archive using the
|
||||
GStreamer library.
|
||||
:members:
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -24,9 +24,8 @@ Stuff we really want to do, but just not right now
|
||||
- Replace libspotify with `openspotify
|
||||
<http://github.com/noahwilliamsson/openspotify>`_ for the
|
||||
``LibspotifyBackend``.
|
||||
- A backend for playback from local disk. Quite a bit of work on a `gstreamer
|
||||
<http://gstreamer.freedesktop.org/>`_ 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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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 <http://getsatisfaction.com/spotify/topics/libspotify_please_fix_the_installation_script>`_
|
||||
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
|
||||
===================================
|
||||
|
||||
@ -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 <http://gstreamer.freedesktop.org/>`_ 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
|
||||
|
||||
@ -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),
|
||||
|
||||
@ -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):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user