Next Page > Hide TOC

QTKit Functions Reference

Framework
/System/Library/Frameworks/QTKit.framework
Declared in
QTTime.h
QTTimeRange.h
QTUtilities.h

Overview

This chapter describes the functions that are available in the QuickTime Kit framework.

Functions by Task

Creating QTTime Structures

The following functions are used to create QTTime structures.

Getting and Setting Times

The following functions are used to get and set times.

Comparing QTTime Structures

The following function is used to compare QTTime structures.

Adding and Subtracting Times

The following functions are used to add and subtract times:

Getting a Time Description

The following function is used to get a time description:

Time Range Functions

QuickTime Helper Functions

Functions

QTEqualTimeRanges

Returns YES if the specified time ranges are identical.

BOOL QTEqualTimeRanges (
   QTTimeRange range,
   QTTimeRange range2
);

Discussion

This function returns YES if the specified time ranges are identical.

Availability
Declared In
QTTimeRange.h

QTGetTimeInterval

Returns the value of a QTTime structure expressed as an NSTimeInterval.

BOOL QTGetTimeInterval (
   QTTime time,
   NSTimeInterval *timeInterval
);

Discussion

This function returns, in the location to by timeInterval, the value of a QTTime structure expressed as a NSTimeInterval. Returns YES if the method succeeded.

Availability
Declared In
QTTime.h

QTGetTimeRecord

Returns the value of a QTTime structure expressed as a TimeRecord.

BOOL QTGetTimeRecord (
   QTTime time,
   TimeRecord *timeRecord
);

Discussion

This function returns, in the location pointed to by timeRecord, the value of a QTTime structure expressed as a TimeRecord. Returns YES if the method succeeded.

Availability
Related Sample Code
Declared In
QTTime.h

QTIntersectionTimeRange

Returns a QTTimeRange structure that represents the intersection of the two ranges.

QTTimeRange QTIntersectionTimeRange (
   QTTimeRange range1,
   QTTimeRange range2
);

Discussion

This function returns a QTTimeRange structure that represents the intersection of the two ranges. The intersection of two ranges is the largest range that includes all times that are in both ranges.

Availability
Declared In
QTTimeRange.h

QTMakeTime

Creates a QTTime structure.

QTTime QTMakeTime (
   long long timeValue,
   long timeScale
);

Discussion

This function creates a QTTime structure initialized using the scalar value timeValue and the time scale scale.

Availability
Related Sample Code
Declared In
QTTime.h

QTMakeTimeRange

Returns a QTTimeRange structure initialized using the QTTime structures time and duration.

QTTimeRange QTMakeTimeRange (
   QTTime time,
   QTTime duration
);

Discussion

This function returns a QTTimeRange structure initialized using the QTTime structures time and duration. Those structures may have different time scales. In all cases, the time scale used in the new QTTimeRange structure is that of time.

Availability
Related Sample Code
Declared In
QTTimeRange.h

QTMakeTimeScaled

Returns a QTTime structure.

QTTime QTMakeTimeScaled (
   QTTime time,
   long timeScale
);

Discussion

This function returns a QTTime structure whose time is set to the time of a QTTime structure interpreted using the time scale scale.

Availability
Declared In
QTTime.h

QTMakeTimeWithTimeInterval

Creates a QTTime structure.

QTKIT_EXTERN QTTime QTMakeTimeWithTimeInterval (
   NSTimeInterval timeInterval
);

Discussion

Creates a QTTime structure initialized using the NSTimeInterval value timeInterval.

Availability
Declared In
QTTime.h

QTMakeTimeWithTimeRecord

Creates a QTTime structure.

QTKIT_EXTERN QTTime QTMakeTimeWithTimeRecord (
   TimeRecord timeRecord
);

Discussion

This function creates a QTTime structure initialized using the values in the time record timeRecord.

Availability
Related Sample Code
Declared In
QTTime.h

QTOSTypeForString

Returns a four-character code representing the specified NSString.

OSType QTOSTypeForString (
   NSString *string
);

Discussion

This function returns a four-character code representing the specified NSString.

Availability
Declared In
QTUtilities.h

QTSMPTETimeCompare

Compares two SMPTETime structures.

NSComparisonResult QTSMPTETimeCompare(SMPTETime time, SMPTETIme otherTime)

QTStringForOSType

Returns an NSString representing the specified four-character code type.

NSString * QTStringForOSType (
   OSType type
);

Discussion

This function returns an NSString representing the specified four-character code type.

Availability
Declared In
QTUtilities.h

QTStringFromSMPTETime

Returns a human-readable string from the SMPTETime. The returned string is of the form hh:mm:ss.ff.

NSString* QTStringFromSMPTETime(SMPTETime time)

Availability
Declared In
QTTime.h

QTStringFromTime

Returns a description of a QTTime structure.

NSString * QTStringFromTime (
   QTTime time
);

Discussion

This function returns a description of a QTTime structure. The string is in the form "sign:days:hours:minutes:seconds:timevalue:timescale", where sign is empty or “-”. Note that this is not for user input, but for archiving and debugging purposes.

Availability
Related Sample Code
Declared In
QTTime.h

QTStringFromTimeRange

Returns a description of a QTTimeRange structure.

NSString * QTStringFromTimeRange (
   QTTimeRange range
);

Discussion

This function returns a description of a QTTimeRange structure. The string is in the form "hours:minutes:seconds.frames:: hours:minutes:seconds.frames". Note that this is for archiving and debugging purposes, not for user display.

Availability
Declared In
QTTimeRange.h

QTTimeCompare

Returns a value of type NSComparisonResult.

NSComparisonResult QTTimeCompare (
   QTTime time,
   QTTime otherTime
);

Discussion

This function returns a value of type NSComparisonResult that indicates the result of comparing a QTTime structure with the specified QTTime structure otherTime.

Availability
Related Sample Code
Declared In
QTTime.h

QTTimeDecrement

Subtracks one QTTime from another.

QTTime QTTimeDecrement (
   QTTime time,
   QTTime decrement
);

Discussion

This function returns a QTTime structure whose time is set to the time of a QTTime structure minus that of the structure decrement.

Availability
Related Sample Code
Declared In
QTTime.h

QTTimeFromString

Returns a QTTime structure.

QTKIT_EXTERN QTTime QTTimeFromString (
   NSString *string
);

Discussion

This function returns a QTTime structure whose time is set to the time expressed by the string; the string is assumed to be in the form "days:hours:minutes:seconds:frames/timescale".

Availability
Related Sample Code
Declared In
QTTime.h

QTTimeIncrement

Adds two QTTime structures.

QTTime QTTimeIncrement (
   QTTime time,
   QTTime increment
);

Discussion

This function returns a QTTime structure whose time is set to the time of a QTTime structure plus that of the structure increment.

Availability
Declared In
QTTime.h

QTTimeInTimeRange

Returns YES if the specified time time lies in the time range range.

BOOL QTTimeInTimeRange (
   QTTime time,
   QTTimeRange range
);

Discussion

This function returns YES if the specified time time lies in the time range range.

Availability
Declared In
QTTimeRange.h

QTTimeRangeEnd

Returns a QTTime structure representing the end of the specified time range.

QTTime QTTimeRangeEnd (
   QTTimeRange range
);

Discussion

This function returns a QTTime structure representing the end of the specified time range.

Availability
Declared In
QTTimeRange.h

QTTimeRangeFromString

Returns a QTTimeRange structure

QTTimeRange QTTimeRangeFromString (
   NSString *string
);

Discussion

This function returns a QTTimeRange structure whose range is set to the range expressed by string; the string is assumed to be in the form "days:hours:minutes:seconds.frames/timescale~days:hours:minutes:seconds.frames/timescale".

Availability
Declared In
QTTimeRange.h

QTUnionTimeRange

Returns a QTTimeRange structure.

QTTimeRange QTUnionTimeRange (
   QTTimeRange range1,
   QTTimeRange range2
);

Discussion

This function returns a QTTimeRange structure that represents the union of the two ranges. The union of two ranges is the smallest range that includes all times that are in either range.

Availability
Declared In
QTTimeRange.h

Next Page > Hide TOC


© 2009 Apple Inc. All Rights Reserved. (Last updated: 2009-05-06)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.