TimeBase Control Plugin for REALbasic
TimeBase Control Plugin for REALbasic
Version 1.0, August 12, 2002
--Initial release
Working With Time Bases
The Movie Toolbox provides a number of functions that allow you to work
with time bases. A QuickTime time base defines the time coordinate system
of a movie. However, you can also use QuickTime time bases to provide
general timing services.
Although most time base functions can be used at interrupt time, several of
the Movie Toolbox functions cannot.
Creating Time Bases
NewTimeBase lets you create a new time base. Time bases rely on either a
clock component or another time base for their time source. You can use
SetTimeBaseMasterTimeBase to cause one time base to be based on another
time base. GetTimeBaseMasterTimeBase allows you to determine the master
time base of a given time base. You can assign a clock component to a time
base; that clock then acts as the master clock for the time base. You can
use SetTimeBaseMasterClock to assign a clock component to a time base.
GetTimeBaseMasterClock enables you to determine the clock component that is
assigned to a time base. You can change the offset between a time base and
its time source by calling SetTimeBaseZero. You can set the time source of
a movie by calling SetMovieMasterTimeBase or SetMovieMasterClock.
Working With Time Base Values
Every time base contains a rate, a start time, a stop time, a current time,
and some status information. The Movie Toolbox provides a number of
functions that allow your application to work with the contents of a time
base. You can use time structures to represent either time values or
durations. Time values specify a point in time, relative to a given time
base. Durations specify a span of time, relative to a given time scale.
Durations are represented by time structures that have the time base set to
0 (that is, the base field in the time structure is set to NIL).
GetTimeBaseTime lets you retrieve the current time value of a time base.
You can set the current time value by calling SetTimeBaseTime; this
function requires you to provide a time structure. Alternatively, you can
set the current time based on a time value by calling SetTimeBaseValue. You
can determine the rate of a time base by calling GetTimeBaseRate. You can
set the rate of a time base by calling SetTimeBaseRate. You can determine
the effective rate of a specified time base (relative to the master time
base to which it is subordinate) by calling GetTimeBaseEffectiveRate. You
can retrieve the start time of a time base by calling GetTimeBaseStartTime.
You can set the start time of a time base by calling SetTimeBaseStartTime.
Similarly, you can use GetTimeBaseStopTime and SetTimeBaseStopTime to work
with the stop time of a time base. The Movie Toolbox provides functions
that allow you to work with the status information of a time base.
GetTimeBaseStatus allows you to read the current status of a time base.
GetTimeBaseFlags helps you obtain the control flags of a time base. You can
set these flags by calling SetTimeBaseFlags.
Hope you can use it for your benefit(s), the plugin comes with a little
sample project.
Alfred N. Van Hoek, Ph.D. (http://homepage.mac.com/vanhoek/)