diff options
author | Rick Pasetto <rick@lindenlab.com> | 2009-11-19 16:47:29 -0800 |
---|---|---|
committer | Rick Pasetto <rick@lindenlab.com> | 2009-11-19 16:47:29 -0800 |
commit | 98d54377f9a793ffc0ed0aff31e828ec772a8d10 (patch) | |
tree | ef43ed3d0b289df188e175d35069c223a3f7bfc4 /indra/newview/llpanelprimmediacontrols.cpp | |
parent | 7be953512ab67e5f7659547232462f4510179196 (diff) |
Make time-based media "forward" and "back" different from navigate forward and navigate back
Diffstat (limited to 'indra/newview/llpanelprimmediacontrols.cpp')
-rw-r--r-- | indra/newview/llpanelprimmediacontrols.cpp | 46 |
1 files changed, 43 insertions, 3 deletions
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<LLUICtrl>("media_address_url"); mMediaPlaySliderPanel = getChild<LLUICtrl>("media_play_position"); mMediaPlaySliderCtrl = getChild<LLUICtrl>("media_play_slider"); + mSkipFwdCtrl = getChild<LLUICtrl>("skip_forward"); + mSkipBackCtrl = getChild<LLUICtrl>("skip_back"); mVolumeCtrl = getChild<LLUICtrl>("media_volume"); mVolumeBtn = getChild<LLButton>("media_volume_button"); mVolumeUpCtrl = getChild<LLUICtrl>("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; |