audio: Add support for gapless playback

By responding to the about-to-finish signal. If it looks like we're
about to pause, then we let the EOS handler handle it instead.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
Anna Schumaker 2021-09-07 15:39:15 -04:00
parent ba1a444bdf
commit 8efb752614
1 changed files with 6 additions and 0 deletions

View File

@ -21,6 +21,12 @@ class Player(bass.BassPlayer):
if self.track:
self.track.add_to_playlist("Previous")
def do_about_to_finish(self):
if self.Autopause.get_value() != 0:
(track, cont) = tagdb.Stack.next()
self.emit("track-changed", self.track, track)
self.Autopause.decrement()
def do_eos(self):
self.next()