summaryrefslogtreecommitdiff
path: root/indra/newview/llpreviewsound.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpreviewsound.cpp')
-rw-r--r--indra/newview/llpreviewsound.cpp37
1 files changed, 16 insertions, 21 deletions
diff --git a/indra/newview/llpreviewsound.cpp b/indra/newview/llpreviewsound.cpp
index 26d8da5a6b..7e7be5b2c6 100644
--- a/indra/newview/llpreviewsound.cpp
+++ b/indra/newview/llpreviewsound.cpp
@@ -49,12 +49,23 @@ extern LLAgent gAgent;
const F32 SOUND_GAIN = 1.0f;
-LLPreviewSound::LLPreviewSound(const std::string& name, const LLRect& rect, const std::string& title, const LLUUID& item_uuid, const LLUUID& object_uuid) :
- LLPreview( name, rect, title, item_uuid, object_uuid)
+LLPreviewSound::LLPreviewSound(const LLSD& key)
+ : LLPreview( key )
{
-
- LLUICtrlFactory::getInstance()->buildFloater(this,"floater_preview_sound.xml");
+ //Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this,"floater_preview_sound.xml", FALSE);
+}
+// virtual
+BOOL LLPreviewSound::postBuild()
+{
+ const LLInventoryItem* item = getItem();
+ if (item)
+ {
+ childSetText("desc", item->getDescription());
+ if (gAudiop)
+ gAudiop->preloadSound(item->getAssetUUID()); // preload the sound
+ }
+
childSetAction("Sound play btn",&LLPreviewSound::playSound,this);
childSetAction("Sound audition btn",&LLPreviewSound::auditionSound,this);
@@ -64,26 +75,10 @@ LLPreviewSound::LLPreviewSound(const std::string& name, const LLRect& rect, cons
button = getChild<LLButton>("Sound audition btn");
button->setSoundFlags(LLView::SILENT);
- const LLInventoryItem* item = getItem();
-
childSetCommitCallback("desc", LLPreview::onText, this);
- childSetText("desc", item->getDescription());
childSetPrevalidate("desc", &LLLineEditor::prevalidatePrintableNotPipe);
-
- // preload the sound
- if(item && gAudiop)
- {
- gAudiop->preloadSound(item->getAssetUUID());
- }
-
- setTitle(title);
-
- if (!getHost())
- {
- LLRect curRect = getRect();
- translate(rect.mLeft - curRect.mLeft, rect.mTop - curRect.mTop);
- }
+ return LLPreview::postBuild();
}
// static