Skip to content
Snippets Groups Projects
Commit c0c1d91c authored by Rick Pasetto's avatar Rick Pasetto
Browse files
parents 78cb4204 0b639775
No related branches found
No related tags found
No related merge requests found
...@@ -48,12 +48,15 @@ ...@@ -48,12 +48,15 @@
#include "llviewerwindow.h" #include "llviewerwindow.h"
#include "llfocusmgr.h" #include "llfocusmgr.h"
#include "llcallbacklist.h" #include "llcallbacklist.h"
#include "llparcel.h"
#include "llaudioengine.h" // for gAudiop
#include "llevent.h" // LLSimpleListener #include "llevent.h" // LLSimpleListener
#include "llnotificationsutil.h" #include "llnotificationsutil.h"
#include "lluuid.h" #include "lluuid.h"
#include "llkeyboard.h" #include "llkeyboard.h"
#include "llmutelist.h" #include "llmutelist.h"
#include "llfirstuse.h"
#include <boost/bind.hpp> // for SkinFolder listener #include <boost/bind.hpp> // for SkinFolder listener
#include <boost/signals2.hpp> #include <boost/signals2.hpp>
...@@ -708,6 +711,8 @@ void LLViewerMedia::updateMedia(void *dummy_arg) ...@@ -708,6 +711,8 @@ void LLViewerMedia::updateMedia(void *dummy_arg)
std::vector<LLViewerMediaImpl*> proximity_order; 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_instances = gSavedSettings.getU32("PluginInstancesTotal");
U32 max_normal = gSavedSettings.getU32("PluginInstancesNormal"); U32 max_normal = gSavedSettings.getU32("PluginInstancesNormal");
U32 max_low = gSavedSettings.getU32("PluginInstancesLow"); U32 max_low = gSavedSettings.getU32("PluginInstancesLow");
...@@ -822,6 +827,21 @@ void LLViewerMedia::updateMedia(void *dummy_arg) ...@@ -822,6 +827,21 @@ void LLViewerMedia::updateMedia(void *dummy_arg)
new_priority = LLPluginClassMedia::PRIORITY_LOW; 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); pimpl->setPriority(new_priority);
if(pimpl->getUsedInUI()) if(pimpl->getUsedInUI())
...@@ -888,6 +908,61 @@ void LLViewerMedia::cleanupClass() ...@@ -888,6 +908,61 @@ void LLViewerMedia::cleanupClass()
gIdleCallbacks.deleteFunction(LLViewerMedia::updateMedia, NULL); gIdleCallbacks.deleteFunction(LLViewerMedia::updateMedia, NULL);
} }
//////////////////////////////////////////////////////////////////////////////////////////
// static
bool LLViewerMedia::needsMediaFirstRun()
{
return gWarningSettings.getBOOL("FirstStreamingMedia");
}
//////////////////////////////////////////////////////////////////////////////////////////
// static
void LLViewerMedia::displayMediaFirstRun()
{
gWarningSettings.setBOOL("FirstStreamingMedia", FALSE);
LLNotificationsUtil::add("ParcelCanPlayMedia", LLSD(), LLSD(),
boost::bind(firstRunCallback, _1, _2));
}
//////////////////////////////////////////////////////////////////////////////////////////
// static
bool LLViewerMedia::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 // LLViewerMediaImpl
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment