Jump to content

Avi get frame?


Recommended Posts

I have made an avi file of a spinning wheel, it has 5 sections on it and the wheel will currently spin an infinate amount of times, I want to be able to generate a random number 1-5 and stop the wheel on the given section, but if I use _guictrlavi_seek() it will immeadiatly jump to the specified frame, is there a way to get it stop when it reaches a certain frame in the cycle, rather than to just jump to it?

Maybe something like this?

$rnd = Random(1,5,1)

$frame = _Guictrlavi_getframe($avi)

While $rnd <> $frame

Sleep(1000)

$frame = _Guictrlavi_getframe($avi)

Wend

?????

Thankyou

Link to comment
Share on other sites

_GUICtrlAVI_Play() allows you to specify the end frame of an AVI. If you're looking for some kind of spinner which then stops (it's hard to know from your description) then why not:

$rnd = Random(5, 15, 1)

_GUICtrlAVI_Play($hWnd, 0, -1, $rnd)

$rnd = Random(1, 5, 1)

_GUICtrlAVI_Play($hWnd, 0, $rnd, 1)

WBD

Edited by WideBoyDixon
Link to comment
Share on other sites

_GUICtrlAVI_Play() allows you to specify the end frame of an AVI. If you're looking for some kind of spinner which then stops (it's hard to know from your description) then why not:

$rnd = Random(5, 15, 1)

_GUICtrlAVI_Play($hWnd, 0, -1, $rnd)

$rnd = Random(1, 5, 1)

_GUICtrlAVI_Play($hWnd, 0, $rnd, 1)

WBD

I tried that, but it doesnt wait for the first play command to finish before executing the second play command, so in effect you only see the second animation, ie it will revolve once and then stop. thanks for your input though.

Link to comment
Share on other sites

Sorry. Was being lazy and didn't test my script before posting. You *should* be able to use _GUICtrlAVI_IsPlaying() to determine whether the clip is playing but it doesn't appear to work for me. Even the AutoIt help example doesn't work :-|

If it works for you then:

$rnd = Random(5, 15, 1)
_GUICtrlAVI_Play($hWnd, 0, -1, $rnd)
While (_GUICtrlAVI_IsPlaying($hWnd))
Sleep(10)
Wend
$rnd = Random(1, 5, 1)
_GUICtrlAVI_Play($hWnd, 0, $rnd, 1)
Link to comment
Share on other sites

Sorry. Was being lazy and didn't test my script before posting. You *should* be able to use _GUICtrlAVI_IsPlaying() to determine whether the clip is playing but it doesn't appear to work for me. Even the AutoIt help example doesn't work :-|

If it works for you then:

$rnd = Random(5, 15, 1)
_GUICtrlAVI_Play($hWnd, 0, -1, $rnd)
While (_GUICtrlAVI_IsPlaying($hWnd))
Sleep(10)
Wend
$rnd = Random(1, 5, 1)
_GUICtrlAVI_Play($hWnd, 0, $rnd, 1)
ah, I see. good thinking. I will give it a go. thanks
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...