summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2010-01-06 12:34:02 -0500
committerLoren Shih <seraph@lindenlab.com>2010-01-06 12:34:02 -0500
commitd9b8f65c03130f659ed0d036a9c542700a84b766 (patch)
treed50256ac783f1b3401eb32e67d4f3a14a90e672e /indra
parentcdb158e9e0cff7070bb68c721cec0e90b0030fb2 (diff)
parent447a908a0a46e6e0ad6ac5e8a3a26260d865243b (diff)
automated merge viewer2.0->viewer2.0
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/app_settings/ignorable_dialogs.xml15
-rw-r--r--indra/newview/llappviewer.cpp3
-rw-r--r--indra/newview/llviewermedia.cpp73
-rw-r--r--indra/newview/llviewermedia.h4
-rw-r--r--indra/newview/llviewerparcelmedia.cpp19
-rw-r--r--indra/newview/llviewerparcelmgr.cpp24
6 files changed, 35 insertions, 103 deletions
diff --git a/indra/newview/app_settings/ignorable_dialogs.xml b/indra/newview/app_settings/ignorable_dialogs.xml
index ab18febccc..e825f13e82 100644
--- a/indra/newview/app_settings/ignorable_dialogs.xml
+++ b/indra/newview/app_settings/ignorable_dialogs.xml
@@ -177,21 +177,10 @@
<key>Value</key>
<integer>1</integer>
</map>
- <key>FirstStreamingMusic</key>
+ <key>FirstStreamingMedia</key>
<map>
<key>Comment</key>
- <string>Enables FirstStreamingMusic warning dialog</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>Boolean</string>
- <key>Value</key>
- <integer>1</integer>
- </map>
- <key>FirstStreamingVideo</key>
- <map>
- <key>Comment</key>
- <string>Enables FirstStreamingVideo warning dialog</string>
+ <string>Enables FirstStreamingMedia warning dialog</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index becc30832d..e0356bc091 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -1929,8 +1929,7 @@ bool LLAppViewer::initConfiguration()
LLFirstUse::addConfigVariable("FirstSandbox");
LLFirstUse::addConfigVariable("FirstFlexible");
LLFirstUse::addConfigVariable("FirstDebugMenus");
- LLFirstUse::addConfigVariable("FirstStreamingMusic");
- LLFirstUse::addConfigVariable("FirstStreamingVideo");
+ LLFirstUse::addConfigVariable("FirstStreamingMedia");
LLFirstUse::addConfigVariable("FirstSculptedPrim");
LLFirstUse::addConfigVariable("FirstVoice");
LLFirstUse::addConfigVariable("FirstMedia");
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 0fc0afed3e..6e11788e0a 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -2541,76 +2541,3 @@ void LLViewerMediaImpl::setTextureID(LLUUID id)
}
}
-
-//////////////////////////////////////////////////////////////////////////////////////////
-//static
-void LLViewerMedia::toggleMusicPlay(void*)
-{
-// FIXME: This probably doesn't belong here
-#if 0
- if (mMusicState != PLAYING)
- {
- mMusicState = PLAYING; // desired state
- if (gAudiop)
- {
- LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
- if ( parcel )
- {
- gAudiop->startInternetStream(parcel->getMusicURL());
- }
- }
- }
- else
- {
- mMusicState = STOPPED; // desired state
- if (gAudiop)
- {
- gAudiop->stopInternetStream();
- }
- }
-#endif
-}
-
-//////////////////////////////////////////////////////////////////////////////////////////
-//static
-void LLViewerMedia::toggleMediaPlay(void*)
-{
-// FIXME: This probably doesn't belong here
-#if 0
- if (LLViewerMedia::isMediaPaused())
- {
- LLViewerParcelMedia::start();
- }
- else if(LLViewerMedia::isMediaPlaying())
- {
- LLViewerParcelMedia::pause();
- }
- else
- {
- LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
- if (parcel)
- {
- LLViewerParcelMedia::play(parcel);
- }
- }
-#endif
-}
-
-//////////////////////////////////////////////////////////////////////////////////////////
-//static
-void LLViewerMedia::mediaStop(void*)
-{
-// FIXME: This probably doesn't belong here
-#if 0
- LLViewerParcelMedia::stop();
-#endif
-}
-
-//////////////////////////////////////////////////////////////////////////////////////////
-//static
-bool LLViewerMedia::isMusicPlaying()
-{
-// FIXME: This probably doesn't belong here
-// FIXME: make this work
- return false;
-}
diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h
index 9119b783c2..5e4dd8ff30 100644
--- a/indra/newview/llviewermedia.h
+++ b/indra/newview/llviewermedia.h
@@ -99,14 +99,10 @@ class LLViewerMedia
static void setVolume(F32 volume);
static void updateMedia(void* dummy_arg = NULL);
- static bool isMusicPlaying();
static void initClass();
static void cleanupClass();
- static void toggleMusicPlay(void*);
- static void toggleMediaPlay(void*);
- static void mediaStop(void*);
static F32 getVolume();
static void muteListChanged();
static void setInWorldMediaDisabled(bool disabled);
diff --git a/indra/newview/llviewerparcelmedia.cpp b/indra/newview/llviewerparcelmedia.cpp
index 86f0f4e04e..0f7903a7a5 100644
--- a/indra/newview/llviewerparcelmedia.cpp
+++ b/indra/newview/llviewerparcelmedia.cpp
@@ -34,6 +34,7 @@
#include "llviewerparcelmedia.h"
#include "llagent.h"
+#include "llaudioengine.h"
#include "llviewercontrol.h"
#include "llviewermedia.h"
#include "llviewerregion.h"
@@ -109,7 +110,9 @@ void LLViewerParcelMedia::update(LLParcel* parcel)
std::string mediaCurrentUrl = std::string( parcel->getMediaCurrentURL());
// First use warning
- if( ! mediaUrl.empty() && gWarningSettings.getBOOL("FirstStreamingVideo") )
+ if( (!mediaUrl.empty() ||
+ !parcel->getMusicURL().empty())
+ && gWarningSettings.getBOOL("FirstStreamingMedia") )
{
LLNotificationsUtil::add("ParcelCanPlayMedia", LLSD(), LLSD(),
boost::bind(callback_play_media, _1, _2, parcel));
@@ -593,16 +596,28 @@ bool callback_play_media(const LLSD& notification, const LLSD& response, LLParce
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("FirstStreamingVideo", FALSE);
+ gWarningSettings.setBOOL("FirstStreamingMedia", FALSE);
return false;
}
diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp
index 87a9eae028..5a5c4e7480 100644
--- a/indra/newview/llviewerparcelmgr.cpp
+++ b/indra/newview/llviewerparcelmgr.cpp
@@ -44,6 +44,7 @@
#include "llparcel.h"
#include "llsecondlifeurls.h"
#include "message.h"
+#include "llfloaterreg.h"
// Viewer includes
#include "llagent.h"
@@ -52,6 +53,7 @@
#include "llfirstuse.h"
#include "llfloaterbuyland.h"
#include "llfloatergroups.h"
+#include "llfloaternearbymedia.h"
#include "llfloatersellland.h"
#include "llfloatertools.h"
#include "llparcelselection.h"
@@ -1735,7 +1737,7 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
}
else if (!gAudiop->getInternetStreamURL().empty())
{
- llinfos << "Stopping parcel music" << llendl;
+ llinfos << "Stopping parcel music (parcel stream URL is empty)" << llendl;
gAudiop->startInternetStream(LLStringUtil::null);
}
}
@@ -1754,15 +1756,19 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
void optionally_start_music(const std::string& music_url)
{
- if (gSavedSettings.getBOOL("AudioStreamingMusic") && gSavedSettings.getBOOL("AudioStreamingMedia"))
- {
- // Make the user click the start button on the overlay bar. JC
- // llinfos << "Starting parcel music " << music_url << llendl;
-
- // now only play music when you enter a new parcel if the control is in PLAY state
- // changed as part of SL-4878
- if ( gOverlayBar && gOverlayBar->musicPlaying())
+ if (gSavedSettings.getBOOL("AudioStreamingMusic") &&
+ gSavedSettings.getBOOL("AudioStreamingMedia"))
+ {
+ // only play music when you enter a new parcel if the UI control for this
+ // was not *explicitly* stopped by the user. (part of SL-4878)
+ LLFloaterNearbyMedia *nearby_media_floater = LLFloaterReg::findTypedInstance<LLFloaterNearbyMedia>("nearby_media");
+ if ((nearby_media_floater &&
+ nearby_media_floater->getParcelAudioAutoStart()) ||
+ // or they have expressed no opinion in the UI, but have autoplay on...
+ (!nearby_media_floater &&
+ gSavedSettings.getBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING)))
{
+ llinfos << "Starting parcel music " << music_url << llendl;
gAudiop->startInternetStream(music_url);
}
}