aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmedia/llmediaengine.h
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llmedia/llmediaengine.h')
-rw-r--r--linden/indra/llmedia/llmediaengine.h139
1 files changed, 139 insertions, 0 deletions
diff --git a/linden/indra/llmedia/llmediaengine.h b/linden/indra/llmedia/llmediaengine.h
new file mode 100644
index 0000000..1efebec
--- /dev/null
+++ b/linden/indra/llmedia/llmediaengine.h
@@ -0,0 +1,139 @@
1/**
2 * @file llmediaengine.h
3 * @brief Top level media engine - wraps more specific functionality.
4 *
5 * Copyright (c) 2005-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#ifndef LLMEDIAENGINE_H
29#define LLMEDIAENGINE_H
30
31#include "linden_common.h"
32#include "lluuid.h"
33#include "llimage.h"
34
35#include "llmediabase.h"
36#include "llmediaobservers.h"
37
38
39#include "message.h"
40
41//////////////////////////////////////////////////////////////////////////////
42// media engine singleton
43class LLMediaEngine
44{
45public:
46 static void initClass();
47 static void updateClass(F32 volume);
48 static void cleanupClass();
49
50protected:
51 // don't let anyone else make one of these
52 LLMediaEngine ();
53
54public:
55 virtual ~LLMediaEngine ();
56
57 // used to get access to single instance of the class (singleton pattern)
58 static LLMediaEngine* getInstance ();
59
60 // public methods
61 BOOL init ();
62 BOOL update ();
63
64 // Pass web_url true if it's a web page, false if it's a movie.
65 // path is to mozilla directory for mozila
66 BOOL load( const LLString& urlIn, bool web_url, const LLString& path, S32 width_pixels, S32 height_pixels);
67
68 BOOL isLoaded ();
69 BOOL unload ();
70 BOOL play ();
71 BOOL loop ();
72 BOOL pause ();
73 BOOL stop ();
74 BOOL seek (F64 time);
75 void setAvailable ( BOOL availableIn );
76 BOOL isAvailable ();
77 void setEnabled ( BOOL enabledIn );
78 BOOL isEnabled ();
79 void setAutoScaled ( BOOL autoScaledIn );
80 BOOL isAutoScaled ();
81 BOOL setVolume ( F32 volumeIn );
82
83 void setUrl ( const LLString& urlIn );
84 const LLString& getUrl ();
85 void setImageUUID ( LLUUID textureIdIn );
86 LLUUID getImageUUID ();
87
88 // MBW -- XXX -- This should return a LLMediaMovieBase, but the web and movie media classes still haven't been
89 // fully disentangled.
90 LLMediaBase* getMediaRenderer();
91 LLImageRaw* getImageRaw() { return mImageRaw; }
92 void handleSizeChangedRequest();
93
94 //////////////////////////////////////////////////////////////////////////////////////////
95 //
96 static void convertImageAndLoadUrl ( bool enableLooping, bool web_url, const std::string& path);
97
98 //////////////////////////////////////////////////////////////////////////////////////////
99 //
100 static void process_parcel_media ( LLMessageSystem *msg, void ** );
101 static void process_parcel_media_update ( LLMessageSystem *msg, void ** );
102
103 // proxy configuration
104 void setNetworkProxy ( BOOL enabledIn, const LLString& addressIn,
105 S32 portIn, S32 socksIn, const LLString& excludeIn );
106
107 void getNetworkProxy ( BOOL& enabledOut, LLString& addressOut,
108 S32& portOut, S32& socksOut, LLString& excludeOuy );
109
110private:
111 void createImageRaw();
112 void destroyImageRaw();
113
114private:
115 BOOL mAvailable;
116 BOOL mEnabled;
117 BOOL mAutoScaled;
118 LLString mUrl;
119 // MBW -- XXX -- This should be a LLMediaMovieBase, but the web and movie media classes still haven't been
120 // fully disentangled.
121 LLMediaBase* mMediaRenderer;
122 LLPointer<LLImageRaw> mImageRaw;
123
124 LLUUID mImageUUID;
125 F32 mVolume;
126
127 // proxy information
128 BOOL mProxyEnabled;
129 LLString mProxyAddress;
130 S32 mProxyPort;
131 S32 mProxySocks;
132 LLString mProxyExlude;
133
134private:
135 static LLMediaEngine* sInstance;
136};
137
138#endif // LLMEDIAENGINE_H
139