Browse Source

fix bug where infinitelooping sounds dont stop playing after activating sndmgr

cxgeorge 23 years ago
parent
commit
1e04368c68
1 changed files with 5 additions and 4 deletions
  1. 5 4
      panda/src/audiotraits/milesAudioSound.cxx

+ 5 - 4
panda/src/audiotraits/milesAudioSound.cxx

@@ -46,7 +46,7 @@
       }
       }
     }
     }
   }
   }
-  
+
   #define miles_audio_debug(x) \
   #define miles_audio_debug(x) \
       audio_debug("MilesAudioSound "<<getStatusChar(_audio)<<" \""<<get_name() \
       audio_debug("MilesAudioSound "<<getStatusChar(_audio)<<" \""<<get_name() \
       <<"\" "<< x )
       <<"\" "<< x )
@@ -96,6 +96,7 @@ play() {
 void MilesAudioSound::
 void MilesAudioSound::
 stop() {
 stop() {
   miles_audio_debug("stop()");
   miles_audio_debug("stop()");
+  _paused=false;
   AIL_quick_halt(_audio);
   AIL_quick_halt(_audio);
 }
 }
 
 
@@ -236,14 +237,14 @@ float MilesAudioSound::
 length() const {
 length() const {
   if (_length == 0.0f) {
   if (_length == 0.0f) {
    #ifndef NEED_MILES_LENGTH_WORKAROUND
    #ifndef NEED_MILES_LENGTH_WORKAROUND
-        _length=((float)AIL_quick_ms_length(_audio))*0.001f;   
+        _length=((float)AIL_quick_ms_length(_audio))*0.001f;
    #else
    #else
         // hack:
         // hack:
         // For now, the sound needs to be playing, in order to
         // For now, the sound needs to be playing, in order to
         // get the right length.  I'm in contact with RAD about the problem.  I've
         // get the right length.  I'm in contact with RAD about the problem.  I've
         // sent them example code.  They've told me they're looking into it.
         // sent them example code.  They've told me they're looking into it.
         // Until then, we'll play the sound to get the length.
         // Until then, we'll play the sound to get the length.
-   
+
         if (AIL_quick_status(_audio)==QSTAT_PLAYING) {
         if (AIL_quick_status(_audio)==QSTAT_PLAYING) {
           _length=((float)AIL_quick_ms_length(_audio))*0.001f;
           _length=((float)AIL_quick_ms_length(_audio))*0.001f;
         } else {
         } else {
@@ -253,7 +254,7 @@ length() const {
         }
         }
    #endif
    #endif
   }
   }
-  
+
   //audio_cat->info() << "MilesAudioSound::length() returning " << _length << endl;
   //audio_cat->info() << "MilesAudioSound::length() returning " << _length << endl;
   audio_debug("MilesAudioSound::length() returning "<<_length);
   audio_debug("MilesAudioSound::length() returning "<<_length);
   return _length;
   return _length;