Next Page > Hide TOC

QTMovie Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/QTKit.framework
Availability
Available in Mac OS X v10.4 and later.
Declared in
QTMovie.h
Related sample code

Overview

The QTMovie class represents both a QuickTime movie and a movie controller. A movie is a collection of playable and editable media content. It describes the sources and types of the media in that collection and their spatial and temporal organization. These collections may be used for presentation (such as playback on the screen) or for the organization of media for processing (such as composition and transcoding to a different compression type). The collection may be as simple as a single file that plays at its natural size for its intrinsic duration, or it may be very complex (with multiple sources of content, rich composition rules, interactivity, and a variety of contingencies).

Just as a QuickTime movie contains a set of tracks, each of which defines the type, the segments, and the ordering of the media data it presents, a QTMovie object is associated with instances of the QTTrack class. In turn, a QTTrack object is associated with a single QTMedia object.

A QTMovie object can be initialized from a file, from a resource specified by a URL, from a block of memory, from a pasteboard, or from an existing QuickTime movie.

Once a QTMovie object has been initialized, it will typically be used in combination with a QTMovieView for playback.

An exception, QTMovieUneditableException, is raised whenever the client attempts to directly or indirectly edit a QTMovie object that is not currently set as editable (for instance, by calling appendSelectionFromMovie: on an uneditable movie).

Tasks

Determining If a Movie Can Be Initialized

Getting a List of Supported File Types

Creating a Movie

Controlling Movie Playback

Managing Threaded Operations of Movie Objects

Initializing a QTMovie

Getting Information About a Movie and Its Chapters

Inspecting Movie Properties

Managing QTMovie Idling States

Setting QTMovie Properties

Setting Movie Attributes

Supporting Aperture Modes

Getting and Setting Selection Times

Getting Movie Tracks

Getting Movie Images

Storing Movie Data

Editing a Movie

Saving a Movie

Getting QTMovie Primitives

Getting and Setting QTMovie Delegates

Class Methods

canInitWithDataReference:

Returns YES if the specified data reference can be used to initialize a QTMovie object.

+ (BOOL)canInitWithDataReference:(QTDataReference*)dataReference

Availability
Declared In
QTMovie.h

canInitWithFile:

Returns YES if the contents of the specified file can be used to initialize a QTMovie object.

+ (BOOL)canInitWithFile:(NSString *)fileName

Availability
Related Sample Code
Declared In
QTMovie.h

canInitWithPasteboard:

Returns YES if the contents of the specified pasteboard can be used to initialize a QTMovie object.

+ (BOOL)canInitWithPasteboard:(NSPasteboard *)pasteboard

Availability
Declared In
QTMovie.h

canInitWithURL:

Returns YES if the contents of the specified URL can be used to initialize a QTMovie object.

+ (BOOL)canInitWithURL:(NSURL *)url

Availability
Declared In
QTMovie.h

enterQTKitOnThread

Performs any QuickTime-specific initialization for the current (non-main) thread; must be paired with a call to exitQTKitOnThread.

+ (void)enterQTKitOnThread

Availability
Declared In
QTMovie.h

enterQTKitOnThreadDisablingThreadSafetyProtection

Performs any QuickTime-specific initialization for the current (non-main) thread, allowing non-threadsafe components; must be paired with a call to exitQTKitOnThread.

+ (void)enterQTKitOnThreadDisablingThreadSafetyProtection

Availability
Related Sample Code
Declared In
QTMovie.h

exitQTKitOnThread

Performs any QuickTime-specific shut-down for the current (non-main) thread; must be paired with a call to enterQTKitOnThread or enterQTKitOnThreadDisablingThreadSafetyProtection.

+ (void)exitQTKitOnThread

Availability
Related Sample Code
Declared In
QTMovie.h

movie

Creates an empty QTMovie object.

+ (id)movie

Availability
Related Sample Code
Declared In
QTMovie.h

movieFileTypes:

Returns an array of file types that can be opened as QuickTime movies.

+ (NSArray *)movieFileTypes:(QTMovieTypeOptions)types

Discussion

Passing zero as the options parameter returns an array of all the common file types that QuickTime can open in place on the current system. This array includes the file type .mov and .mqv, and any files types that can be opened using a movie importer that does not need to write data into a new file while performing the import. This array excludes any file types for still images and any file types that require an aggressive movie importer (for instance, the movie importer for text files). The following values can be used to include some or all of the file types that are normally excluded:

enum {
    QTIncludeStillImageTypes  =  1 << 0,
    QTIncludeTranslatableTypes =  1 << 1,
    QTIncludeAggressiveTypes =  1 << 2,
    QTIncludeCommonTypes = 0,
    QTIncludeAllTypes = 0xffff
} QTMovieFileTypeOptions;

Constants

Description

QTIncludeStillImageTypes

Available in Mac OS X v10.3 and later.

This value adds to the array all file types for still images that can be opened using a graphics importer.

QTIncludeTranslatableTypes

Available in Mac OS X v10.3 and later.

Declared in QTMovie.h.

This value adds to the array all file types for files that can be opened using a movie importer but for which a new file must be created.

QTIncludeAggressiveTypes

Available in Mac OS X v10.3 and later.

Declared in QTMovie.h.

This value adds to the array all file types for files that can be opened using a movie importer but that are not commonly used in connection with movies (for instance, text or HTML files).

QTIncludeCommonTypes

Available in Mac OS X v10.3 and later.

Declared in QTMovie.h.

This value adds to the array all common file types that QuickTime can open in place on the current system.

QTIncludeAllTypes

Available in Mac OS X v10.3 and later.

Declared in QTMovie.h.

This value adds to the array all file types that QuickTime can open on the current system, using any available movie or graphics importer.

Related Sample Code
Declared In
QTMovie.h

movieNamed:error:

Creates a QTMovie object initialized with the data from the QuickTime movie of the specified name in the application’s bundle.

+ (id)movieNamed:(NSString *)name error:(NSError **)errorPtr

Discussion

If a QTMovie 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
Related Sample Code
Declared In
QTMovie.h

movieTypesWithOptions:

Returns an array of UTIs that QuickTime can open.

+ (NSArray *)movieTypesWithOptions:(QTMovieFileTypeOptions)types

Discussion

This method gets an array of NSString objects that specify the uniform type identifiers (UTIs) for types of files that QuickTime can open. The types parameter is interpreted just like the types parameter to + (NSArray *)movieFileTypes:(QTMovieFileTypeOptions)types.

Availability
Declared In
QTMovie.h

movieUnfilteredFileTypes

Returns an array of file types that can be used to initialize a QTMovie object.

+ (NSArray *)movieUnfilteredFileTypes

Availability
Related Sample Code
Declared In
QTMovie.h

movieUnfilteredPasteboardTypes

Returns an array of pasteboard types that can be used to initialize a QTMovie object.

+ (NSArray *)movieUnfilteredPasteboardTypes

Availability
Declared In
QTMovie.h

movieWithAttributes:error:

Creates a QTMovie object initialized with the attributes specified in attributes.

+ (id)movieWithAttributes:(NSDictionary *)attributes error:(NSError **)errorPtr

Discussion

If a QTMovie 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.

A new QTMovie object is created using the specified attributes. There are three types of attributes that can be included in this dictionary:

The following is a list of the keys that specify the location of the movie data; at least one of these must occur in the dictionary. If more than one occurs, the first one in the dictionary is used.

Attribute

Description

QTMovieFileNameAttribute

The file name string of a QTMovie object; the value for this key is of type NSString.

QTMovieURLAttribute

The URL of a QTMovie object; the value for this key is of type NSURL.

QTMovieDataReferenceAttribute

The data reference of a QTMovie object; the value for this key is of type QTDataReference.

QTMoviePasteboardAttribute

The pasteboard representation of a QTMovie object; the value for this key is of type NSPasteboard.

QTMovieDataAttribute

The data representation of a QTMovie object; the value for this key is of type NSData.

The following is a list of the keys that specify movie instantiation options; none of these keys is required. If a key is missing, the specified default value is used.

Attribute

Description

QTMovieFileOffsetAttribute

The file offset of a QTMovie. The value for this key is of type NSNumber, which is interpreted as a long long. The default is 0.

QTMovieResolveDataRefsAttribute

The resolved data reference of a QTMovie. The value for this key is of type NSNumber, which is interpreted as a BOOL. Default: YES. If NO, QTMovie makes no attempt to resolve any external data references in a movie file.

QTMovieAskUnresolvedDataRefsAttribute

The asked unresolved data reference setting of a QTMovie. The value for this key is of type NSNumber, which is interpreted as a BOOL. Default: YES. If YES, QTMovie may display a dialog box prompting the user to help resolve any unresolved external data references in a movie file.

QTMovieOpenAsyncOKAttribute

The allowed synchronization opening setting of a QTMovie. The value for this key is of type NSNumber, which is interpreted as a BOOL. Default: YES. If YES, the initialization method returns immediately with a non-nil QTMovie object; however, the movie data might not all be loaded yet, so you may need to check the movie load state before performing certain operations on the movie. If NO, the movie data is loaded synchronously; when the initialization method returns with a non-nil QTMovie object, its data is completely loaded.

The following is a list of the new keys that specify movie playback characteristics or other properties of the QTMovie object; most other existing movie attributes can be included as well.

Attribute

Description

QTMovieAutoAlternatesAttribute

The auto-alternate setting of a QTMovie object. The value for this key is of type NSNumber, interpreted as a BOOL.

QTMovieIsActiveAttribute

The active setting; the value for this key is of type NSNumber, interpreted as a BOOL.

QTMovieDelegateAttribute

The delegate for a QTMovie object. The value for this key is of type NSObject.

Availability
Declared In
QTMovie.h

movieWithData:error:

Creates a QTMovie object initialized with the data specified by data.

+ (id)movieWithData:(NSData *)data error:(NSError **)errorPtr

Discussion

If a QTMovie 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
Related Sample Code
Declared In
QTMovie.h

movieWithDataReference:error:

Creates a QTMovie object intitalized with the data specified by the data reference dataReference.

+ (id)movieWithDataReference:(QTDataReference *)dataReference error:(NSError **)errorPtr

Discussion

If a QTMovie 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
Declared In
QTMovie.h

movieWithFile:error:

Creates a QTMovie object initialized with the data in the file specified by the name fileName.

+ (id)movieWithFile:(NSString *)fileName error:(NSError **)errorPtr

Discussion

The fileName is assumed to be a full path name for a file.

If a QTMovie 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
Related Sample Code
Declared In
QTMovie.h

movieWithPasteboard:error:

Creates a QTMovie object initialized with the contents of the pasteboard specified by pasteboard.

+ (id)movieWithPasteboard:(NSPasteboard *)pasteboard error:(NSError **)errorPtr

Discussion

These contents can be a QuickTime movie (of type Movie), a file path, or data of type QTMoviePasteboardType.

If a QTMovie 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
Declared In
QTMovie.h

movieWithQuickTimeMovie:disposeWhenDone:error:

Creates a QTMovie object initialized with the data from an existing QuickTime movie movie.

+ (id)movieWithQuickTimeMovie:(Movie)movie disposeWhenDone:(BOOL)dispose error:(NSError **)errorPtr

Discussion

The dispose parameter (a BOOL) indicates whether the QTKit should call DisposeMovie on the specified movie when the QTMovie object is deallocated. Passing YES effectively transfers “ownership” of the Movie to the QTKit. (Note that most applications will probably want to pass YES; passing NO means that the application wants to call DisposeMovie itself, perhaps so that it can operate on a Movie after it has been disassociated with a QTMovie object.)

If a QTMovie 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.

Note that command-line tools that pass NO for the disposeWhenDone parameter must make sure to release the active autorelease pool before calling DisposeMovie on the specified QuickTime movie. Failure to do this may result in a crash. Tools that need to call DisposeMovie before releasing the main autorelease pool can create another autorelease pool associated with the movie.

Availability
Related Sample Code
Declared In
QTMovie.h

movieWithURL:error:

Creates a QTMovie object initialized with the data in the URL specified by url.

+ (id)movieWithURL:(NSURL *)url error:(NSError **)errorPtr

Discussion

If a QTMovie 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
Related Sample Code
Declared In
QTMovie.h

Instance Methods

addChapters

Adds chapters to the receiver using the information specified in the chapters array. 

- (void)addChapters:(NSArray *)chapters withAttributes:(NSDictionary *)attributes error:(NSError **)errorPtr

Discussion

Each array element is an NSDictionary containing key-value pairs. Currently two keys are defined for this dictionary, QTMovieChapterName and QTMovieChapterStartTime. The value for the QTMovieChapterName key is an NSString object that is the chapter name. The value for the QTMovieChapterStartTime key is an NSValue object that wraps a QTTime structure that indicates the start time of the chapter. The receiving QTMovie object must be editable or an exception will be raised.

The attributes dictionary specifies additional attributes for the chapters. Currently only one key is recognized for this dictionary, QTMovieChapterTargetTrackAttribute, which specifies the QTTrack in the receiver that is the target of the chapters; if none is specified, this method uses first video track in movie. If no video track is in the movie, this method uses the first audio track in the movie. If no audio track is in the movie, this method uses the first track in the movie. If an error occurs and errorPtr is non-NULL, then an NSError object is returned in that location.

Availability

addImage:forDuration:withAttributes:

Adds 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

Discussion

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.) The attributes dictionary can also contain a value for the QTTrackTimeScaleAttribute key, which is used as the time scale of the new track, should one need to be created. The default time scale for a new track is 600.

Availability
Related Sample Code
Declared In
QTMovie.h

appendSelectionFromMovie:

Appends to a QTMovie the current selection in movie.

- (void)appendSelectionFromMovie:(id)movie

Discussion

If the movie is not editable, this method raises an exception.

Availability
Declared In
QTMovie.h

attachToCurrentThread

Attaches the receiver to the current thread; returns YES if successful, NO otherwise.

- (BOOL)attachToCurrentThread

Availability
Related Sample Code
Declared In
QTMovie.h

attributeForKey:

Returns the current value of the movie attribute attributeKey.

- (id)attributeForKey:(NSString *)attributeKey

Discussion

A list of supported movie attributes and their acceptable values can be found in the “Constants” section.

Availability
Related Sample Code
Declared In
QTMovie.h

autoplay

Sets a movie to start playing when a sufficient amount of media data is available.

- (void)autoplay

Discussion

The autoplay method configures a QTMovie object to begin playing as soon as enough data is available that the playback can continue uninterrupted to the end of the movie. This is most useful for movies being loaded from a remote URL or from an extremely slow local device. For movies stored on most local devices, this method has the same effect as the -[QTMovie play] method.

Availability
Declared In
QTMovie.h

canUpdateMovieFile

Indicates whether a movie file can be updated with changes made to the movie object.

- (BOOL)canUpdateMovieFile

Discussion

This method returns NO if any of the following conditions are true:

Otherwise, the method returns YES.

Using this method, an application can check first to see if the movie file can be updated; if not, it can prompt the user for a new name and location of a file in which to save the updated movie.

Availability
Declared In
QTMovie.h

chapterCount

Returns the number of chapters in the receiver, or 0 if there are no chapters.

- (NSInteger)chapterCount

Availability
Declared In
QTMovie.h

chapterIndexForTime:

Returns the 0-based index of the chapter that contains the specified movie time.

- (NSInteger)chapterIndexForTime:(QTTime)time

Availability
Declared In
QTMovie.h

chapters

Returns an NSArray containing information about the chapters in the receiver.

- (NSArray *)chapters

Discussion

Each array element is an NSDictionary containing key-value pairs. Currently two keys are defined for this dictionary, QTMovieChapterName and QTMovieChapterStartTime. The value for the QTMovieChapterName key is an NSString object that is the chapter name. The value for the QTMovieChapterStartTime key is an NSValue object that wraps a QTTime structure that indicates the start time of the chapter.

Availability
Declared In
QTMovie.h

currentFrameImage

Returns an NSImage for the frame at the current time in a QTMovie.

- (NSImage *)currentFrameImage

Availability
See Also
Declared In
QTMovie.h

currentTime

Returns the current time of a QTMovie object as a structure of type QTTime.

- (QTTime)currentTime

Availability
Declared In
QTMovie.h

delegate

Returns the delegate of a QTMovie object.

- (id)delegate

Availability
Declared In
QTMovie.h

deleteSegment:

Deletes from a QTMovie the segment delimited by segment.

- (void)deleteSegment:(QTTimeRange)segment

Discussion

If the movie is not editable, this method raises an exception.

Availability
Related Sample Code
Declared In
QTMovie.h

detachFromCurrentThread

Detaches the receiver from the current thread; returns YES if successful, NO otherwise.

- (BOOL)detachFromCurrentThread

Discussion

These methods allow applications to manage QTMovie objects on non-main threads. Before any QTKit operations can be performed on a secondary thread, either enterQTKitOnThread or enterQTKitOnThreadDisablingThreadSafetyProtection must be called, and exitQTKitOnThread must be called before exiting the thread. A QTMovie object can be migrated from one thread to another by first calling detachFromCurrentThread on the first thread and then attachToCurrentThread on the second thread.

Availability
Related Sample Code
Declared In
QTMovie.h

duration

Returns the duration of a QTMovie object as a structure of type QTTime.

- (QTTime)duration

Availability
Related Sample Code
Declared In
QTMovie.h

frameImageAtTime:

Returns an NSImage for the frame at the time time in a QTMovie.

- (NSImage *)frameImageAtTime:(QTTime)time

Availability
See Also
Declared In
QTMovie.h

frameImageAtTime:withAttributes:error:

Returns an NSImage*, CIImage*, CGImageRef, CVPixelBufferRef, or CVOpenGLTextureRef for the movie image at the specified time

- (void *)frameImageAtTime:(QTTime)time withAttributes:(NSDictionary *)attributes error:(NSError **)errorPtr

Discussion

if an error occurs and the desired type of image cannot be created, then this returns nil and sets errorPtr to an NSError * describing the error. The dictionary of attributes can contain these keys:

Note: All images returned by this method are autoreleased objects and must be retained by the caller if they are to be accessed outside of the current run loop cycle.

Availability
Declared In
QTMovie.h

generateApertureModeDimensions

Adds information to a QTMovie needed to support aperture modes for tracks created with applications and/or versions of QuickTime that did not support aperture mode dimensions.

- (void)generateApertureModeDimensions

Discussion

If the image descriptions in video tracks 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 those tracks. Tracks that do not support aperture modes are not changed.

Availability
Declared In
QTMovie.h

gotoBeginning

Repositions the play position to the beginning of the movie.

- (void)gotoBeginning

Discussion

If the movie is playing, the movie continues playing from the new position.

Availability
Declared In
QTMovie.h

gotoEnd

Repositions the play position to the end of the movie.

- (void)gotoEnd

Discussion

If the movie is playing in one of the looping modes, the movie continues playing accordingly; otherwise, play stops.

Availability
Declared In
QTMovie.h

gotoNextSelectionPoint

Repositions the movie to the next selection point.

- (void)gotoNextSelectionPoint

Availability
Declared In
QTMovie.h

gotoPosterFrame

Repositions the play position to the movie’s poster time.

- (void)gotoPosterFrame

Discussion

If no poster time is defined, the movie jumps to the beginning. If the movie is playing, the movie continues playing from the new position.

gotoPreviousSelectionPoint

Repositions the movie to the previous selection point.

- (void)gotoPreviousSelectionPoint

Availability
Declared In
QTMovie.h

hasChapters

Returns YES if the receiver has chapters, NO otherwise.

- (BOOL)hasChapters

Availability
Declared In
QTMovie.h

initToWritableData:error:

Useful for directly passing filenames and data objects. The QTMovie returned by this method is editable.

- (id)initToWritableData:(NSMutableData *)data error:(NSError **)errorPtr

Discussion

These methods––initToWritableDataReference:error:, initToWritableFile:error: and initToWritableData:error:––create an empty, writable storage container to which media data can be added (for example, using the QTMovie addImage method). The methods return QTMovie objects associated with those containers.

Availability
Declared In
QTMovie.h

initToWritableDataReference:error:

Creates a new storage container at the location specified by dataReference and returns a QTMovie object that has that container as its default data reference.

- (id)initToWritableDataReference:(QTDataReference *)dataReference error:(NSError **)errorPtr

Availability
Declared In
QTMovie.h

initToWritableFile:error:

Useful for directly passing filenames and data objects. The QTMovie returned by this method is editable.

- (id)initToWritableFile:(NSString *)filename error:(NSError **)errorPtr

Availability
Related Sample Code
Declared In
QTMovie.h

initWithAttributes:error:

Initializes a QTMovie object with the attributes specified in attributes.

- (id)initWithAttributes:(NSDictionary *)attributes error:(NSError **)errorPtr

Discussion

If a QTMovie 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.

A new QTMovie object is created using the specified attributes. There are three types of attributes that can be included in this dictionary:

The following is a list of the keys that specify the location of the movie data; at least one of these must occur in the dictionary. If more than one occurs, the first one in the dictionary is used.

Attribute

Description

QTMovieFileNameAttribute

The file name string of a QTMovie object; the value for this key is of type NSString.

QTMovieURLAttribute

The URL of a QTMovie object; the value for this key is of type NSURL.

QTMovieDataReferenceAttribute

The data reference of a QTMovie object; the value for this key is of type QTDataReference.

QTMoviePasteboardAttribute

The pasteboard of a QTMovie object; the value for this key is of type NSPasteboard.

QTMovieDataAttribute

The data of a QTMovie object; the value for this key is of type NSData.

The following is a list of the keys that specify movie instantiation options; none of these keys is required. If a key is missing, the specified default value is used.

Attribute

Description

QTMovieFileOffsetAttribute

The file offset of a QTMovie. The value for this key is of type NSNumber, which is interpreted as a long long. The default is 0.

QTMovieResolveDataRefsAttribute

The resolved data reference setting of a QTMovie. The value for this key is of type NSNumber, which is interpreted as a BOOL. Default: YES.

QTMovieAskUnresolvedDataRefsAttribute

The asked unresolved data reference of a QTMovie. The value for this key is of type NSNumber, which is interpreted as a BOOL. Default: YES.

QTMovieOpenAsyncOKAttribute

The opened synchronization of a QTMovie. The value for this key is of type NSNumber, which is interpreted as a BOOL. Default: YES.

The following is a list of the new keys that specify movie playback characteristics or other properties of the QTMovie object; most other existing movie attributes can be included as well.

Attribute

Description

QTMovieAutoAlternatesAttribute

The auto-alternate of a QTMovie object. The value for this key is of type NSNumber, interpreted as a BOOL.

QTMovieIsActiveAttribute

The active setting; the value for this key is of type NSNumber, interpreted as a BOOL.

QTMovieDontInteractWithUserAttribute

When set in a dictionary passed to movieWithAttributes or initWithAttributes, this prevents QuickTime from interacting with the user during movie initialization. The value for this key is of type NSNumber, interpreted as a BOOL.

QTMovieDelegateAttribute

The delegate for a QTMovie object. The value for this key is of type NSObject.

Availability
Related Sample Code
Declared In
QTMovie.h

initWithData:error:

Initializes a QTMovie object with the data specified by data.

- (id)initWithData:(NSData *)data error:(NSError **)errorPtr

Discussion

If a QTMovie 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
Declared In
QTMovie.h

initWithDataReference:error:

Initializes a QTMovie object with the data reference setting specified by dataReference.

- (id)initWithDataReference:(QTDataReference *)dataReference error:(NSError **)errorPtr

Discussion

If a QTMovie 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
Declared In
QTMovie.h

initWithFile:error:

Initializes a QTMovie object with the data in the file specified by the name fileName.

- (id)initWithFile:(NSString *)fileName error:(NSError **)errorPtr

Discussion

The fileName is assumed to be a full path name for a file. If a QTMovie 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.

Note that alias files should not be passed into this method; the client application is responsible for resolving aliases before handing them to QTKit methods.

Availability
Related Sample Code
Declared In
QTMovie.h

initWithMovie:timeRange:error:

Initializes a QTMovie object with some or all of the data from an existing QTMovie object movie.

- (id)initWithMovie:(QTMovie *)movie timeRange:(QTTimeRange)range error:(NSError **)errorPtr

Discussion

The section of data used is delimited by the range range. If a QTMovie 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
Declared In
QTMovie.h

initWithPasteboard:error:

Initializes a QTMovie object with the contents of the pasteboard specified by pasteboard.

- (id)initWithPasteboard:(NSPasteboard *)pasteboard error:(NSError **)errorPtr

Discussion

These contents can be a QuickTime movie (of type Movie), a file path, or data of type QTMoviePasteBoardType. If a QTMovie 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
Declared In
QTMovie.h

initWithQuickTimeMovie:disposeWhenDone:error:

Initializes a QTMovie object with the data from an existing QuickTime movie movie.

- (id)initWithQuickTimeMovie:(Movie)movie disposeWhenDone:(BOOL)dispose error:(NSError **)errorPtr

Discussion

This is the designated initializer for the QTMovie class. The dispose parameter (a BOOL) indicates whether the QTKit should call DisposeMovie on the specified movie when the QTMovie object is deallocated. Passing YES effectively transfers “ownership” of the Movie to the QTKit. (Note that most applications will probably want to pass YES; passing NO means that the application wants to call DisposeMovie itself, perhaps so that it can operate on a Movie after it has been disassociated from a QTMovie object.)

If a QTMovie 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
Declared In
QTMovie.h

initWithURL:error:

Initializes a QTMovie object with the data in the URL specified by url.

- (id)initWithURL:(NSURL *)url error:(NSError **)errorPtr

Discussion

If a QTMovie 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
Related Sample Code
Declared In
QTMovie.h

insertEmptySegmentAt:

inserts into a QTMovie an empty segment delimited by the range range.

- (void)insertEmptySegmentAt:(QTTimeRange)range

Discussion

If the movie is not editable, this method raises an exception.

Availability
Declared In
QTMovie.h

insertSegmentOfMovie:fromRange:scaledToRange:

Inserts the specified segment from the movie into the receiver, scaled to the range dstRange.

- (void)insertSegmentOfMovie:(QTMovie *)movie fromRange:(QTTimeRange)srcRange scaledToRange:(QTTimeRange)dstRange

Discussion

This is essentially an Add Scaled operation on a movie. If the movie is not editable, this method raises an exception.

Availability
Declared In
QTMovie.h

insertSegmentOfMovie:timeRange:atTime:

Inserts into a QTMovie at time time the selection in movie delimited by the time range range.

- (void)insertSegmentOfMovie:(QTMovie *)movie timeRange:(QTTimeRange)range atTime:(QTTime)time

Discussion

If the movie is not editable, this method raises an exception.

Availability
Related Sample Code
Declared In
QTMovie.h

isIdling

Returns the current idling state of a QTMovie object.

- (BOOL)isIdling

Discussion

This method allows you to manage the idling state of a QTMovie object, that is, whether it is being tasked. Note that movies attached to a background thread should not be idled; if they are idled, unexpected behavior can result.

Availability
Declared In
QTMovie.h

movieAttributes

Returns a dictionary containing the current values of all defined movie attributes.

- (NSDictionary *)movieAttributes

Discussion

A list of supported movie attributes and their acceptable values can be found in the “Constants” section.

Availability
Declared In
QTMovie.h

movieFormatRepresentation

Returns the movie’s data in an NSData object.

- (NSData *)movieFormatRepresentation

Availability
See Also
Related Sample Code
Declared In
QTMovie.h

movieWithTimeRange:error:

Returns a QTMovie object whose data is the data in the specified time range.

- (id)movieWithTimeRange:(QTTimeRange)range error:(NSError **)errorPtr

Discussion

If a QTMovie 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
Declared In
QTMovie.h

muted

Returns the movie’s mute setting.

- (BOOL)muted

Availability
Declared In
QTMovie.h

play

Plays the movie.

- (void)play

Availability
Related Sample Code
Declared In
QTMovie.h

posterImage

Returns an NSImage for the poster frame of a QTMovie.

- (NSImage *)posterImage

Availability
See Also
Related Sample Code
Declared In
QTMovie.h

quickTimeMovie

Returns the QuickTime movie associated with a QTMovie object.

- (Movie)quickTimeMovie

Availability
See Also
Related Sample Code
Declared In
QTMovie.h

quickTimeMovieController

Returns the QuickTime movie controller associated with a QTMovie object.

- (MovieController)quickTimeMovieController

Availability
See Also
Related Sample Code
Declared In
QTMovie.h

rate

Returns the current rate of a QTMovie object.

- (float)rate

Availability
Related Sample Code
Declared In
QTMovie.h

removeApertureModeDimensions

Removes aperture mode dimension information from a movie's tracks.

- (void)removeApertureModeDimensions

Discussion

This method does not attempt to modify sample descriptions, so it may not completely reverse the effects of generateApertureModeDimensions. It sets the QTMovieHasApertureModeDimensionsAttribute property to NO.

Availability
Declared In
QTMovie.h

removeChapters

 Removes any existing chapters from the receiver.

- (BOOL)removeChapters

Discussion

Returns YES if either the receiver had no chapters or the chapters were successfully removed from the receiver. Returns NO if the chapters could not for some reason be removed from the receiver. The receiving QTMovie object must be editable or an exception will be raised.

Availability
Declared In
QTMovie.h

replaceSelectionWithSelectionFromMovie:

Replaces the current selection in a QTMovie with the current selection in movie.

- (void)replaceSelectionWithSelectionFromMovie:(id)movie

Discussion

If the movie is not editable, this method raises an exception.

Availability
Declared In
QTMovie.h

scaleSegment:newDuration:

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

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

Discussion

If the movie is not editable, this method raises an exception.

Availability
Declared In
QTMovie.h

selectionDuration

Returns the duration of the movie’s current selection as a QTTime structure.

- (QTTime)selectionDuration

Availability
Declared In
QTMovie.h

selectionEnd

Returns the end point of the movie’s current selection as a QTTime structure.

- (QTTime)selectionEnd

Availability
Declared In
QTMovie.h

selectionStart

Returns the start time of the movie’s current selection as a QTTime structure.

- (QTTime)selectionStart

Availability
Declared In
QTMovie.h

setAttribute:forKey:

Set the movie attribute attributeKey to the value specified by the value parameter.

- (void)setAttribute:(id)value forKey:(NS String *)attributeKey

Discussion

A list of supported movie attributes and their acceptable values can be found in the “Constants” section.

Availability
Related Sample Code
Declared In
QTMovie.h

setCurrentTime:

Sets the movie’s current time setting to time.

- (void)setCurrentTime:(QTTime)time

Availability
Declared In
QTMovie.h

setDelegate:

Sets the movie’s delegate to delegate.

- (void)setDelegate:(id)delegate

Availability
Related Sample Code
Declared In
QTMovie.h

setIdling:

Sets the movie to idle YES or not to idle NO.

- (void)setIdling:(BOOL)state

Discussion

This method allows you to manage the idling state of a QTMovie object, that is, whether it is being tasked. Note that movies attached to a background thread should not be idled; if they are idled, unexpected behavior can result.

Availability
Declared In
QTMovie.h

setMovieAttributes:

Set the movie attributes using the key-value pairs specified in the dictionary attributes.

- (void)setMovieAttributes:(NSDictionary *)attributes

Discussion

A list of supported movie attributes and their acceptable values can be found in the “Constants” section.

Availability
Declared In
QTMovie.h

setMuted:

Sets the movie’s mute setting to mute.

- (void)setMuted:(BOOL)mute

Discussion

Note that this does not affect the volume.

Availability
Declared In
QTMovie.h

setRate:

Sets the movie’s rate to rate.

- (void)setRate:(float)rate

Discussion

For instance, 0.0 is stop, 1.0 is playback at normal speed, 2.0 is twice normal speed, and so on.

Availability
Related Sample Code
Declared In
QTMovie.h

setSelection:

Sets the movie’s selection to selection.

- (void)setSelection:(QTTimeRange)selection

Availability
Declared In
QTMovie.h

setVolume:

Sets the movie’s volume to volume.

- (void)setVolume:(float)volume

Discussion

Note that this does not affect the movie’s stored settings.

Availability
Declared In
QTMovie.h

startTimeOfChapter:

Returns a QTTime structure that is the start time of the chapter having the specified 0-based index in the list of chapters.

- (QTTime)startTimeOfChapter:(NSInteger)chapterIndex

Availability
Declared In
QTMovie.h

stepBackward

Sets the movie backward a single frame.

- (void)stepBackward

Availability
Declared In
QTMovie.h

stepForward

Sets the movie forward a single frame.

- (void)stepForward

Availability
Declared In
QTMovie.h

stop

Stops the movie playing.

- (void)stop

Availability
Related Sample Code
Declared In
QTMovie.h

tracks

Returns an array of QTTrack objects associated with the receiver.

- (NSArray *)tracks

Availability
Related Sample Code
Declared In
QTMovie.h

tracksOfMediaType:

Returns an array of tracks with the specified media type.

- (NSArray *)tracksOfMediaType:(NSString *)type

Discussion

The type parameter should be one of the media types defined by constants in QTMedia.h beginning with "QTMediaType", for instance, QTMediaTypeVideo.

Availability
Related Sample Code
Declared In
QTMovie.h

updateMovieFile

Updates the movie file of a QTMovie.

- (BOOL)updateMovieFile

Discussion

Returns YES if the update succeeds and NO otherwise.

Availability
Related Sample Code
Declared In
QTMovie.h

volume

Returns the movie’s volume as a scalar value of type float.

- (float)volume

Discussion

The valid range is 0.0 to 1.0.

Availability
Declared In
QTMovie.h

writeToFile:withAttributes:

Returns YES if the movie file was successfully created and NO otherwise.

- (BOOL)writeToFile:(NSString *)fileNamewithAttributes :(NSDictionary *)attributes

Discussion

This method returns YES if the movie file was successfully created and NO otherwise. NO will also be returned if the load state of the target is less than QTMovieLoadStateComplete, in which case no attempt is made to write the QTMovie into a file. If the dictionary attributes contains an object whose key is QTMovieFlatten, then the movie is flattened into the specified file. If the dictionary attributes contains an object whose key is QTMovieExport, then the movie is exported into the specified file using a movie exporter whose type is specified by the value of the key QTMovieExportType. The value associated with the QTMovieExportSettings key should be an object of type NSData that contains an atom container of movie export settings.

Availability
See Also
Related Sample Code
Declared In
QTMovie.h

writeToFile:withAttributes:error:

Returns an NSError object if an error occurs and if errorPtr is non-NULL.

- (BOOL)writeToFile:(NSString *)fileName withAttributes:(NSDictionary *)attributes error:(NSError **)errorPtr

Discussion

The method operates exactly like the existing QTMovie writeToFile:withAttributes method.

Availability
See Also
Declared In
QTMovie.h

Delegate Methods

externalMovie:

This method is called, if implemented by a QTMovie delegate object, when an external movie needs to be found (usually for a wired action targeted at an external movie).

- (QTMovie *)externalMovie:(NSDictionary *)dictionary

Discussion

The keys for the dictionary in this delegate method are: QTMovieTargetIDNotificationParameter and QTMovieTargetNameNotificationParameter. The QTMovieTargetIDNotificationParameter key indicates that the delegate should return a QTMovie object that has the specified movie ID. The QTMovieTargetNameNotificationParameter key indicates that the delegate should return a QTMovie object that has the specified movie name.

Availability
Declared In
QTMovie.h

movie:linkToURL:

Called to handle the mcAction mcActionLinkToURL.

- (BOOL)movie:(QTMovie *)movielinkToURL :(NSURL *)url

Discussion

Most applications will not need to install a delegate to handle this.

Availability
Declared In
QTMovie.h

movie:shouldContinueOperation:withPhase:atPercent:withAttributes:

If implemented, this method is called periodically during lengthy operations (such as exporting a movie).

- (BOOL)movie:(QTMovie *)movieshouldContinueOperation :(NSString *)opwithPhase :(QTMovieOperationPhase)phaseatPercent :(NSNumber *)percentwithAttributes :(NSDictionary *)attributes

Discussion

A delegate can implement this method. The op string is a localized string that indicates what the operation is. The phase indicates whether the operation is just beginning, ending, or is at a certain percentage of completion. If the phase is QTMovieOperationUpdatePercentPhase, then the percent parameter indicates the percentage of the operation completed. The attributes dictionary may be NIL; if not NIL, it is the same dictionary passed to a QTMovie method that caused the lengthy operation (for example, the attributes dictionary passed to writeToFile). The constants for this method are defined as follows:

typedef enum {
    QTMovieOperationBeginPhase = movieProgressOpen,
    QTMovieOperationUpdatePercentPhase = movieProgressUpdatePercent,
    QTMovieOperationEndPhase = movieProgressClose
}
Availability
Declared In
QTMovie.h

movieShouldTask:

If a QTMovie object has a delegate and that delegate implements this method, that method will be called before QTKit performs the standard idle processing on a movie.

- (BOOL)movieShouldTask:(id)movie

Discussion

The delegate can cancel that normal processing by returning YES.

Availability
Declared In
QTMovie.h

Constants

The following constants specify the movie attributes that you can get and set using the movieAttributes and setMovieAttributes methods. To get or set a single attribute, use attributeForKey or setAttribute.

Constant

Description

QTMovieActiveSegmentAttribute

The active segment of a QTMovie object; the value for this key is of type NSValue, interpreted as a QTTimeRange structure. (Deprecated. This constant is available in Mac OS X 10.4 and later, but deprecated in Mac OS X 10.5.)

QTMovieApertureModeAttribute

Sets the aperture mode attribute on a QTMovie object to indicate whether aspect ratio and clean aperture correction should be performed. When a movie is in clean, production, or encoded pixels aperture mode, each track's dimensions are overridden by special dimensions for that mode. The original track dimensions are preserved and can be restored by setting the movie into classic aperture mode. Aperture modes are not saved in movies. The associated value is of type NSString and is assumed to be one of the following strings:

QTMovieApertureModeClassic. No aspect ratio or clean aperture correction is performed. This is the default aperture mode and provides compatibility with behavior in QuickTime 7.0.x and earlier. If you call -[QTTrack setDimensions], the movie is automatically switched to classic mode.

QTMovieApertureModeClean. An aperture mode for general display. Where possible, video will be displayed at the correct pixel aspect ratio, trimmed to the clean aperture. A movie in clean aperture mode sets each track’s dimensions to match the size returned by -[QTTrack apertureModeDimensionsForMode:QTMovieApertureModeClean]. QTMovieApertureModeProduction.

QTMovieApertureModeProduction. An aperture mode for modal use in authoring applications. Where possible, video will be displayed at the correct pixel aspect ratio, but without trimming to the clean aperture so that the edge processing region can be viewed. A movie in production aperture mode sets each track's dimensions to match the size returned by -[QTTrack apertureModeDimensionsForMode:QTMovieApertureModeProduction]. QTMovieApertureModeEncodedPixels.

QTMovieApertureModeEncodedPixels. An aperture mode for technical use. Displays all encoded pixels with no aspect ratio or clean aperture compensation. A movie in encoded pixels aperture mode sets each track's dimensions to match the size returned by -[QTTrack apertureModeDimensionsForMode:QTMovieApertureModeEncodedPixels].

QTMovieAutoAlternatesAttribute

The auto-alternate state of a QTMovie object. The value for this key is of type NSNumber, interpreted as a BOOL.

QTMovieCopyrightAttribute

The copyright string of a QTMovie object; the value for this key is of type NSString.

QTMovieCreationTimeAttribute

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

QTMovieCurrentSizeAttribute

The current size of a QTMovie object; the value for this key is of type NSValue, interpreted as an NSSize structure.

QTMovieCurrentTimeAttribute

The current time of a QTMovie object; the value for this key is of type NSValue, interpreted as a QTTime structure.

QTMovieDataSizeAttribute

The data size of a QTMovie. The value for this key is of type NSNumber, which is interpreted as a long long.

QTMovieDelegateAttribute

The delegate for a QTMovie object. The value for this key is of type NSObject.

QTMovieDisplayNameAttribute

The display name of a QTMovie object. A display name is stored as user data in a movie file and hence may differ from the base name of the movie’s filename or URL. The value for this key is of type NSString.

QTMovieDontInteractWithUserAttribute

When set in a dictionary passed to movieWithAttributes or initWithAttributes, this prevents QuickTime from interacting with the user during movie initialization. The value for this key is of type NSNumber, interpreted as a BOOL.

QTMovieDurationAttribute

The duration of a QTMovie object; the value for this key is of type NSValue, interpreted as a QTTime structure.

QTMovieEditableAttribute

The editable setting; the value for this key is of type NSNumber, interpreted as a BOOL. This value is YES if the movie can be edited.

QTMovieFileNameAttribute

The file name string of a QTMovie object; the value for this key is of type NSString.

QTMovieHasApertureModeDimensionsAttribute

The aperture mode dimensions set on any track in this QTMovie object, even if those dimemsions are all identical to the classic dimensions (as is the case for content with square pixels and no edge-processing region). The value for this key is of type NSNumber, interpreted as a BOOL.

QTMovieHasAudioAttribute

The audio data setting; the value for this key is of type NSNumber, interpreted as a BOOL. This value is YES if the movie contains audio data.

QTMovieHasDurationAttribute

The duration setting; the value for this key is of type NSNumber, interpreted as a BOOL. This value is YES if the movie has a duration. (Some types of movies, for instance QuickTime VR movies, have no duration.)

QTMovieHasVideoAttribute

The video data setting; the value for this key is of type NSNumber, interpreted as a BOOL. This value is YES if the movie contains video data.

QTMovieIsActiveAttribute

The active setting; the value for this key is of type NSNumber, interpreted as a BOOL.

QTMovieIsInteractiveAttribute

The interactive setting; the value for this key is of type NSNumber, interpreted as a BOOL. This value is YES if the movie is interactive.

QTMovieIsLinearAttribute

The linear setting; the value for this key is of type NSNumber, interpreted as a BOOL. This value is YES if the movie is linear, as opposed to a non-linear QuickTime VR movie.

QTMovieIsSteppableAttribute

The steppable setting; the value for this key is of type NSNumber, interpreted as a BOOL. This value is YES if the movie can step from frame to frame.

QTMovieLoadStateAttribute

The load state value; the value for this key is of type NSNumber, interpreted as a long.

enum {
QTMovieLoadStateError = -1L, // an error occurred while loading the movie
QTMovieLoadStateLoading = 1000, // the movie is loading
QTMovieLoadStateLoaded = 2000, // the movie atom has loaded; it's safe to query movie properties
QTMovieLoadStatePlayable = 10000, // the movie has loaded enough media data to begin playing
QTMovieLoadStatePlaythroughOK = 20000, // the movie has loaded enough media data to play through to the end
QTMovieLoadStateComplete = 100000L // the movie has loaded completely
};

The attributeForKey:QTMovieLoadStateAttribute returns an NSNumber that wraps a long integer; the enumerated constants shown above are the possible values of that long integer.

Mac OS X v10.5 and later.

QTMovieLoopsAttribute

The looping setting; the value for this key is of type NSNumber, interpreted as a BOOL. This value is YES if the movie is set to loop.

QTMovieLoopsBackAndForthAttribute

The palindrome looping setting; the value for this key is of type NSNumber, interpreted as a BOOL. This value is YES if the movie is set to loop back and forth. Note that QTMovieLoopsAttribute and QTMovieLoopsBackAndForthAttribute are independent and indeed exclusive. QTMovieLoopsAttribute is used to get and set the state of normal looping; QTMovieLoopsBackAndForthAttribute is used to get and set the state of palindrome looping.

QTMovieModificationTimeAttribute

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

QTMovieMutedAttribute

The mute setting; the value for this key is of type NSNumber, interpreted as a BOOL. This value is YES if the movie volume is muted.

QTMovieNaturalSizeAttribute

The natural size of a QTMovie object; the value for this key is of type NSValue, interpreted as an NSSize structure.

QTMoviePlaysAllFramesAttribute

The play-all-frames setting; the value for this key is of type NSNumber, interpreted as a BOOL. This value is YES if the movie will play all frames.

QTMoviePlaysSelectionOnlyAttribute

The play-selection setting; the value for this key is of type NSNumber, interpreted as a BOOL. This value is YES if the movie will play only the current selection.

QTMoviePosterTimeAttribute

The movie poster time of a QTMovie object; the value for this key is of type NSValue, interpreted as a QTTime structure.

QTMoviePreferredMutedAttribute

The preferred mute setting; the value for this key is of type NSNumber, interpreted as a BOOL. This value is YES if the movie preferred mute setting is muted.

QTMoviePreferredRateAttribute

The preferred rate; the value for this key is of type NSNumber, interpreted as a float.

QTMoviePreferredVolumeAttribute

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

QTMoviePreviewModeAttribute

The preview mode setting; the value for this key is of type NSNumber, interpreted as a BOOL. This value is YES if the movie is in preview mode.

QTMoviePreviewRangeAttribute

The preview range of a QTMovie object; the value for this key is of type NSValue, interpreted as a QTTimeRange structure.

QTMovieRateAttribute

The movie rate; the value for this key is of type NSNumber, interpreted as a float.

QTMovieRateChangesPreservePitchAttribute

When the playback rate is not unity, audio must be resampled in order to play at the new rate. The default resampling affects the pitch of the audio (for example, playing at 2x speed raises the pitch by an octave, 1/2x lowers an octave). If this property is set on the Movie, an alternative algorithm is used, which alters the speed without changing the pitch. As this is more computationally expensive, this property may be silently ignored on some slow CPUs.

QTMovieSelectionAttribute

The selection range of a QTMovie object; the value for this key is of type NSValue, interpreted as a QTTimeRange structure.

QTMovieTimeScaleAttribute

The movie time scale; the value for this key is of type NSNumber, interpreted as a long. In Mac OS X 10.5 and later, this attribute is gettable and settable. In general, you should set this attribute only on newly-created movies or on movies that have not been edited. Also, you should only increase the time scale value, and you should try to use integer multiples of the existing time scale. In earlier versions of Mac OS X, this attribute is gettable only.

QTMovieURLAttribute

The URL of a QTMovie object; the value for this key is of type NSURL.

QTMovieVolumeAttribute

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

The following constants specify items in dictionaries passed to QTMovie notifications and delegate methods.

Constant

Description

QTMovieMessageNotificationParameter

Used as a key in the userInfo dictionary passed to the QTMovieMessageNotification notification to indicate the message. The associated value is an NSString.

QTMovieRateDidChangeNotificationParameter

Used as a key in the userInfo dictionary passed to the QTMovieRateDidChangeNotification notification to indicate the new playback rate. The associated value is an NSNumber that holds a float.

QTMovieStatusFlagsNotificationParameter

Used as a key in the userInfo dictionary passed to the QTMovieStatusStringPostedNotification notification to indicate status flags. The associated value is an NSNumber that holds a long.

QTMovieStatusCodeNotificationParameter

Used as a key in the userInfo dictionary passed to the QTMovieStatusStringPostedNotification notification to indicate a status code (or error code). The associated value is an NSNumber that holds an int.

QTMovieStatusStringNotificationParameter

Used as a key in the userInfo dictionary passed to the QTMovieStatusStringPostedNotification notification to indicate a status string.

QTMovieTargetIDNotificationParameter

Used as a key in the dictionary passed to the externalMovie: delegate method to indicate that the delegate should return a QTMovie object that has the movie ID specified by the key’s value.

QTMovieTargetNameNotificationParameter

Used as a key in the dictionary passed to the externalMovie: delegate method to indicate that the delegate should return a QTMovie object that has the movie name specified by the key’s value.

The following constants are dictionary keys that you can use to specify movie attributes, using the writeToFile method.

Constant

Description

QTMovieExport

The movie export setting; the value for this key is of type NSNumber, interpreted as a BOOL.

QTMovieExportType

The movie export type; the value for this key is of type NSNumber, interpreted as a long.

QTMovieFlatten

The movie flatten setting; the value for this key is of type NSNumber, interpreted as a BOOL.

QTMovieExportSettings

Information to come.

QTMovieExportManufacturer

The export manufacturer value; the value for this key is of type NSNumber, interpreted as a long.

The following constants are dictionary keys that you can use to specify movie attributes, using the addImage method.

Constant

Description

QTAddImageCodecType

The image codec string; the value for this key is of type NSString.

QTAddImageCodecQuality

The image codec value; the value for this key is of type NSNumber.

The following is a dictionary of attributes can contain these keys, using the frameImageAtTime:withAttributes:error: method.

Constant

Description

QTMovieFrameImageSize

Size of the image. Value is an NSValue containing an NSSize record. The default image size is the current movie size.

QTMovieFrameImageType

Type of the image. Value is an NSString. The default image type is NSImage.

QTMovieFrameImageRepresentationsType

For NSImage, the image representations in the image. Value is an NSArray of NSString; strings are, for example, NSBitmapImageRep class description. The default is NSBitmapImageRep.

QTMovieFrameImageOpenGLContext

For CVOpenGLTextureRef, the OpenGL context to use. Value is an NSValue (CGLContextObj).

QTMovieFrameImagePixelFormat

For CVOpenGLTextureRef, the pixel format to use. Value is an NSValue (CGLPixelFormatObj).

QTMovieFrameImageInterlaced

Image is interlaced. Value is an NSNumber (BOOL) (default = NO).

QTMovieFrameImageHighQuality

Image is high quality. Value is an NSNumber (BOOL) (default = YES).

QTMovieFrameImageSingleField

Image is single field. Value is an NSNumber (BOOL) (default = YES). The returned object is an autorelease object.

The following constants are data locators that you can use to specify movie attributes, using the movieWithAttributes and initWithAttributes methods.

Constant

Description

QTMovieDataReferenceAttribute

The data reference of a QTMovie object.

QTMoviePasteboardAttribute

The pasteboard setting of a QTMovie object.

QTMovieDataAttribute

The data of a QTMovie object.

The following constants are movie instantiation options that you can use to specify movie attributes, using the movieWithAttributes and initWithAttributes methods.

Constant

Description

QTMovieFileOffsetAttribute

The file offset value; the value for this key is of type NSNumber, interpreted as a long long.

QTMovieResolveDataRefAttribute

The resolved data reference setting; the value for this key is of type NSNumber, interpreted as a BOOL.

QTMovieAskUnresolvedDataRefAttribute

The unresolved data reference setting; the value for this key is of type NSNumber, interpreted as a BOOL.

QTMovieOpenAsyncOKAttribute

The open async setting; the value for this key is of type NSNumber, interpreted as a BOOL.

These constants allow applications to get information about a movie and its chapters, and to navigate within a movie by chapters. Since chapters are a reasonably common feature of movies and podcasts, QTKit enables developers to create them.

Constant

Description

QTMovieChapterName

A key indicating the chapter name in the dictionaries that are array elements in the array returned by QTMovie chapters or passed to QTMovie addChapters:withAttributes:error.

QTMovieChapterStartTime

Aey indicating the chapter start time in the dictionaries that are array elements in the array returned by QTMovie chapters or passed to QTMovie addChapters:withAttributes:error.

QTMovieChapterTargetTrackAttribute

A key indicating the track in the QTMovie object that is the target of the chapter track.

Notifications

QTMovieApertureModeDidChangeNotification

Issued when the aperture mode of the target QTMovie object changes.

Availability
Declared In
QTMovie.h

QTMovieChapterDidChangeNotification

Issued when the chapter associated with QTMovie changes.

This notification contains no information in the userInfo dictionary.

Availability
Declared In
QTMovie.h

QTMovieChapterListDidChangeNotification

Issued when the chapter list associated with QTMovie changes.

This notification contains no information in the userInfo dictionary.

Availability
Declared In
QTMovie.h

QTMovieCloseWindowRequestNotification

Sent when a request is made to close the movie’s window.

This notification contains no information in the userInfo dictionary.

Availability
Declared In
QTMovie.h

QTMovieDidEndNotification

Sent when the movie is “done” or at its end.

This notification contains no userInfo parameters. It is equivalent to the standard player controller’s mcActionMovieFinished action.

Availability
Declared In
QTMovie.h

QTMovieEditabilityDidChangeNotification

Sent when the editable state of a movie has changed.

Availability
Declared In
QTMovie.h

QTMovieEditedNotification

Sent when a movie has been edited.

This notification contains no userInfo dictionary.

Availability
Declared In
QTMovie.h

QTMovieEnterFullScreenRequestNotification

Sent when a request is made to play back a movie in full screen mode.

This notification contains no information in the userInfo dictionary.

Availability
Declared In
QTMovie.h

QTMovieExitFullScreenRequestNotification

Sent when a request is made to play back a movie in normal windowed mode.

This notification contains no information in the userInfo dictionary.

Availability
Declared In
QTMovie.h

QTMovieLoadStateDidChangeNotification

Sent when the load state of a movie has changed.

Availability
Declared In
QTMovie.h

QTMovieLoopModeDidChangeNotification

Sent when a change is made in a movie’s looping mode.

This notification contains no information in the userInfo dictionary.

Availability
Declared In
QTMovie.h

QTMovieMessageStringPostedNotification

Sent when a movie message has been received by the movie controller.

Movie messages can be sent to an application by wired actions (for instance, a wired sprite) or by code that issues the mcActionShowMessageString movie controller action. The userInfo dictionary contains a single entry whose value is of type NSString, which is the movie message.

Availability
Declared In
QTMovie.h

QTMovieRateDidChangeNotification

Sent when the rate of a movie has changed.

The userInfo dictionary contains a single entry whose value is of type NSNumber that represents a float, which is the new rate.

Availability
Declared In
QTMovie.h

QTMovieSelectionDidChangeNotification

Sent when the selection of a movie has changed.

This notification contains no userInfo dictionary.

Availability
Declared In
QTMovie.h

QTMovieSizeDidChangeNotification

Sent when the size of a movie has changed.

This notification contains no userInfo dictionary.

Availability
Declared In
QTMovie.h

QTMovieStatusStringPostedNotification

Status messages can be sent by QuickTime’s streaming components or by any code that wants to display a message in the movie controller bar status area.

The userInfo dictionary contains a single entry whose value is of type NSString, which is the status message.

The following are keys (notification parameters) for userInfo items for the QTMovieStatusStringPostedNotification notification QTMovieStatusCodeNotificationParameter and QTMovieStatusStringNotificationParameter.

A status string notification can indicate an error (in which case QTMovieStatusCodeNotificationParameter will have a value), or it can contain a string (in which case QTMovieStatusStringNotificationParameter will have a value). For more information, see mcActionShowStatusString.

Availability
Declared In
QTMovie.h

QTMovieTimeDidChangeNotification

Sent when the time in a movie has changed to a value other than what it would be during normal playback.

The QTMovieTimeDidChangeNotification is fired whenever the movie time changes to a time other than what it would be during normal playback. So, for example, this notification is not fired every frame.

Availability
Declared In
QTMovie.h

QTMovieVolumeDidChangeNotification

Sent when the volume of a movie has changed.

Availability
Declared In
QTMovie.h

Next Page > Hide TOC


© 2009 Apple Inc. All Rights Reserved. (Last updated: 2009-01-07)


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.