diff --git a/indra/llaudio/llaudioengine_fmodex.cpp b/indra/llaudio/llaudioengine_fmodex.cpp index 2f6dc56c8..1948a0b7d 100644 --- a/indra/llaudio/llaudioengine_fmodex.cpp +++ b/indra/llaudio/llaudioengine_fmodex.cpp @@ -305,13 +305,6 @@ bool LLAudioEngine_FMODEX::init(const S32 num_channels, void* userdata) if (!getStreamingAudioImpl()) // no existing implementation added setStreamingAudioImpl(new LLStreamingAudio_FMODEX(mSystem)); - result = mSystem->createSoundGroup("World Sounds", &mWorldSoundGroup); - if(!Check_FMOD_Error(result, "Error creating 'World Sounds' group.")) - { - mWorldSoundGroup->setMaxAudible(num_channels); - mWorldSoundGroup->setMaxAudibleBehavior(FMOD_SOUNDGROUP_BEHAVIOR_MUTE); - } - LL_DEBUGS("AppInit") << "LLAudioEngine_FMODEX::init() FMOD initialized correctly" << LL_ENDL; mInited = true; @@ -363,13 +356,13 @@ void LLAudioEngine_FMODEX::shutdown() LLAudioBuffer * LLAudioEngine_FMODEX::createBuffer() { - return new LLAudioBufferFMODEX(this); + return new LLAudioBufferFMODEX(mSystem); } LLAudioChannel * LLAudioEngine_FMODEX::createChannel() { - return new LLAudioChannelFMODEX(this); + return new LLAudioChannelFMODEX(mSystem); } bool LLAudioEngine_FMODEX::initWind() @@ -411,11 +404,6 @@ void LLAudioEngine_FMODEX::cleanupWind() mWindDSP->release(); mWindDSP = NULL; } - if(mWorldSoundGroup) - { - mWorldSoundGroup->release(); - mWorldSoundGroup = NULL; - } delete mWindGen; mWindGen = NULL; @@ -482,7 +470,7 @@ void LLAudioEngine_FMODEX::setInternalGain(F32 gain) // LLAudioChannelFMODEX implementation // -LLAudioChannelFMODEX::LLAudioChannelFMODEX(LLAudioEngine_FMODEX *audioengine) : LLAudioChannel(), mEnginep(audioengine), mChannelp(NULL), mLastSamplePos(0) +LLAudioChannelFMODEX::LLAudioChannelFMODEX(FMOD::System *system) : LLAudioChannel(), mSystemp(system), mChannelp(NULL), mLastSamplePos(0) { } @@ -516,17 +504,7 @@ bool LLAudioChannelFMODEX::updateBuffer() // setup. if(!mChannelp) { - if(mCurrentSourcep) - { - S32 type = mCurrentSourcep->getType(); - if(type == LLAudioEngine::AUDIO_TYPE_SFX || type == LLAudioEngine::AUDIO_TYPE_AMBIENT) - { - FMOD::SoundGroup *world_group = getEngine()->getWorldSoundGroup(); - if(world_group) - soundp->setSoundGroup(world_group); - } - } - FMOD_RESULT result = getEngine()->getSystem()->playSound(FMOD_CHANNEL_FREE, soundp, false, &mChannelp); + FMOD_RESULT result = getSystem()->playSound(FMOD_CHANNEL_FREE, soundp, false, &mChannelp); Check_FMOD_Error(result, "FMOD::System::playSound"); } @@ -686,7 +664,7 @@ bool LLAudioChannelFMODEX::isPlaying() // -LLAudioBufferFMODEX::LLAudioBufferFMODEX(LLAudioEngine_FMODEX *audioengine) : mEnginep(audioengine), mSoundp(NULL) +LLAudioBufferFMODEX::LLAudioBufferFMODEX(FMOD::System *system) : mSystemp(system), mSoundp(NULL) { } @@ -731,9 +709,9 @@ bool LLAudioBufferFMODEX::loadWAV(const std::string& filename) exinfo.suggestedsoundtype = FMOD_SOUND_TYPE_WAV; //Hint to speed up loading. // Load up the wav file into an fmod sample #if LL_WINDOWS - FMOD_RESULT result = getEngine()->getSystem()->createSound((const char*)utf8str_to_utf16str(filename).c_str(), base_mode | FMOD_UNICODE, &exinfo, &mSoundp); + FMOD_RESULT result = getSystem()->createSound((const char*)utf8str_to_utf16str(filename).c_str(), base_mode | FMOD_UNICODE, &exinfo, &mSoundp); #else - FMOD_RESULT result = getEngine()->getSystem()->createSound(filename.c_str(), base_mode, &exinfo, &mSoundp); + FMOD_RESULT result = getSystem()->createSound(filename.c_str(), base_mode, &exinfo, &mSoundp); #endif if (result != FMOD_OK) diff --git a/indra/llaudio/llaudioengine_fmodex.h b/indra/llaudio/llaudioengine_fmodex.h index 72ef3a96d..f6f920e10 100644 --- a/indra/llaudio/llaudioengine_fmodex.h +++ b/indra/llaudio/llaudioengine_fmodex.h @@ -46,7 +46,6 @@ namespace FMOD class Channel; class Sound; class DSP; - class SoundGroup; } //Interfaces @@ -71,7 +70,6 @@ public: typedef F32 MIXBUFFERFORMAT; FMOD::System *getSystem() const {return mSystem;} - FMOD::SoundGroup *getWorldSoundGroup() const {return mWorldSoundGroup;} protected: /*virtual*/ LLAudioBuffer *createBuffer(); // Get a free buffer, or flush an existing one if you have to. /*virtual*/ LLAudioChannel *createChannel(); // Create a new audio channel. @@ -84,7 +82,6 @@ protected: FMOD::DSP *mWindDSP; FMOD::System *mSystem; - FMOD::SoundGroup *mWorldSoundGroup; bool mEnableProfiler; }; @@ -92,7 +89,7 @@ protected: class LLAudioChannelFMODEX : public LLAudioChannel { public: - LLAudioChannelFMODEX(LLAudioEngine_FMODEX *audioengine); + LLAudioChannelFMODEX(FMOD::System *audioengine); virtual ~LLAudioChannelFMODEX(); protected: @@ -107,8 +104,8 @@ protected: void set3DMode(bool use3d); protected: - LLAudioEngine_FMODEX *getEngine() const {return mEnginep;} - LLAudioEngine_FMODEX *mEnginep; + FMOD::System *getSystem() const {return mSystemp;} + FMOD::System *mSystemp; FMOD::Channel *mChannelp; S32 mLastSamplePos; }; @@ -117,16 +114,16 @@ protected: class LLAudioBufferFMODEX : public LLAudioBuffer { public: - LLAudioBufferFMODEX(LLAudioEngine_FMODEX *audioengine); + LLAudioBufferFMODEX(FMOD::System *audioengine); virtual ~LLAudioBufferFMODEX(); /*virtual*/ bool loadWAV(const std::string& filename); /*virtual*/ U32 getLength(); friend class LLAudioChannelFMODEX; protected: - LLAudioEngine_FMODEX *getEngine() const {return mEnginep;} - LLAudioEngine_FMODEX *mEnginep; - FMOD::Sound *getSound() const{ return mSoundp; } + FMOD::System *getSystem() const {return mSystemp;} + FMOD::System *mSystemp; + FMOD::Sound *getSound() const{ return mSoundp; } FMOD::Sound *mSoundp; };