QTMovieView Class Reference

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

Overview

A QTMovieView is a subclass of NSView that can be used to display and control QuickTime movies. You normally use a QTMovieView object in combination with a QTMovie object, which supplies the movie being displayed. A QTMovieView also supports editing operations on the movie.

The movie can be placed within an arbitrary bounding rectangle in the view’s coordinate system, and the remainder of the view can be filled with a fill color. The movie controller, if it is visible, can also be placed within an arbitrary bounding rectangle in the view’s coordinate system.

Adopted Protocols

NSMenuValidations
NSUserInterfaceValidations

Tasks

Initializing the View

Getting View Characteristics

Setting View Characteristics

Controlling Movie Playback

Editing a Movie

Showing and Hiding Buttons in the Movie Controller Bar

Delegate Methods

Instance Methods

add:

Adds the contents of the clipboard to the movie at the current movie time.

- (IBAction)add:(id)sender

Discussion

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

Availability
  • Available in Mac OS X v10.3 and later.
Declared In
QTMovieView.h

addScaled:

Adds the contents of the clipboard to the movie, scaled to fit into the current movie selection.

- (IBAction)addScaled:(id)sender

Discussion

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

Availability
  • Available in Mac OS X v10.3 and later.
Declared In
QTMovieView.h

areStepButtonsVisible

Returns the current visibility state of the specified controller bar button.

- (BOOL)areStepButtonsVisible

Availability
  • QuickTime 7.2.1 or later.
Related Sample Code
Declared In
QTMovieView.h

areZoomButtonsVisible

Returns the current visibility state of the specified controller bar button.

- (BOOL)areZoomButtonsVisible

Discussion

These methods allow applications to hide and show specific buttons in the movie controller bar.

Availability
  • QuickTime 7.2.1 or later.
Related Sample Code
Declared In
QTMovieView.h

controllerBarHeight

Returns the height of the controller bar.

- (float)controllerBarHeight

Availability
  • Available in Mac OS X v10.3 and later.
Related Sample Code
Declared In
QTMovieView.h

copy:

Copies the current movie selection onto the clipboard.

- (IBAction)copy:(id)sender

Discussion

If there is no selection, the current frame is copied. The movie does not need to be editable.

Availability
  • Available in Mac OS X v10.3 and later.
Declared In
QTMovieView.h

cut:

Deletes the current movie selection from the movie, placing it on the clipboard.

- (IBAction)cut:(id)sender

Discussion

If there is no selection, the current frame is deleted. This action is undoable. If the movie is not editable, this method raises an exception.

Availability
  • Available in Mac OS X v10.3 and later.
Declared In
QTMovieView.h

delegate

Returns the receiver’s delegate.

- (id)delegate

Availability
  • QuickTime 7.2.1 or later.
Declared In
QTMovieView.h

delete:

Deletes the current movie selection from the movie, placing it on the clipboard.

- (IBAction)delete:(id)sender

Discussion

If there is no selection, the current frame is deleted. This action is undoable. If the movie is not editable, this method raises an exception.

Availability
  • Available in Mac OS X v10.3 and later.
Declared In
QTMovieView.h

fillColor

Returns the fill color of the QTMovieView.

- (NSColor *)fillColor

Parameters
fillColor

The fill color of the QTMovieView object.

Availability
  • Available in Mac OS X v10.3 and later.
Related Sample Code
Declared In
QTMovieView.h

gotoBeginning:

Sets the current movie time to the beginning of the movie.

- (IBAction)gotoBeginning:(id)sender

Discussion

This action method sets the current movie time to the beginning of the movie. If the movie is playing, the movie continues playing from the new position.

Availability
  • Available in Mac OS X v10.3 and later.
Declared In
QTMovieView.h

gotoEnd:

Sets the current movie time to the end of the movie.

- (IBAction)gotoEnd:(id)sender

Discussion

This action method sets the current movie time to the end of the movie. If the movie is playing in one of the looping modes, the movie continues playing accordingly; otherwise, play stops.

Availability
  • Available in Mac OS X v10.3 and later.
Declared In
QTMovieView.h

gotoNextSelectionPoint:

Sets the current movie time to the next selection point.

- (IBAction)gotoNextSelectionPoint:(id)sender

Discussion

This action method sets the current movie time to the next selection point.

Availability
  • Available in Mac OS X v10.3 and later.
Declared In
QTMovieView.h

gotoPosterFrame:

Sets the current movie time to the movie poster frame.

- (IBAction)gotoPosterFrame:(id)sender

Availability
  • Available in Mac OS X v10.3 and later.
Declared In
QTMovieView.h

gotoPreviousSelectionPoint:

Sets the current movie time to the previous selection point.

- (IBAction)gotoPreviousSelectionPoint:(id)sender

Availability
  • Available in Mac OS X v10.3 and later.
Declared In
QTMovieView.h

initWithFrame:

Initializes a newly allocated QTMovieView with frame as its frame rectangle.

- (id)initWithFrame:(NSRect)frame

Parameters
frame

The NSRect object with which to initialize the QTMovieView with its frame rectangle.

Discussion

The new movie view object must be inserted into the view hierarchy of an NSWindow before it can be used. This method is the designated initializer for the QTMovieView class.

Availability
  • Available in Mac OS X v10.3 through Mac OS X v10.5.
Declared In
QTMovieView.h

isBackButtonVisible

Returns the current visibility state of the specified controller bar button.

- (BOOL)isBackButtonVisible

Availability
  • QuickTime 7.2.1 or later.
Related Sample Code
Declared In
QTMovieView.h

isControllerVisible

Returns an indication of whether the QTMovieView has been requested to display a built-in movie controller user interface.

- (BOOL)isControllerVisible

Discussion

Using the setControllerVisible: method, the client tells QTMovieView whether or not to display a user interface for controlling the movie within its bounds. Using the isControllerVisible method, the client can determine whether a QTMovieView has been configured to display such an interface. By using the controllerBarHeight method, you can determine the height of the portion of the QTMovieView that is required to display that interface. Note that some types of QuickTime content are authored to display their own user interface; for those types of content it is possible for the controllerBarHeight method to return 0 even when the isControllerVisible method is YES.

Availability
  • Available in Mac OS X v10.3 and later.
Related Sample Code
Declared In
QTMovieView.h

isCustomButtonVisible

Returns the current visibility state of the specified controller bar button.

- (BOOL)isCustomButtonVisible

Availability
  • QuickTime 7.2.1 or later.
Related Sample Code
Declared In
QTMovieView.h

isEditable

Returns YES if the QTMovieView object is editable.

- (BOOL)isEditable

Parameters
isEditable

The editable state being returned by the QTMovieView object.

Discussion

When editable, a movie can be modified using editing methods and associated key commands. The default is NO.

Availability
  • Available in Mac OS X v10.3 and later.
Declared In
QTMovieView.h

isHotSpotButtonVisible

Returns the current visibility state of the specified controller bar button.

- (BOOL)isHotSpotButtonVisible

Availability
  • QuickTime 7.2.1 or later.
Related Sample Code
Declared In
QTMovieView.h

isTranslateButtonVisible

Returns the current visibility state of the specified controller bar button.

- (BOOL)isTranslateButtonVisible

Availability
  • QuickTime 7.2.1 or later.
Related Sample Code
Declared In
QTMovieView.h

isVolumeButtonVisible

Returns the current visibility state of the specified controller bar button.

- (BOOL)isVolumeButtonVisible

Availability
  • QuickTime 7.2.1 or later.
Related Sample Code
Declared In
QTMovieView.h

menuForEventDelegate:

Returns an NSMenu object that is the contextual menu for the specified event.

- (NSMenu *)menuForEventDelegate:(NSEvent *)event

Parameters
event

An NSEvent object that specifies an event.

Discussion

This delegate method can be used instead of subclassing QTMovieView in cases where an application cannot hard-link against the QTKit framework.

Availability
  • Mac OS X v10.6; QuickTime 7.6.3 or later.

movie

Returns the QTMovie object associated with the QTMovieView.

- (QTMovie *)movie

Parameters
movie

The QuickTime movie to be returned with the QTMovieView object.

Availability
  • Available in Mac OS X v10.3 and later.
Related Sample Code
Declared In
QTMovieView.h

movieBounds

Returns the rectangle currently occupied by the movie in a QTMovieView.

- (NSRect)movieBounds

Parameters
movieBounds

The NSRect rectangle returned by the movie in a QTMovieView object.

Discussion

This rectangle does not include the area occupied by the movie controller bar (if it’s visible).

Availability
  • Available in Mac OS X v10.3 and later.
Declared In
QTMovieView.h

movieControllerBounds

Returns the rectangle currently occupied by the movie controller bar (if it’s visible) in a QTMovieView.

- (NSRect)movieControllerBounds

Availability
  • Available in Mac OS X v10.3 and later.
Related Sample Code
Declared In
QTMovieView.h

paste:

Inserts the contents of the clipboard (if it contains a movie clip) into the movie at the current play position.

- (IBAction)paste:(id)sender

Discussion

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

Availability
  • Available in Mac OS X v10.3 and later.
Declared In
QTMovieView.h

pause:

Pauses the movie playing.

- (IBAction)pause:(id)sender

Discussion

This action method pauses the movie playback. This method does nothing if the movie is already paused.

Availability
  • Available in Mac OS X v10.3 and later.
Related Sample Code
Declared In
QTMovieView.h

play:

Starts the movie playing at its current location.

- (IBAction)play:(id)sender

Discussion

This action method starts the movie playing at its current location. This method does nothing if the movie is already playing.

Availability
  • Available in Mac OS X v10.3 and later.
Related Sample Code
Declared In
QTMovieView.h

preservesAspectRatio

Returns YES if the QTMovieView object maintains the aspect ratio of the movie when drawing it in the view.

- (BOOL)preservesAspectRatio

Parameters
preservesAspectRatio

The state of the aspect ratio returned by the QTMovieView object.

Discussion

The remainder is filled with fillColor.

Availability
  • Available in Mac OS X v10.3 and later.
Related Sample Code
Declared In
QTMovieView.h

replace:

Replaces the current movie selection with the contents of the clipboard.

- (IBAction)replace:(id)sender

Discussion

If there is no selection, the contents of the clipboard replace the entire movie. This action is undoable. If the movie is not editable, this method raises an exception.

Availability
  • Available in Mac OS X v10.3 and later.
Declared In
QTMovieView.h

selectAll:

Selects the entire movie.

- (IBAction)selectAll:(id)sender

Availability
  • Available in Mac OS X v10.3 and later.
Declared In
QTMovieView.h

selectNone:

Selects nothing.

- (IBAction)selectNone:(id)sender

Discussion

Note that this method does not change the movie time.

Availability
  • Available in Mac OS X v10.3 and later.
Declared In
QTMovieView.h

setBackButtonVisible:

Sets the specified controller bar button to be visible or invisible, according to the state parameter.

- (void)setBackButtonVisible:(BOOL)state

Availability
  • QuickTime 7.2.1 or later.
Related Sample Code
Declared In
QTMovieView.h

setControllerVisible:

Sets the visibility state of the movie controller bar in a QTMovieView to controllerVisible.

- (void)setControllerVisible:(BOOL)controllerVisible

Parameters
controllerVisible

The state of controller visibility set in a QTMovieView object.

Availability
  • Available in Mac OS X v10.3 and later.
Related Sample Code
Declared In
QTMovieView.h

setCustomButtonVisible:

Sets the specified controller bar button to be visible or invisible, according to the state parameter.

- (void)setCustomButtonVisible:(BOOL)state

Availability
  • QuickTime 7.2.1 or later.
Related Sample Code
Declared In
QTMovieView.h

setDelegate:

Sets the receiver’s delegate.

- (void)setDelegate:(id)delegate

Availability
  • QuickTime 7.2.1 or later.
Declared In
QTMovieView.h

setEditable:

Sets the edit state of a QTMovieView to editable.

- (void)setEditable:(BOOL)editable

Parameters
editable

The editable state of the QTMovieView object.

Discussion

The default state is NO.

Availability
  • Available in Mac OS X v10.3 and later.
Related Sample Code
Declared In
QTMovieView.h

setFillColor:

Sets the fill color of a QTMovieView to fillColor.

- (void)setFillColor:(NSColor *)fillColor

Discussion

Note that this may cause a redraw.

Availability
  • Available in Mac OS X v10.3 and later.
Related Sample Code
Declared In
QTMovieView.h

setHotSpotButtonVisible:

Sets the specified controller bar button to be visible or invisible, according to the state parameter.

- (void)setHotSpotButtonVisible:(BOOL)state

Availability
  • QuickTime 7.2.1 or later.
Related Sample Code
Declared In
QTMovieView.h

setMovie:

Sets the QTMovie object in a QTMovieView to movie.

- (void)setMovie:(QTMovie *)movie

Discussion

The currently set QuickTime movie is disposed of using DisposeMovie, unless the QTMovie was created with a call to initWithQuickTimeMovie and the disposeWhenDone flag was NO.

Availability
  • Available in Mac OS X v10.3 and later.
Related Sample Code
Declared In
QTMovieView.h

setPreservesAspectRatio:

Sets the aspect ratio state of a QTMovieView to preservesAspectRatio.

- (void)setPreservesAspectRatio:(BOOL)preservesAspectRatio

Parameters
preservesAspectRatio

The aspect ratio of the movie rectangle.

Discussion

If preservesAspectRatio is YES, the longer side of the movie rectangle is scaled to exactly fit into the view’s frame and the other side is centered in the view frame; the remaining area is filled with the view’s fill color. Note that the movie view may be redrawn, but not resized.

Availability
  • Available in Mac OS X v10.3 and later.
Related Sample Code
Declared In
QTMovieView.h

setShowsResizeIndicator:

Shows or hides the movie controller grow box.

- (void)setShowsResizeIndicator:(BOOL)show

Availability
  • Available in Mac OS X v10.3 and later.
Related Sample Code
Declared In
QTMovieView.h

setStepButtonsVisible:

Sets the specified controller bar button to be visible or invisible, according to the state parameter.

- (void)setStepButtonsVisible:(BOOL)state

Availability
  • QuickTime 7.2.1 or later.
Related Sample Code
Declared In
QTMovieView.h

setTranslateButtonVisible:

Sets the specified controller bar button to be visible or invisible, according to the state parameter.

- (void)setTranslateButtonVisible:(BOOL)state

Availability
  • QuickTime 7.2.1 or later.
Related Sample Code
Declared In
QTMovieView.h

setVolumeButtonVisible:

Sets the specified controller bar button to be visible or invisible, according to the state parameter.

- (void)setVolumeButtonVisible:(BOOL)state

Availability
  • QuickTime 7.2.1 or later.
Related Sample Code
Declared In
QTMovieView.h

setZoomButtonsVisible:

Sets the specified controller bar button to be visible or invisible, according to the state parameter.

- (void)setZoomButtonsVisible:(BOOL)state

Availability
  • QuickTime 7.2.1 or later.
Related Sample Code
Declared In
QTMovieView.h

stepBackward:

Steps the movie backward one frame.

- (IBAction)stepBackward:(id)sender

Availability
  • Available in Mac OS X v10.3 and later.
Declared In
QTMovieView.h

stepForward:

Steps the movie forward one frame.

- (IBAction)stepForward:(id)sender

Availability
  • Available in Mac OS X v10.3 and later.
Declared In
QTMovieView.h

trim:

Trims the movie to the current movie selection.

- (IBAction)trim:(id)sender

Discussion

If there is no selection, the current frame is retained and the remainder of the movie is deleted. This action is undoable. If the movie is not editable, this method raises an exception.

Availability
  • Available in Mac OS X v10.3 and later.
Declared In
QTMovieView.h

Constants

Movie View Bindings

Constants for different movie view bindings.

NSString * const QTMovieViewMovieBinding;
NSString * const QTMovieViewControllerVisibleBinding;
NSString * const QTMovieViewPreservesAspectRatioBinding;
NSString * const QTMovieViewFillColorBinding;
Constants
QTMovieViewMovieBinding

A QTMovieView binding that determines the receiver's movie. Value is a QTMovie.

Available in Mac OS X v10.4 and later.

Declared in QTMovieView.h.

QTMovieViewControllerVisibleBinding

A QTMovieView binding that determines whether or not the controls are visible. Value is a boolean.

Available in Mac OS X v10.4 and later.

Declared in QTMovieView.h.

QTMovieViewPreservesAspectRatioBinding

A QTMovieView binding that determines whether or not the receiver preserves the natural aspect ratio of the movie. Value is a boolean.

Available in Mac OS X v10.4 and later.

Declared in QTMovieView.h.

QTMovieViewFillColorBinding

A QTMovieView binding that determines the fill color. Value is an NSColor.

Available in Mac OS X v10.4 and later.

Declared in QTMovieView.h.



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