From 427adeb35d9c7aef10244bafdec36264a950ebdc Mon Sep 17 00:00:00 2001 From: puckey Date: Wed, 14 Sep 2022 09:47:26 +0200 Subject: [PATCH] QueuedAudioPlayer: emit event.playbackEnd.emit events after their subject has ocurred (see #14) --- SwiftAudioEx/Classes/QueuedAudioPlayer.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SwiftAudioEx/Classes/QueuedAudioPlayer.swift b/SwiftAudioEx/Classes/QueuedAudioPlayer.swift index 392a58e..187a175 100755 --- a/SwiftAudioEx/Classes/QueuedAudioPlayer.swift +++ b/SwiftAudioEx/Classes/QueuedAudioPlayer.swift @@ -103,16 +103,16 @@ public class QueuedAudioPlayer: AudioPlayer, QueueManagerDelegate { - throws: `APError` */ public func next() { - event.playbackEnd.emit(data: .skippedToNext) _ = queue.next(wrap: repeatMode == .queue) + event.playbackEnd.emit(data: .skippedToNext) } /** Step to the previous item in the queue. */ public func previous() { - event.playbackEnd.emit(data: .skippedToPrevious) _ = queue.previous(wrap: repeatMode == .queue) + event.playbackEnd.emit(data: .skippedToPrevious) } /** @@ -138,8 +138,8 @@ public class QueuedAudioPlayer: AudioPlayer, QueueManagerDelegate { if (index == currentIndex) { seek(to: 0) } else { - event.playbackEnd.emit(data: .jumpedToIndex) _ = try queue.jump(to: index) + event.playbackEnd.emit(data: .jumpedToIndex) } }