X-Git-Url: https://ruin.nu/git/?p=moosique.git;a=blobdiff_plain;f=Moosique.java;h=df94b478e464f79277871e4d95d80265b03da463;hp=c9ea45644407d55fc9f9e83a5319bc765a738948;hb=ca56fc1424e8887b09375a52e8e02605d5dff175;hpb=31f81450a303d52bf37ec8bcbb12e0f3b3b8b833 diff --git a/Moosique.java b/Moosique.java index c9ea456..df94b47 100644 --- a/Moosique.java +++ b/Moosique.java @@ -168,8 +168,10 @@ public class Moosique { * Pauses playback of the current sequence. */ public static void pause() { - sequencer.stop(); - player.interrupt(); + if (sequencer.isRunning()) { + sequencer.stop(); + } + if (player != null) player.interrupt(); } /** @@ -198,10 +200,10 @@ public class Moosique { public static void stop() { if (sequencer.isRunning()) { sequencer.stop(); - sequencer.setTickPosition(editPosition); - player.interrupt(); - gui.update((long)0); } + sequencer.setTickPosition(editPosition); + if (player != null) player.interrupt(); + gui.update((long)0); } /**