help with timecode

Mike Bonner bonnmike at gmail.com
Sat May 30 10:07:01 EDT 2015


Be aware I have no clue about drop, no drop etc so I am probably way off
base here but..

It seems to me that first you need to make sure you're working in seconds,
so you need to divide the currenttime by the timescale to get the total
seconds.
Then its just a matter of math.

Having said that, I may have an easy way to do the conversion.  The first
thing to do would be to grab a padding number when your app starts up like
so:

put 0 into tSeconds
convert tSeconds to dateitems
put (24 - (item -4 of tSeconds)) * 3600 into myAdjustment --the adjustment
allows for timezone differences

gives an adjustment number of seconds that will be used later.

Then, it should be easy.

put ((the currenttime of player "yourplayer"  / the timescale of player
"yourPlayer" ) + myAdjustment) into tCurrentTime
convert tCurrentTime  to dateitems

At this point the hours of tCurrentTime should be item 4, minutes is 5, and
seconds is 6.
When displaying them, look at numberformat in the dictionary.


On Sat, May 30, 2015 at 7:38 AM, Tim Selander <selander at tkf.att.ne.jp>
wrote:

> Dear Listers,
>
> I am trying to convert the currenttime of a player showing video into
> standard video timecode -- hours:minutes:seconds:frames -- in both drop and
> non-drop timecode. I'm not being too successful at it. As I struggled with
> it, it occured to me I may be trying to re-invent the wheel.
>
> Does anyone of a solution for turning the current time of an LC player
> into time code that they could share?
>
> Thanks,
>
> Tim Selander
> Tokyo, Japan
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list