Ejemplo n.º 1
0
  public void playLoop() {

    if (sequence != null) {
      double playStartTime = (player.getSeekTime() / 100) * (playGetLength());
      sequencer.setMicrosecondPosition((long) playStartTime);
      if (playState != PLAYING) {
        sequencer.start();
        playState = PLAYING;
      }
    }
  }
Ejemplo n.º 2
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;
    }
  }
Ejemplo n.º 3
0
 /** Para o seqüenciador e reinicia sua posição para 0. */
 public void stop() {
   if (sequencer != null && sequencer.isOpen()) {
     sequencer.stop();
     sequencer.setMicrosecondPosition(0);
   }
 }
Ejemplo n.º 4
0
  public void playSetSeek(double seekTime) {

    if (sequence != null) {
      sequencer.setMicrosecondPosition((long) (seekTime * 1000.0));
    }
  }