CMTimebase

A model of a timeline under application control.

Overview

A timebase represents a timeline that clients can control by setting the rate and time. Each timebase has either a master clock or a master timebase and its rate is expressed relative to its master:

  • When a timebase has rate 0.0, its time is fixed and does not change as its master's time changes.

  • When a timebase has rate 1.0, its time increases one second as its master's time increases by one second.

  • When a timebase has rate 2.0, its time increases two seconds as its master's time increases by one second.

  • When a timebase has rate -1.0, its time decreases one second as its master's time increases by one second.

If a timebase has a master timebase, the master timebase's rate is a factor in determining the timebase's effective rate. In fact, a timebase's effective rate is defined as the product of its rate, its master timebase's rate, its master timebase's master timebase's rate, and so on up to the ultimate master clock. This is the rate at which the timebase's time changes relative to the ultimate master clock.

Topics

Functions

CMTimebaseNotificationBarrier

Requests that the timebase wait until it is not posting any notifications.

CMTimebaseGetTypeID

Returns the CFTypeID for CMTimebase.

CMTimebaseCreateWithMasterClock

Creates a timebase driven by the given clock.

CMTimebaseCreateWithMasterTimebase

Creates a timebase driven by the given master timebase.

CMTimebaseGetMasterTimebase

Returns the immediate master timebase of a timebase.

Deprecated
CMTimebaseGetMasterClock

Returns the immediate master clock of a timebase.

Deprecated
CMTimebaseGetMaster

Returns the immediate master (either timebase or clock) of a timebase.

Deprecated
CMTimebaseGetUltimateMasterClock

Returns the master clock that is the master of all of a timebase's master timebases.

Deprecated
CMTimebaseGetTime

Retrieves the current time from a timebase.

CMTimebaseGetTimeWithTimeScale

Retrieves the current time from a timebase in the specified timescale.

CMTimebaseSetTime

Sets the current time of a timebase.

CMTimebaseSetAnchorTime

Sets the time of a timebase at a particular master time.

CMTimebaseGetRate

Retrieves the current rate of a timebase.

CMTimebaseGetTimeAndRate

Retrieves the current time and rate of a timebase.

CMTimebaseSetRate

Sets the rate of a timebase.

CMTimebaseSetRateAndAnchorTime

Sets the time of a timebase at a particular master time, and changes the rate at exactly that time.

CMTimebaseGetEffectiveRate

Gets the effective rate of a timebase (which combines its rate with the rates of all its master timebases).

CMTimebaseAddTimer

Adds the timer to the list of timers managed by the timebase.

CMTimebaseRemoveTimer

Removes the timer from the list of timers managed by the timebase.

CMTimebaseSetTimerNextFireTime

Sets the CMTime on the timebase's timeline at which the timer should next be fired.

CMTimebaseSetTimerToFireImmediately

Sets the timer to fire immediately once, overriding any previous CMTimebaseSetTimerNextFireTime call.

CMTimebaseAddTimerDispatchSource

Adds the timer dispatch source to the list of timers managed by the timebase.

CMTimebaseRemoveTimerDispatchSource

Removes the timer dispatch source from the list of timers managed by the timebase.

CMTimebaseSetTimerDispatchSourceNextFireTime

Sets the CMTime on the timebase's timeline at which the timer dispatch source should be fired next.

CMTimebaseSetTimerDispatchSourceToFireImmediately

Sets the timer dispatch source to fire immediately once, overriding any previous CMTimebaseSetTimerDispatchSourceNextFireTime call.

CMTimebaseCopyMaster

Returns the immediate master timebase of a timebase.

CMTimebaseCopyMasterClock

Returns the immediate master clock of a timebase.

CMTimebaseCopyMasterTimebase

Returns the immediate master timebase of a timebase.

CMTimebaseCopyUltimateMasterClock

Returns the master clock that is the master of all of a timebase's master timebases.

Data Types

CMTimebaseRef

Models a timeline under application control.

Constants

kCMTimebaseVeryLongCFTimeInterval

Defines a very long elapsed time in seconds.

kCMTimebaseFarFutureCFAbsoluteTime

Returns a specific point of time in far, far future.

kCMTimebaseError_MissingRequiredParameter

Indicates that a required parameter is missing.

kCMTimebaseError_InvalidParameter

Indicates a NULL or 0 was passed for a required parameter.

kCMTimebaseError_AllocationFailed

Indicates a failed memory allocation.

kCMTimebaseError_TimerIntervalTooShort

Indicates that the supplied time interval is too short.

kCMTimebaseError_ReadOnly

Indicates that an attempt was made to modify a read-only timebase.

See Also

Media Synchronization

CMClock

A reference clock used to synchronize applications and devices.

CMAudioClock

A specialized reference clock used to synchronize with audio sources.