return channels;
}
+ /**
+ * Returns the MidiChannels of the selected synthesizer.
+ * @return the available MidiChannels
+ */
+ public static MidiChannel getChannel(int i) {
+ return channels[i];
+ }
+
/**
* Returns the currently active MidiChannel.
* @return the active MidiChannel
* Stops playback of the current sequence.
*/
public static void stop() {
- sequencer.stop();
- sequencer.setTickPosition(position);
- player.interrupt();
- gui.update((long)0);
+ if (sequencer.isRunning()) {
+ sequencer.stop();
+ sequencer.setTickPosition(position);
+ player.interrupt();
+ gui.update((long)0);
+ }
}
/**
* @return the tick position
*/
public static long getPosition() {
- return position;
+ return sequencer.getTickPosition();
}
/**
* @param ticks the tick position
*/
public static void setPosition(long ticks) {
- position = ticks;
+ sequencer.setTickPosition(ticks);
}
/**