diff options
-rw-r--r-- | indra/newview/llviewermedia.cpp | 73 | ||||
-rw-r--r-- | indra/newview/llviewermedia.h | 6 | ||||
-rw-r--r-- | indra/newview/llviewerparcelmedia.cpp | 40 |
3 files changed, 38 insertions, 81 deletions
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index f91d126073..7e8c8eb92e 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -54,7 +54,6 @@ #include "lluuid.h" #include "llkeyboard.h" #include "llmutelist.h" -#include "llfirstuse.h" #include <boost/bind.hpp> // for SkinFolder listener #include <boost/signals2.hpp> @@ -709,8 +708,6 @@ void LLViewerMedia::updateMedia(void *dummy_arg) std::vector<LLViewerMediaImpl*> proximity_order; - bool inworld_media_enabled = gSavedSettings.getBOOL("AudioStreamingMedia"); - bool needs_first_run = LLViewerMedia::needsMediaFirstRun(); U32 max_instances = gSavedSettings.getU32("PluginInstancesTotal"); U32 max_normal = gSavedSettings.getU32("PluginInstancesNormal"); U32 max_low = gSavedSettings.getU32("PluginInstancesLow"); @@ -825,21 +822,6 @@ void LLViewerMedia::updateMedia(void *dummy_arg) new_priority = LLPluginClassMedia::PRIORITY_LOW; } - if(!inworld_media_enabled) - { - // If inworld media is locked out, force all inworld media to stay unloaded. - if(!pimpl->getUsedInUI()) - { - new_priority = LLPluginClassMedia::PRIORITY_UNLOADED; - if(needs_first_run) - { - // Don't do this more than once in this loop. - needs_first_run = false; - LLViewerMedia::displayMediaFirstRun(); - } - } - } - pimpl->setPriority(new_priority); if(pimpl->getUsedInUI()) @@ -906,61 +888,6 @@ void LLViewerMedia::cleanupClass() gIdleCallbacks.deleteFunction(LLViewerMedia::updateMedia, NULL); } - -////////////////////////////////////////////////////////////////////////////////////////// -// static -bool LLViewerParcelMedia::needsMediaFirstRun() -{ - return gWarningSettings.getBOOL("FirstStreamingMedia"); -} - -////////////////////////////////////////////////////////////////////////////////////////// -// static -void LLViewerParcelMedia::displayMediaFirstRun() -{ - gWarningSettings.setBOOL("FirstStreamingMedia", FALSE); - - LLNotificationsUtil::add("ParcelCanPlayMedia", LLSD(), LLSD(), - boost::bind(firstRunCallback, _1, _2)); -} - -////////////////////////////////////////////////////////////////////////////////////////// -// static -bool LLViewerParcelMedia::firstRunCallback(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if (option == 0) - { - // user has elected to automatically play media. - gSavedSettings.setBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING, TRUE); - gSavedSettings.setBOOL("AudioStreamingVideo", TRUE); - gSavedSettings.setBOOL("AudioStreamingMusic", TRUE); - gSavedSettings.setBOOL("AudioStreamingMedia", TRUE); - - LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); - - if (parcel) - { - // play media right now, if available - LLViewerParcelMedia::play(parcel); - - // play music right now, if available - std::string music_url = parcel->getMusicURL(); - if (gAudiop && !music_url.empty()) - gAudiop->startInternetStream(music_url); - } - } - else - { - gSavedSettings.setBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING, FALSE); - gSavedSettings.setBOOL("AudioStreamingMedia", FALSE); - gSavedSettings.setBOOL("AudioStreamingVideo", FALSE); - gSavedSettings.setBOOL("AudioStreamingMusic", FALSE); - } - return false; -} - - ////////////////////////////////////////////////////////////////////////////////////////// // LLViewerMediaImpl ////////////////////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index 3ce9f1887c..b103c48bd8 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -115,12 +115,6 @@ class LLViewerMedia // This is the comparitor used to sort the list. static bool priorityComparitor(const LLViewerMediaImpl* i1, const LLViewerMediaImpl* i2); - - // For displaying the media first-run dialog. - static bool needsMediaFirstRun(); - static void displayMediaFirstRun(); - static bool firstRunCallback(const LLSD& notification, const LLSD& response); - }; // Implementation functions not exported into header file diff --git a/indra/newview/llviewerparcelmedia.cpp b/indra/newview/llviewerparcelmedia.cpp index 56dee6b34c..0f7903a7a5 100644 --- a/indra/newview/llviewerparcelmedia.cpp +++ b/indra/newview/llviewerparcelmedia.cpp @@ -56,6 +56,10 @@ LLUUID LLViewerParcelMedia::sMediaRegionID; viewer_media_t LLViewerParcelMedia::sMediaImpl; +// Local functions +bool callback_play_media(const LLSD& notification, const LLSD& response, LLParcel* parcel); + + // static void LLViewerParcelMedia::initClass() { @@ -108,10 +112,12 @@ void LLViewerParcelMedia::update(LLParcel* parcel) // First use warning if( (!mediaUrl.empty() || !parcel->getMusicURL().empty()) - && LLViewerMedia::needsMediaFirstRun()) + && gWarningSettings.getBOOL("FirstStreamingMedia") ) { - LLViewerMedia::displayMediaFirstRun(); + LLNotificationsUtil::add("ParcelCanPlayMedia", LLSD(), LLSD(), + boost::bind(callback_play_media, _1, _2, parcel)); return; + } // if we have a current (link sharing) url, use it instead @@ -585,6 +591,36 @@ void LLViewerParcelMedia::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent }; } +bool callback_play_media(const LLSD& notification, const LLSD& response, LLParcel* parcel) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option == 0) + { + // user has elected to automatically play media. + gSavedSettings.setBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING, TRUE); + gSavedSettings.setBOOL("AudioStreamingVideo", TRUE); + gSavedSettings.setBOOL("AudioStreamingMusic", TRUE); + if(!gSavedSettings.getBOOL("AudioStreamingMedia")) + gSavedSettings.setBOOL("AudioStreamingMedia", TRUE); + // play media right now, if available + LLViewerParcelMedia::play(parcel); + // play music right now, if available + if (parcel) + { + std::string music_url = parcel->getMusicURL(); + if (gAudiop && !music_url.empty()) + gAudiop->startInternetStream(music_url); + } + } + else + { + gSavedSettings.setBOOL("AudioStreamingVideo", FALSE); + gSavedSettings.setBOOL("AudioStreamingMusic", FALSE); + } + gWarningSettings.setBOOL("FirstStreamingMedia", FALSE); + return false; +} + // TODO: observer /* void LLViewerParcelMediaNavigationObserver::onNavigateComplete( const EventType& event_in ) |