private void setActionBarTitle() {
   MySong currentSong = App.mClementine.getCurrentSong();
   if (currentSong == null) {
     mActionBar.setTitle(getString(R.string.player_nosong));
     mActionBar.setSubtitle("");
   } else {
     mActionBar.setTitle(currentSong.getArtist());
     mActionBar.setSubtitle(currentSong.getTitle());
   }
 }
  /** Update the notification with the new track info */
  private void updateNotification() {
    if (mLastSong != null) {
      Bitmap scaledArt =
          Bitmap.createScaledBitmap(
              mLastSong.getArt(), mNotificationWidth, mNotificationHeight, false);
      mNotifyBuilder.setLargeIcon(scaledArt);
      mNotifyBuilder.setContentTitle(mLastSong.getArtist());
      mNotifyBuilder.setContentText(mLastSong.getTitle() + " / " + mLastSong.getAlbum());
    } else {
      mNotifyBuilder.setContentTitle(App.mApp.getString(R.string.app_name));
      mNotifyBuilder.setContentText(App.mApp.getString(R.string.player_nosong));
    }

    mNotificationManager.notify(App.NOTIFY_ID, mNotifyBuilder.build());
  }
  @Override
  protected void onProgressUpdate(Integer... progress) {
    mBuilder.setProgress(100, progress[0], false);
    StringBuilder sb = new StringBuilder();

    switch (mItem) {
      case APlaylist:
        sb.append(mContext.getString(R.string.download_noti_title_playlist));
        sb.append(" ");
        sb.append(mPlaylistName);
        break;
      case CurrentItem:
        sb.append(mContext.getString(R.string.download_noti_title_song));
        sb.append(" ");
        sb.append(mCurrentSong.getTitle());
        break;
      case ItemAlbum:
        sb.append(mContext.getString(R.string.download_noti_title_album));
        sb.append(" ");
        sb.append(mCurrentSong.getAlbum());
        break;
    }

    mTitle = sb.toString();

    sb = new StringBuilder();

    if (mCurrentSong.equals(new MySong())) {
      sb.append(mContext.getString(R.string.connectdialog_connecting));
    } else {
      sb.append("(");
      sb.append(mCurrentFile);
      sb.append("/");
      sb.append(mFileCount);
      sb.append(") ");
      sb.append(mCurrentSong.getArtist());
      sb.append(" - ");
      sb.append(mCurrentSong.getTitle());
    }

    mSubtitle = sb.toString();

    mBuilder.setContentTitle(mTitle);
    mBuilder.setContentText(mSubtitle);

    // Displays the progress bar for the first time.
    mNotifyManager.notify(mId, mBuilder.build());
  }
  /** Update the RemoteControlClient */
  private void updateRemoteControlClient() {
    // Update playstate
    if (App.mClementine.getState() == Clementine.State.PLAY) {
      mRcClient.setPlaybackState(RemoteControlClient.PLAYSTATE_PLAYING);
    } else {
      mRcClient.setPlaybackState(RemoteControlClient.PLAYSTATE_PAUSED);
    }

    // Get the metadata editor
    if (mLastSong != null && mLastSong.getArt() != null) {
      RemoteControlClient.MetadataEditor editor = mRcClient.editMetadata(false);
      editor.putBitmap(MetadataEditor.BITMAP_KEY_ARTWORK, mLastSong.getArt());

      // The RemoteControlClients displays the following info:
      // METADATA_KEY_TITLE (white) - METADATA_KEY_ALBUMARTIST (grey) - METADATA_KEY_ALBUM (grey)
      //
      // So i put the metadata not in the "correct" fields to display artist, track and album
      // TODO: Fix it when changed in newer android versions
      editor.putString(MediaMetadataRetriever.METADATA_KEY_ALBUM, mLastSong.getAlbum());
      editor.putString(MediaMetadataRetriever.METADATA_KEY_TITLE, mLastSong.getArtist());
      editor.putString(MediaMetadataRetriever.METADATA_KEY_ALBUMARTIST, mLastSong.getTitle());
      editor.apply();
    }
  }