+ public static void resume() {
+ gui.update(0);
+ try {
+ sequencer.setSequence(seq);
+ } catch (InvalidMidiDataException e) {}
+ Track[] tracks = seq.getTracks();
+
+ sequencer.start();
+
+ for (int i = 0; i < tracks.length; i++) {
+
+ Object ob = trackSolo.get(tracks[i]);
+ if(ob instanceof Boolean){
+ sequencer.setTrackSolo(i,((Boolean)ob).booleanValue());
+ }
+
+ ob = trackMute.get(tracks[i]);
+ if(ob instanceof Boolean){
+ sequencer.setTrackMute(i,((Boolean)ob).booleanValue());
+ }
+ }
+
+
+ // Disables input to volatile components
+ // gui.disable();
+
+ // Creates the visualisation thread and starts it.
+ player = new Thread () {
+ public void run() {
+ while(sequencer.isRunning()) {
+ // Updates the GUI with the current tick position.
+ gui.update(sequencer.getTickPosition());
+
+ // Puts the thread to sleep for as long as it takes
+ // the sequencer to reach the next sixteenth.
+ try {
+ //sleep((long)((15000 / getTempo()) * (tickDiff / ticksPerSixteenth)));
+ sleep (10);
+ } catch (InterruptedException e) {
+ Moosique.stop();
+ }
+ }
+ Moosique.stop();
+ }
+ };
+ player.start();