aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview
diff options
context:
space:
mode:
authorMcCabe Maxsted2009-02-15 00:10:35 -0700
committerMcCabe Maxsted2009-02-15 00:10:35 -0700
commitb967768af6b39d91376dd9a35794d50e947df933 (patch)
tree82b284c04e09300d078ee182d7f1c2ab28d31ea2 /linden/indra/newview
parentCommit error (diff)
parentRemoved useless music pause button (diff)
downloadmeta-impy-b967768af6b39d91376dd9a35794d50e947df933.zip
meta-impy-b967768af6b39d91376dd9a35794d50e947df933.tar.gz
meta-impy-b967768af6b39d91376dd9a35794d50e947df933.tar.bz2
meta-impy-b967768af6b39d91376dd9a35794d50e947df933.tar.xz
Removed useless music pause button
Diffstat (limited to 'linden/indra/newview')
-rw-r--r--linden/indra/newview/app_settings/settings.xml4
-rw-r--r--linden/indra/newview/llmediaremotectrl.cpp20
-rw-r--r--linden/indra/newview/lloverlaybar.cpp7
-rw-r--r--linden/indra/newview/lloverlaybar.h3
-rw-r--r--linden/indra/newview/llviewerparcelmedia.cpp8
-rw-r--r--linden/indra/newview/llviewerparcelmgr.cpp22
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/alerts.xml36
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/panel_media_controls.xml14
8 files changed, 69 insertions, 45 deletions
diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml
index 9ec5727..7405aad 100644
--- a/linden/indra/newview/app_settings/settings.xml
+++ b/linden/indra/newview/app_settings/settings.xml
@@ -317,7 +317,7 @@
317 <key>Type</key> 317 <key>Type</key>
318 <string>Boolean</string> 318 <string>Boolean</string>
319 <key>Value</key> 319 <key>Value</key>
320 <integer>0</integer> 320 <integer>1</integer>
321 </map> 321 </map>
322 <key>AudioStreamingVideo</key> 322 <key>AudioStreamingVideo</key>
323 <map> 323 <map>
@@ -328,7 +328,7 @@
328 <key>Type</key> 328 <key>Type</key>
329 <string>Boolean</string> 329 <string>Boolean</string>
330 <key>Value</key> 330 <key>Value</key>
331 <integer>0</integer> 331 <integer>1</integer>
332 </map> 332 </map>
333 <key>AutoAcceptNewInventory</key> 333 <key>AutoAcceptNewInventory</key>
334 <map> 334 <map>
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()
85 childSetAction("media_stop",LLOverlayBar::mediaStop,this); 85 childSetAction("media_stop",LLOverlayBar::mediaStop,this);
86 childSetAction("music_stop",LLOverlayBar::toggleMusicPlay,this); 86 childSetAction("music_stop",LLOverlayBar::toggleMusicPlay,this);
87 childSetAction("media_pause",LLOverlayBar::toggleMediaPlay,this); 87 childSetAction("media_pause",LLOverlayBar::toggleMediaPlay,this);
88 childSetAction("music_pause",LLOverlayBar::toggleMusicPlay,this);
89 88
90 childSetAction("expand", onClickExpandBtn, this); 89 childSetAction("expand", onClickExpandBtn, this);
91 return TRUE; 90 return TRUE;
@@ -150,7 +149,6 @@ void LLMediaRemoteCtrl::enableMediaButtons()
150 bool stop_media_enabled = false; 149 bool stop_media_enabled = false;
151 bool play_music_enabled = false; 150 bool play_music_enabled = false;
152 bool stop_music_enabled = false; 151 bool stop_music_enabled = false;
153 bool music_show_pause = false;
154 bool media_show_pause = false; 152 bool media_show_pause = false;
155 LLColor4 music_icon_color = LLUI::sColorsGroup->getColor( "IconDisabledColor" ); 153 LLColor4 music_icon_color = LLUI::sColorsGroup->getColor( "IconDisabledColor" );
156 LLColor4 media_icon_color = LLUI::sColorsGroup->getColor( "IconDisabledColor" ); 154 LLColor4 media_icon_color = LLUI::sColorsGroup->getColor( "IconDisabledColor" );
@@ -203,17 +201,16 @@ void LLMediaRemoteCtrl::enableMediaButtons()
203 201
204 if ( parcel && parcel->getMusicURL()[0]) 202 if ( parcel && parcel->getMusicURL()[0])
205 { 203 {
206 play_music_enabled = true;
207 music_icon_color = LLUI::sColorsGroup->getColor( "IconEnabledColor" ); 204 music_icon_color = LLUI::sColorsGroup->getColor( "IconEnabledColor" );
208 205
209 if (gOverlayBar->musicPlaying()) 206 if (gOverlayBar->musicPlaying())
210 { 207 {
211 music_show_pause = true; 208 play_music_enabled = false;
212 stop_music_enabled = true; 209 stop_music_enabled = true;
213 } 210 }
214 else 211 else
215 { 212 {
216 music_show_pause = false; 213 play_music_enabled = true;
217 stop_music_enabled = false; 214 stop_music_enabled = false;
218 } 215 }
219 } 216 }
@@ -226,20 +223,19 @@ void LLMediaRemoteCtrl::enableMediaButtons()
226 } 223 }
227 } 224 }
228 const std::string media_icon_name = LLMIMETypes::findIcon(media_type); 225 const std::string media_icon_name = LLMIMETypes::findIcon(media_type);
226
229 LLButton* music_play_btn = getChild<LLButton>("music_play"); 227 LLButton* music_play_btn = getChild<LLButton>("music_play");
230 LLButton* music_stop_btn = getChild<LLButton>("music_stop"); 228 LLButton* music_stop_btn = getChild<LLButton>("music_stop");
231 LLButton* music_pause_btn = getChild<LLButton>("music_pause"); 229
230 music_play_btn->setEnabled(play_music_enabled);
231 music_stop_btn->setEnabled(stop_music_enabled);
232 childSetColor("music_icon", music_icon_color);
233
232 LLButton* media_play_btn = getChild<LLButton>("media_play"); 234 LLButton* media_play_btn = getChild<LLButton>("media_play");
233 LLButton* media_stop_btn = getChild<LLButton>("media_stop"); 235 LLButton* media_stop_btn = getChild<LLButton>("media_stop");
234 LLButton* media_pause_btn = getChild<LLButton>("media_pause"); 236 LLButton* media_pause_btn = getChild<LLButton>("media_pause");
235 LLIconCtrl* media_icon = getChild<LLIconCtrl>("media_icon"); 237 LLIconCtrl* media_icon = getChild<LLIconCtrl>("media_icon");
236 238
237 music_play_btn->setEnabled(play_music_enabled);
238 music_stop_btn->setEnabled(stop_music_enabled);
239 music_pause_btn->setEnabled(music_show_pause);
240 music_pause_btn->setVisible(music_show_pause);
241 music_play_btn->setVisible(! music_show_pause);
242 childSetColor("music_icon", music_icon_color);
243 if(!media_icon_name.empty()) 239 if(!media_icon_name.empty())
244 { 240 {
245 media_icon->setImage(media_icon_name); 241 media_icon->setImage(media_icon_name);
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()
275 { 275 {
276 layoutButtons(); 276 layoutButtons();
277 } 277 }
278
278} 279}
279 280
280//----------------------------------------------------------------------- 281//-----------------------------------------------------------------------
@@ -360,6 +361,12 @@ void LLOverlayBar::toggleMediaPlay(void*)
360} 361}
361 362
362//static 363//static
364void LLOverlayBar::musicFirstRun()
365{
366 gOverlayBar->mMusicState = PLAYING;
367}
368
369//static
363void LLOverlayBar::toggleMusicPlay(void*) 370void LLOverlayBar::toggleMusicPlay(void*)
364{ 371{
365 if (!gOverlayBar) 372 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:
80 static void musicStop(void*); 80 static void musicStop(void*);
81 static void mediaStop(void*); 81 static void mediaStop(void*);
82 82
83 // hack to make sure the music button plays.
84 static void musicFirstRun();
85
83 static void toggleAudioVolumeFloater(void*); 86 static void toggleAudioVolumeFloater(void*);
84 87
85protected: 88protected:
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 *
384 384
385void callback_play_media(S32 option, void* data) 385void callback_play_media(S32 option, void* data)
386{ 386{
387 LLParcel* parcel = (LLParcel*)data;
388 if (option == 0) 387 if (option == 0)
389 { 388 {
390 gSavedSettings.setBOOL("AudioStreamingVideo", TRUE); 389 LLParcel* parcel = (LLParcel*)data;
391 LLViewerParcelMedia::play(parcel); 390 LLViewerParcelMedia::play(parcel);
392 } 391 }
393 else
394 {
395 gSavedSettings.setBOOL("AudioStreamingVideo", FALSE);
396 }
397 gSavedSettings.setWarning("FirstStreamingVideo", FALSE); 392 gSavedSettings.setWarning("FirstStreamingVideo", FALSE);
398
399} 393}
400 394
diff --git a/linden/indra/newview/llviewerparcelmgr.cpp b/linden/indra/newview/llviewerparcelmgr.cpp
index 5ef6f83..2dee2bf 100644
--- a/linden/indra/newview/llviewerparcelmgr.cpp
+++ b/linden/indra/newview/llviewerparcelmgr.cpp
@@ -1692,7 +1692,12 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
1692 1692
1693void optionally_start_music(const std::string& music_url) 1693void optionally_start_music(const std::string& music_url)
1694{ 1694{
1695 if (gSavedSettings.getBOOL("AudioStreamingMusic")) 1695 // Check to see if this your first time on a music-enabled parcel.
1696 if (gSavedSettings.getWarning("FirstStreamingMusic"))
1697 {
1698 gViewerWindow->alertXml("ParcelCanPlayMusic", callback_start_music, (void*)&music_url);
1699 }
1700 else if (gSavedSettings.getBOOL("AudioStreamingMusic"))
1696 { 1701 {
1697 // Make the user click the start button on the overlay bar. JC 1702 // Make the user click the start button on the overlay bar. JC
1698 // llinfos << "Starting parcel music " << music_url << llendl; 1703 // llinfos << "Starting parcel music " << music_url << llendl;
@@ -1706,6 +1711,21 @@ void optionally_start_music(const std::string& music_url)
1706 } 1711 }
1707} 1712}
1708 1713
1714
1715void callback_start_music(S32 option, void* data)
1716{
1717 if (option == 0)
1718 {
1719 // Before the callback, we verified the url was good.
1720 // We fetch again to avoid lag while loading.
1721 LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
1722 gAudiop->startInternetStream(parcel->getMusicURL());
1723
1724 LLOverlayBar::musicFirstRun();
1725 }
1726 gSavedSettings.setWarning("FirstStreamingMusic", FALSE);
1727}
1728
1709// static 1729// static
1710void LLViewerParcelMgr::processParcelAccessListReply(LLMessageSystem *msg, void **user) 1730void LLViewerParcelMgr::processParcelAccessListReply(LLMessageSystem *msg, void **user)
1711{ 1731{
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.
1893 Region Not Found 1893 Region Not Found
1894 </message> 1894 </message>
1895 </alert> 1895 </alert>
1896 <alert modal="true" name="ParcelCanPlayMedia"> 1896 <alert modal="true" name="ParcelCanPlayMusic">
1897 <message name="message"> 1897 <message name="message">
1898 This location can play streaming media. 1898 This location wants to play streaming music.
1899Streaming media requires a fast Internet connection. 1899 (Requires a fast Internet connection.)
1900 1900
1901Play streaming media when available? 1901 Play streaming music now?
1902(You can change this option later under 1902 </message>
1903Preferences &gt; Audio &amp; Video.) 1903 <option name="PlayMusic">
1904 </message> 1904 Yes
1905 </option>
1906 <option name="No">
1907 No
1908 </option>
1909 </alert>
1910 <alert modal="true" name="ParcelCanPlayMedia">
1911 <message name="message">
1912 This location wants to play streaming media.
1913 (Requires a fast Internet connection.)
1914
1915 Play streaming media now?
1916 </message>
1905 <option name="PlayMedia"> 1917 <option name="PlayMedia">
1906 Play Media 1918 Yes
1907 </option> 1919 </option>
1908 <option name="Disable"> 1920 <option name="No">
1909 Disable 1921 No
1910 </option> 1922 </option>
1911 </alert> 1923 </alert>
1912 <alert modal="true" name="CannotDeedLandWaitingForServer"> 1924 <alert modal="true" name="CannotDeedLandWaitingForServer">
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 a8ecfca..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
@@ -4,7 +4,7 @@
4 name="media_controls" width="262"> 4 name="media_controls" width="262">
5 <icon bottom="-22" enabled="true" follows="left|top" height="22" 5 <icon bottom="-22" enabled="true" follows="left|top" height="22"
6 image_name="icn_label_music.tga" label="" left_delta="2" mouse_opaque="true" 6 image_name="icn_label_music.tga" label="" left_delta="2" mouse_opaque="true"
7 name="music_icon" scale_image="true" tool_tip="Play/pause streaming music" 7 name="music_icon" scale_image="true" tool_tip="Play streaming music"
8 width="20" /> 8 width="20" />
9 <button bottom="-21" enabled="true" follows="left|top" height="20" 9 <button bottom="-21" enabled="true" follows="left|top" height="20"
10 image_overlay="icn_play.tga" 10 image_overlay="icn_play.tga"
@@ -13,15 +13,7 @@
13 image_disabled="flyout_btn_left_disabled.tga" 13 image_disabled="flyout_btn_left_disabled.tga"
14 label="" left_delta="20" 14 label="" left_delta="20"
15 mouse_opaque="true" name="music_play" scale_image="true" toggle="false" 15 mouse_opaque="true" name="music_play" scale_image="true" toggle="false"
16 tool_tip="Play/pause streaming music" width="20" /> 16 tool_tip="Play streaming music" width="20" />
17 <button bottom="-21" enabled="false" follows="left|top" height="20"
18 image_overlay="icn_pause.tga"
19 image_unselected="flyout_btn_left.tga"
20 image_selected="flyout_btn_left_selected.tga"
21 image_disabled="flyout_btn_left_disabled.tga"
22 label="" left_delta="0"
23 mouse_opaque="true" name="music_pause" scale_image="true" toggle="false"
24 tool_tip="Pause streaming music" width="20" />
25 <button bottom="-21" enabled="true" follows="left|top" height="20" 17 <button bottom="-21" enabled="true" follows="left|top" height="20"
26 image_overlay="icn_stop.tga" 18 image_overlay="icn_stop.tga"
27 image_unselected="flyout_btn_right.tga" 19 image_unselected="flyout_btn_right.tga"
@@ -33,7 +25,7 @@
33 <icon bottom="-22" enabled="true" follows="left|top" height="22" 25 <icon bottom="-22" enabled="true" follows="left|top" height="22"
34 image_name="icn_label_media.tga" 26 image_name="icn_label_media.tga"
35 label="" left_delta="23" mouse_opaque="true" 27 label="" left_delta="23" mouse_opaque="true"
36 name="media_icon" scale_image="true" tool_tip="Play/pause streaming music" 28 name="media_icon" scale_image="true" tool_tip="Play/pause streaming media"
37 width="20" /> 29 width="20" />
38 <button bottom="-21" enabled="true" follows="left|top" height="20" 30 <button bottom="-21" enabled="true" follows="left|top" height="20"
39 image_overlay="icn_play.tga" 31 image_overlay="icn_play.tga"