Exemplo n.º 1
0
  synchronized void setCurrentPlaying(DownloadFile currentPlaying) {
    this.currentPlaying = currentPlaying;

    MusicDirectory.Entry song = currentPlaying != null ? currentPlaying.getSong() : null;
    Util.broadcastNewTrackInfo(this, song);
    NotificationUtil.updateNotification(this, this, handler, song, song != null);
  }
Exemplo n.º 2
0
  synchronized void setPlayerState(PlayerState playerState) {
    LOG.info(this.playerState.name() + " -> " + playerState.name() + " (" + currentPlaying + ")");

    if (playerState == PAUSED) {
      lifecycleSupport.serializeDownloadQueue();
    }

    Util.broadcastPlaybackStatusChange(this, playerState);

    this.playerState = playerState;

    if (playerState == STARTED) {
      scrobbler.scrobble(this, currentPlaying, false);
      NotificationUtil.setNotificationHiddenByUser(this, false);
    } else if (playerState == COMPLETED) {
      scrobbler.scrobble(this, currentPlaying, true);
    }

    MusicDirectory.Entry song = currentPlaying == null ? null : currentPlaying.getSong();
    NotificationUtil.updateNotification(this, this, handler, song, this.playerState == STARTED);
  }