From 4131069d0f517180a92e8ebda20b4760ecaeb855 Mon Sep 17 00:00:00 2001 From: thickbrick Date: Fri, 1 Apr 2011 15:28:48 +0300 Subject: Fix 829: Several changes to media filter - Adds a "less annoying" mode, which attempts to only filter scripted streaming events. On by default (should we change that?) - Adds UI to enable and disable the media filter, both from the filter floater and from the preferences floater. - Adds a button to launch the filter floater to prefences. - Some UI tweaks to the filter floater. --- linden/indra/newview/llviewerparcelmedia.h | 40 ++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) (limited to 'linden/indra/newview/llviewerparcelmedia.h') diff --git a/linden/indra/newview/llviewerparcelmedia.h b/linden/indra/newview/llviewerparcelmedia.h index 7531a0f..f4c4312 100644 --- a/linden/indra/newview/llviewerparcelmedia.h +++ b/linden/indra/newview/llviewerparcelmedia.h @@ -34,6 +34,7 @@ #define LLVIEWERPARCELMEDIA_H #include "llviewermedia.h" +#include "llmemory.h" // For use by other patches so they know that media filtering is implemented. #define MEDIA_FILTERING 1 @@ -41,6 +42,7 @@ class LLMessageSystem; class LLParcel; class LLViewerParcelMediaNavigationObserver; +class LLViewerParcelMediaInfo; // This class understands land parcels, network traffic, LSL media @@ -49,6 +51,13 @@ class LLViewerParcelMediaNavigationObserver; class LLViewerParcelMedia : public LLViewerMediaObserver { LOG_CLASS(LLViewerParcelMedia); + private: + typedef enum e_command_origin + { + COMMAND_ORIGIN_LOCAL, + COMMAND_ORIGIN_REMOTE + } ECommandOrigin; + public: static void initClass(); static void cleanupClass(); @@ -57,14 +66,14 @@ class LLViewerParcelMedia : public LLViewerMediaObserver // called when the agent's parcel has a new URL, or the agent has // walked on to a new parcel with media - static void play(LLParcel* parcel, bool filter = true); + static void play(LLParcel* parcel, bool filter = true, const ECommandOrigin origin = COMMAND_ORIGIN_LOCAL); // user clicked play button in media transport controls static void playStreamingMusic(LLParcel* parcel, bool filter = true); // play the parcel music stream static void stopStreamingMusic(); // stop the parcel music stream - static void filterMedia(LLParcel* parcel, U32 type); // type: 0 = media, 1 = streaming music + static void filterMedia(LLParcel* parcel, U32 type, const ECommandOrigin origin); // type: 0 = media, 1 = streaming music static bool allowedMedia(std::string media_url); static bool loadDomainFilterList(); @@ -90,6 +99,7 @@ class LLViewerParcelMedia : public LLViewerMediaObserver static void processParcelMediaCommandMessage( LLMessageSystem *msg, void ** ); static void processParcelMediaUpdate( LLMessageSystem *msg, void ** ); + static void undoParcelMediaUpdate(); // reset the parcel's media to what it was before ParcelMediaUpdate static void sendMediaNavigateMessage(const std::string& url); // inherited from LLViewerMediaObserver @@ -107,6 +117,7 @@ class LLViewerParcelMedia : public LLViewerMediaObserver static std::set sMediaQueries; static std::set sAllowedMedia; static std::set sDeniedMedia; + static LLPointer sSavedMediaInfo; // The parcel original media (before a remote command is applied) }; @@ -120,4 +131,29 @@ public: }; +class LLViewerParcelMediaInfo : public LLRefCount +{ +public: + LLViewerParcelMediaInfo(const std::string url, + const std::string type, + const LLUUID media_id, + const S32 width, + const S32 height, + const U8 scale, + const U8 loop); + LLViewerParcelMediaInfo(const LLParcel* parcel); + ~LLViewerParcelMediaInfo() {} + void applyToParcel(LLParcel* parcel); + bool sameParcel(const LLParcel* parcel) const; + bool operator==(const LLViewerParcelMediaInfo &rhs) const; +private: + std::string mMediaURL; + std::string mMediaType; + LLUUID mMediaID; + S32 mMediaWidth; + S32 mMediaHeight; + U8 mMediaAutoScale; + U8 mMediaLoop; + S32 mParcelLocalID; +}; #endif -- cgit v1.1