Code: Select all
send "showTime" to me in 500 milliseconds
Unfortunately it runs slow. A 7.44 clip I have is ten seconds behind. Not much use in a tv studio.
The code is below, most - as ever - kludged together from various places. I wonder if anyone has any idea why it should run slow?
thanks
Bernie
Code: Select all
-- @@@@@@@@@@@@@@@@@@@@@@@@@ showtime @@@@@@@@@@'
on showTime
-- its going to loop every 500msecs
subtract 0.5 from totalsecs
-- put the result on the screen
put totalsecs div 3600 into xhrs of card "clipper"
put (totalsecs mod 3600) div 60 into xmins of card "clipper"
put trunc((totalsecs mod 3600) mod 60) into xsecs of card "clipper"
--add leading zeros etc
if xhrs<10 then
put "0" & xhrs into field "xHr" of card "clipper"
else if xhrs =0 then
put "00" into field "xHr" of card "clipper"
else
put xhrs into field "xHr" of card "clipper"
end if
if xmins <10 then
put "0" & xmins into field "xMin" of card "clipper"
else if xmins =0 then
put "00" into field "xMin" of card "clipper"
else
put xmins into field "xMin" of card "clipper"
end if
if xsecs <10 then
put "0" & xsecs into field "xSec" of card "clipper"
else if xsecs =0 then
put "00" into field "xSec" of card "clipper"
else
put xsecs into field "xSec" of card "clipper"
end if
-- getting out of loop
if (totalsecs >1 and the cMediaOnFlag of this stack is 1) then
send "showTime" to me in 500 milliseconds
else
if showTime is in the pendingMessages then
put the pendingMessages into myMsgs
filter myMsgs with "*showTime*"
repeat for each line myMsg in myMsgs
cancel item 1 of myMsg
end repeat
end if
-- change the button setup
set the disabled of button "player1" of card "clipper" to "false"
--reset everything
set the cMediaOnFlag of this stack to 0
set the visible of field "board1" of card "clipper" to "false" -- don't show clip playing
put 00 into field "xSec" of card "clipper"
put 00 into field "xMin" of card "clipper"
put 00 into field "xHr" of card "clipper"
put 0 into xsecs of card "clipper"
put 0 into xmins of card "clipper"
put 0 into xhrs of card "clipper"
end if
end showTime