aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewerparcelmedia.h
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llviewerparcelmedia.h')
-rw-r--r--linden/indra/newview/llviewerparcelmedia.h40
1 files changed, 38 insertions, 2 deletions
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 @@
34#define LLVIEWERPARCELMEDIA_H 34#define LLVIEWERPARCELMEDIA_H
35 35
36#include "llviewermedia.h" 36#include "llviewermedia.h"
37#include "llmemory.h"
37 38
38// For use by other patches so they know that media filtering is implemented. 39// For use by other patches so they know that media filtering is implemented.
39#define MEDIA_FILTERING 1 40#define MEDIA_FILTERING 1
@@ -41,6 +42,7 @@
41class LLMessageSystem; 42class LLMessageSystem;
42class LLParcel; 43class LLParcel;
43class LLViewerParcelMediaNavigationObserver; 44class LLViewerParcelMediaNavigationObserver;
45class LLViewerParcelMediaInfo;
44 46
45 47
46// This class understands land parcels, network traffic, LSL media 48// This class understands land parcels, network traffic, LSL media
@@ -49,6 +51,13 @@ class LLViewerParcelMediaNavigationObserver;
49class LLViewerParcelMedia : public LLViewerMediaObserver 51class LLViewerParcelMedia : public LLViewerMediaObserver
50{ 52{
51 LOG_CLASS(LLViewerParcelMedia); 53 LOG_CLASS(LLViewerParcelMedia);
54 private:
55 typedef enum e_command_origin
56 {
57 COMMAND_ORIGIN_LOCAL,
58 COMMAND_ORIGIN_REMOTE
59 } ECommandOrigin;
60
52 public: 61 public:
53 static void initClass(); 62 static void initClass();
54 static void cleanupClass(); 63 static void cleanupClass();
@@ -57,14 +66,14 @@ class LLViewerParcelMedia : public LLViewerMediaObserver
57 // called when the agent's parcel has a new URL, or the agent has 66 // called when the agent's parcel has a new URL, or the agent has
58 // walked on to a new parcel with media 67 // walked on to a new parcel with media
59 68
60 static void play(LLParcel* parcel, bool filter = true); 69 static void play(LLParcel* parcel, bool filter = true, const ECommandOrigin origin = COMMAND_ORIGIN_LOCAL);
61 // user clicked play button in media transport controls 70 // user clicked play button in media transport controls
62 static void playStreamingMusic(LLParcel* parcel, bool filter = true); 71 static void playStreamingMusic(LLParcel* parcel, bool filter = true);
63 // play the parcel music stream 72 // play the parcel music stream
64 static void stopStreamingMusic(); 73 static void stopStreamingMusic();
65 // stop the parcel music stream 74 // stop the parcel music stream
66 75
67 static void filterMedia(LLParcel* parcel, U32 type); // type: 0 = media, 1 = streaming music 76 static void filterMedia(LLParcel* parcel, U32 type, const ECommandOrigin origin); // type: 0 = media, 1 = streaming music
68 static bool allowedMedia(std::string media_url); 77 static bool allowedMedia(std::string media_url);
69 78
70 static bool loadDomainFilterList(); 79 static bool loadDomainFilterList();
@@ -90,6 +99,7 @@ class LLViewerParcelMedia : public LLViewerMediaObserver
90 99
91 static void processParcelMediaCommandMessage( LLMessageSystem *msg, void ** ); 100 static void processParcelMediaCommandMessage( LLMessageSystem *msg, void ** );
92 static void processParcelMediaUpdate( LLMessageSystem *msg, void ** ); 101 static void processParcelMediaUpdate( LLMessageSystem *msg, void ** );
102 static void undoParcelMediaUpdate(); // reset the parcel's media to what it was before ParcelMediaUpdate
93 static void sendMediaNavigateMessage(const std::string& url); 103 static void sendMediaNavigateMessage(const std::string& url);
94 104
95 // inherited from LLViewerMediaObserver 105 // inherited from LLViewerMediaObserver
@@ -107,6 +117,7 @@ class LLViewerParcelMedia : public LLViewerMediaObserver
107 static std::set<std::string> sMediaQueries; 117 static std::set<std::string> sMediaQueries;
108 static std::set<std::string> sAllowedMedia; 118 static std::set<std::string> sAllowedMedia;
109 static std::set<std::string> sDeniedMedia; 119 static std::set<std::string> sDeniedMedia;
120 static LLPointer<LLViewerParcelMediaInfo> sSavedMediaInfo; // The parcel original media (before a remote command is applied)
110}; 121};
111 122
112 123
@@ -120,4 +131,29 @@ public:
120 131
121}; 132};
122 133
134class LLViewerParcelMediaInfo : public LLRefCount
135{
136public:
137 LLViewerParcelMediaInfo(const std::string url,
138 const std::string type,
139 const LLUUID media_id,
140 const S32 width,
141 const S32 height,
142 const U8 scale,
143 const U8 loop);
144 LLViewerParcelMediaInfo(const LLParcel* parcel);
145 ~LLViewerParcelMediaInfo() {}
146 void applyToParcel(LLParcel* parcel);
147 bool sameParcel(const LLParcel* parcel) const;
148 bool operator==(const LLViewerParcelMediaInfo &rhs) const;
149private:
150 std::string mMediaURL;
151 std::string mMediaType;
152 LLUUID mMediaID;
153 S32 mMediaWidth;
154 S32 mMediaHeight;
155 U8 mMediaAutoScale;
156 U8 mMediaLoop;
157 S32 mParcelLocalID;
158};
123#endif 159#endif