QTMedia Class Reference
| Inherits from | |
| Conforms to | |
| Framework | QTKit.framework |
| Availability | Available in Mac OS X v10.4 and later.
|
| Declared in | QTMedia.h
|
Overview
The QTMedia class represents a QuickTime media (of type Media). QTMedia objects are associated with QTTrack objects and support methods for getting and setting the media properties. If necessary, you can retrieve the media identifier associated with a QTMedia object by calling its quickTimeMedia: method. Note that a track has a single media.
Tasks
Creating a QTMedia
Initializing a QTMedia
Getting Media Properties
Setting Media Properties
Getting QTMedia Primitives
Class Methods
mediaWithQuickTimeMedia:error:
+ (id)mediaWithQuickTimeMedia:(Media)media error:(NSError **)errorPtr
Discussion
Creates a QTMedia object with data from the QuickTime media media. If a QTMedia 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.
Availability
- Available in Mac OS X v10.3 and later.
- Not available to 64-bit applications.
Declared In
QTMedia.hInstance Methods
attributeForKey:
- (id)attributeForKey:(NSString *)attributeKey
Discussion
Returns the current value of the media attribute attributeKey. A list of supported media attributes and their acceptable values can be found in “Constants.”
Availability
- Available in Mac OS X v10.3 and later.
Declared In
QTMedia.hhasCharacteristic:
- (BOOL)hasCharacteristic:(NSString *)characteristic
Discussion
Returns YES if a QTMedia object has the specified characteristic. See the list of constants given in “Constants” for the characteristics you can query.
Availability
- Available in Mac OS X v10.3 and later.
Declared In
QTMedia.hinitWithQuickTimeMedia:error:
- (id)initWithQuickTimeMedia:(Media)media error:(NSError **)errorPtr
Discussion
Initializes a newly created QTMedia object with data from the QuickTime media media. If a QTMedia 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.
Availability
- Available in Mac OS X v10.3 and later.
- Not available to 64-bit applications.
Declared In
QTMedia.hmediaAttributes
- (NSDictionary *)mediaAttributes
Discussion
Returns a dictionary containing the current values of all defined media attributes. A list of supported media attributes and their acceptable values can be found in “Constants.”
Availability
- Available in Mac OS X v10.3 and later.
Declared In
QTMedia.hquickTimeMedia
- (Media)quickTimeMedia
Discussion
Returns the QuickTime media associated with a QTMedia object.
Availability
- Available in Mac OS X v10.3 and later.
- Not available to 64-bit applications.
Declared In
QTMedia.hsetAttribute:forKey:
- (void)setAttribute:(id)value forKey:(NSString *)attributeKey
Discussion
Set the media attribute attributeKey to the value specified by the value parameter. A list of supported media attributes and their acceptable values can be found in “Constants.”
Availability
- Available in Mac OS X v10.3 and later.
Declared In
QTMedia.hsetMediaAttributes:
- (void)setMediaAttributes:(NSDictionary *)attributes
Discussion
Set the media attributes using the key-value pairs specified in the dictionary attributes. A list of supported media attributes and their acceptable values can be found in “Constants.”
Availability
- Available in Mac OS X v10.3 and later.
Declared In
QTMedia.htrack
- (QTTrack *)track
Discussion
Returns the QTTrack that contains a QTMedia object.
Availability
- Available in Mac OS X v10.3 and later.
Declared In
QTMedia.hConstants
The following constants specify the media attributes that you can get and set using the mediaAttributes and setMediaAttributes methods. To get or set a single attribute, use attributeForKey: or setAttribute:.
Note: The QTMediaTypeAttribute attribute indicates the type of media data contained in a QTMedia object. These constants are used to indicate media types, as shown in the portion of the table beginning with the QTMediaTypeVideo constant.
Constant | Description |
QTMediaCreationTimeAttribute | The creation time of a QTMedia object; the value for this key is of type NSDate. |
QTMediaDurationAttribute | The duration of a QTMedia object; the value for this key is of type NSValue, interpreted as a QTTime. |
QTMediaModificationTimeAttribute | The modification time of a QTMedia object; the value for this key is of type NSDate. |
QTMediaSampleCountAttribute | The media sample count; the value for this key is of type NSNumber, interpreted as a long. |
QTMediaQualityAttribute | The media quality; the value for this key is of type NSNumber, interpreted as a short. |
QTMediaTimeScaleAttribute | The media time scale; the value for this key is of type NSNumber, interpreted as a long. |
QTMediaTypeAttribute | The media type; the value for this key is of type NSString; see below for the values this attribute can return. |
QTMediaTypeVideo | Video media. |
QTMediaTypeSound | Sound media. |
QTMediaTypeText | Text media. |
QTMediaTypeBase | Base media. |
QTMediaTypeMPEG | MPEG media |
QTMediaTypeMusic | Music media |
QTMediaTypeTimeCode | Timecode media. |
QTMediaTypeSprite | Sprite media. |
QTMediaTypeFlash | Flash media. |
QTMediaTypeMovie | Movie media. |
QTMediaTypeTween | Tween media. |
QTMediaType3D | 3D media. |
QTMediaTypeSkin | Skin media |
QTMediaTypeQTVR | QuickTime VR media. |
QTMediaTypeHint | Hint media. |
QTMediaTypeStream | Stream media. |
Note: The constants beginning with QTMediaCharacteristic indicate the characteristics of a media that you can query using the hasCharacteristic method.
Constant | Description |
QTMediaCharacteristicVisual | The media has video data. This is a BOOL. |
QTMediaCharacteristicAudio | The media has audio data. This is a BOOL. |
QTMediaCharacteristicCanSendVideo | The media can send visual data to another track. This is a BOOL. |
QTMediaCharacteristicProvidesActions | The media has actions. This is a BOOL. |
QTMediaCharacteristicNonLinear | The media is non-linear. This is a BOOL. |
QTMediaCharacteristicCanStep | The media can step. This is a BOOL. |
QTMediaCharacteristicHasNoDuration | The media has no duration. This is a BOOL. |
QTMediaCharacteristicHasSkinData | The media has skin data. This is a BOOL. |
QTMediaCharacteristicProvidesKeyFocus | Key events can be focused at the media. This is a BOOL. |
QTMediaCharacteristicHasVideoFrameRate | The media has a video frame rate. This is a BOOL. |