summaryrefslogtreecommitdiff
path: root/indra/media_plugins/webkit
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
parent551771fd90e2caf58856b746d4dfc108679cc05f (diff)
Wire the linux volume catcher into the webkit plugin.
Diffstat (limited to 'indra/media_plugins/webkit')
-rw-r--r--indra/media_plugins/webkit/linux_volume_catcher.cpp8
-rw-r--r--indra/media_plugins/webkit/media_plugin_webkit.cpp34
2 files changed, 35 insertions, 7 deletions
diff --git a/indra/media_plugins/webkit/linux_volume_catcher.cpp b/indra/media_plugins/webkit/linux_volume_catcher.cpp
index 1439f1c5a5..89cababdd8 100644
--- a/indra/media_plugins/webkit/linux_volume_catcher.cpp
+++ b/indra/media_plugins/webkit/linux_volume_catcher.cpp
@@ -58,7 +58,7 @@ public:
LinuxVolumeCatcherImpl();
~LinuxVolumeCatcherImpl();
- void setVol(F32 volume);
+ void setVolume(F32 volume);
void pump(void);
// for internal use - can't be private because used from our C callbacks
@@ -144,7 +144,7 @@ void LinuxVolumeCatcherImpl::cleanup()
mConnected = false;
}
-void LinuxVolumeCatcherImpl::setVol(F32 volume)
+void LinuxVolumeCatcherImpl::setVolume(F32 volume)
{
mDesiredVolume = volume;
@@ -311,10 +311,10 @@ LinuxVolumeCatcher::~LinuxVolumeCatcher()
pimpl = NULL;
}
-void LinuxVolumeCatcher::setVol(F32 volume)
+void LinuxVolumeCatcher::setVolume(F32 volume)
{
llassert(pimpl);
- pimpl->setVol(volume);
+ pimpl->setVolume(volume);
}
void LinuxVolumeCatcher::pump()
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);