What's New in QuickTime 4.1

| Previous | Chapter Contents | Chapter Top | Next |

The movie class

The movie class is the central class in the QuickTime Player Suite. Most of the QuickTime Player suite events target a movie, including play, stop, save, export, and find. Tracks, files, internet locations, windows, and annotations are all parts of a movie.

This class provides access to many useful properties of a movie, such as name, current time, duration, volume, selection, and dimensions. Many of these properties can be set, such as current time, selection, volume, and dimension.

Class movie: A QuickTime movie.

Plural form:

movies

Elements:

track by numeric index, by name

file by numeric index, by name

internet location by numeric index

window by numeric index, by name

annotation by numeric index, by name

Properties:

class type class [r/o]

-- the class

name international text [r/o]

-- the name of the movie

current time integer

-- the current time (can be set by name as well as

number)

duration integer [r/o]

-- the duration of the movie

selection start integer

-- the start of the movie selection

selection end integer

-- the end of the movie selection

rate small real

-- the rate at which the movie is currently playing

playing boolean [r/o]

-- is the movie playing?

done boolean [r/o]

-- is the movie done playing?

auto play boolean [r/o]

-- will the movie automatically start playing?

sound volume small integer

-- the sound volume of the movie. [0..384], where 256 is 100 percent. Note that a range of 0 to 150 percent is supported.

muted boolean

-- is the volume muted?

dimensions point [r/o]

-- the current dimensions of the movie, not including the

controller

natural dimensions point [r/o]

-- the dimensions the movie has when it is not scaled

looping boolean

-- keep playing the movie in a loop?

palindrome boolean

-- loop back and forth?

play selection only boolean

-- whether to play the selection only?

play all frames boolean

-- play every frame? (no audio will play)

scale half/normal/double/screen/current

-- the current scale of the movie

poster frame time integer

-- the time of the poster frame for the movie

time scale integer [r/o]

-- the time scale of the movie

close when done boolean

-- close the movie when it is done playing

quit when done boolean

-- quit the application when this movie is done playing?

modified boolean [r/o]

-- has the document been modified since the last save?

language international text [r/o]

-- the current language of the movie

Some examples of how you would use various properties of the movie class:

-- get class of movie --

get class of movie 1

-- get movie name --

get name of movie 1

-- get current time of movie --

set x to current time of movie 1

x / 600 -- in seconds if 600 is movie time scale

-- get duration of movie --

set x to duration of first movie

get duration of movie 1

-- get movie rate -- (movie has to be playing)

get rate of movie 1

-- get playing of movie (is movie playing?) --

get playing of movie 1

-- set the playing of movie --

set playing of movie 1 to true

-- is movie done? --

get done of movie 1

-- is AutoPlay on? --

get auto play of movie 1

-- get volume of movie --

get volume of front movie

-- is movie muted? --

get muted of front movie

-- get movie data size (in kbytes)

set x to movie data size of front movie

x / 1024

-- get/set movie dimensions --

get dimensions of front movie

set dimensions of movie 1 to {320,240}

-- set looping of movie --

set looping of movie 1 to true

-- set palindrome of movie --

set palindrome of movie 1 to true

-- set 'Play Selection only' of movie --

set play selection only of movie 1 to true

-- set 'Play all frames' of movie --

set play all frames of movie 1 to true

-- set scale of movie --

set scale of movie 1 to double (half, screen)

-- get/set poster frame of movie --

set poster frame of movie 1 to 88

-- get time scale of movie --

get time scale of movie 1

-- set selection of movie --

tell first movie to select at 422 duration 800

-- select all of a movie --

tell first movie to select all

-- has movie been modified? --

get modified of movie 1


© 1999 Apple Computer, Inc.

| Previous | Chapter Contents | Chapter Top | Next |