def next_song(self):
        """next song for player, calculated based on playback_mode"""
        # 如果没有正在播放的歌曲，找列表里面第一首能播放的
        if self.current_song is None:
            return self._get_good_song()

        if self.playback_mode == PlaybackMode.random:
            next_song = self._get_good_song(random_=True)
        else:
            current_index = self._songs.index(self.current_song)
            if current_index == len(self._songs) - 1:
                if self.playback_mode in (PlaybackMode.loop, PlaybackMode.one_loop):
                    next_song = self._get_good_song()
                elif self.playback_mode == PlaybackMode.sequential:
                    next_song = None
            else:
                next_song = self._get_good_song(base=current_index+1)
        return next_song
def next_song ( self ) : if self . current_song is None : return self . _get_good_song ( ) if self . playback_mode == PlaybackMode . random : next_song = self . _get_good_song ( random_ = True ) else : current_index = self . _songs . index ( self . current_song ) if current_index == len ( self . _songs ) - 1 : if self . playback_mode in ( PlaybackMode . loop , PlaybackMode . one_loop ) : next_song = self . _get_good_song ( ) elif self . playback_mode == PlaybackMode . sequential : next_song = None else : next_song = self . _get_good_song ( base = current_index + 1 ) return next_song
next song for player, calculated based on playback_mode