From f4d9d23927368884ffbd859fb4a9e8886ff5004a Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> Date: Fri, 4 Sep 2026 18:18:50 +0300 Subject: #6223 360 Snapshot should make an inworld sound --- indra/llplugin/llpluginclassmedia.cpp | 8 ++++++++ indra/llplugin/llpluginclassmedia.h | 8 +++++++- indra/llplugin/llpluginclassmediaowner.h | 1 + 3 files changed, 16 insertions(+), 1 deletion(-) (limited to 'indra/llplugin') diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index 2269d7adc8..540bd77b7d 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -1309,8 +1309,16 @@ void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message) else if (message_name == "file_download") { mFileDownloadFilename = message.getValue("filename"); + mFileDownloadProgressPercent = 0; + mFileDownloadProgressComplete = false; mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_FILE_DOWNLOAD); } + else if (message_name == "file_download_progress") + { + mFileDownloadProgressPercent = message.getValueS32("percent"); + mFileDownloadProgressComplete = message.getValueBoolean("complete"); + mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_FILE_DOWNLOAD_PROGRESS); + } else if(message_name == "debug_message") { mDebugMessageText = message.getValue("message_text"); diff --git a/indra/llplugin/llpluginclassmedia.h b/indra/llplugin/llpluginclassmedia.h index 153a7eb823..1d886f16f9 100644 --- a/indra/llplugin/llpluginclassmedia.h +++ b/indra/llplugin/llpluginclassmedia.h @@ -324,9 +324,13 @@ public: std::string getHoverText() const { return mHoverText; }; std::string getHoverLink() const { return mHoverLink; }; - // these are valid during MEDIA_EVENT_LINK_HOVERED + // These are valid during MEDIA_EVENT_FILE_DOWNLOAD std::string getFileDownloadFilename() const { return mFileDownloadFilename; } + // these are valid during MEDIA_EVENT_FILE_DOWNLOAD_PROGRESS + int getFileDownloadProgressPercent() const { return mFileDownloadProgressPercent; } + bool getFileDownloadProgressComplete() const { return mFileDownloadProgressComplete; } + const std::string& getMediaName() const { return mMediaName; }; std::string getMediaDescription() const { return mMediaDescription; }; @@ -488,6 +492,8 @@ protected: std::string mHoverText; std::string mHoverLink; std::string mFileDownloadFilename; + int mFileDownloadProgressPercent = 0; + bool mFileDownloadProgressComplete = false; bool mIsMultipleFilePick; ///////////////////////////////////////// diff --git a/indra/llplugin/llpluginclassmediaowner.h b/indra/llplugin/llpluginclassmediaowner.h index a75d0b9960..76f93be3eb 100644 --- a/indra/llplugin/llpluginclassmediaowner.h +++ b/indra/llplugin/llpluginclassmediaowner.h @@ -64,6 +64,7 @@ public: MEDIA_EVENT_AUTH_REQUEST, // The plugin wants to display an auth dialog MEDIA_EVENT_FILE_DOWNLOAD, // the plugin wants to download a file + MEDIA_EVENT_FILE_DOWNLOAD_PROGRESS, // file download progress/completion update MEDIA_EVENT_DEBUG_MESSAGE, // plugin sending back debug information for host to process -- cgit v1.3