             return
         }
         playNextSong(stopIfInvalid: true)
-        if self.audioPlayer?.playing == false {
-            if let dataSource = self.dataSource {
-                switch dataSource.audioRepeatTypeInAudioPlayer(self) {
-                case ColiseuPlayerRepeat.None:
+        if let dataSource = self.dataSource where self.audioPlayer?.playing == false {
+            switch dataSource.audioRepeatTypeInAudioPlayer(self) {
+            case ColiseuPlayerRepeat.None:
+                self.playerWillRepeat = false
+            case ColiseuPlayerRepeat.One:
+                switch self.playerWillRepeat {
+                case true?:
                     self.playerWillRepeat = false
-                case ColiseuPlayerRepeat.One:
-                    switch self.playerWillRepeat {
-                    case true?:
-                        self.playerWillRepeat = false
-                    default:
-                        self.playerWillRepeat = true
-                        playSong(0)
-                    }
-                case ColiseuPlayerRepeat.All:
+                default:
                     self.playerWillRepeat = true
                     playSong(0)
                 }
+            case ColiseuPlayerRepeat.All:
+                self.playerWillRepeat = true
+                playSong(0)
             }
         }
     }


    public func remoteControlEvent(event: UIEvent)
    {
        if let delegate = self.delegate {
            if (event.type == UIEventType.RemoteControl) {
                switch event.subtype {
                case UIEventSubtype.RemoteControlPlay:
                    delegate.audioPlayer?(self, didReceiveRemoteControlPlayEvent: event.subtype)
                case UIEventSubtype.RemoteControlPause:
                    delegate.audioPlayer?(self, didReceiveRemoteControlPauseEvent: event.subtype)
                case UIEventSubtype.RemoteControlPreviousTrack:
                    delegate.audioPlayer?(self, didReceiveRemoteControlPreviousTrackEvent: event.subtype)
                case UIEventSubtype.RemoteControlNextTrack:
                    delegate.audioPlayer?(self, didReceiveRemoteControlNextTrackEvent: event.subtype)
                case UIEventSubtype.RemoteControlBeginSeekingBackward:
                    delegate.audioPlayer?(self, didReceiveRemoteControlBeginSeekingBackwardEvent: event.subtype)
                case UIEventSubtype.RemoteControlEndSeekingBackward:
                    delegate.audioPlayer?(self, didReceiveRemoteControlEndSeekingBackwardEvent: event.subtype)
                case UIEventSubtype.RemoteControlBeginSeekingForward:
                    delegate.audioPlayer?(self, didReceiveRemoteControlBeginSeekingForwardEvent: event.subtype)
                case UIEventSubtype.RemoteControlEndSeekingForward:
                    delegate.audioPlayer?(self, didReceiveRemoteControlEndSeekingForwardEvent: event.subtype)
                default: break
                }
            }
        }
    }


    public func playNextSong(stopIfInvalid stopIfInvalid: Bool = false)
    {
        if let songs = self.songsList, song = self.currentSong {
            var index = song.index

            // Next song
            index++

            if index > songs.count - 1 {
                if stopIfInvalid {
                    stopSong()
                }
                return
            }

            playSong(index)
        }
    }

    public func playPreviousSong()
    {
        if let _ = self.songsList, song = self.currentSong {
            var index = song.index

            // Previous song
            index--

            if index < 0 {
                return
            }

            playSong(index)
        }
    }

    public func isLastSong() -> Bool
    {
        if let currentSong = self.currentSong, songsList = self.songsList where currentSong.index + 1 == songsList.count {
            return true
        }
        return false
    }

    public func isFirstSong() -> Bool
    {
        if let currentSong = self.currentSong where currentSong.index == 0 {
            return true
        }
        return false
    }
