| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/QTKit.framework |
| Availability | Available in Mac OS X v10.4 and later. |
| Declared in | QTTrack.h |
| Related sample code |
The QTTrack class represents a QuickTime track (of type Track). QTTrack objects are associated with QTMovie objects and support methods for getting and setting the track properties. If necessary, you can retrieve the track identifier associated with a QTTrack object by calling its quickTimeTrack: method. Note that a movie can have multiple tracks. A track has a single media.
Initializes a newly created QTTrack object with data from the QuickTime track track.
– addImage:forDuration:withAttributes:
– deleteSegment:
– insertEmptySegmentAt:
– insertSegmentOfTrack:timeRange:atTime:
– insertSegmentOfTrack:fromRange:scaledToRange:
– scaleSegment:newDuration:
– apertureModeDimensionsForMode:
– setApertureModeDimensions:forMode:
– generateApertureModeDimensions
– removeApertureModeDimensions
Creates a QTTrack object with data from the QuickTime track track.
+ (id)trackWithQuickTimeTrack:(Track)track error:(NSError **)errorPtr
If a QTTrack object cannot be created, an NSError object is returned in the location pointed to by errorPtr. Pass NIL if you do not want an NSError object returned.
QTTrack.hAdds an image for the specified duration to the receiver, using attributes specified in the attributes dictionary.
- (void)addImage:(NSImage *)image forDuration:(QTTime)duration withAttributes:(NSDictionary *)attributes
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.)
QTTrack.hReturns an NSSize value that indicates the dimensions of the target track for the specified movie aperture mode.
- (NSSize)apertureModeDimensionsForMode:(NSString *)mode
For instance, passing a mode of QTMovieApertureModeClean would cause apertureModeDimensionsForMode: to return the track dimensions to use in clean aperture mode.
QTTrack.hReturns the current value of the track attribute attributeKey.
-(id)attributeForKey:(NSString *)attributeKey
A list of supported track attributes and their acceptable values can be found in the “Constants” section.
QTTrack.hDeletes from a QTTrack the segment delimited by segment.
- (void)deleteSegment:(QTTimeRange)segment
If the track is not editable, this method raises an exception.
QTTrack.hAdds information to a QTTrack needed to support aperture modes for tracks created with applications and/or versions of QuickTime that did not support aperture mode dimensions.
- (void)generateApertureModeDimensions
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 YES for this track. Tracks that do not support aperture modes are not changed.
QTTrack.hIf a QTTrack object cannot be created, an NSError object is returned in the location pointed to by errorPtr.
- (id)initWithQuickTimeTrack:(Track)track error:(NSError **)errorPtr
Pass NIL if you do not want an NSError object returned.
QTTrack.hInserts into a QTTrack an empty segment delimited by the range range.
- (void)insertEmptySegmentAt:(QTTimeRange)range
If the track is not editable, this method raises an exception.
QTTrack.hInserts the specified segment from the track into the receiver, scaled to the range dstRange.
- (void)insertSegmentOfTrack:(QTTrack *)track fromRange:(QTTimeRange)srcRange scaledToRange:(QTTimeRange)dstRange
This is essentially an Add Scaled operation on a track. If the track is not editable, this method raises an exception.
QTTrack.hInserts into a QTTrack at time time the selection in movie delimited by the time range range.
- (void)insertSegmentOfTrack:(QTTrack *)track timeRange:(QTTimeRange)range atTime:(QTTime)time
If the track is not editable, this method raises an exception.
QTTrack.hReturns YES if the QTTrack object is currently enabled, NO otherwise.
- (BOOL)isEnabled
QTTrack.hReturns the media associated with a QTTrack object.
- (QTMedia *)media
QTTrack.hReturns the movie that contains a QTTrack object.
- (QTMovie *)movie
QTTrack.hReturns the QuickTime track associated with a QTTrack object.
-(Track)quickTimeTrack
QTTrack.hRemoves aperture mode dimension information from the target track.
- (void)removeApertureModeDimensions
It does not attempt to modify sample descriptions, so it may not completely reverse the effects of generateApertureModeDimensions. It sets the QTTrackHasApertureModeDimensionsAttribute property to NO.
QTTrack.hScales the QTTrack segment delimited by the segment segment so that it will have the new duration newDuration.
- (void)scaleSegment:(QTTimeRange)segment newDuration:(QTTime)newDuration
If the track is not editable, this method raises an exception.
QTTrack.hSets the dimensions of the target track for the specified movie aperture mode.
- (void)setApertureModeDimensions:(NSSize)dimensions forMode:(NSString *)mode
QTTrack.hSet the track attribute attributeKey to the value specified by the value parameter.
-(void)setAttribute:(id)value forKey:(NSString *)attributeKey
A list of supported track attributes and their acceptable values can be found in the “Constants” section.
QTTrack.hSets the enabled state of a QTTrack to enabled.
- (void)setEnabled:(BOOL)enabled
QTTrack.hSet the track attributes using the key-value pairs specified in the dictionary attributes.
-(void)setTrackAttributes:(NSDictionary *)attributes
A list of supported track attributes and their acceptable values can be found in the “Constants” section.
QTTrack.hSets the volume of a QTTrack to volume.
-(void)setVolume:(float)volume
The valid range is 0.0 to 1.0.
QTTrack.hReturns a dictionary containing the current values of all defined track attributes.
-(NSDictionary *)trackAttributes
A list of supported track attributes and their acceptable values can be found in the “Constants” section.
QTTrack.hReturns the volume of a QTTrack object.
-(float)volume
The valid range is 0.0 to 1.0.
QTTrack.hThe 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.
© 2009 Apple Inc. All Rights Reserved. (Last updated: 2009-03-04)