aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/lloverlaybar.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:34 -0500
committerJacek Antonelli2008-08-15 23:45:34 -0500
commitcd17687f01420952712a500107e0f93e7ab8d5f8 (patch)
treece48c2b706f2c1176290e39fb555fbdf6648ce01 /linden/indra/newview/lloverlaybar.cpp
parentSecond Life viewer sources 1.19.0.5 (diff)
downloadmeta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.zip
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.gz
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.bz2
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.xz
Second Life viewer sources 1.19.1.0
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/lloverlaybar.cpp82
1 files changed, 27 insertions, 55 deletions
diff --git a/linden/indra/newview/lloverlaybar.cpp b/linden/indra/newview/lloverlaybar.cpp
index e24cbc7..0366e75 100644
--- a/linden/indra/newview/lloverlaybar.cpp
+++ b/linden/indra/newview/lloverlaybar.cpp
@@ -37,12 +37,12 @@
37#include "lloverlaybar.h" 37#include "lloverlaybar.h"
38 38
39#include "audioengine.h" 39#include "audioengine.h"
40#include "llglimmediate.h"
40#include "llagent.h" 41#include "llagent.h"
41#include "llbutton.h" 42#include "llbutton.h"
42#include "llchatbar.h" 43#include "llchatbar.h"
43#include "llfocusmgr.h" 44#include "llfocusmgr.h"
44#include "llimview.h" 45#include "llimview.h"
45#include "llmediaengine.h"
46#include "llmediaremotectrl.h" 46#include "llmediaremotectrl.h"
47#include "llpanelaudiovolume.h" 47#include "llpanelaudiovolume.h"
48#include "llparcel.h" 48#include "llparcel.h"
@@ -50,7 +50,10 @@
50#include "llui.h" 50#include "llui.h"
51#include "llviewercontrol.h" 51#include "llviewercontrol.h"
52#include "llviewerimagelist.h" 52#include "llviewerimagelist.h"
53#include "llviewermedia.h"
53#include "llviewermenu.h" // handle_reset_view() 54#include "llviewermenu.h" // handle_reset_view()
55#include "llviewermedia.h"
56#include "llviewerparcelmedia.h"
54#include "llviewerparcelmgr.h" 57#include "llviewerparcelmgr.h"
55#include "llvieweruictrlfactory.h" 58#include "llvieweruictrlfactory.h"
56#include "llviewerwindow.h" 59#include "llviewerwindow.h"
@@ -97,7 +100,6 @@ LLOverlayBar::LLOverlayBar()
97 : LLPanel(), 100 : LLPanel(),
98 mMediaRemote(NULL), 101 mMediaRemote(NULL),
99 mVoiceRemote(NULL), 102 mVoiceRemote(NULL),
100 mMediaState(STOPPED),
101 mMusicState(STOPPED) 103 mMusicState(STOPPED)
102{ 104{
103 setMouseOpaque(FALSE); 105 setMouseOpaque(FALSE);
@@ -122,7 +124,7 @@ BOOL LLOverlayBar::postBuild()
122 childSetAction("Stand Up",onClickStandUp,this); 124 childSetAction("Stand Up",onClickStandUp,this);
123 childSetVisible("chat_bar", gSavedSettings.getBOOL("ChatVisible")); 125 childSetVisible("chat_bar", gSavedSettings.getBOOL("ChatVisible"));
124 126
125 mIsFocusRoot = TRUE; 127 setFocusRoot(TRUE);
126 mBuilt = true; 128 mBuilt = true;
127 129
128 layoutButtons(); 130 layoutButtons();
@@ -219,7 +221,7 @@ void LLOverlayBar::refresh()
219 221
220 BOOL controls_grabbed = gAgent.anyControlGrabbed(); 222 BOOL controls_grabbed = gAgent.anyControlGrabbed();
221 button = LLUICtrlFactory::getButtonByName(this, "Release Keys"); 223 button = LLUICtrlFactory::getButtonByName(this, "Release Keys");
222 224
223 if (button && button->getVisible() != controls_grabbed) 225 if (button && button->getVisible() != controls_grabbed)
224 { 226 {
225 button->setVisible(controls_grabbed); 227 button->setVisible(controls_grabbed);
@@ -230,7 +232,7 @@ void LLOverlayBar::refresh()
230 232
231 BOOL mouselook_grabbed; 233 BOOL mouselook_grabbed;
232 mouselook_grabbed = gAgent.isControlGrabbed(CONTROL_ML_LBUTTON_DOWN_INDEX) 234 mouselook_grabbed = gAgent.isControlGrabbed(CONTROL_ML_LBUTTON_DOWN_INDEX)
233 || gAgent.isControlGrabbed(CONTROL_ML_LBUTTON_UP_INDEX); 235 || gAgent.isControlGrabbed(CONTROL_ML_LBUTTON_UP_INDEX);
234 button = LLUICtrlFactory::getButtonByName(this, "Mouselook"); 236 button = LLUICtrlFactory::getButtonByName(this, "Mouselook");
235 237
236 if (button && button->getVisible() != mouselook_grabbed) 238 if (button && button->getVisible() != mouselook_grabbed)
@@ -256,7 +258,6 @@ void LLOverlayBar::refresh()
256 buttons_changed = TRUE; 258 buttons_changed = TRUE;
257 } 259 }
258 260
259 enableMediaButtons();
260 261
261 moveChildToBackOfTabGroup(mMediaRemote); 262 moveChildToBackOfTabGroup(mMediaRemote);
262 moveChildToBackOfTabGroup(mVoiceRemote); 263 moveChildToBackOfTabGroup(mVoiceRemote);
@@ -330,7 +331,15 @@ void LLOverlayBar::onClickStandUp(void*)
330//////////////////////////////////////////////////////////////////////////////// 331////////////////////////////////////////////////////////////////////////////////
331// static media helpers 332// static media helpers
332// *TODO: Move this into an audio manager abstraction 333// *TODO: Move this into an audio manager abstraction
333 334//static
335void LLOverlayBar::mediaStop(void*)
336{
337 if (!gOverlayBar)
338 {
339 return;
340 }
341 LLViewerParcelMedia::stop();
342}
334//static 343//static
335void LLOverlayBar::toggleMediaPlay(void*) 344void LLOverlayBar::toggleMediaPlay(void*)
336{ 345{
@@ -339,24 +348,23 @@ void LLOverlayBar::toggleMediaPlay(void*)
339 return; 348 return;
340 } 349 }
341 350
342 if (gOverlayBar->mMediaState != PLAYING) 351
352 if (LLViewerMedia::isMediaPaused())
353 {
354 LLViewerParcelMedia::start();
355 }
356 else if(LLViewerMedia::isMediaPlaying())
357 {
358 LLViewerParcelMedia::pause();
359 }
360 else
343 { 361 {
344 gOverlayBar->mMediaState = PLAYING; // desired state
345 LLParcel* parcel = gParcelMgr->getAgentParcel(); 362 LLParcel* parcel = gParcelMgr->getAgentParcel();
346 if (parcel) 363 if (parcel)
347 { 364 {
348 LLString path(""); 365 LLViewerParcelMedia::play(parcel);
349 LLMediaEngine::getInstance()->convertImageAndLoadUrl( true, false, path );
350 } 366 }
351 } 367 }
352 else
353 {
354 gOverlayBar->mMediaState = PAUSED; // desired state
355 LLMediaEngine::getInstance()->pause();
356 }
357
358 //gOverlayBar->mMediaState = STOPPED; // desired state
359 //LLMediaEngine::getInstance()->stop();
360} 368}
361 369
362//static 370//static
@@ -402,39 +410,3 @@ void LLOverlayBar::toggleMusicPlay(void*)
402 } 410 }
403} 411}
404 412
405void LLOverlayBar::enableMediaButtons()
406{
407 if (mMediaRemote)
408 {
409 // Music
410 LLParcel* parcel = gParcelMgr->getAgentParcel();
411 if (parcel
412 && gAudiop
413 && !parcel->getMusicURL().empty()
414 && gSavedSettings.getBOOL("AudioStreamingMusic"))
415 {
416 mMediaRemote->childSetEnabled("music_play", TRUE);
417 }
418 else
419 {
420 mMediaRemote->childSetEnabled("music_play", FALSE);
421 }
422
423 // Media
424 // if there is a url and a texture and media is enabled and available and media streaming is on... (phew!)
425 if (LLMediaEngine::getInstance()
426 && LLMediaEngine::getInstance()->getUrl ().length ()
427 && LLMediaEngine::getInstance()->getImageUUID ().notNull ()
428 && LLMediaEngine::getInstance()->isEnabled ()
429 && LLMediaEngine::getInstance()->isAvailable ()
430 && gSavedSettings.getBOOL ( "AudioStreamingVideo" ) )
431 {
432 mMediaRemote->childSetEnabled("media_play", TRUE);
433 }
434 else
435 {
436 mMediaRemote->childSetEnabled("media_play", FALSE);
437 }
438 }
439}
440