Mac Developer Library

Developer

QTKit Framework Reference QTTrack Class Reference

Options
Deployment Target:

On This Page
Language:

QTTrack

A QTTrack object is an object that represents the ordering and other characteristics of media data in a QTMovie object, such as a single video track or audio track. A QTMovie object typically contains one or more streams of media data, which are represented by QTTrack objects. When a QTMovie object has been initialized with QTMovieOpenForPlaybackAttribute set to NOfalse, a QTTrack object wraps the underlying QuickTime track (of type Track). A QTMovie object may have several QTTrack objects associated with it. By constrast, a QTTrack object has exactly one QTMedia object associated with it.

Inheritance


Conforms To


Import Statement


import QTKit @import QTKit;

Availability


Available in OS X v10.4 and later.
  • Returns a QTTrack object associated with a QuickTime Track.

    Declaration

    Objective-C

    + (id)trackWithQuickTimeTrack:(Track)track error:(NSError **)errorPtr

    Parameters

    track

    A QuickTime Track with which to initialize the QTTrack object.

    errorPtr

    A pointer to an NSError object; if a QTTrack object cannot be created, an NSError object is returned in this location.

    Discussion

    This method cannot be called when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue. In addition, this method cannot be called by 64-bit applications. Pass NULL if you do not want an NSError object returned.

    Import Statement

    Availability

    Available in OS X v10.3 and later.

    Deprecated in OS X v10.9.

    Not available to 64-bit applications.

  • Returns a QTTrack object associated with a QuickTime Track.

    Declaration

    Objective-C

    - (id)initWithQuickTimeTrack:(Track)track error:(NSError **)errorPtr

    Parameters

    track

    A QuickTime Track with which to initialize the QTTrack object.

    errorPtr

    A pointer to an NSError object; if a QTTrack object cannot be created, an NSError object is returned in this location.

    Discussion

    This method cannot be called when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue. In addition, this method cannot be called by 64-bit applications. Pass NULL if you do not want an NSError object returned.

    Import Statement

    Availability

    Available in OS X v10.3 and later.

    Deprecated in OS X v10.9.

    Not available to 64-bit applications.

  • movie movie (OS X v10.9)

    Returns the QTMovie object associated with a QTTrack object.

    Declaration

    Objective-C

    - (QTMovie *)movie

    Discussion

    This method can be called when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue.

    Import Statement

    Availability

    Available in OS X v10.3 and later.

    Deprecated in OS X v10.9.

  • media media (OS X v10.9)

    Returns the QTMedia object associated with a QTTrack object.

    Declaration

    Objective-C

    - (QTMedia *)media

    Discussion

    This method can be called when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue.

    Import Statement

    Availability

    Available in OS X v10.3 and later.

    Deprecated in OS X v10.9.

  • isEnabled isEnabled (OS X v10.9)

    Returns YEStrue if the QTTrack object is currently enabled, NOfalse otherwise.

    Declaration

    Objective-C

    - (BOOL)isEnabled

    Discussion

    This method can be called when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue.

    Import Statement

    Availability

    Available in OS X v10.3 and later.

    Deprecated in OS X v10.9.

  • volume volume (OS X v10.9)

    Returns the volume of a QTTrack object.

    Declaration

    Objective-C

    - (float)volume

    Discussion

    This method can be called when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue. The valid range is 0.0 to 1.0.

    Import Statement

    Availability

    Available in OS X v10.3 and later.

    Deprecated in OS X v10.9.

  • Returns the current value of an attribute of a QTTrack object.

    Declaration

    Objective-C

    - (id)attributeForKey:(NSString *)attributeKey

    Parameters

    attributeKey

    An NSString object that specifies the attribute to be read; pass strings like QTTrackTimeScaleAttribute or QTTrackVolumeAttribute.

    Return Value

    An NSObject that is the value of the specified attribute key.

    Discussion

    This method can be called when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue. A list of supported track attributes and their acceptable values can be found in the Track Attributes section.

    Import Statement

    Availability

    Available in OS X v10.3 and later.

    Deprecated in OS X v10.9.

  • Returns a dictionary containing the current values of public attributes of a QTTrack object.

    Declaration

    Objective-C

    - (NSDictionary *)trackAttributes

    Discussion

    This method can be called when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue. A list of supported track attributes and their acceptable values can be found in the Track Attributes section.

    Import Statement

    Availability

    Available in OS X v10.3 and later.

    Deprecated in OS X v10.9.

  • setEnabled: setEnabled: (OS X v10.9)

    Sets the enabled state of a QTTrack to enabled.

    Declaration

    Objective-C

    - (void)setEnabled:(BOOL)enabled

    Parameters

    enabled

    The desired track enabled state.

    Discussion

    This method can be called when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue.

    Import Statement

    Availability

    Available in OS X v10.3 and later.

    Deprecated in OS X v10.9.

  • setVolume: setVolume: (OS X v10.9)

    Sets the volume of a QTTrack object.

    Declaration

    Objective-C

    - (void)setVolume:(float)volume

    Parameters

    volume

    The desired track volume.

    Discussion

    This method can be called when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue. The valid range is 0.0 to 1.0.

    Import Statement

    Availability

    Available in OS X v10.3 and later.

    Deprecated in OS X v10.9.

  • Set the track attribute attributeKey to the value specified by the value parameter.

    Declaration

    Objective-C

    - (void)setAttribute:(id)value forKey:(NSString *)attributeKey

    Parameters

    attributes

    An NSDictionary object that specifies the attributes to set and their desired values.

    Discussion

    This method can be called when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue. However, certain attributes may not be writable when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue. A list of supported track attributes and their acceptable values can be found in the Track Attributes section.

    Import Statement

    Availability

    Available in OS X v10.3 and later.

    Deprecated in OS X v10.9.

  • Sets the attributes of a QTTrack object using the key-value pairs in a specified dictionary.

    Declaration

    Objective-C

    - (void)setTrackAttributes:(NSDictionary *)attributes

    Parameters

    attributes

    An NSDictionary object that specifies the attributes to set and their desired values.

    Discussion

    This method can be called when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue. However, certain attributes may not be writable when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue. A list of supported track attributes and their acceptable values can be found in the Track Attributes section.

    Import Statement

    Availability

    Available in OS X v10.3 and later.

    Deprecated in OS X v10.9.

  • Adds an image to a QTTrack object for the specified duration, using attributes specified in the attributes dictionary.

    Declaration

    Objective-C

    - (void)addImage:(NSImage *)image forDuration:(QTTime)duration withAttributes:(NSDictionary *)attributes

    Parameters

    image

    An NSImage that is to be appended to the target track.

    duration

    A QTTime structure that indicates the desired duration of the appended image in the track.

    attributes

    An NSDictionary object that specifies attributes of the appended image.

    Keys in the dictionary can be QTAddImageCodecType to select a codec type and QTAddImageCodecQuality to select a quality. Qualities are expected to be specified as NSNumbers, using the codec values like codecNormalQuality. (See ImageCompression.h for the complete list.)

    Discussion

    This method cannot be called when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue.

    Import Statement

    Availability

    Available in OS X v10.3 and later.

    Deprecated in OS X v10.9.

  • Deletes a specified segment from a QTTrack object.

    Declaration

    Objective-C

    - (void)deleteSegment:(QTTimeRange)segment

    Parameters

    segment

    A QTTimeRange structure that indicates the segment in the target track that is to be deleted.

    Discussion

    This method cannot be called when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue. If the movie containing this track is not editable, this method raises an exception.

    Import Statement

    Availability

    Available in OS X v10.3 and later.

    Deprecated in OS X v10.9.

  • Inserts into a QTTrack an empty segment delimited by the range range.

    Declaration

    Objective-C

    - (void)insertEmptySegmentAt:(QTTimeRange)range

    Parameters

    range

    A QTTimeRange structure that indicates the segment in the target track at which an empty segment is to be inserted.

    Discussion

    This method cannot be called when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue. If the movie containing this track is not editable, this method raises an exception.

    Import Statement

    Availability

    Available in OS X v10.3 and later.

    Deprecated in OS X v10.9.

  • Inserts into a QTTrack object the specified segment of another QTTrack object.

    Declaration

    Objective-C

    - (void)insertSegmentOfTrack:(QTTrack *)track timeRange:(QTTimeRange)range atTime:(QTTime)time

    Parameters

    track

    The QTTrack object from which the segment to be inserted is copied.

    range

    A QTTimeRange structure that indicates the segment in track to be copied.

    time

    A QTTime structure that indicates the time in the target track at which the copied segment is to be inserted.

    Discussion

    This method cannot be called when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue. If the movie containing this track is not editable, this method raises an exception.

    Import Statement

    Availability

    Available in OS X v10.3 and later.

    Deprecated in OS X v10.9.

  • Inserts into a QTTrack object the specified segment of another QTTrack object, scaling that new segment to a specified start time and duration.

    Declaration

    Objective-C

    - (void)insertSegmentOfTrack:(QTTrack *)track fromRange:(QTTimeRange)srcRange scaledToRange:(QTTimeRange)dstRange

    Parameters

    track

    The QTTrack object from which the segment to be inserted is copied.

    srcRange

    A QTTimeRange structure that indicates the segment in track to be copied.

    dstRange

    A QTTimeRange structure that indicates the range in the target track into which the copied segment is to be inserted.

    Discussion

    This method cannot be called when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue. This is essentially an Add Scaled operation on a track. If the movie containing this track is not editable, this method raises an exception.

    Import Statement

    Availability

    Available in OS X v10.3 and later.

    Deprecated in OS X v10.9.

  • Scales the QTTrack segment delimited by the segment segment so that it will have the new duration newDuration.

    Declaration

    Objective-C

    - (void)scaleSegment:(QTTimeRange)segment newDuration:(QTTime)newDuration

    Parameters

    segment

    A QTTimeRange structure that indicates the segment in the target track that is to be scaled.

    newDuration

    A QTTime structure that indicates the desired duration of the segment that is to be scaled.

    Discussion

    This method cannot be called when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue. If the track is not editable, this method raises an exception.

    Import Statement

    Availability

    Available in OS X v10.3 and later.

    Deprecated in OS X v10.9.

  • Returns the QuickTime track associated with a QTTrack object.

    Declaration

    Objective-C

    - (Track)quickTimeTrack

    Discussion

    This method cannot be called when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue. In addition, this method cannot be called by 64-bit applications.

    Import Statement

    Availability

    Available in OS X v10.3 and later.

    Deprecated in OS X v10.9.

    Not available to 64-bit applications.

  • Returns an NSSize value that indicates the dimensions of the target track for the specified movie aperture mode.

    Declaration

    Objective-C

    - (NSSize)apertureModeDimensionsForMode:(NSString *)mode

    Parameters

    mode

    An NSString object that indicates the aperture mode whose dimensions are to be returned; pass values like QTMovieApertureModeClean.

    Discussion

    For instance, passing a mode of QTMovieApertureModeClean would cause apertureModeDimensionsForMode: to return the track dimensions to use in clean aperture mode. This method cannot be called when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue.

    Import Statement

    Availability

    QuickTime 7.2 or later.

    Deprecated in OS X v10.9.

  • Sets the dimensions of the target track for the specified movie aperture mode.

    Declaration

    Objective-C

    - (void)setApertureModeDimensions:(NSSize)dimensions forMode:(NSString *)mode

    Parameters

    dimensions

    An NSSize structure that indicates the desired dimensions for the specified aperture mode.

    mode

    An NSString object that indicates the aperture mode whose dimensions are to be set; pass values like QTMovieApertureModeClean.

    Discussion

    This method cannot be called when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue.

    Import Statement

    Availability

    QuickTime 7.2 or later.

    Deprecated in OS X v10.9.

  • Adds aperture mode dimensions information to a QTTrack object.

    Declaration

    Objective-C

    - (void)generateApertureModeDimensions

    Discussion

    If the image descriptions in the track lack tags describing clean aperture and pixel aspect ratio information, the media data is scanned to see if the correct values can be divined and attached. Then the aperture mode dimensions are calculated and set. Afterwards, the QTTrackHasApertureModeDimensionsAttribute property will be set to YEStrue for this track. Tracks that do not support aperture modes are not changed. This method cannot be called when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue.

    Import Statement

    Availability

    QuickTime 7.2 or later.

    Deprecated in OS X v10.9.

  • Removes aperture mode dimensions information from the QTTrack object.

    Declaration

    Objective-C

    - (void)removeApertureModeDimensions

    Discussion

    It does not attempt to modify sample descriptions, so it may not completely reverse the effects of generateApertureModeDimensions. It sets the QTTrackHasApertureModeDimensionsAttribute property to NOfalse. This method cannot be called when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue.

    Import Statement

    Availability

    QuickTime 7.2 or later.

    Deprecated in OS X v10.9.

  • The following constants specify the track attributes that you can get and set using the trackAttributes and setTrackAttributes methods. To get or set a single attribute, use attributeForKey or setAttribute.

    Declaration

    Objective-C

    NSString * const QTTrackBoundsAttribute; NSString * const QTTrackCreationTimeAttribute; NSString * const QTTrackDimensionsAttribute; NSString * const QTTrackDisplayNameAttribute; NSString * const QTTrackEnabledAttribute; NSString * const QTTrackFormatSummaryAttribute; NSString * const QTTrackIsChapterTrackAttribute; NSString * const QTTrackHasApertureModeDimensionsAttribute; NSString * const QTTrackIDAttribute; NSString * const QTTrackLayerAttribute; NSString * const QTTrackMediaTypeAttribute; NSString * const QTTrackModificationTimeAttribute; NSString * const QTTrackRangeAttribute; NSString * const QTTrackTimeScaleAttribute; NSString * const QTTrackUsageInMovieAttribute; NSString * const QTTrackUsageInPosterAttribute; NSString * const QTTrackUsageInPreviewAttribute; NSString * const QTTrackVolumeAttribute;

    Constants

    • QTTrackBoundsAttribute

      QTTrackBoundsAttribute

      The bounding rectangle of a QTTrack object; the value for this key is of type NSValue, interpreted as an NSRect.

      This attribute can be read and written. This attribute can be read and written when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue.

      Available in OS X v10.4 and later.

      Deprecated in OS X v10.9.

    • QTTrackCreationTimeAttribute

      QTTrackCreationTimeAttribute

      The creation time of a QTTrack object; the value for this key is of type NSDate.

      This attribute can be read and written. This attribute can be read and written when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue.

      Available in OS X v10.4 and later.

      Deprecated in OS X v10.9.

    • QTTrackDimensionsAttribute

      QTTrackDimensionsAttribute

      The dimensions of a QTTrack object; the value for this key is of type NSValue, interpreted as an NSSize.

      This attribute can be read and written. This attribute can be read and written when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue.

      Available in OS X v10.4 and later.

      Deprecated in OS X v10.9.

    • QTTrackDisplayNameAttribute

      QTTrackDisplayNameAttribute

      The display name of a QTTrack object; the value for this key is of type NSString.

      This attribute can be read and written. This attribute can be read and written when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue.

      Available in OS X v10.4 and later.

      Deprecated in OS X v10.9.

    • QTTrackEnabledAttribute

      QTTrackEnabledAttribute

      The track enabled state of a QTTrack object; the value for this key is of type NSNumber, interpreted as a BOOL.

      This attribute can be read and written. This attribute can be read and written when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue.

      Available in OS X v10.4 and later.

      Deprecated in OS X v10.9.

    • QTTrackFormatSummaryAttribute

      QTTrackFormatSummaryAttribute

      An NSString that is a localized, human-readable string that summarizes a track’s format; for example, “16-bit Integer (Big Endian), Stereo (L R), 48.000 kHz”.

      This attribute can be read and written. This attribute can be read and written when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue.

      OS X v10.5 and later.

      Deprecated in OS X v10.9.

    • QTTrackIsChapterTrackAttribute

      QTTrackIsChapterTrackAttribute

      Whether a QTTrack object is a chapter track for some other QTTrack object; the value for this key is of type NSNumber, interpreted as a BOOL.

      This attribute can be read and written. This attribute can be read and written when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue.

      Available in OS X v10.5 and later.

      Deprecated in OS X v10.9.

    • QTTrackHasApertureModeDimensionsAttribute

      QTTrackHasApertureModeDimensionsAttribute

      Whether aperture mode dimensions have been set on a QTTrack object; the value for this key is of type NSNumber, interpreted as a BOOL.

      This attribute can be read and written. This attribute can be read and written when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue.

      Available in OS X v10.5 and later.

      Deprecated in OS X v10.9.

    • QTTrackIDAttribute

      QTTrackIDAttribute

      The track ID of a QTTrack object; the value for this key is of type NSNumber, interpreted as a long.

      This attribute can be read and written. This attribute can be read and written when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue.

      Available in OS X v10.4 and later.

      Deprecated in OS X v10.9.

    • QTTrackLayerAttribute

      QTTrackLayerAttribute

      The track layer of a QTTrack object; the value for this key is of type NSNumber, interpreted as a short.

      This attribute can be read and written. This attribute can be read and written when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue.

      Available in OS X v10.4 and later.

      Deprecated in OS X v10.9.

    • QTTrackMediaTypeAttribute

      QTTrackMediaTypeAttribute

      The media type of a QTTrack object; the value for this key is of type NSString.

      This attribute can be read and written. This attribute can be read and written when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue.

      Available in OS X v10.4 and later.

      Deprecated in OS X v10.9.

    • QTTrackModificationTimeAttribute

      QTTrackModificationTimeAttribute

      The modification time of a QTTrack object; the value for this key is of type NSDate.

      This attribute can be read and written. This attribute can be read and written when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue.

      Available in OS X v10.4 and later.

      Deprecated in OS X v10.9.

    • QTTrackRangeAttribute

      QTTrackRangeAttribute

      The range of time this track occupies; the value for this key is of type NSValue, interpreted as a QTTimeRange.

      This attribute can be read and written. This attribute can be read and written when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue.

      Available in OS X v10.4 and later.

      Deprecated in OS X v10.9.

    • QTTrackTimeScaleAttribute

      QTTrackTimeScaleAttribute

      The time scale of a QTTrack object; the value for this key is of type NSNumber, interpreted as a long.

      This attribute can be read and written. This attribute can be read and written when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue.

      Available in OS X v10.4 and later.

      Deprecated in OS X v10.9.

    • QTTrackUsageInMovieAttribute

      QTTrackUsageInMovieAttribute

      Whether a QTTrack object contributes data to the movie; the value for this key is of type NSNumber, interpreted as a BOOL.

      This attribute can be read and written. This attribute can be read and written when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue.

      Available in OS X v10.4 and later.

      Deprecated in OS X v10.9.

    • QTTrackUsageInPosterAttribute

      QTTrackUsageInPosterAttribute

      Whether a QTTrack object contributes data to the movie poster; the value for this key is of type NSNumber, interpreted as a BOOL.

      This attribute can be read and written. This attribute can be read and written when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue.

      Available in OS X v10.4 and later.

      Deprecated in OS X v10.9.

    • QTTrackUsageInPreviewAttribute

      QTTrackUsageInPreviewAttribute

      Whether a QTTrack object contributes data to the movie preview; the value for this key is of type NSNumber, interpreted as a BOOL.

      This attribute can be read and written. This attribute can be read and written when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue.

      Available in OS X v10.4 and later.

      Deprecated in OS X v10.9.

    • QTTrackVolumeAttribute

      QTTrackVolumeAttribute

      The volume of a QTTrack object; the value for this key is of type NSNumber, interpreted as a float.

      This attribute can be read and written. This attribute can be read and written when the movie containing this track has been initialized with QTMovieOpenForPlaybackAttribute set to YEStrue.

      Available in OS X v10.4 and later.

      Deprecated in OS X v10.9.

    Import Statement