Fix few minor issues (empty lines, french comment)

Separate attached sounds in two types: attached sounds, gesture sounds
Add the new type, gesture sounds, in all updated files
master
Rohacan Hirons 2025-06-09 12:07:50 +02:00
parent a620722087
commit c7e593c4ea
9 changed files with 97 additions and 22 deletions

View File

@ -131,10 +131,13 @@ public:
AT_GLTF = 58, // gltf json document
AT_GLTF_BIN = 59, // gltf binary data
// <FS> Asset types for sounds muting in Sounds Explorer window
AT_AVATAR_ATTACHED_SOUNDS = 60, // Black list avatar attached sounds
AT_AVATAR_REZZED_SOUNDS = 61, // Black list avatar rezzed sounds
AT_AVATAR_REZZED_SOUNDS = 61, // Black list avatar rezzed sounds
AT_AVATAR_GESTURE_SOUNDS = 62, // Black list avatar gesture sounds
AT_COUNT = 62,
AT_COUNT = 63,
// </FS>
// +*********************************************************+
// | TO ADD AN ELEMENT TO THIS ENUM: |

View File

@ -163,8 +163,11 @@ DEFAULT_ASSET_FOR_INV_TYPE[LLAssetType::AT_COUNT] =
LLInventoryType::IT_GLTF, // 58 AT_GLTF
LLInventoryType::IT_GLTF_BIN, // 59 AT_GLTF_BIN
// <FS> Asset types for sounds muting in Sounds Explorer window
LLInventoryType::IT_NONE, // 60 AT_AVATAR_ATTACHED_SOUNDS
LLInventoryType::IT_NONE, // 61 AT_AVATAR_REZZED_SOUNDS
LLInventoryType::IT_NONE, // 62 AT_AVATAR_GESTURE_SOUNDS
// </FS>
};
// static

View File

@ -77,6 +77,7 @@ bool NACLFloaterExploreSounds::postBuild()
getChild<LLButton>("stop_locally_btn")->setClickedCallback(boost::bind(&NACLFloaterExploreSounds::handleStopLocally, this));
getChild<LLButton>("block_avatar_attached_sounds_btn")->setClickedCallback(boost::bind(&NACLFloaterExploreSounds::blacklistAvatarAttachedSounds, this));
getChild<LLButton>("block_avatar_rezzed_sounds_btn")->setClickedCallback(boost::bind(&NACLFloaterExploreSounds::blacklistAvatarRezzedSounds, this));
getChild<LLButton>("block_avatar_gesture_sounds_btn")->setClickedCallback(boost::bind(&NACLFloaterExploreSounds::blacklistAvatarGestureSounds, this));
mHistoryScroller = getChild<LLScrollListCtrl>("sound_list");
mHistoryScroller->setCommitCallback(boost::bind(&NACLFloaterExploreSounds::handleSelection, this));
@ -100,6 +101,9 @@ void NACLFloaterExploreSounds::handleSelection()
childSetEnabled("play_locally_btn", num_selected);
childSetEnabled("stop_btn", num_selected);
childSetEnabled("bl_btn", num_selected);
childSetEnabled("block_avatar_attached_sounds_btn", num_selected);
childSetEnabled("block_avatar_rezzed_sounds_btn", num_selected);
childSetEnabled("block_avatar_gesture_sounds_btn", num_selected);
}
LLSoundHistoryItem NACLFloaterExploreSounds::getItem(const LLUUID& itemID)
@ -502,7 +506,6 @@ void NACLFloaterExploreSounds::blacklistSound()
}
}
void NACLFloaterExploreSounds::onBlacklistAvatarNameCacheCallback(const LLUUID& av_id, const LLAvatarName& av_name, const LLUUID& asset_id, const std::string& region_name)
{
blacklist_avatar_name_cache_connection_map_t::iterator it = mBlacklistAvatarNameCacheConnections.find(av_id);
@ -517,10 +520,7 @@ void NACLFloaterExploreSounds::onBlacklistAvatarNameCacheCallback(const LLUUID&
FSAssetBlacklist::getInstance()->addNewItemToBlacklist(asset_id, av_name.getCompleteName(), region_name, LLAssetType::AT_SOUND);
}
// add avatar attached sounds to blacklist
// add avatar attachments sounds to blacklist
void NACLFloaterExploreSounds::blacklistAvatarAttachedSounds()
{
std::vector<LLScrollListItem*> selection = mHistoryScroller->getAllSelected();
@ -575,9 +575,7 @@ void NACLFloaterExploreSounds::onBlacklistAvatarAttachedSoundsNameCacheCallback(
FSAssetBlacklist::getInstance()->addNewItemToBlacklist(owner_id, av_name.getCompleteName(), region_name, LLAssetType::AT_AVATAR_ATTACHED_SOUNDS);
}
// add avatar rezzed sounds to blacklist
// add avatar rezzed objects sounds to blacklist
void NACLFloaterExploreSounds::blacklistAvatarRezzedSounds()
{
std::vector<LLScrollListItem*> selection = mHistoryScroller->getAllSelected();
@ -634,8 +632,65 @@ void NACLFloaterExploreSounds::onBlacklistAvatarRezzedSoundsNameCacheCallback(co
}
mBlacklistAvatarNameCacheConnections.erase(it);
}
FSAssetBlacklist::getInstance()->addNewItemToBlacklist(owner_id,
av_name.getCompleteName(),
region_name,
LLAssetType::AT_AVATAR_REZZED_SOUNDS);
FSAssetBlacklist::getInstance()->addNewItemToBlacklist(owner_id, av_name.getCompleteName(), region_name, LLAssetType::AT_AVATAR_REZZED_SOUNDS);
}
// add avatar gestures sounds to blacklist
void NACLFloaterExploreSounds::blacklistAvatarGestureSounds()
{
std::vector<LLScrollListItem*> selection = mHistoryScroller->getAllSelected();
std::vector<LLScrollListItem*>::iterator selection_iter = selection.begin();
std::vector<LLScrollListItem*>::iterator selection_end = selection.end();
for (; selection_iter != selection_end; ++selection_iter)
{
LLSoundHistoryItem item = getItem((*selection_iter)->getValue());
if (item.mID.isNull())
{
continue;
}
std::string region_name;
LLViewerRegion* cur_region = gAgent.getRegion();
if (cur_region)
{
region_name = cur_region->getName();
}
blacklist_avatar_name_cache_connection_map_t::iterator it = mBlacklistAvatarNameCacheConnections.find(item.mOwnerID);
if (it != mBlacklistAvatarNameCacheConnections.end())
{
if (it->second.connected())
{
it->second.disconnect();
}
mBlacklistAvatarNameCacheConnections.erase(it);
}
LLAvatarNameCache::callback_connection_t cb =
LLAvatarNameCache::get(item.mOwnerID,
boost::bind(&NACLFloaterExploreSounds::onBlacklistAvatarGestureSoundsNameCacheCallback,
this,
_1,
_2,
item.mOwnerID,
region_name));
mBlacklistAvatarNameCacheConnections.insert(std::make_pair(item.mOwnerID, cb));
}
}
void NACLFloaterExploreSounds::onBlacklistAvatarGestureSoundsNameCacheCallback(const LLUUID& av_id,
const LLAvatarName& av_name,
const LLUUID& owner_id,
const std::string& region_name)
{
blacklist_avatar_name_cache_connection_map_t::iterator it = mBlacklistAvatarNameCacheConnections.find(av_id);
if (it != mBlacklistAvatarNameCacheConnections.end())
{
if (it->second.connected())
{
it->second.disconnect();
}
mBlacklistAvatarNameCacheConnections.erase(it);
}
FSAssetBlacklist::getInstance()->addNewItemToBlacklist(owner_id, av_name.getCompleteName(), region_name, LLAssetType::AT_AVATAR_GESTURE_SOUNDS);
}

View File

@ -34,6 +34,7 @@ private:
void blacklistSound();
void blacklistAvatarAttachedSounds();
void blacklistAvatarRezzedSounds();
void blacklistAvatarGestureSounds();
LLScrollListCtrl* mHistoryScroller;
LLCheckBoxCtrl* mCollisionSounds;
@ -48,10 +49,11 @@ private:
typedef std::map<LLUUID, boost::signals2::connection> blacklist_avatar_name_cache_connection_map_t;
blacklist_avatar_name_cache_connection_map_t mBlacklistAvatarNameCacheConnections;
void onBlacklistAvatarNameCacheCallback(const LLUUID& av_id, const LLAvatarName& av_name, const LLUUID& asset_id, const std::string& region_name);
void onBlacklistAvatarAttachedSoundsNameCacheCallback(const LLUUID& av_id, const LLAvatarName& av_name, const LLUUID& asset_id, const std::string& region_name);
void onBlacklistAvatarRezzedSoundsNameCacheCallback(const LLUUID& av_id, const LLAvatarName& av_name, const LLUUID& asset_id, const std::string& region_name);
void onBlacklistAvatarGestureSoundsNameCacheCallback(const LLUUID& av_id, const LLAvatarName& av_name, const LLUUID& asset_id, const std::string& region_name);
};
#endif

View File

@ -66,6 +66,9 @@ LLAssetType::EType S32toAssetType(S32 assetindex)
case 61:
type = LLAssetType::AT_AVATAR_REZZED_SOUNDS;
break;
case 62:
type = LLAssetType::AT_AVATAR_GESTURE_SOUNDS;
break;
default:
type = LLAssetType::AT_NONE;
}
@ -135,7 +138,6 @@ bool FSAssetBlacklist::removeItem(const LLUUID& id)
container.erase(id);
}
// Supprime les métadonnées
LLSD data = it->second;
mBlacklistData.erase(it);

View File

@ -108,6 +108,8 @@ std::string FSFloaterAssetBlacklist::getTypeString(S32 type)
return getString("asset_avatar_attached_sounds");
case LLAssetType::AT_AVATAR_REZZED_SOUNDS:
return getString("asset_avatar_rezzed_sounds");
case LLAssetType::AT_AVATAR_GESTURE_SOUNDS:
return getString("asset_avatar_gesture_sounds");
default:
return getString("asset_unknown");
}

View File

@ -4715,9 +4715,9 @@ void process_sound_trigger(LLMessageSystem *msg, void **)
return;
}
// Gesture sound
if (object_id == owner_id) {
if (FSAssetBlacklist::getInstance()->isBlacklisted(owner_id, LLAssetType::AT_AVATAR_ATTACHED_SOUNDS))
if (FSAssetBlacklist::getInstance()->isBlacklisted(owner_id, LLAssetType::AT_AVATAR_GESTURE_SOUNDS))
{
return;
}
@ -4725,6 +4725,7 @@ void process_sound_trigger(LLMessageSystem *msg, void **)
else
{
LLViewerObject* object = gObjectList.findObject(object_id);
// Attachment sound
if (object && object->isAttachment())
{
if (FSAssetBlacklist::getInstance()->isBlacklisted(owner_id, LLAssetType::AT_AVATAR_ATTACHED_SOUNDS))
@ -4732,6 +4733,7 @@ void process_sound_trigger(LLMessageSystem *msg, void **)
return;
}
}
// Rezzed object sound
else if (FSAssetBlacklist::getInstance()->isBlacklisted(owner_id, LLAssetType::AT_AVATAR_REZZED_SOUNDS))
{
return;
@ -4848,13 +4850,15 @@ void process_preload_sound(LLMessageSystem *msg, void **user_data)
return;
}
LLViewerObject* objectp = gObjectList.findObject(object_id);
// Gesture sound
if (object_id == owner_id)
{
if (FSAssetBlacklist::getInstance()->isBlacklisted(owner_id, LLAssetType::AT_AVATAR_ATTACHED_SOUNDS))
if (FSAssetBlacklist::getInstance()->isBlacklisted(owner_id, LLAssetType::AT_AVATAR_GESTURE_SOUNDS))
{
return;
}
}
// Attachment sound
else if (objectp && objectp->isAttachment())
{
if (FSAssetBlacklist::getInstance()->isBlacklisted(owner_id, LLAssetType::AT_AVATAR_ATTACHED_SOUNDS))
@ -4862,6 +4866,7 @@ void process_preload_sound(LLMessageSystem *msg, void **user_data)
return;
}
}
// Rezzed object sound
else if (FSAssetBlacklist::getInstance()->isBlacklisted(owner_id, LLAssetType::AT_AVATAR_REZZED_SOUNDS))
{
return;

View File

@ -53,7 +53,7 @@
<button bottom_delta="0" follows="left|bottom" height="20" label="Stop" name="stop_btn" right="-10" width="95" enabled="false"/>
<button bottom_delta="0" follows="left|bottom" height="20" label="Blacklist" name="bl_btn" right="-110" width="95" enabled="false"/>
<button bottom_delta="25" follows="left|bottom" height="20" label="Block attached sounds by avatar" name="block_avatar_attached_sounds_btn" left="10" width="195" enabled="true"/>
<button bottom_delta="0" follows="left|bottom" height="20" label="Block rezzed sounds by avatar" name="block_avatar_rezzed_sounds_btn" left_delta="200" width="195" enabled="true"/>
<button bottom_delta="25" follows="left|bottom" height="20" label="Block AV attached sounds" name="block_avatar_attached_sounds_btn" left="10" width="165" enabled="false"/>
<button bottom_delta="0" follows="left|bottom" height="20" label="Block AV rezzed sounds" name="block_avatar_rezzed_sounds_btn" left_delta="170" width="165" enabled="false"/>
<button bottom_delta="0" follows="left|bottom" height="20" label="Block AV gesture sounds" name="block_avatar_gesture_sounds_btn" left_delta="170" width="165" enabled="false"/>
</floater>

View File

@ -32,6 +32,9 @@
</floater.string>
<floater.string name="asset_avatar_rezzed_sounds">
Avatar Rezzed Sounds
</floater.string>
<floater.string name="asset_avatar_gesture_sounds">
Avatar Gesture Sounds
</floater.string>
<floater.string name="asset_unknown">
Unknown