disable length workaround for miles 6.5

This commit is contained in:
cxgeorge 2002-09-24 00:20:51 +00:00
parent 7759f7b212
commit 194118d3d4
2 changed files with 26 additions and 19 deletions

View File

@ -1,6 +1,5 @@
// Filename: milesAudioSound.cxx // Filename: milesAudioSound.cxx
// Created by: skyler (June 6, 2001) // Created by: skyler (June 6, 2001)
// Prior system by: cary
// //
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// //
@ -23,6 +22,10 @@
#include "milesAudioSound.h" #include "milesAudioSound.h"
#include "milesAudioManager.h" #include "milesAudioManager.h"
#if (MSS_MAJOR_VERSION <= 6) && (MSS_MINOR_VERSION < 5)
#define NEED_MILES_LENGTH_WORKAROUND
#endif
#ifndef NDEBUG //[ #ifndef NDEBUG //[
namespace { namespace {
char char
@ -229,12 +232,16 @@ get_balance() const {
float MilesAudioSound:: float MilesAudioSound::
length() const { length() const {
if (_length == 0.0f) {
#ifndef NEED_MILES_LENGTH_WORKAROUND
_length=((float)AIL_quick_ms_length(_audio))*0.001f;
#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 (!_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 {
@ -242,6 +249,7 @@ length() const {
_length=((float)AIL_quick_ms_length(_audio))*0.001f; _length=((float)AIL_quick_ms_length(_audio))*0.001f;
AIL_quick_halt(_audio); AIL_quick_halt(_audio);
} }
#endif
} }
audio_debug("MilesAudioSound::length() returning "<<_length); audio_debug("MilesAudioSound::length() returning "<<_length);
return _length; return _length;

View File

@ -27,7 +27,6 @@
#include "milesAudioManager.h" #include "milesAudioManager.h"
#include "mss.h" #include "mss.h"
class EXPCL_MILES_AUDIO MilesAudioSound : public AudioSound { class EXPCL_MILES_AUDIO MilesAudioSound : public AudioSound {
public: public:
~MilesAudioSound(); ~MilesAudioSound();
@ -51,19 +50,19 @@ public:
// 0 = begining; length() = end. // 0 = begining; length() = end.
// inits to 0.0. // inits to 0.0.
void set_time(float start_time=0.0); void set_time(float start_time=0.0f);
float get_time() const; float get_time() const;
// 0 = minimum; 1.0 = maximum. // 0 = minimum; 1.0 = maximum.
// inits to 1.0. // inits to 1.0.
void set_volume(float volume=1.0); void set_volume(float volume=1.0f);
float get_volume() const; float get_volume() const;
// -1.0 is hard left // -1.0 is hard left
// 0.0 is centered // 0.0 is centered
// 1.0 is hard right // 1.0 is hard right
// inits to 0.0. // inits to 0.0.
void set_balance(float balance_right=0.0); void set_balance(float balance_right=0.0f);
float get_balance() const; float get_balance() const;
// inits to manager's state. // inits to manager's state.
@ -90,7 +89,7 @@ private:
bool _paused; bool _paused;
MilesAudioSound(MilesAudioManager* manager, MilesAudioSound(MilesAudioManager* manager,
HAUDIO audio, string file_name, float length=0.0); HAUDIO audio, string file_name, float length=0.0f);
friend class MilesAudioManager; friend class MilesAudioManager;
}; };