Commit Graph

73 Commits

Author SHA1 Message Date
Stein Magnus Jodal
45d4445eea Merge branch 'develop' into feature/limit-spotify-data-pushing
Conflicts:
	mopidy/backends/spotify/session_manager.py
2013-01-03 16:18:08 +01:00
Thomas Adamcik
88398ea355 Add new mopidy.audio.utils functions (fixes #301).
Adds functions to create buffers, calcalute buffer durations based on number of
samples and the sample rate and converting milliseconds to gst internal clock
time.

This also alows for the removal of all gst imports outside of mopidy.audio.
2013-01-03 15:35:52 +01:00
Stein Magnus Jodal
ea431c2f18 Revert "spotify: Remove gst import from spotify.playback module"
This reverts commit b4028e9c57.
2012-12-27 21:00:37 +01:00
Stein Magnus Jodal
b4028e9c57 spotify: Remove gst import from spotify.playback module 2012-12-27 20:58:05 +01:00
Stein Magnus Jodal
f9c50051c2 Revert "spotify: Remove gst import from spotify.playback module"
This reverts commit 0459f037a4.
2012-12-27 20:53:20 +01:00
Stein Magnus Jodal
0459f037a4 spotify: Remove gst import from spotify.playback module 2012-12-27 20:44:19 +01:00
Thomas Adamcik
8a0c48e61e Add timestamp and duration to all spotify buffers.
This fixes the issue where pausing playback would show the time of the last
timestamped buffer instead of the current time. We also make sure to reset the
time when we start a new track. This was done by overriding the play method on
the session manager as it is also used for pausing, resuming and stopping.

Ideally this should probably be reworked to avoid the gst import in
mopidy.backends.spotify.playback, but for now this should do.
2012-12-27 00:30:03 +01:00
Thomas Adamcik
3a4a9e60e0 Fix use of threading.Event for Python 2.6 and clear connected state.
threading.Event's wait method returns None on python pre 2.7, which means all
searches would fail. This also corrects that fact that we weren't clearing the
connected threading event on disconnects. I did not add any tests for this at
this time as I just want to get the fix out.
2012-12-24 13:55:46 +01:00
Stein Magnus Jodal
50e8ff04b3 spotify: Only push audio data when GStreamer wants more 2012-12-23 12:38:37 +01:00
Stein Magnus Jodal
c7656cdc15 spotify: Replace wall clock timer with GStreamer timer 2012-12-23 12:34:24 +01:00
Stein Magnus Jodal
d1b2641b86 spotify: Gather the search functionality in one place 2012-12-19 23:16:45 +01:00
Stein Magnus Jodal
ac4411ec83 spotify: Make session manager work with pyspotify 1.9 _and_ 1.10 2012-12-12 16:08:16 +01:00
Matt Bray
30a5fd06c2 Fix for updates to pyspotify
Pyspotify now creates the session in
`pyspotify.SpotifySessionManager.__init__` (rather than in `.connect`) -
see [here][1].  Therefore it seems best not to set `self.session = None`
in `mopidy.SpotifySessionManager.__init__` or `self.session = session`
in `logged_in`.

[1]: 483f757430 (L1R39)
2012-12-10 00:07:27 +00:00
Stein Magnus Jodal
6a0e9aa69c spotify: Playlist refresh hack should not be active after first run 2012-11-26 15:22:31 +01:00
Stein Magnus Jodal
16518697c8 spotify: Only pause on connection error if playing
Spotify has availability issues today, which makes this easy to reproduce and
improve. Before this patch, the following was logged on a Spotify connection
error when not playing:

ERROR    Spotify connection error: Can not connect to Spotify
WARNING  Setting GStreamer state to GST_STATE_PAUSED failed
ERROR    Resource not found. gstplaybin2.c(3824): setup_next_source ():
/GstPlayBin2:playbin20

With this patch, only the first and relevant error message is logged.
2012-11-20 15:08:17 +01:00
Stein Magnus Jodal
6db50c4306 Merge pull request #248 from Dvad/develop
spotify: Add proxy support
2012-11-20 05:27:08 -08:00
Stein Magnus Jodal
9159491d85 spotify: Search should return list of tracks 2012-11-19 19:19:35 +01:00
David C
f17852c98f Add proxy support 2012-11-19 16:06:50 +01:00
Stein Magnus Jodal
4e4c887fb1 spotify: Trigger BackendListener.playlists_loaded() when playlists loads 2012-11-17 01:22:25 +01:00
Thomas Adamcik
f2b975cc37 Update emit_data to return true if data was delivered.
This is probably not needed, but for the sake of correctnes it doesn't hurt.
2012-11-15 22:38:27 +01:00
Thomas Adamcik
0a96e5dccb Update emit_data to take buffers.
Simplify emit data method to take Gstreamer buffers. This allows us to more
concisely give it buffers with duration, timestamp and other relevant data set.
2012-11-15 22:34:20 +01:00
Stein Magnus Jodal
3a24deaec3 Rename 'stored playlists' to 'playlists' 2012-11-14 09:23:19 +01:00
Stein Magnus Jodal
6acaa490e9 Make all strings unicode by default (fixes #224) 2012-11-13 00:18:47 +01:00
Stein Magnus Jodal
1207700a15 Convert Spotify translator to plain functions 2012-10-30 10:14:38 +01:00
Stein Magnus Jodal
4588dd2ec2 Empty Spotify backend's __init__ and flatten logger hierarchy 2012-10-25 22:42:24 +02:00
Stein Magnus Jodal
8f1f0bc82a Create attribute in __init__ (#211) 2012-10-17 01:31:20 +02:00
Stein Magnus Jodal
986c0a9ad3 Move get_version() helper to mopidy.utils.versioning 2012-10-16 21:45:36 +02:00
Stein Magnus Jodal
666800ec57 Fix most flake8 warnings (#211) 2012-10-16 14:00:34 +02:00
Stein Magnus Jodal
609bd6a5b5 Limit audio access to the playback provider 2012-09-28 01:38:39 +02:00
Stein Magnus Jodal
2fdeec9f5a Move controllers to a new core actor
The frontends use the new core actor, while the core actor uses the backend.

This is a step towards supporting multiple backends, where the core actor will
coordinate the backends.
2012-09-27 20:35:39 +02:00
Stein Magnus Jodal
c5ef8431c3 Remove unused imports 2012-09-27 20:09:31 +02:00
Stein Magnus Jodal
5dd67fa7a7 Remove reverse dependency on the stored playlists controller 2012-09-27 02:10:03 +02:00
Stein Magnus Jodal
4ba5395cc0 Remove unused imports 2012-09-26 14:39:22 +02:00
Stein Magnus Jodal
53d6156227 Give SpotifySessionManager audio and backend proxies on construction 2012-09-26 10:40:58 +02:00
Stein Magnus Jodal
d1d5a084a2 Log Spotify playlist loading completion on INFO level 2012-09-19 01:05:02 +02:00
Thomas Adamcik
355ff811af Add $XDG_name_DIR substitution to _FILE and _PATH settings.
This change removes the practice of hardcoding fallbacks to these paths outside
of the base settings file. We can probably get rid of some of the location
CONSTANTS that are currently in use in mopidy/__init__.py
2012-09-16 18:03:07 +02:00
Stein Magnus Jodal
aab37302a1 Rename mopidy.gstreamer to mopidy.audio 2012-09-14 01:05:42 +02:00
Stein Magnus Jodal
d78d62c68c Hack to speed up Spotify backend startup with clean cache from 35s to 12s
The time Improvement is probably a magnitude or two larger on outdated caches.
2012-08-11 00:39:00 +02:00
Stein Magnus Jodal
436fd7815d Move the Spotify cache to a subdir of the Mopidy cache 2012-08-11 00:37:40 +02:00
Stein Magnus Jodal
4ea3bb1167 Don't override notify_main_thread, which has a sensible default implementation 2012-04-22 01:26:27 +02:00
Stein Magnus Jodal
24d9f8f200 Fix a bunch of pylint warnings 2012-02-10 00:17:21 +01:00
Stein Magnus Jodal
7fa46f1ace Refactor from nested list comprehensions to map/filter 2011-11-01 18:35:34 +01:00
Stein Magnus Jodal
98756d837e Replace loop and filter with more Pythonic list comprehension 2011-11-01 08:46:06 +01:00
Stein Magnus Jodal
9ce6a155af Only logout if we have a session to log out from 2011-11-01 08:44:57 +01:00
Stein Magnus Jodal
a9a7f23921 Fix typo 2011-10-31 12:31:17 +01:00
sandos
83bf9af8c1 Log out from spotify when shutting down 2011-09-21 21:25:11 +02:00
Stein Magnus Jodal
28257306a4 Increase max number of Spotify search results 2011-08-13 17:40:06 +02:00
Thomas Adamcik
0479adf7fc Fix s/_FOLDER/_PATH/, move cache to mopidy instead of spotify folder and fix docs. 2011-07-18 00:15:58 +02:00
Thomas Adamcik
c112e6d5df Fix conversion of spotify backend to xdg locations 2011-07-17 02:19:18 +02:00
Thomas Adamcik
ee856dd06e Switch to using xdg cache folder for spotify cache 2011-07-17 02:12:54 +02:00