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:
Mark Johnson
2006-12-14 23:00:21 +00:00
parent 11f82ff097
commit d2aabbcfae
+14 -3
View File
@@ -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;
}
}