summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rwxr-xr-xindra/newview/llinventorybridge.cpp21
-rwxr-xr-xindra/newview/llinventorybridge.h1
-rwxr-xr-xindra/newview/skins/default/xui/en/menu_inventory.xml2
3 files changed, 22 insertions, 2 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 8e6ac20eaa..d6f2803fc2 100755
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -87,6 +87,8 @@ void copy_slurl_to_clipboard_callback_inv(const std::string& slurl);
typedef std::pair<LLUUID, LLUUID> two_uuids_t;
typedef std::list<two_uuids_t> two_uuids_list_t;
+const F32 SOUND_GAIN = 1.0f;
+
struct LLMoveInv
{
LLUUID mObjectID;
@@ -4523,6 +4525,23 @@ void LLSoundBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
hide_context_entries(menu, items, disabled_items);
}
+void LLSoundBridge::performAction(LLInventoryModel* model, std::string action)
+{
+ if ("sound_play" == action)
+ {
+ LLViewerInventoryItem* item = getItem();
+ if(item)
+ {
+ send_sound_trigger(item->getAssetUUID(), SOUND_GAIN);
+ }
+ }
+ else if ("open" == action)
+ {
+ openSoundPreview((void*)this);
+ }
+ else LLItemBridge::performAction(model, action);
+}
+
// +=================================================+
// | LLLandmarkBridge |
// +=================================================+
@@ -6135,7 +6154,7 @@ public:
LLViewerInventoryItem* item = getItem();
if (item)
{
- LLFloaterReg::showInstance("preview_sound", LLSD(mUUID), TAKE_FOCUS_YES);
+ send_sound_trigger(item->getAssetUUID(), SOUND_GAIN);
}
LLInvFVBridgeAction::doIt();
}
diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h
index 833fbbadbb..e8d5db4437 100755
--- a/indra/newview/llinventorybridge.h
+++ b/indra/newview/llinventorybridge.h
@@ -389,6 +389,7 @@ public:
LLItemBridge(inventory, root, uuid) {}
virtual void openItem();
virtual void buildContextMenu(LLMenuGL& menu, U32 flags);
+ virtual void performAction(LLInventoryModel* model, std::string action);
static void openSoundPreview(void*);
};
diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml
index 6fa45d7d66..7099db63ab 100755
--- a/indra/newview/skins/default/xui/en/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/en/menu_inventory.xml
@@ -531,7 +531,7 @@
name="Sound Play">
<menu_item_call.on_click
function="Inventory.DoToSelected"
- parameter="open" />
+ parameter="sound_play" />
</menu_item_call>
<menu_item_separator
layout="topleft"