summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermedia.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/llviewermedia.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/llviewermedia.cpp')
-rw-r--r--indra/newview/llviewermedia.cpp79
1 files changed, 38 insertions, 41 deletions
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 3a7c54479b..e55523c11e 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -278,7 +278,7 @@ viewer_media_t LLViewerMedia::newMediaImpl(
}
else
{
- media_impl->stop();
+ media_impl->unload();
media_impl->mTextureId = texture_id;
media_impl->mMediaWidth = media_width;
media_impl->mMediaHeight = media_height;
@@ -1092,15 +1092,7 @@ void LLViewerMediaImpl::stop()
{
if(mMediaSource)
{
- if(mMediaSource->pluginSupportsMediaBrowser())
- {
- mMediaSource->browse_stop();
- }
- else
- {
- mMediaSource->stop();
- }
-
+ mMediaSource->stop();
// destroyMediaSource();
}
}
@@ -1133,6 +1125,40 @@ void LLViewerMediaImpl::seek(F32 time)
}
//////////////////////////////////////////////////////////////////////////////////////////
+void LLViewerMediaImpl::skipBack(F32 step_scale)
+{
+ if(mMediaSource)
+ {
+ if(mMediaSource->pluginSupportsMediaTime())
+ {
+ F64 back_step = mMediaSource->getCurrentTime() - (mMediaSource->getDuration()*step_scale);
+ if(back_step < 0.0)
+ {
+ back_step = 0.0;
+ }
+ mMediaSource->seek(back_step);
+ }
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+void LLViewerMediaImpl::skipForward(F32 step_scale)
+{
+ if(mMediaSource)
+ {
+ if(mMediaSource->pluginSupportsMediaTime())
+ {
+ F64 forward_step = mMediaSource->getCurrentTime() + (mMediaSource->getDuration()*step_scale);
+ if(forward_step > mMediaSource->getDuration())
+ {
+ forward_step = mMediaSource->getDuration();
+ }
+ mMediaSource->seek(forward_step);
+ }
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
void LLViewerMediaImpl::setVolume(F32 volume)
{
mRequestedVolume = volume;
@@ -1339,21 +1365,7 @@ void LLViewerMediaImpl::navigateBack()
{
if (mMediaSource)
{
- if(mMediaSource->pluginSupportsMediaTime())
- {
- F64 step_scale = 0.02; // temp , can be changed
- F64 back_step = mMediaSource->getCurrentTime() - (mMediaSource->getDuration()*step_scale);
- if(back_step < 0.0)
- {
- back_step = 0.0;
- }
- mMediaSource->seek(back_step);
- //mMediaSource->start(-2.0);
- }
- else
- {
- mMediaSource->browse_back();
- }
+ mMediaSource->browse_back();
}
}
@@ -1362,21 +1374,7 @@ void LLViewerMediaImpl::navigateForward()
{
if (mMediaSource)
{
- if(mMediaSource->pluginSupportsMediaTime())
- {
- F64 step_scale = 0.02; // temp , can be changed
- F64 forward_step = mMediaSource->getCurrentTime() + (mMediaSource->getDuration()*step_scale);
- if(forward_step > mMediaSource->getDuration())
- {
- forward_step = mMediaSource->getDuration();
- }
- mMediaSource->seek(forward_step);
- //mMediaSource->start(2.0);
- }
- else
- {
- mMediaSource->browse_forward();
- }
+ mMediaSource->browse_forward();
}
}
@@ -1525,7 +1523,6 @@ void LLViewerMediaImpl::navigateStop()
{
mMediaSource->browse_stop();
}
-
}
//////////////////////////////////////////////////////////////////////////////////////////