public void playResume() { if (sequence != null) { if (playState == PAUSED) { sequencer.start(); playState = PLAYING; } } }
public void playLoop() { if (sequence != null) { double playStartTime = (player.getSeekTime() / 100) * (playGetLength()); sequencer.setMicrosecondPosition((long) playStartTime); if (playState != PLAYING) { sequencer.start(); playState = PLAYING; } } }
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; } }