コード例 #1
0
 private void PlayPauseEvent(View v) {
   if (MediaController.getInstance().isAudioPaused()) {
     MediaController.getInstance().playAudio(MediaController.getInstance().getPlayingSongDetail());
     ((PlayPauseView) v).Play();
   } else {
     MediaController.getInstance()
         .pauseAudio(MediaController.getInstance().getPlayingSongDetail());
     ((PlayPauseView) v).Pause();
   }
 }
コード例 #2
0
  private void updateTitle(boolean shutdown) {
    SongDetail mSongDetail = MediaController.getInstance().getPlayingSongDetail();
    if (mSongDetail == null && shutdown) {
      return;
    } else {
      updateProgress(mSongDetail);
      if (MediaController.getInstance().isAudioPaused()) {
        btn_playpausePanel.Pause();
        btn_playpause.Pause();
      } else {
        btn_playpausePanel.Play();
        btn_playpause.Play();
      }
      SongDetail audioInfo = MediaController.getInstance().getPlayingSongDetail();
      loadSongsDetails(audioInfo);

      if (txt_timetotal != null) {
        long duration = Long.valueOf(audioInfo.getDuration());
        txt_timetotal.setText(
            duration != 0 ? String.format("%d:%02d", duration / 60, duration % 60) : "-:--");
      }
    }
  }