automated merge viewer2.0->viewer2.0

meow-7.2.2
Loren Shih 2010-01-06 12:34:02 -05:00
commit d9b8f65c03
6 changed files with 34 additions and 102 deletions

View File

@ -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>

View File

@ -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");

View File

@ -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;
}

View File

@ -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);

View File

@ -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;
}

View File

@ -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"))
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())
// 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);
}
}