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 host clock or a host timebase, and its rate is expressed relative to its host:
When a timebase has rate 0.0, its time is fixed and doesn’t change as its host’s time changes.
When a timebase has rate 1.0, its time increases one second as its host’s time increases by one second.
When a timebase has rate 2.0, its time increases two seconds as its host’s time increases by one second.
When a timebase has rate -1.0, its time decreases one second as its host’s time increases by one second.
If a timebase has a host timebase, the host 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 host timebase’s rate, its host timebase’s host timebase’s rate, and so on up to the ultimate host clock. This is the rate at which the timebase’s time changes relative to the ultimate host clock.
Topics
Creating Timebases
CMTimebaseCreateWithSourceClock(allocator:sourceClock:timebaseOut:)CMTimebaseCreateWithSourceTimebase(allocator:sourceTimebase:timebaseOut:)
Copying Timebases
CMTimebaseCopySource(_:)CMTimebaseCopySourceClock(_:)CMTimebaseCopySourceTimebase(_:)CMTimebaseCopyUltimateSourceClock(_:)
Getting and Setting Time
CMTimebaseGetTime(_:)CMTimebaseGetTimeWithTimeScale(_:timescale:method:)CMTimebaseGetTimeAndRate(_:timeOut:rateOut:)CMTimebaseSetTime(_:time:)CMTimebaseSetSourceClock(_:_:)CMTimebaseSetSourceTimebase(_:_:)CMTimebaseSetAnchorTime(_:timebaseTime:immediateSourceTime:)
Getting and Setting the Time Rate
CMTimebaseGetRate(_:)CMTimebaseGetEffectiveRate(_:)CMTimebaseSetRate(_:rate:)CMTimebaseSetRateAndAnchorTime(_:rate:anchorTime:immediateSourceTime:)
Interacting with Timers
CMTimebaseAddTimer(_:timer:runloop:)CMTimebaseAddTimerDispatchSource(_:timerSource:)CMTimebaseRemoveTimer(_:timer:)CMTimebaseRemoveTimerDispatchSource(_:timerSource:)CMTimebaseSetTimerNextFireTime(_:timer:fireTime:flags:)CMTimebaseSetTimerToFireImmediately(_:timer:)CMTimebaseSetTimerDispatchSourceNextFireTime(_:timerSource:fireTime:flags:)CMTimebaseSetTimerDispatchSourceToFireImmediately(_:timerSource:)
Pausing Time Notifications
Data Types
Timebase Errors
kCMTimebaseError_MissingRequiredParameterkCMTimebaseError_InvalidParameterkCMTimebaseError_AllocationFailedkCMTimebaseError_TimerIntervalTooShortkCMTimebaseError_ReadOnly
Constants
Notifications
Deprecations
CMTimebaseSetRateAndAnchorTime(_:rate:anchorTime:immediateMasterTime:)CMTimebaseGetMasterTimebase(_:)CMTimebaseGetMasterClock(_:)CMTimebaseGetMaster(_:)CMTimebaseGetUltimateMasterClock(_:)CMTimebaseSetMasterClock(_:_:)CMTimebaseSetMasterTimebase(_:_:)CMTimebaseSetAnchorTime(_:timebaseTime:immediateMasterTime:)CMTimebaseCopyMaster(_:)CMTimebaseCopyMasterClock(_:)CMTimebaseCopyMasterTimebase(_:)CMTimebaseCopyUltimateMasterClock(_:)CMTimebaseCreateWithMasterClock(allocator:masterClock:timebaseOut:)CMTimebaseCreateWithMasterTimebase(allocator:masterTimebase:timebaseOut:)