guiTheoraCtrl problem!! ~help me.
by hxfps · in Torque 3D Professional · 02/16/2011 (10:50 am) · 6 replies
I need a setCurrentTime (U32 time); function.
The following is my approach:
1.In the statement in the guiTheoraCtrl.h
void setCurrentTime(F32 time) { mTheoraTexture.setPosition( time*1000.f ); } //+
2.In the statement in the guiTheoraCtrl.cpp
DefineEngineMethod( guiTheoraCtrl, setCurrentTime, void, (F32 time),,
"set the current playback time.\n\n"
"@return The elapsed playback time in seconds." )
{
object->setCurrentTime(time);
}
3.In the statement in the TheoraTexture.h
void TheoraTexture::setPosition(U32 ms){if( mSFXSource )mSFXSource->setPosition(ms);}
end...
torque Script:
%ms = %val * %totalTime;
%videoCtrl.setCurrentTime(%ms);
This approach did not?
help.
Need T3D version guiTheoraCtrl control setCurrentTime function....
The following is my approach:
1.In the statement in the guiTheoraCtrl.h
void setCurrentTime(F32 time) { mTheoraTexture.setPosition( time*1000.f ); } //+
2.In the statement in the guiTheoraCtrl.cpp
DefineEngineMethod( guiTheoraCtrl, setCurrentTime, void, (F32 time),,
"set the current playback time.\n\n"
"@return The elapsed playback time in seconds." )
{
object->setCurrentTime(time);
}
3.In the statement in the TheoraTexture.h
void TheoraTexture::setPosition(U32 ms){if( mSFXSource )mSFXSource->setPosition(ms);}
end...
torque Script:
%ms = %val * %totalTime;
%videoCtrl.setCurrentTime(%ms);
This approach did not?
help.
Need T3D version guiTheoraCtrl control setCurrentTime function....
#2
This still does not work.
02/16/2011 (5:32 pm)
Thank you, Nathan Martinvirtual void setPosition( U32 pos ) { _getTimeSource()->setPosition(pos); }
//virtual void setPosition( U32 pos ) {} // Not (yet?) implemented.This still does not work.
#3
02/16/2011 (9:32 pm)
help me :(
#4
02/17/2011 (1:53 pm)
ATM, the Theora decoder (OggTheoraDecoder) doesn't implement seeking.
#5
02/17/2011 (7:40 pm)
How to do it?
#6
I'd recommend taking a peek at sample code online for how it's done with other decoders (use google, it really helps). If it involves hefty C++ work, I'd ask cplusplus.com, although responses do take a while, and you may get none at all (I had a lot of trouble with my xxz568 auth system when I tried asking them).
Alternatively, you could try to implement a different encoder/decoder for video controls that do support what you are trying to do, it would take some time, but if it is necessary for your project, it may be worth it.
02/18/2011 (7:48 am)
That's your job. :)I'd recommend taking a peek at sample code online for how it's done with other decoders (use google, it really helps). If it involves hefty C++ work, I'd ask cplusplus.com, although responses do take a while, and you may get none at all (I had a lot of trouble with my xxz568 auth system when I tried asking them).
Alternatively, you could try to implement a different encoder/decoder for video controls that do support what you are trying to do, it would take some time, but if it is necessary for your project, it may be worth it.
Torque Owner Nathan Martin
TRON 2001 Network
virtual void setPosition( U32 pos ) {} // Not (yet?) implemented.