Example #1
0
  public void playResume() {

    if (sequence != null) {
      if (playState == PAUSED) {

        sequencer.start();
        playState = PLAYING;
      }
    }
  }
Example #2
0
  public void playLoop() {

    if (sequence != null) {
      double playStartTime = (player.getSeekTime() / 100) * (playGetLength());
      sequencer.setMicrosecondPosition((long) playStartTime);
      if (playState != PLAYING) {
        sequencer.start();
        playState = PLAYING;
      }
    }
  }
Example #3
0
  public boolean play() {

    try {
      if (playState != STOPPED) playStop();

      if (sequence == null) return false;
      if (sequencer == null) return false;

      sequencer.open();
      sequencer.setSequence(sequence);

      double playStartTime = (player.getSeekTime() / 100) * (playGetLength());
      sequencer.setMicrosecondPosition((long) playStartTime);

      sequencer.start();
      playState = PLAYING;
      return true;

    } catch (Exception ex) {
      ex.printStackTrace();
      playState = STOPPED;
      return false;
    }
  }