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.
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.
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.
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)
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.
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.
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.
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