From 98d54377f9a793ffc0ed0aff31e828ec772a8d10 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Thu, 19 Nov 2009 16:47:29 -0800 Subject: Make time-based media "forward" and "back" different from navigate forward and navigate back --- indra/newview/llpanelprimmediacontrols.cpp | 46 ++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 3 deletions(-) (limited to 'indra/newview/llpanelprimmediacontrols.cpp') diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp index 12ad070efd..80d2a9425c 100644 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -102,6 +102,8 @@ LLPanelPrimMediaControls::LLPanelPrimMediaControls() : mCommitCallbackRegistrar.add("MediaCtrl.CommitVolumeUp", boost::bind(&LLPanelPrimMediaControls::onCommitVolumeUp, this)); mCommitCallbackRegistrar.add("MediaCtrl.CommitVolumeDown", boost::bind(&LLPanelPrimMediaControls::onCommitVolumeDown, this)); mCommitCallbackRegistrar.add("MediaCtrl.ToggleMute", boost::bind(&LLPanelPrimMediaControls::onToggleMute, this)); + mCommitCallbackRegistrar.add("MediaCtrl.SkipBack", boost::bind(&LLPanelPrimMediaControls::onClickSkipBack, this)); + mCommitCallbackRegistrar.add("MediaCtrl.SkipForward", boost::bind(&LLPanelPrimMediaControls::onClickSkipForward, this)); LLUICtrlFactory::getInstance()->buildPanel(this, "panel_prim_media_controls.xml"); mInactivityTimer.reset(); @@ -135,6 +137,8 @@ BOOL LLPanelPrimMediaControls::postBuild() mMediaAddress = getChild("media_address_url"); mMediaPlaySliderPanel = getChild("media_play_position"); mMediaPlaySliderCtrl = getChild("media_play_slider"); + mSkipFwdCtrl = getChild("skip_forward"); + mSkipBackCtrl = getChild("skip_back"); mVolumeCtrl = getChild("media_volume"); mVolumeBtn = getChild("media_volume_button"); mVolumeUpCtrl = getChild("volume_up"); @@ -329,12 +333,17 @@ void LLPanelPrimMediaControls::updateShape() mReloadCtrl->setVisible(FALSE); mMediaStopCtrl->setVisible(has_focus); mHomeCtrl->setVisible(FALSE); - mBackCtrl->setEnabled(has_focus); - mFwdCtrl->setEnabled(has_focus); + // No nav controls + mBackCtrl->setVisible(FALSE); + mFwdCtrl->setEnabled(FALSE); mMediaAddressCtrl->setVisible(false); mMediaAddressCtrl->setEnabled(false); mMediaPlaySliderPanel->setVisible(has_focus && !mini_controls); mMediaPlaySliderPanel->setEnabled(has_focus && !mini_controls); + mSkipFwdCtrl->setVisible(has_focus && !mini_controls); + mSkipFwdCtrl->setEnabled(has_focus && !mini_controls); + mSkipBackCtrl->setVisible(has_focus && !mini_controls); + mSkipBackCtrl->setEnabled(has_focus && !mini_controls); mVolumeCtrl->setVisible(has_focus); mVolumeUpCtrl->setVisible(has_focus); @@ -435,6 +444,10 @@ void LLPanelPrimMediaControls::updateShape() mMediaAddressCtrl->setEnabled(has_focus && !mini_controls); mMediaPlaySliderPanel->setVisible(FALSE); mMediaPlaySliderPanel->setEnabled(FALSE); + mSkipFwdCtrl->setVisible(FALSE); + mSkipFwdCtrl->setEnabled(FALSE); + mSkipBackCtrl->setVisible(FALSE); + mSkipBackCtrl->setEnabled(FALSE); mVolumeCtrl->setVisible(FALSE); mVolumeUpCtrl->setVisible(FALSE); @@ -789,7 +802,7 @@ void LLPanelPrimMediaControls::onClickForward() focusOnTarget(); LLViewerMediaImpl* impl = getTargetMediaImpl(); - + if (impl) { impl->navigateForward(); @@ -866,12 +879,39 @@ void LLPanelPrimMediaControls::onClickStop() } } +void LLPanelPrimMediaControls::onClickSkipBack() +{ + focusOnTarget(); + + LLViewerMediaImpl* impl =getTargetMediaImpl(); + + if (impl) + { + // XXX Oddly, the impl has the policy that "skipping" is really navigating + impl->navigateBack(); + } +} + +void LLPanelPrimMediaControls::onClickSkipForward() +{ + focusOnTarget(); + + LLViewerMediaImpl* impl = getTargetMediaImpl(); + + if (impl) + { + // XXX Oddly, the impl has the policy that "skipping" is really navigating + impl->navigateForward(); + } +} + void LLPanelPrimMediaControls::onClickZoom() { focusOnTarget(); nextZoomLevel(); } + void LLPanelPrimMediaControls::nextZoomLevel() { int index = 0; -- cgit v1.2.3 From a8b603f33ef71ab8afae66236579d41a09b2fce1 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Thu, 19 Nov 2009 18:34:37 -0800 Subject: Push the policy that "back", "forward" and "stop" do different things out of LLViewerMedia. Now, LLViewerMedia has explicit skipBack() and skipForward() functions, and the buttons in LLPanelPrimMediaControls now map onto those functions neatly. --- indra/newview/llpanelprimmediacontrols.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'indra/newview/llpanelprimmediacontrols.cpp') diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp index 80d2a9425c..aca0e1d5c7 100644 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -54,6 +54,7 @@ #include "llpanelprimmediacontrols.h" #include "llpluginclassmedia.h" #include "llprogressbar.h" +#include "llstring.h" #include "llviewercontrol.h" #include "llviewerparcelmgr.h" #include "llviewermedia.h" @@ -92,6 +93,7 @@ LLPanelPrimMediaControls::LLPanelPrimMediaControls() : mCommitCallbackRegistrar.add("MediaCtrl.Forward", boost::bind(&LLPanelPrimMediaControls::onClickForward, this)); mCommitCallbackRegistrar.add("MediaCtrl.Home", boost::bind(&LLPanelPrimMediaControls::onClickHome, this)); mCommitCallbackRegistrar.add("MediaCtrl.Stop", boost::bind(&LLPanelPrimMediaControls::onClickStop, this)); + mCommitCallbackRegistrar.add("MediaCtrl.MediaStop", boost::bind(&LLPanelPrimMediaControls::onClickMediaStop, this)); mCommitCallbackRegistrar.add("MediaCtrl.Reload", boost::bind(&LLPanelPrimMediaControls::onClickReload, this)); mCommitCallbackRegistrar.add("MediaCtrl.Play", boost::bind(&LLPanelPrimMediaControls::onClickPlay, this)); mCommitCallbackRegistrar.add("MediaCtrl.Pause", boost::bind(&LLPanelPrimMediaControls::onClickPause, this)); @@ -149,6 +151,7 @@ BOOL LLPanelPrimMediaControls::postBuild() mLeftBookend = getChild("left_bookend"); mRightBookend = getChild("right_bookend"); mBackgroundImage = LLUI::getUIImage(getString("control_background_image_name")); + LLStringUtil::convertToF32(getString("skip_step"), mSkipStep); // These are currently removed...but getChild creates a "dummy" widget. // This class handles them missing. @@ -873,6 +876,18 @@ void LLPanelPrimMediaControls::onClickStop() LLViewerMediaImpl* impl = getTargetMediaImpl(); + if(impl) + { + impl->navigateStop(); + } +} + +void LLPanelPrimMediaControls::onClickMediaStop() +{ + focusOnTarget(); + + LLViewerMediaImpl* impl = getTargetMediaImpl(); + if(impl) { impl->stop(); @@ -887,8 +902,7 @@ void LLPanelPrimMediaControls::onClickSkipBack() if (impl) { - // XXX Oddly, the impl has the policy that "skipping" is really navigating - impl->navigateBack(); + impl->skipBack(mSkipStep); } } @@ -900,8 +914,7 @@ void LLPanelPrimMediaControls::onClickSkipForward() if (impl) { - // XXX Oddly, the impl has the policy that "skipping" is really navigating - impl->navigateForward(); + impl->skipForward(mSkipStep); } } -- cgit v1.2.3 From 1b07c1d7fb5b6d3ce15083bc3dbb65a3f0ac8006 Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Fri, 20 Nov 2009 17:49:52 -0800 Subject: Fix for DEV-43040 (Change media focus rules to be the same as alt-zoom). Added an optional reset_camera parameter to LLPanelPrimMediaControls ::resetZoomLevel(). Default is true, but if false it prevents the reset from moving the camera, and just resets the internal state for zoom tracking. Fixed zoom-related bugs in LLPanelPrimMediaControls::close() and LLPanelPrimMediaControls::onClickZoom(). Changed the zooming behavior in LLViewerMediaFocus to match the desired behavior. --- indra/newview/llpanelprimmediacontrols.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'indra/newview/llpanelprimmediacontrols.cpp') diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp index aca0e1d5c7..529912929d 100644 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -782,8 +782,8 @@ void LLPanelPrimMediaControls::onClickClose() void LLPanelPrimMediaControls::close() { + resetZoomLevel(true); LLViewerMediaFocus::getInstance()->clearFocus(); - resetZoomLevel(); setVisible(FALSE); } @@ -921,8 +921,11 @@ void LLPanelPrimMediaControls::onClickSkipForward() void LLPanelPrimMediaControls::onClickZoom() { focusOnTarget(); - - nextZoomLevel(); + + if(mCurrentZoom == ZOOM_NONE) + { + nextZoomLevel(); + } } void LLPanelPrimMediaControls::nextZoomLevel() @@ -941,12 +944,15 @@ void LLPanelPrimMediaControls::nextZoomLevel() updateZoom(); } -void LLPanelPrimMediaControls::resetZoomLevel() +void LLPanelPrimMediaControls::resetZoomLevel(bool reset_camera) { if(mCurrentZoom != ZOOM_NONE) { mCurrentZoom = ZOOM_NONE; - updateZoom(); + if(reset_camera) + { + updateZoom(); + } } } -- cgit v1.2.3