Mark Luetzelschwab wrote:

> 1. Step forward one frame in a player

Ah, this is a thorny one.  QT is not frame-based; everything is done with
timecode integers.  You can coerce an emulation of a frame-based system by
using the movie's timescale function.

These two functions may help get you started:

--
-- TimeCode2Time
--
function TimeCode2Time pTimeCode, pTimeScale
  set the itemDelimiter to ":"
  if the number of items of pTimeCode < 3 then
    answer "Error: invalid time code format"
    exit to MetaCard
  end if
  put item 1 of pTimeCode into tHours
  put item 2 of pTimeCode into tMins
  put item 3 of pTimeCode into tSecs
  if item 4 of pTimeCode is not empty then -- support older frame-based
format:
    set the numberformat to "00.000"
    add (item 4 of pTimeCode / 30) to tSecs
  end if
  put (tSecs * pTimeScale) into tInt
  add (tMins*60*pTimeScale) to tInt
  add (tHours*3600*pTimeScale) to tInt
  return round(tInt)
end TimeCode2Time


--
-- Time2TimeCode
--
function Time2TimeCode pInt, pTimeScale
  if pInt = 0 then put 1 into pInt
  if pTimeScale = 0 then put 1 into pTimeScale
  put pInt / pTimeScale into tSecs
  set the numberformat to "00"
  put tSecs div 3600 &":" into tHrs
  put tSecs mod 3600 into tSecs
  put tSecs div 60   &":" into tMins
  set the numberformat to 00.000
  put tSecs mod 60 into tSecs
  return tHrs & tMins &tSecs
end Time2TimeCode


One method might be to increment your own timecode, and use timecode2time to
get an integer value that you can set the player's currenttime property to.

Of course, the easiest way is to use the controller's Step buttons. :)


> 2. Tell if a movie has completely downloaded (after setting the
> fileName to a URL?).  I think I can get around it by forcing the
> movie to play (these are very short clips) and waiting for a
> playStopped message at the duration...but there might be a better way
> to do this.

Check the UrlStatus function.  Typically you would use "load...with
message", and then in the handler for that message use a timer to check its
status periodically.

See the urlDownload stack in mctools.com for a great implementation.

> 3. Save a movie in a player to a file.

Hmmm... that's an interesting one.  Rather than use a URL in a player,
perhaps you could treat it as a data file and write it out as it comes in,
then assign it to a player when you're done.  I'm sure there's a better way,
though, and with QT's "quick start" option it'd be a shame not to take
advantage of near-immediate playback while downloading.

Anyone else know a good method for this?


-- 
 Richard Gaskin 
 Fourth World Media Corporation
 Multimedia Design and Development for Mac, Windows, UNIX, and the Web
 _____________________________________________________________________
 [EMAIL PROTECTED]                 http://www.FourthWorld.com
 Tel: 323-225-3717        AIM: FourthWorldInc        Fax: 323-225-0716



Archives: http://www.mail-archive.com/[email protected]/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.

Reply via email to