fix bug where infinitelooping sounds dont stop playing after activating sndmgr

This commit is contained in:
cxgeorge 2002-09-27 23:34:15 +00:00
parent 19f7b146df
commit 1e04368c68

View File

@ -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;