From df43c0e18b852fb1490cf9199b7766239cd2801c Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Mon, 22 Feb 2010 14:08:15 +0000 Subject: Wire the linux volume catcher into the webkit plugin. --- .../media_plugins/webkit/linux_volume_catcher.cpp | 8 ++--- indra/media_plugins/webkit/media_plugin_webkit.cpp | 34 ++++++++++++++++++++-- 2 files changed, 35 insertions(+), 7 deletions(-) (limited to 'indra/media_plugins') 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 +# include #else -#include -#include +# include +# include #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); -- cgit v1.2.3