Follow-up to #99: replay seeking improvements.

- Added on/off option for replay seeking in the "custom" menu.
- Mute sounds while seeking.
- Draw a bar on the left of the screen during replays for seeking (instead of just clicking near the top of the screen).

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han
2015-07-02 22:16:14 -05:00
parent 495a7e7f8b
commit 2167698740
4 changed files with 70 additions and 8 deletions

View File

@@ -59,6 +59,9 @@ public class SoundController {
/** Sample volume multiplier, from timing points [0, 1]. */
private static float sampleVolumeMultiplier = 1f;
/** Whether all sounds are muted. */
private static boolean isMuted;
/** The name of the current sound file being loaded. */
private static String currentFileName;
@@ -261,7 +264,7 @@ public class SoundController {
if (clip == null) // clip failed to load properly
return;
if (volume > 0f) {
if (volume > 0f && !isMuted) {
try {
clip.start(volume, listener);
} catch (LineUnavailableException e) {
@@ -317,6 +320,12 @@ public class SoundController {
playClip(s.getClip(), Options.getHitSoundVolume() * sampleVolumeMultiplier * Options.getMasterVolume(), null);
}
/**
* Mutes or unmutes all sounds (hit sounds and sound effects).
* @param mute true to mute, false to unmute
*/
public static void mute(boolean mute) { isMuted = mute; }
/**
* Returns the name of the current file being loaded, or null if none.
*/