We should only be hooking up end of track when an audio instance is passed in.
Additionally the tracklist tests where wrongly sending in the audio module
instead of the mock audio.Audio instance.
The audio class had to many attributes for simply tracking connected signals in
my opinion. This change adds a helper for adding and removing signals and storing
the tracking data in a common dictionary instead of a ton of instance attributes.
The appsrc cleanup code was still short circuiting the about to finish handler,
this meant that EOT handling never happened for local files and playback stopped.
With this change proper EOT handling works for all track types.
This ensures that we block about-to-finish and the pipeline until the next URI
is set, alowing for at least EOS free playback. If the uri is set quickly enough
this will also be gapless.
For e.g. ``console.log`` to be used as a callback, it must be bound to the
``console`` object first: ``console.log.bind(console)``. If not, this will
cause "Illegal invocation" errors in WebKit browsers.
This change updates all our Mopidy.js examples to bind ``console`` functions
before they are used as callbacks.
Fixes#298.
We now ensure that the track we choose has one or more volume channels we can
control. This change also fixes that fact the MIXER_TRACK setting would not
work if we happened to find a track that was flaged as MASTER OUPUT before
finding the right label, so far no one has reported this as an issue.
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.
Likely cause of this issue is libspotify getting the intial seek to early. We
have not yet had time to dig beyond this point and develop has been broken for
to long due to this. As such this work aroundly simply ignores the first seek
to position zero outright, this avoiding what is likely a race condition in
libspotify.
Next step will be to create a minimal libspotify/pyspotify test case for this
to verify that assumption and hopefully figure out a correct fix. We also need
to look into if the intial seek can be avoided in gstreamer.
Adds a basic streaming backend simply handles streaming audio and nothing else.
I.e. no metadata beyond the URI we where given. #270 still needs to be solved
for actual metadata to make sense in this backend.
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.