GuiAviBitMapCtrl
by Chris Frankie · in Torque Game Engine · 02/27/2007 (3:22 pm) · 20 replies
Have they ever fixed this GUI Interface to play AVI Files yet?
I noticed in 1.5 that the control appears, but does not have anywhere to input files and never really plays the AVI File if I do hand input the aviFilename code.
So I was just wondering, since the last post for AVI Files was in 2002, if this was ever fixed yet.
I noticed in 1.5 that the control appears, but does not have anywhere to input files and never really plays the AVI File if I do hand input the aviFilename code.
So I was just wondering, since the last post for AVI Files was in 2002, if this was ever fixed yet.
About the author
#2
02/28/2007 (3:52 pm)
Ah, but then I would have to completely reprogram the SDK to a new exe that can use Theora wouldn't I?
#3
02/28/2007 (3:53 pm)
No. It is included in 1.4+.
#4
Can't find it in my 1.5 instruction sets...
02/28/2007 (3:57 pm)
How would it be used / implemented?Can't find it in my 1.5 instruction sets...
#6
03/01/2007 (10:57 am)
The Theora causes the Torque Engine to freeze whenever I choose the ogg file to view... but hte file plays fine and een showed once in the Torque engine.... now I can't load any file to it. Any ideas?
#7
You can download wtc memorial and look at the files. I included all the cs files in it. I have the theora control set to init when a player enters a trigger area, and stop when they walk out. It works great.
03/01/2007 (7:04 pm)
Chris, I use the theora control without a problem. I just followed the instructions in the tdn.You can download wtc memorial and look at the files. I included all the cs files in it. I have the theora control set to init when a player enters a trigger area, and stop when they walk out. It works great.
#8
03/02/2007 (11:39 am)
Cool - I got the vids to play finally... but now I can't seem to detect when the video ends, or setup a way for a person to interupt it's playing through a click or other means.
#9
03/02/2007 (3:08 pm)
StopVideoFile();Stops the video from playing. You can set it up in a trigger, button press or whatever. I don't think there is a way in the code to detect when the video ends. (I could be wrong, but I didn't see anything there) There is also a pause command.
#10
03/03/2007 (8:51 am)
Huh - then I wonder how you would control if a player just 'watches the entire' video... or if this is used as an Intro Video player where they have to watch it till it is done... '-_-
#11
There's a function call, (don't know if it's open to script or not tho) for:
03/03/2007 (10:21 am)
If you look in "sdk/engine/core/theora.h", there are several things you can do. There's a function call, (don't know if it's open to script or not tho) for:
F64 getTheoraTime();and
/// Background playback thread. static void playThread( void *udata ); bool playLoop();Also, twords the end of the file, there's this:
bool setFile(const char*, bool play = false, bool restart = false, Audio::Description* desc = NULL);
const bool isPlaying() const { return mPlaying; }
const bool isReady() const { return mReady; }
bool play();
void stop();
bool pause();It seems to me that you can track the movie, pause it, restart it, loop it, etc...
#12
03/05/2007 (9:01 am)
Oo - That isPlaying Boolean looks promising, let's see if that's the ticket.
#13
I think tis time to upgrade this to someone in the garagegames employment... ;)
03/06/2007 (8:31 am)
Drat - none of those are actual commands for the player that can be used. They are internal commands it calls to itself. I think tis time to upgrade this to someone in the garagegames employment... ;)
#14
I tried to use:
moveMap.bindCmd(keyboard, "escape", "", "introVid.stop();");
I've even made a function instead and tried:
moveMap.bindCmd(keyboard, "escape", "", "checkStartVidDone();");
and have that function stop the video...
the ONLY thing that is working so far is:
schedule(10000, 0, checkStartVidDone );
that's right schedule works - not sure why, but making the computer stop it over time seems to work... but how come binding it to a key press doesn't is rather disturbing...
03/06/2007 (12:10 pm)
Good gawd! Binding a key to stop the video doesn't seem to work either....I tried to use:
moveMap.bindCmd(keyboard, "escape", "", "introVid.stop();");
I've even made a function instead and tried:
moveMap.bindCmd(keyboard, "escape", "", "checkStartVidDone();");
and have that function stop the video...
the ONLY thing that is working so far is:
schedule(10000, 0, checkStartVidDone );
that's right schedule works - not sure why, but making the computer stop it over time seems to work... but how come binding it to a key press doesn't is rather disturbing...
#15
Give this a try and see if it works for you:
Make sure z and x are not already bound before you try it. Also, make sure you delete your pref files or the new key bindings will not take effect.
03/06/2007 (3:22 pm)
Ok, you cannot bind the escape key. It'a already bound to "quit();"Give this a try and see if it works for you:
moveMap.bindCmd(keyboard, "z", "", "PlayVideoFile();"); moveMap.bindCmd(keyboard, "x", "", "StopVideoFile();");
Make sure z and x are not already bound before you try it. Also, make sure you delete your pref files or the new key bindings will not take effect.
#16
03/07/2007 (9:41 am)
Hmmm - but that doesn't explain why clicking the mouse doesn't make it zip by though... but I shalt try 'different' keys. Is there a generic 'any key pressed' I might try out?
#17
03/07/2007 (10:33 am)
Well, even more fun - you can not get any inputs during a video feed of any sort. Keyboard is ignored and mouse. Looks like playing Intro Videos is going to be a no-go for the Torque Engine for awhile over here...
#18
03/07/2007 (12:12 pm)
Quote:Is there a generic 'any key pressed' I might try out?You can use any key that is not bound by the engine or in the default.bind.cs.
Quote:you can not get any inputs during a video feed of any sortThis may be true. I had a theora control for a splash screen with a "skip" button, but when someone "skipped" the intro video, the sound would continue until the end. I may have coded it wrong at that time tho, as I was very new to torque. In WTC, I have a trigger that when entered, starts the video, and when exited, stops the video. That works. I'm still looking thru the code, and still learning, so can't help you much more than I already have.
#19
03/07/2007 (12:16 pm)
I've been binding, slapping, and everything else - so far only the Schedule Command can call anything while the Video is playing. BUT if I could find a way for someone to press any key or mouse input, I could skip the vide for hte introduction.
#20
You can detect when the video is "Done", use that to load the main menu.
To handle the event of a user wanting to bypass the intro video with a mouse click or keyboard press, use a GuiFadeinBitmapCtrl. Just use a transparent texture and remember to set the "waitTime" to the length of your video.
Example:
03/07/2007 (4:54 pm)
Here's my hacky way of doing it.You can detect when the video is "Done", use that to load the main menu.
To handle the event of a user wanting to bypass the intro video with a mouse click or keyboard press, use a GuiFadeinBitmapCtrl. Just use a transparent texture and remember to set the "waitTime" to the length of your video.
Example:
//--- OBJECT WRITE BEGIN ---
new GuiFadeinBitmapCtrl(StartupGui) {
profile = "GuiInputCtrlProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 0";
extent = "640 480";
minExtent = "8 8";
visible = "1";
helpTag = "0";
bitmap = "./menu/blackback.jpg";
wrap = "0";
fadeinTime = "125";
waitTime = "11000";
fadeoutTime = "125";
new GuiTheoraCtrl(video) {
Profile = "GuiDefaultProfile";
HorizSizing = "center";
VertSizing = "center";
position = "152 144";
Extent = "720 480";
MinExtent = "8 2";
Visible = "1";
theoraFile = "./video/SG_IntroMovieAVI.ogg";
done = "0";
stopOnSleep = "1";
backgroundColor = "0 0 0 255";
};
new GuiFadeinBitmapCtrl(StartupGuiClick) {
profile = "GuiInputCtrlProfile";
HorizSizing = "center";
VertSizing = "center";
position = "152 144";
Extent = "720 480";
MinExtent = "8 2";
visible = "1";
helpTag = "0";
bitmap = "./menu/alpha.png";
wrap = "0";
fadeinTime = "125";
waitTime = "11000";
fadeoutTime = "125";
};
};
//--- OBJECT WRITE END ---
function loadStartup()
{
StartupGui.done = false;
Canvas.setContent( StartupGui );
schedule(100, 0, checkStartupDone );
// If you want a sound or music to play add a new AudioProfile to client\scripts\audioProfiles.cs
// that is named AudioStartup and uncomment the line below. You can see an example of this in the
// demo scripts.
alxPlay(introVideo);
}
//-------------------------------------
function StartupGui::click()
{
StartupGui.done = true;
alxStopAll();
}
function StartupGuiClick::click()
{
StartupGui.done = true;
alxStopAll();
}
//-------------------------------------
function checkStartupDone()
{
if (StartupGui.done || video.done)
{
echo ("*** Load Main Menu");
loadMainMenu();
}
else
schedule(100, 0, checkStartupDone );
}
Associate David Montgomery-Blake
David MontgomeryBlake