Addition/Edge Addition SampleSet

Minor fix with combo colors and spinners
This commit is contained in:
fd
2015-03-01 11:06:46 -05:00
parent 955a184d2c
commit 04bfbc70fc
10 changed files with 138 additions and 50 deletions

View File

@@ -73,6 +73,9 @@ public enum HitSound implements SoundController.SoundComponent {
/** Current sample set. */
private static SampleSet currentSampleSet;
/** Current default sample set. */
private static SampleSet currentDefaultSampleSet = SampleSet.NORMAL;
/** The file name. */
private String filename;
@@ -112,25 +115,38 @@ public enum HitSound implements SoundController.SoundComponent {
}
/**
* Sets the sample set to use when playing hit sounds.
* @param sampleSet the sample set ("None", "Normal", "Soft", "Drum")
* Sets the default sample set to use when playing hit sounds.
* @param sampleSet the sample set ("auto", "Normal", "Soft", "Drum")
*/
public static void setSampleSet(String sampleSet) {
currentSampleSet = null;
public static void setDefaultSampleSet(String sampleSet) {
currentDefaultSampleSet = SampleSet.NORMAL;
for (SampleSet ss : SampleSet.values()) {
if (sampleSet.equalsIgnoreCase(ss.getName())) {
currentSampleSet = ss;
currentDefaultSampleSet = ss;
return;
}
}
}
/**
* Sets the default sample set to use when playing hit sounds.
* @param sampleSet the sample set (0:auto, 1:normal, 2:soft, 3:drum)
*/
public static void setDefaultSampleSet(byte sampleType) {
currentDefaultSampleSet = SampleSet.NORMAL;
for (SampleSet ss : SampleSet.values()) {
if (sampleType == ss.getIndex()) {
currentDefaultSampleSet = ss;
return;
}
}
}
/**
* Sets the sample set to use when playing hit sounds.
* @param sampleType the sample set (0:none, 1:normal, 2:soft, 3:drum)
* @param sampleType the sample set (0:auto, 1:normal, 2:soft, 3:drum)
*/
public static void setSampleSet(byte sampleType) {
currentSampleSet = null;
currentSampleSet = currentDefaultSampleSet;
for (SampleSet ss : SampleSet.values()) {
if (sampleType == ss.getIndex()) {
currentSampleSet = ss;
@@ -138,4 +154,6 @@ public enum HitSound implements SoundController.SoundComponent {
}
}
}
}

View File

@@ -255,7 +255,7 @@ public class SoundController {
* Plays hit sound(s) using an OsuHitObject bitmask.
* @param hitSound the hit sound (bitmask)
*/
public static void playHitSound(byte hitSound) {
public static void playHitSound(byte hitSound, byte sampleSet, byte additionSampleSet) {
if (hitSound < 0)
return;
@@ -264,16 +264,16 @@ public class SoundController {
return;
// play all sounds
if (hitSound == OsuHitObject.SOUND_NORMAL)
playClip(HitSound.NORMAL.getClip(), volume);
else {
if ((hitSound & OsuHitObject.SOUND_WHISTLE) > 0)
playClip(HitSound.WHISTLE.getClip(), volume);
if ((hitSound & OsuHitObject.SOUND_FINISH) > 0)
playClip(HitSound.FINISH.getClip(), volume);
if ((hitSound & OsuHitObject.SOUND_CLAP) > 0)
playClip(HitSound.CLAP.getClip(), volume);
}
HitSound.setSampleSet(sampleSet);
playClip(HitSound.NORMAL.getClip(), volume);
HitSound.setSampleSet(additionSampleSet);
if ((hitSound & OsuHitObject.SOUND_WHISTLE) > 0)
playClip(HitSound.WHISTLE.getClip(), volume);
if ((hitSound & OsuHitObject.SOUND_FINISH) > 0)
playClip(HitSound.FINISH.getClip(), volume);
if ((hitSound & OsuHitObject.SOUND_CLAP) > 0)
playClip(HitSound.CLAP.getClip(), volume);
}
/**