Added the ability to stop and reclaim all the sources without fully
disposing the sound group. git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@94 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
@@ -63,6 +63,20 @@ public class SoundGroup
|
||||
* longer be usable and should be discarded.
|
||||
*/
|
||||
public void dispose ()
|
||||
{
|
||||
reclaimAll();
|
||||
if (_sourceIds != null) {
|
||||
_sources.clear();
|
||||
AL10.alDeleteSources(_sourceIds);
|
||||
_sourceIds = null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Stops and reclaims all sounds from this sound group but does not
|
||||
* free the sources.
|
||||
*/
|
||||
public void reclaimAll ()
|
||||
{
|
||||
if (_sourceIds != null) {
|
||||
// make sure any bound sources are released
|
||||
@@ -72,9 +86,6 @@ public class SoundGroup
|
||||
source.holder.reclaim();
|
||||
}
|
||||
}
|
||||
_sources.clear();
|
||||
AL10.alDeleteSources(_sourceIds);
|
||||
_sourceIds = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user