From 4aefa977b42566859093294a0fdd54e39e858444 Mon Sep 17 00:00:00 2001 From: Charlie Groves Date: Thu, 14 Aug 2008 19:02:17 +0000 Subject: [PATCH] Expose shouldPlay git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@629 ed5b42cb-e716-0410-a449-f6a68f950b19 --- .../threerings/media/sound/SoundPlayer.java | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/java/com/threerings/media/sound/SoundPlayer.java b/src/java/com/threerings/media/sound/SoundPlayer.java index 0d9787f4..854bad28 100644 --- a/src/java/com/threerings/media/sound/SoundPlayer.java +++ b/src/java/com/threerings/media/sound/SoundPlayer.java @@ -116,6 +116,18 @@ public abstract class SoundPlayer return (!_disabledTypes.contains(type)); } + /** + * Is sound on and is the specified soundtype enabled? + */ + public boolean shouldPlay (SoundType type) + { + if (type == null) { + type = DEFAULT; // let the lazy kids play too + } + + return _clipVol != 0f && isEnabled(type); + } + /** * Turns on or off the specified sound type. */ @@ -250,15 +262,6 @@ public abstract class SoundPlayer */ protected abstract Frob loop (String pkgPath, String key, float pan); - protected boolean shouldPlay (SoundType type) - { - if (type == null) { - type = DEFAULT; // let the lazy kids play too - } - - return _clipVol != 0f && isEnabled(type); - } - /** * Gets the run queue on which sound should be played. It defaults to {@link RunQueue#AWT}. */