Have play call StartObserver.soundStarted with a null sound when the
sound fails to play for any reason. We use the StartObserver to time other effects with sounds, however if the sound isn't going to play, we still want the other effects to go ahead. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4203 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -36,7 +36,10 @@ public class Sound
|
||||
* delayed in loading. */
|
||||
public interface StartObserver
|
||||
{
|
||||
/** Called when the specified sound has started playing. */
|
||||
/** Called when the specified sound has started playing. If
|
||||
* sound is null then the sound failed to play but soundStarted
|
||||
* was called anyway to perform whatever actions were waiting
|
||||
* on the sound. */
|
||||
public void soundStarted (Sound sound);
|
||||
}
|
||||
|
||||
@@ -181,6 +184,9 @@ public class Sound
|
||||
{
|
||||
// if we were unable to get our buffer, fail immediately
|
||||
if (_buffer == null) {
|
||||
if (obs != null) {
|
||||
obs.soundStarted(null);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -204,6 +210,9 @@ public class Sound
|
||||
return true;
|
||||
} else {
|
||||
// sorry charlie...
|
||||
if (obs != null) {
|
||||
obs.soundStarted(null);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user