diff --git a/res/sfx/drum-hitclap.wav b/res/sfx/drum-hitclap.wav deleted file mode 100644 index df7b461d..00000000 Binary files a/res/sfx/drum-hitclap.wav and /dev/null differ diff --git a/res/sfx/drum-hitfinish.wav b/res/sfx/drum-hitfinish.wav deleted file mode 100644 index 974eacaa..00000000 Binary files a/res/sfx/drum-hitfinish.wav and /dev/null differ diff --git a/res/sfx/drum-hitnormal.wav b/res/sfx/drum-hitnormal.wav deleted file mode 100644 index c9fddbef..00000000 Binary files a/res/sfx/drum-hitnormal.wav and /dev/null differ diff --git a/res/sfx/drum-hitwhistle.wav b/res/sfx/drum-hitwhistle.wav deleted file mode 100644 index d6a95d95..00000000 Binary files a/res/sfx/drum-hitwhistle.wav and /dev/null differ diff --git a/res/sfx/normal-hitclap.wav b/res/sfx/normal-hitclap.wav deleted file mode 100644 index 871cd9c6..00000000 Binary files a/res/sfx/normal-hitclap.wav and /dev/null differ diff --git a/res/sfx/normal-hitfinish.wav b/res/sfx/normal-hitfinish.wav deleted file mode 100644 index 34e9cdaa..00000000 Binary files a/res/sfx/normal-hitfinish.wav and /dev/null differ diff --git a/res/sfx/normal-hitnormal.wav b/res/sfx/normal-hitnormal.wav deleted file mode 100644 index ab28b002..00000000 Binary files a/res/sfx/normal-hitnormal.wav and /dev/null differ diff --git a/res/sfx/normal-hitwhistle.wav b/res/sfx/normal-hitwhistle.wav deleted file mode 100644 index ac787855..00000000 Binary files a/res/sfx/normal-hitwhistle.wav and /dev/null differ diff --git a/res/sfx/soft-hitclap.wav b/res/sfx/soft-hitclap.wav deleted file mode 100644 index f3b56a02..00000000 Binary files a/res/sfx/soft-hitclap.wav and /dev/null differ diff --git a/res/sfx/soft-hitfinish.wav b/res/sfx/soft-hitfinish.wav deleted file mode 100644 index 1ac21401..00000000 Binary files a/res/sfx/soft-hitfinish.wav and /dev/null differ diff --git a/res/sfx/soft-hitnormal.wav b/res/sfx/soft-hitnormal.wav deleted file mode 100644 index 8a4298ed..00000000 Binary files a/res/sfx/soft-hitnormal.wav and /dev/null differ diff --git a/res/sfx/soft-hitwhistle.wav b/res/sfx/soft-hitwhistle.wav deleted file mode 100644 index c6da4602..00000000 Binary files a/res/sfx/soft-hitwhistle.wav and /dev/null differ diff --git a/src/nmania/MultiSample.java b/src/nmania/MultiSample.java deleted file mode 100644 index d78988e2..00000000 --- a/src/nmania/MultiSample.java +++ /dev/null @@ -1,87 +0,0 @@ -package nmania; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; - -import javax.microedition.media.Manager; -import javax.microedition.media.MediaException; -import javax.microedition.media.Player; - -/** - * Zero-allocation (in theory) pool of samples. - * - * @author Feodor0090 - * - */ -public final class MultiSample { - - /** - * Creates the pool. - * - * @param local Is it inside JAR package? - * @param file File name. - * @param type MIME type. - * @param count Count of player to prepare. - * @throws IOException - * @throws MediaException - */ - public MultiSample(boolean local, String file, String type, int count) throws IOException, MediaException { - poolSize = count; - pool = new Player[count]; - streams = new ByteArrayInputStream[count]; - ByteArrayOutputStream os = new ByteArrayOutputStream(); - InputStream data; - if (local) { - data = getClass().getResourceAsStream(file); - } else { - throw new IllegalArgumentException("Remote samples are not supported yet!"); - } - byte[] buf = new byte[2048]; - int r; - while ((r = data.read(buf)) != -1) { - os.write(buf, 0, r); - } - raw = os.toByteArray(); - for (int i = 0; i < count; i++) { - streams[i] = new ByteArrayInputStream(raw); - Player player; - player = Manager.createPlayer(streams[i], type); - player.realize(); - player.prefetch(); - pool[i] = player; - } - } - - private byte[] raw; - private final ByteArrayInputStream[] streams; - private final Player[] pool; - private final int poolSize; - private int next; - - public final void Play() { - try { - pool[next].setMediaTime(0); - pool[next].start(); - } catch (MediaException e) { - } - next++; - if (next >= poolSize) - next = 0; - } - - public final void Dispose() { - for (int i = 0; i < poolSize; i++) { - pool[i].deallocate(); - pool[i].close(); - pool[i] = null; - try { - streams[i].close(); - } catch (IOException e) { - } - streams[i] = null; - } - raw = null; - } -} diff --git a/src/nmania/Player.java b/src/nmania/Player.java index d94a7587..2420248f 100644 --- a/src/nmania/Player.java +++ b/src/nmania/Player.java @@ -183,22 +183,6 @@ public Player(Beatmap map, PlayerBootstrapData opts, Skin s, ILogger log, Displa restart = null; applause = null; } - if (Settings.hitSamples) { // ?full - String[] sets = new String[] { "normal", "soft", "drum" }; // ?full - String[] types = new String[] { "normal", "whistle", "finish", "clap" }; // ?full - hitSounds = new MultiSample[3][]; // ?full - for (int i = 0; i < sets.length; i++) { // ?full - hitSounds[i] = new MultiSample[types.length]; // ?full - for (int j = 0; j < types.length; j++) { // ?full - hitSounds[i][j] = new MultiSample(true, "/sfx/" + sets[i] + "-hit" + types[j] + ".wav", "audio/wav", // ?full - 4); // ?full - Thread.sleep(1); // ?full - } // ?full - } // ?full - } else { // ?full - hitSounds = null; // ?full - } // ?full - defaultHSSet = map.defaultSampleSet; // ?full // step 7: cache data for HUD drawing log.log("Caching service data"); @@ -489,9 +473,7 @@ private final void UpdateHealthX() { private final Sample sectionFail; private final Sample fail = null; private final Sample restart; - private final MultiSample[][] hitSounds; // ?full private final String applause; - private final int defaultHSSet; // ?full public final static String[] judgements = new String[] { "MISS", "MEH", "OK", "GOOD", "GREAT", "PERFECT" }; public final static int[] judgementColors = new int[] { SNUtils.toARGB("0xF00"), SNUtils.toARGB("0xFA0"), @@ -503,13 +485,6 @@ private final void UpdateHealthX() { * Clears allocated samples. */ public final void Dispose() { - if (hitSounds != null) { // ?full - for (int i = 0; i < hitSounds.length; i++) { // ?full - for (int j = 0; j < hitSounds[i].length; j++) { // ?full - hitSounds[i][j].Dispose(); // ?full - } // ?full - } // ?full - } // ?full if (restart != null) restart.Dispose(); if (combobreak != null) @@ -859,10 +834,6 @@ else if (!colKey && lastHoldKeys[column]) + column + " is hit"); // ?dbg CountHit(j); currentNote[column] += 2; - if (hitSounds != null) { // ?full - if (j != 0) // ?full - hitSounds[defaultHSSet][0].Play(); // ?full - } // ?full break; // loop on HW } } @@ -882,10 +853,6 @@ else if (!colKey && lastHoldKeys[column]) GL.Log("(detect) Head note at " + columns[column][currentNote[column]] + " c=" + column + " is hit"); // ?dbg CountHit(j); - if (hitSounds != null) { // ?full - if (j != 0) // ?full - hitSounds[defaultHSSet][0].Play(); // ?full - } // ?full holdHeadScored[column] = true; break; // loop on HW } @@ -920,10 +887,6 @@ else if (!colKey && lastHoldKeys[column]) CountHit(j); currentNote[column] += 2; holdHeadScored[column] = false; - if (hitSounds != null) { // ?full - if (j != 0) // ?full - hitSounds[defaultHSSet][2].Play(); // ?full - } // ?full break; } } diff --git a/src/nmania/Settings.java b/src/nmania/Settings.java index 80cb9ed1..1c5eda60 100644 --- a/src/nmania/Settings.java +++ b/src/nmania/Settings.java @@ -49,10 +49,6 @@ else if (dir.charAt(dir.length() - 1) != '/') * Are exit/fail/pass/restart samples enabled? */ public static boolean gameplaySamples = false; - /** - * Are hit samples enabled? - */ - public static boolean hitSamples = false; /** * If hit samples are enabled, do we want to load them from beatmap? */ @@ -148,7 +144,6 @@ public static final String Serialize() { } j.accumulate("keys", keys); j.accumulate("samples", new Boolean(gameplaySamples)); - j.accumulate("hitsounds", new Boolean(hitSamples)); j.accumulate("keepmenu", new Boolean(keepMenu)); j.accumulate("drawcounters", new Boolean(drawHUD)); j.accumulate("fullscreenflush", new Boolean(fullScreenFlush)); @@ -215,7 +210,6 @@ public static final void Load() { } } gameplaySamples = j.optBoolean("samples", true); // ?full - hitSamples = j.optBoolean("hitsounds", false); // ?full keepMenu = j.optBoolean("keepmenu", true); // ?full drawHUD = j.optBoolean("drawcounters", true); final String device = Nmania.GetDevice(); diff --git a/src/nmania/ui/ng/AudioSettings.java b/src/nmania/ui/ng/AudioSettings.java index 28083c04..76055030 100644 --- a/src/nmania/ui/ng/AudioSettings.java +++ b/src/nmania/ui/ng/AudioSettings.java @@ -6,7 +6,6 @@ public class AudioSettings extends ListScreen implements IListSelectHandler, INu public AudioSettings() { SetItems(new ListItem[] { // new SwitchItem(0, "Play music in menu", this, Settings.musicInMenu), // ?full - new SwitchItem(1, "Enable hitsounds", this, Settings.hitSamples), // ?full new SwitchItem(2, "Enable feedback samples", this, Settings.gameplaySamples), // ?full new SwitchItem(3, "Use BMS's sounds", this, Settings.useBmsSamples), // ?full new DataItem(4, "Clock offset", this, Settings.gameplayOffset + "ms"), @@ -36,8 +35,7 @@ public void OnSelect(ListItem item, ListScreen screen, IDisplay display) { } break; case 1: - Settings.hitSamples = !Settings.hitSamples; - ((SwitchItem) item).Toggle(); + // hitsounds (deleted) break; case 2: Settings.gameplaySamples = !Settings.gameplaySamples;