mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 08:34:40 +00:00
add loop playback to GuiTheoraCtrl
This commit is contained in:
parent
a2e0b1a163
commit
fd715f3ef3
2 changed files with 13 additions and 1 deletions
|
|
@ -73,6 +73,7 @@ GuiTheoraCtrl::GuiTheoraCtrl()
|
||||||
mPlayOnWake = true;
|
mPlayOnWake = true;
|
||||||
mRenderDebugInfo = false;
|
mRenderDebugInfo = false;
|
||||||
mTranscoder = OggTheoraDecoder::TRANSCODER_Auto;
|
mTranscoder = OggTheoraDecoder::TRANSCODER_Auto;
|
||||||
|
mLoop = false;
|
||||||
|
|
||||||
mBackgroundColor.set( 0, 0, 0, 255);
|
mBackgroundColor.set( 0, 0, 0, 255);
|
||||||
}
|
}
|
||||||
|
|
@ -89,6 +90,8 @@ void GuiTheoraCtrl::initPersistFields()
|
||||||
"Fill color when video is not playing." );
|
"Fill color when video is not playing." );
|
||||||
addField( "playOnWake", TypeBool, Offset( mPlayOnWake, GuiTheoraCtrl ),
|
addField( "playOnWake", TypeBool, Offset( mPlayOnWake, GuiTheoraCtrl ),
|
||||||
"Whether to start playing video when control is woken up." );
|
"Whether to start playing video when control is woken up." );
|
||||||
|
addField( "loop", TypeBool, Offset( mLoop, GuiTheoraCtrl ),
|
||||||
|
"Loop playback." );
|
||||||
addField( "stopOnSleep", TypeBool, Offset( mStopOnSleep, GuiTheoraCtrl ),
|
addField( "stopOnSleep", TypeBool, Offset( mStopOnSleep, GuiTheoraCtrl ),
|
||||||
"Whether to stop video when control is set to sleep.\n\n"
|
"Whether to stop video when control is set to sleep.\n\n"
|
||||||
"If this is not set to true, the video will be paused when the control is put to sleep. This is because there is no support "
|
"If this is not set to true, the video will be paused when the control is put to sleep. This is because there is no support "
|
||||||
|
|
@ -221,7 +224,14 @@ void GuiTheoraCtrl::onRender(Point2I offset, const RectI &updateRect)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
mDone = true;
|
{
|
||||||
|
if(mLoop)
|
||||||
|
{
|
||||||
|
play();
|
||||||
|
} else {
|
||||||
|
mDone = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
GFX->getDrawUtil()->drawRectFill(rect, mBackgroundColor); // black rect
|
GFX->getDrawUtil()->drawRectFill(rect, mBackgroundColor); // black rect
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,8 @@ class GuiTheoraCtrl : public GuiControl
|
||||||
/// onWake().
|
/// onWake().
|
||||||
bool mPlayOnWake;
|
bool mPlayOnWake;
|
||||||
|
|
||||||
|
bool mLoop;
|
||||||
|
|
||||||
/// Which transcoder to use on the Theora decoder. This is mostly
|
/// Which transcoder to use on the Theora decoder. This is mostly
|
||||||
/// meant as a development aid.
|
/// meant as a development aid.
|
||||||
OggTheoraDecoder::ETranscoder mTranscoder;
|
OggTheoraDecoder::ETranscoder mTranscoder;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue