X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=Moosique.java;h=df94b478e464f79277871e4d95d80265b03da463;hb=357944d9255bb7cb1ad5ed4f5c960b22a8c64b8f;hp=edace75227333d65e706ced4755db1f2d11084eb;hpb=d50b6cfbebef6c3f620f916f0d2da838c4de3355;p=moosique.git diff --git a/Moosique.java b/Moosique.java index edace75..df94b47 100644 --- a/Moosique.java +++ b/Moosique.java @@ -168,14 +168,17 @@ 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(); } /** * Resumes playback of the current sequence. */ public static void resume() { + gui.update(0); sequencer.start(); // Disables input to volatile components @@ -197,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); } /**