mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
fixed sound looping
This commit is contained in:
parent
73750b7587
commit
703f3086a8
@ -56,9 +56,9 @@ AudioManager::
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AudioManager::
|
||||
set_update_func(AudioManager::UpdateFunc* func) {
|
||||
if (_update_func != (AudioManager::UpdateFunc*)0L)
|
||||
audio_cat->error() << "There maybe be more then one audio driver installed"
|
||||
<< endl;
|
||||
if (_update_func) {
|
||||
audio_error("There maybe be more then one audio driver installed");
|
||||
}
|
||||
_update_func = func;
|
||||
}
|
||||
|
||||
@ -86,7 +86,7 @@ copy_loopset() {
|
||||
void AudioManager::
|
||||
ns_update() {
|
||||
// handle looping
|
||||
if (!_loopcopy) {
|
||||
if (_loopcopy) {
|
||||
for (LoopSet::iterator i=_loopcopy->begin(); i!=_loopcopy->end(); ++i) {
|
||||
AudioSound* sound = *i;
|
||||
if (sound->status() == AudioSound::READY) {
|
||||
@ -174,12 +174,14 @@ ns_stop(AudioSound* sound) {
|
||||
void AudioManager::
|
||||
ns_set_loop(AudioSound* sound, bool state) {
|
||||
mutex_lock l(_manager_mutex);
|
||||
if (_loopset == (LoopSet*)0L)
|
||||
if (!_loopset) {
|
||||
_loopset = new LoopSet;
|
||||
if (state)
|
||||
}
|
||||
if (state) {
|
||||
_loopset->insert(sound);
|
||||
else if (_loopset->find(sound) != _loopset->end())
|
||||
} else if (_loopset->find(sound) != _loopset->end()) {
|
||||
_loopset->erase(sound);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
Loading…
x
Reference in New Issue
Block a user