             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 playSong(index: Int, songsList: [AudioFile])
    {
        self.songsList = songsList
        if let dataSource = self.dataSource where dataSource.audioWillShuffleInAudioPlayer(self) {
            self.songsList?.shuffle()
        }
        // Prepare core audio
        prepareAudio(index)
