diff options
author | Leyla Farazha <leyla@lindenlab.com> | 2010-04-16 14:18:21 -0700 |
---|---|---|
committer | Leyla Farazha <leyla@lindenlab.com> | 2010-04-16 14:18:21 -0700 |
commit | 652d18e6c4e33fbbe6343e8810d2c6accbc4f150 (patch) | |
tree | 55f51cea2392d13131f760193d65081c30e25d11 | |
parent | 748de83a633d8d2117304a57aea54350cdd14d22 (diff) |
Adding volume controls in NMP
reivewed by RIchard cc#194
-rw-r--r-- | indra/newview/llpanelnearbymedia.cpp | 27 | ||||
-rw-r--r-- | indra/newview/llpanelnearbymedia.h | 2 | ||||
-rw-r--r-- | indra/newview/llpanelprimmediacontrols.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llviewermedia.h | 4 |
4 files changed, 25 insertions, 12 deletions
diff --git a/indra/newview/llpanelnearbymedia.cpp b/indra/newview/llpanelnearbymedia.cpp index 93ebae334f..79786c06d9 100644 --- a/indra/newview/llpanelnearbymedia.cpp +++ b/indra/newview/llpanelnearbymedia.cpp @@ -1010,7 +1010,7 @@ void LLPanelNearByMedia::updateControls() if (NULL == impl) { // Just means it hasn't started yet - showBasicControls(false, false, false); + showBasicControls(false, false, false, false, 0); } else if (impl->isMediaTimeBased()) { @@ -1022,7 +1022,11 @@ void LLPanelNearByMedia::updateControls() } else { // non-time-based parcel media - showBasicControls(LLViewerMedia::isParcelMediaPlaying(), false, false); + showBasicControls(LLViewerMedia::isParcelMediaPlaying(), + false, + false, + impl->getVolume() == 0.0, + impl->getVolume()); } } } @@ -1045,19 +1049,28 @@ void LLPanelNearByMedia::updateControls() else { showBasicControls(!impl->isMediaDisabled(), ! impl->isParcelMedia(), // include_zoom - LLViewerMediaFocus::getInstance()->isZoomed()); + LLViewerMediaFocus::getInstance()->isZoomed(), + impl->getVolume() == 0.0, + impl->getVolume()); } } } } -void LLPanelNearByMedia::showBasicControls(bool playing, bool include_zoom, bool is_zoomed) +void LLPanelNearByMedia::showBasicControls(bool playing, bool include_zoom, bool is_zoomed, bool muted, F32 volume) { mStopCtrl->setVisible(playing); mPlayCtrl->setVisible(!playing); mPauseCtrl->setVisible(false); - mMuteCtrl->setVisible(false); +#ifdef PER_MEDIA_VOLUME + mVolumeSliderCtrl->setVisible(true); + mMuteCtrl->setVisible(true); + mMuteBtn->setValue(muted); + mVolumeSlider->setValue(volume); +#else mVolumeSliderCtrl->setVisible(false); + mMuteCtrl->setVisible(false); +#endif mZoomCtrl->setVisible(include_zoom && !is_zoomed); mUnzoomCtrl->setVisible(include_zoom && is_zoomed); mStopCtrl->setEnabled(true); @@ -1156,7 +1169,7 @@ void LLPanelNearByMedia::onClickSelectedMediaMute() else { LLViewerMediaImpl* impl = (selected_media_id == PARCEL_MEDIA_LIST_ITEM_UUID) ? ((LLViewerMediaImpl*)LLViewerParcelMedia::getParcelMedia()) : LLViewerMedia::getMediaImplFromTextureID(selected_media_id); - if (NULL != impl && impl->isMediaTimeBased()) + if (NULL != impl) { F32 volume = impl->getVolume(); if(volume > 0.0) @@ -1187,7 +1200,7 @@ void LLPanelNearByMedia::onCommitSelectedMediaVolume() else { LLViewerMediaImpl* impl = (selected_media_id == PARCEL_MEDIA_LIST_ITEM_UUID) ? ((LLViewerMediaImpl*)LLViewerParcelMedia::getParcelMedia()) : LLViewerMedia::getMediaImplFromTextureID(selected_media_id); - if (NULL != impl && impl->isMediaTimeBased()) + if (NULL != impl) { impl->setVolume(mVolumeSlider->getValueF32()); } diff --git a/indra/newview/llpanelnearbymedia.h b/indra/newview/llpanelnearbymedia.h index 7c07867df3..3cecf8e40c 100644 --- a/indra/newview/llpanelnearbymedia.h +++ b/indra/newview/llpanelnearbymedia.h @@ -140,7 +140,7 @@ private: bool shouldShow(LLViewerMediaImpl* impl); - void showBasicControls(bool playing, bool include_zoom, bool is_zoomed); + void showBasicControls(bool playing, bool include_zoom, bool is_zoomed, bool muted, F32 volume); void showTimeBasedControls(bool playing, bool include_zoom, bool is_zoomed, bool muted, F32 volume); void showDisabledControls(); void updateControls(); diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp index 83244edb8e..e8c1a0a569 100644 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -66,10 +66,6 @@ #include "llwindow.h" #include "llfloatertools.h" // to enable hide if build tools are up -#if defined(LL_DARWIN) || (defined(LL_WINDOW) && (! defined(LL_RELEASE_FOR_DOWNLOAD)) ) -#define PER_MEDIA_VOLUME -#endif - // Functions pulled from pipeline.cpp glh::matrix4f glh_get_current_modelview(); glh::matrix4f glh_get_current_projection(); diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index e829d7a5b4..d89c81e7a7 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -46,6 +46,10 @@ #include "llurl.h" +#if defined(LL_DARWIN) || (defined(LL_WINDOWS) && (! defined(LL_RELEASE_FOR_DOWNLOAD)) ) +#define PER_MEDIA_VOLUME +#endif + class LLViewerMediaImpl; class LLUUID; class LLViewerMediaTexture; |