def change_playlist(new_playlist):
 global current_music, current_playlist, next_change_delay
 if (music and (new_playlist is not current_playlist)):
  current_playlist = new_playlist
  if music_enabled:
   music.fadeout((fadeout_time * 1000))
   next_change_delay = max(0, (change_delay - fadeout_time))
   jog_music()
  else:
   current_music = None

def change_playlist ( new_playlist ) : global current_music , current_playlist , next_change_delay if ( music and ( new_playlist is not current_playlist ) ) : current_playlist = new_playlist if music_enabled : music . fadeout ( ( fadeout_time * 1000 ) ) next_change_delay = max ( 0 , ( change_delay - fadeout_time ) ) jog_music ( ) else : current_music = None
fade out any currently playing music and start playing from the given playlist .