summaryrefslogtreecommitdiff
path: root/indra/media_plugins/webkit/media_plugin_webkit.cpp
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-02-22 14:08:15 +0000
committerTofu Linden <tofu.linden@lindenlab.com>2010-02-22 14:08:15 +0000
commitdf43c0e18b852fb1490cf9199b7766239cd2801c (patch)
tree5f3f1b0182149d9ba09bc6bd8c05f256b5c5ca32 /indra/media_plugins/webkit/media_plugin_webkit.cpp
parent551771fd90e2caf58856b746d4dfc108679cc05f (diff)
Wire the linux volume catcher into the webkit plugin.
Diffstat (limited to 'indra/media_plugins/webkit/media_plugin_webkit.cpp')
-rw-r--r--indra/media_plugins/webkit/media_plugin_webkit.cpp34
1 files changed, 31 insertions, 3 deletions
diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp
index 688d3bcd3d..292585caa6 100644
--- a/indra/media_plugins/webkit/media_plugin_webkit.cpp
+++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp
@@ -43,11 +43,15 @@
#include "llpluginmessageclasses.h"
#include "media_plugin_base.h"
+#if LL_LINUX
+# include "linux_volume_catcher.h"
+#endif
+
#if LL_WINDOWS
-#include <direct.h>
+# include <direct.h>
#else
-#include <unistd.h>
-#include <stdlib.h>
+# include <unistd.h>
+# include <stdlib.h>
#endif
#if LL_WINDOWS
@@ -102,6 +106,10 @@ private:
F32 mBackgroundG;
F32 mBackgroundB;
+#if LL_LINUX
+ LinuxVolumeCatcher mLinuxVolumeCatcher;
+#endif
+
void setInitState(int state)
{
// std::cerr << "changing init state to " << state << std::endl;
@@ -114,6 +122,10 @@ private:
{
LLQtWebKit::getInstance()->pump( milliseconds );
+#if LL_LINUX
+ mLinuxVolumeCatcher.pump();
+#endif
+
checkEditState();
if(mInitState == INIT_STATE_NAVIGATE_COMPLETE)
@@ -281,6 +293,7 @@ private:
return false;
};
+ void setVolume(F32 vol);
////////////////////////////////////////////////////////////////////////////////
// virtual
@@ -732,6 +745,14 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
// std::cerr << "MediaPluginWebKit::receiveMessage: unknown base message: " << message_name << std::endl;
}
}
+ else if(message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA_TIME)
+ {
+ if(message_name == "set_volume")
+ {
+ F32 volume = message_in.getValueReal("volume");
+ setVolume(volume);
+ }
+ }
else if(message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA)
{
if(message_name == "size_change")
@@ -998,6 +1019,13 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
}
}
+void MediaPluginWebKit::setVolume(F32 volume)
+{
+#if LL_LINUX
+ mLinuxVolumeCatcher.setVolume(volume);
+#endif
+}
+
int init_media_plugin(LLPluginInstance::sendMessageFunction host_send_func, void *host_user_data, LLPluginInstance::sendMessageFunction *plugin_send_func, void **plugin_user_data)
{
MediaPluginWebKit *self = new MediaPluginWebKit(host_send_func, host_user_data);