summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelprimmediacontrols.cpp
diff options
context:
space:
mode:
authorRick Pasetto <rick@lindenlab.com>2009-11-19 18:34:37 -0800
committerRick Pasetto <rick@lindenlab.com>2009-11-19 18:34:37 -0800
commita8b603f33ef71ab8afae66236579d41a09b2fce1 (patch)
tree3ffcc13b066f916431ce7ab86cab9d06ce83113a /indra/newview/llpanelprimmediacontrols.cpp
parent98d54377f9a793ffc0ed0aff31e828ec772a8d10 (diff)
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.
Diffstat (limited to 'indra/newview/llpanelprimmediacontrols.cpp')
-rw-r--r--indra/newview/llpanelprimmediacontrols.cpp21
1 files changed, 17 insertions, 4 deletions
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<LLUICtrl>("left_bookend");
mRightBookend = getChild<LLUICtrl>("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.
@@ -875,6 +878,18 @@ void LLPanelPrimMediaControls::onClickStop()
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);
}
}