From e6cda8b59b9b52617a4c40a9ae6111403a3dba2f Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Sat, 14 Feb 2009 23:12:10 -0700 Subject: Fixed missing music prompt (streaming now enabled by default) --- linden/indra/newview/app_settings/settings.xml | 4 +-- linden/indra/newview/llviewerparcelmedia.cpp | 8 +---- linden/indra/newview/llviewerparcelmgr.cpp | 20 +++++++++++- .../newview/skins/default/xui/en-us/alerts.xml | 36 ++++++++++++++-------- 4 files changed, 46 insertions(+), 22 deletions(-) (limited to 'linden/indra/newview') diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index 779b668..fbb620c 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml @@ -317,7 +317,7 @@ Type Boolean Value - 0 + 1 AudioStreamingVideo @@ -328,7 +328,7 @@ Type Boolean Value - 0 + 1 AutoAcceptNewInventory diff --git a/linden/indra/newview/llviewerparcelmedia.cpp b/linden/indra/newview/llviewerparcelmedia.cpp index 956ed03..94f6d84 100644 --- a/linden/indra/newview/llviewerparcelmedia.cpp +++ b/linden/indra/newview/llviewerparcelmedia.cpp @@ -384,17 +384,11 @@ void LLViewerParcelMedia::processParcelMediaUpdate( LLMessageSystem *msg, void * void callback_play_media(S32 option, void* data) { - LLParcel* parcel = (LLParcel*)data; if (option == 0) { - gSavedSettings.setBOOL("AudioStreamingVideo", TRUE); + LLParcel* parcel = (LLParcel*)data; LLViewerParcelMedia::play(parcel); } - else - { - gSavedSettings.setBOOL("AudioStreamingVideo", FALSE); - } gSavedSettings.setWarning("FirstStreamingVideo", FALSE); - } diff --git a/linden/indra/newview/llviewerparcelmgr.cpp b/linden/indra/newview/llviewerparcelmgr.cpp index 5ef6f83..e27e284 100644 --- a/linden/indra/newview/llviewerparcelmgr.cpp +++ b/linden/indra/newview/llviewerparcelmgr.cpp @@ -1692,7 +1692,12 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use void optionally_start_music(const std::string& music_url) { - if (gSavedSettings.getBOOL("AudioStreamingMusic")) + // Check to see if this your first time on a music-enabled parcel. + if (gSavedSettings.getWarning("FirstStreamingMusic")) + { + gViewerWindow->alertXml("ParcelCanPlayMusic", callback_start_music, (void*)&music_url); + } + else if (gSavedSettings.getBOOL("AudioStreamingMusic")) { // Make the user click the start button on the overlay bar. JC // llinfos << "Starting parcel music " << music_url << llendl; @@ -1706,6 +1711,19 @@ void optionally_start_music(const std::string& music_url) } } + +void callback_start_music(S32 option, void* data) +{ + if (option == 0) + { + // Before the callback, we verified the url was good. + // We fetch again to avoid lag while loading. + LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); + gAudiop->startInternetStream(parcel->getMusicURL()); + } + gSavedSettings.setWarning("FirstStreamingMusic", FALSE); +} + // static void LLViewerParcelMgr::processParcelAccessListReply(LLMessageSystem *msg, void **user) { diff --git a/linden/indra/newview/skins/default/xui/en-us/alerts.xml b/linden/indra/newview/skins/default/xui/en-us/alerts.xml index 0be529f..92e2014 100644 --- a/linden/indra/newview/skins/default/xui/en-us/alerts.xml +++ b/linden/indra/newview/skins/default/xui/en-us/alerts.xml @@ -1893,20 +1893,32 @@ Try selecting a single parcel. Region Not Found - - - This location can play streaming media. -Streaming media requires a fast Internet connection. - -Play streaming media when available? -(You can change this option later under -Preferences > Audio & Video.) - + + + This location wants to play streaming music. + (Requires a fast Internet connection.) + + Play streaming music now? + + + + + + + This location wants to play streaming media. + (Requires a fast Internet connection.) + + Play streaming media now? + - -- cgit v1.1 From 5ca6654804dd26f41320b461dbe81d1dba42c3f4 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Sat, 14 Feb 2009 23:16:16 -0700 Subject: Fixed music button not toggling on first run --- linden/indra/newview/lloverlaybar.cpp | 7 +++++++ linden/indra/newview/lloverlaybar.h | 3 +++ linden/indra/newview/llviewerparcelmgr.cpp | 2 ++ 3 files changed, 12 insertions(+) (limited to 'linden/indra/newview') diff --git a/linden/indra/newview/lloverlaybar.cpp b/linden/indra/newview/lloverlaybar.cpp index 1087fd8..80cac14 100644 --- a/linden/indra/newview/lloverlaybar.cpp +++ b/linden/indra/newview/lloverlaybar.cpp @@ -275,6 +275,7 @@ void LLOverlayBar::refresh() { layoutButtons(); } + } //----------------------------------------------------------------------- @@ -360,6 +361,12 @@ void LLOverlayBar::toggleMediaPlay(void*) } //static +void LLOverlayBar::musicFirstRun() +{ + gOverlayBar->mMusicState = PLAYING; +} + +//static void LLOverlayBar::toggleMusicPlay(void*) { if (!gOverlayBar) diff --git a/linden/indra/newview/lloverlaybar.h b/linden/indra/newview/lloverlaybar.h index 5880ff0..73d0a43 100644 --- a/linden/indra/newview/lloverlaybar.h +++ b/linden/indra/newview/lloverlaybar.h @@ -80,6 +80,9 @@ public: static void musicStop(void*); static void mediaStop(void*); + // hack to make sure the music button plays. + static void musicFirstRun(); + static void toggleAudioVolumeFloater(void*); protected: diff --git a/linden/indra/newview/llviewerparcelmgr.cpp b/linden/indra/newview/llviewerparcelmgr.cpp index e27e284..2dee2bf 100644 --- a/linden/indra/newview/llviewerparcelmgr.cpp +++ b/linden/indra/newview/llviewerparcelmgr.cpp @@ -1720,6 +1720,8 @@ void callback_start_music(S32 option, void* data) // We fetch again to avoid lag while loading. LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); gAudiop->startInternetStream(parcel->getMusicURL()); + + LLOverlayBar::musicFirstRun(); } gSavedSettings.setWarning("FirstStreamingMusic", FALSE); } -- cgit v1.1 From b126a1f08592c59b185a89325c55031ff939cae1 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Sat, 14 Feb 2009 23:56:36 -0700 Subject: Removed useless music pause button --- linden/indra/newview/llmediaremotectrl.cpp | 20 +-- .../default/xui/en-us/panel_media_controls.xml | 188 ++++++++++----------- 2 files changed, 98 insertions(+), 110 deletions(-) (limited to 'linden/indra/newview') diff --git a/linden/indra/newview/llmediaremotectrl.cpp b/linden/indra/newview/llmediaremotectrl.cpp index 1b337ab..06978d7 100644 --- a/linden/indra/newview/llmediaremotectrl.cpp +++ b/linden/indra/newview/llmediaremotectrl.cpp @@ -85,7 +85,6 @@ BOOL LLMediaRemoteCtrl::postBuild() childSetAction("media_stop",LLOverlayBar::mediaStop,this); childSetAction("music_stop",LLOverlayBar::toggleMusicPlay,this); childSetAction("media_pause",LLOverlayBar::toggleMediaPlay,this); - childSetAction("music_pause",LLOverlayBar::toggleMusicPlay,this); childSetAction("expand", onClickExpandBtn, this); return TRUE; @@ -150,7 +149,6 @@ void LLMediaRemoteCtrl::enableMediaButtons() bool stop_media_enabled = false; bool play_music_enabled = false; bool stop_music_enabled = false; - bool music_show_pause = false; bool media_show_pause = false; LLColor4 music_icon_color = LLUI::sColorsGroup->getColor( "IconDisabledColor" ); LLColor4 media_icon_color = LLUI::sColorsGroup->getColor( "IconDisabledColor" ); @@ -203,17 +201,16 @@ void LLMediaRemoteCtrl::enableMediaButtons() if ( parcel && parcel->getMusicURL()[0]) { - play_music_enabled = true; music_icon_color = LLUI::sColorsGroup->getColor( "IconEnabledColor" ); if (gOverlayBar->musicPlaying()) { - music_show_pause = true; + play_music_enabled = false; stop_music_enabled = true; } else { - music_show_pause = false; + play_music_enabled = true; stop_music_enabled = false; } } @@ -226,20 +223,19 @@ void LLMediaRemoteCtrl::enableMediaButtons() } } const std::string media_icon_name = LLMIMETypes::findIcon(media_type); + LLButton* music_play_btn = getChild("music_play"); LLButton* music_stop_btn = getChild("music_stop"); - LLButton* music_pause_btn = getChild("music_pause"); + + music_play_btn->setEnabled(play_music_enabled); + music_stop_btn->setEnabled(stop_music_enabled); + childSetColor("music_icon", music_icon_color); + LLButton* media_play_btn = getChild("media_play"); LLButton* media_stop_btn = getChild("media_stop"); LLButton* media_pause_btn = getChild("media_pause"); LLIconCtrl* media_icon = getChild("media_icon"); - music_play_btn->setEnabled(play_music_enabled); - music_stop_btn->setEnabled(stop_music_enabled); - music_pause_btn->setEnabled(music_show_pause); - music_pause_btn->setVisible(music_show_pause); - music_play_btn->setVisible(! music_show_pause); - childSetColor("music_icon", music_icon_color); if(!media_icon_name.empty()) { media_icon->setImage(media_icon_name); diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_media_controls.xml b/linden/indra/newview/skins/default/xui/en-us/panel_media_controls.xml index 1fead04..7e4f12a 100644 --- a/linden/indra/newview/skins/default/xui/en-us/panel_media_controls.xml +++ b/linden/indra/newview/skins/default/xui/en-us/panel_media_controls.xml @@ -1,98 +1,90 @@ - - - -