Ejemplo n.º 1
0
  public void show() {
    for (int index = this.songList.size(); --index >= 0; ) {
      Sound sound = (Sound) this.songList.get(index);

      long duration = sound.getPlayer().getDuration();

      PreLogUtil.put(
          new StringBuilder()
              .append(PLAY)
              .append(sound.getResource())
              .append(FOR)
              .append(duration)
              .toString(),
          this,
          CommonStrings.getInstance().PROCESS);
    }
  }
Ejemplo n.º 2
0
  public void startNewSong() {
    try {
      // PreLogUtil.put(Memory.getInfo(), this, CommonStrings.getInstance().PROCESS);

      ResourceUtil.getInstance().getContext().stopService(this.currentIntent);

      this.currentSongSound = (Sound) BasicArrayListUtil.getInstance().getRandom(this.songList);

      long duration = this.currentSongSound.getDuration();
      // 18000;
      // this.currentSongSound.getPlayer().getDuration();

      PreLogUtil.put(
          new StringBuilder()
              .append(PLAY)
              .append(this.currentSongSound.getResource())
              .append(FOR)
              .append(duration)
              .toString(),
          this,
          CommonStrings.getInstance().PROCESS);

      this.timeDelayHelper.setDelay((int) duration);

      this.currentIntent.putExtra(
          MusicStrings.getInstance().SONG_EXTRA,
          ResourceUtil.getInstance().getResourceId(this.currentSongSound.getResource()).intValue());

      ResourceUtil.getInstance().getContext().startService(this.currentIntent);
    } catch (Exception e) {
      String resource = StringUtil.getInstance().EMPTY_STRING;
      if (currentSongSound != null) {
        resource = currentSongSound.getResource();
      }

      PreLogUtil.put(
          CommonStrings.getInstance().EXCEPTION_LABEL + resource,
          this,
          CommonStrings.getInstance().PROCESS,
          e);
    }
  }