summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorGilbert Gonzales <gilbert@lindenlab.com>2013-01-28 18:27:54 -0800
committerGilbert Gonzales <gilbert@lindenlab.com>2013-01-28 18:27:54 -0800
commit4c5790d4bf24d80fd88f36e85a4aa51d4dc06c30 (patch)
treea90a38f19c88d50f06a5b29c26ae7cd3a0387338 /indra/newview
parentdaa5084dd611b45d55598dbdebbb673652877176 (diff)
CHUI-667: Post code review changes
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llappviewer.cpp8
-rw-r--r--indra/newview/lldeferredsounds.cpp12
-rw-r--r--indra/newview/lldeferredsounds.h6
3 files changed, 13 insertions, 13 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index a291fac5a1..d09c835e41 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -221,8 +221,6 @@
#include "llmachineid.h"
#include "llmainlooprepeater.h"
-#include <queue>
-
// *FIX: These extern globals should be cleaned up.
// The globals either represent state/config/resource-storage of either
// this app, or another 'component' of the viewer. App globals should be
@@ -458,11 +456,11 @@ void idle_afk_check()
}
// A callback set in LLAppViewer::init()
-void ui_audio_callback(const LLUUID& uuid)
+static void ui_audio_callback(const LLUUID& uuid)
{
if (gAudiop)
{
- gAudiop->triggerSound(uuid, gAgent.getID(), 1.0f, LLAudioEngine::AUDIO_TYPE_UI);
+ gAudiop->triggerSound(SoundData(uuid, gAgent.getID(), 1.0f, LLAudioEngine::AUDIO_TYPE_UI));
}
}
@@ -471,7 +469,7 @@ static void deferred_ui_audio_callback(const LLUUID& uuid)
{
if (gAudiop)
{
- LLDeferredSounds::instance().deferSound(uuid);
+ LLDeferredSounds::instance().deferSound(SoundData(uuid, gAgent.getID(), 1.0f, LLAudioEngine::AUDIO_TYPE_UI));
}
}
diff --git a/indra/newview/lldeferredsounds.cpp b/indra/newview/lldeferredsounds.cpp
index 2b2b493875..9416e7cd29 100644
--- a/indra/newview/lldeferredsounds.cpp
+++ b/indra/newview/lldeferredsounds.cpp
@@ -29,17 +29,17 @@
#include "lldeferredsounds.h"
-void ui_audio_callback(const LLUUID& uuid);
+#include "llaudioengine.h"
-void LLDeferredSounds::deferSound(LLUUID sound)
+void LLDeferredSounds::deferSound(SoundData& sound)
{
- soundQueue.push(sound);
+ soundVector.push_back(sound);
}
void LLDeferredSounds::playdeferredSounds()
{
- while(soundQueue.size())
+ while(soundVector.size())
{
- ui_audio_callback(soundQueue.front());
- soundQueue.pop();
+ gAudiop->triggerSound(soundVector.back());
+ soundVector.pop_back();
}
}
diff --git a/indra/newview/lldeferredsounds.h b/indra/newview/lldeferredsounds.h
index 50da9acf2b..bf1eb62957 100644
--- a/indra/newview/lldeferredsounds.h
+++ b/indra/newview/lldeferredsounds.h
@@ -29,13 +29,15 @@
#include "llsingleton.h"
+struct SoundData;
+
class LLDeferredSounds : public LLSingleton<LLDeferredSounds>
{
private:
- std::queue<LLUUID> soundQueue;
+ std::vector<SoundData> soundVector;
public:
//Add sounds to be played once progress bar is hidden (such as after teleport or loading screen)
- void deferSound(LLUUID sound);
+ void deferSound(SoundData& sound);
void playdeferredSounds();
};