Game Development Community

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....






#1
02/16/2011 (3:08 pm)
The reason why it doesn't work is because theoraTexture::SetPosition() is empty as seen in theoraTexture.h:
virtual void setPosition( U32 pos ) {} // Not (yet?) implemented.
#2
02/16/2011 (5:32 pm)
Thank you, Nathan Martin

virtual 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
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.