summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rwxr-xr-xsrc/com/fourisland/fourpuzzle/Audio.java4
-rw-r--r--src/com/fourisland/fourpuzzle/util/MidiParser.java14
2 files changed, 16 insertions, 2 deletions
diff --git a/src/com/fourisland/fourpuzzle/Audio.java b/src/com/fourisland/fourpuzzle/Audio.java index 9083d27..3283c68 100755 --- a/src/com/fourisland/fourpuzzle/Audio.java +++ b/src/com/fourisland/fourpuzzle/Audio.java
@@ -62,6 +62,10 @@ public class Audio {
62 if ((seq.getSequence() != null) && (seq.getSequence().equals(s))) 62 if ((seq.getSequence() != null) && (seq.getSequence().equals(s)))
63 { 63 {
64 return; 64 return;
65 } else {
66 seq.close();
67
68 init();
65 } 69 }
66 70
67 try { 71 try {
diff --git a/src/com/fourisland/fourpuzzle/util/MidiParser.java b/src/com/fourisland/fourpuzzle/util/MidiParser.java index 84dea26..3d6c06b 100644 --- a/src/com/fourisland/fourpuzzle/util/MidiParser.java +++ b/src/com/fourisland/fourpuzzle/util/MidiParser.java
@@ -55,7 +55,12 @@ public class MidiParser {
55 { 55 {
56 parseShortMessage((ShortMessage) mm,tick); 56 parseShortMessage((ShortMessage) mm,tick);
57 } else { 57 } else {
58 currentTrack.add(new MidiEvent(mm, tick)); 58 if (foundFirstReal)
59 {
60 currentTrack.add(new MidiEvent(mm, tick-firstReal));
61 } else {
62 currentTrack.add(new MidiEvent(mm, 0));
63 }
59 } 64 }
60 } 65 }
61 66
@@ -77,7 +82,12 @@ public class MidiParser {
77 } 82 }
78 } 83 }
79 84
80 currentTrack.add(new MidiEvent(mm, tick-firstReal)); 85 if (foundFirstReal)
86 {
87 currentTrack.add(new MidiEvent(mm, tick-firstReal));
88 } else {
89 currentTrack.add(new MidiEvent(mm, 0));
90 }
81 } 91 }
82 92
83} 93}