breaking currentTime into minutes, seconds, and frames
Josh Mellicker
josh at dvcreators.net
Mon Feb 13 21:47:57 EST 2006
I kind of figured it out.
By the way, the purpose of the app is to load a QT movie, then allow
the user to easily and efficiently take notes, tagged with the
current movie time.
If this is of any use to anyone:
Make a card with:
1. a Player object
2. a "get new movie" button
3. a "stop movie and take note" button.
Here is my script for the "start/stop" button:
ON mouseUp
IF the paused of player "Player" is false THEN
stop player "Player"
set the numberFormat to "##"
put the currentTime of player "Player" into curTime
put (curTime - (curTime mod 1800))/1800 into curMin
put (curTime mod 1800)/30 into curSec
put cr & "time: " & curMin & ":" & curSec & " - " after fld
"notes"
select after text of fld "notes"
set the label of me to "start movie again"
ELSE
set the label of me to "stop movie and take note"
start player "Player"
END IF
END mouseUp
Here's what the output looks like:
________________________________________
movie: aeps_05_c1_final.mov
timescale: 30
________________________________________
time: 00:05 - white rect
time: 00:15 - arrows
time: 00:21 - title with bullet points
time: 00:55 - white rect left side
time: 00:57 - WR right side
time: 01:07 - like the tooltip! awesome! :D
time: 01:43 - power tip anim
"get new movie" button:
ON mouseUp
IF the paused of player "Player" is false THEN
set the paused of player "Player" to true
END IF
answer file "Please choose a movie:"
set the filename of player "Player" to it
set the itemDelimiter to "/"
put cr & cr & "________________________________________" after
fld "notes"
put cr & "movie: " & the last item of it after fld "notes"
put cr & "timescale: " & the timeScale of player "Player" & cr
after fld "notes"
put "________________________________________"after fld "notes"
END mouseUp
If your job is to watch movies and make comments at certain points,
this is the app for you!
It is pretty lame right now, but with a little work...
Anyway, let me know if anyone would like the actual stack, I can
upload it.
On Feb 13, 2006, at 3:19 PM, Josh Mellicker wrote:
> I'm sure this has been done so many times so I thought I would ask.
> (I've searched everywhere I can find)
>
> When getting currentTime of a QT movie, you get an integer which is
> the current frame.
>
> This gets minutes:
>
> put "minutes: " & (curTime - (curTime mod 1800))/1800 into curMin
>
> What I'm trying to get is:
>
>
> mm:ss:ff
>
> minutes:seconds:frames
>
> (like: 1:34.23)
>
>
> My brain hurts.
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>
More information about the use-livecode
mailing list