acm.util
Class MovieClip

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by acm.util.MovieClip

public class MovieClip
extends Container

This class represents a video clip, which can be read from a QuickTime movie file or web-based resource.


Field Summary
 
Constructor Summary
MovieClip(File file)
Creates a MovieClip object from the specified movie file.
MovieClip(String filename)
Creates a MovieClip object from the specified movie file.
MovieClip(URL url)
Creates a MovieClip object from the specified network URL.
 
Method Summary
 void disableController()
Disables the QuickTime controller from the bottom of the movie, making it disappear from the window.
 void enableController()
Enables the QuickTime controller displayed at the bottom of the movie.
 int getControllerHeight()
Returns the height of the QuickTime controller, measured in pixels.
 double getDuration()
Returns the duration of a movie (in seconds).
 int getFrameCount()
Returns the number of frames in a movie.
 int getFrameIndex()
Returns the current frame index in the movie.
 double getFrameRate()
Returns the frame rate of the movie.
 String getName()
Returns the name of the movie, which is typically the file name from which it was read.
 double getPlaybackRate()
Returns the playback rate, which is a floating-point number indicating the speed and direction of playback.
 double getVolume()
Returns the playback volume setting for the movie, which is a number between 0 (silent) and 1 (maximum volume).
 boolean isControllerEnabled()
Returns true if the QuickTime controller is enabled.
 void loop()
Plays the movie in a continuous audio loop.
 void play()
Starts the movie from its current position.
 void rewind()
Rewinds the movie to the beginning.
 void setFrameIndex(int frameIndex)
Sets the current frame index.
 void setName(String name)
Sets a name to identify the movie.
 void setPlaybackRate(double rate)
Sets the playback rate for the movie.
 void setVolume(double volume)
Sets the playback volume setting for the movie, which is a number between 0 (silent) and 1 (maximum volume).
 void stop()
Stops the playback of the movie.
 

Constructor Detail

public MovieClip(File file)

Creates a MovieClip object from the specified movie file.

 
Usage: MovieClip movie = new MovieClip(file); 
Parameter: 
file  A File object from which the movie is read
 


public MovieClip(String filename)

Creates a MovieClip object from the specified movie file.

 
Usage: MovieClip movie = new MovieClip(filename); 
Parameter: 
filename  The file from which the movie is read
 


public MovieClip(URL url)

Creates a MovieClip object from the specified network URL.

 
Usage: MovieClip movie = new MovieClip(file); 
Parameter: 
url  A network URL containing the movie
 

Method Detail

public void disableController()

Disables the QuickTime controller from the bottom of the movie, making it disappear from the window. This call has no effect if no controller is already disabled.

 
Usage: movie.disableController(); 
 


public void enableController()

Enables the QuickTime controller displayed at the bottom of the movie. This call has no effect if a controller is already enabled.

 
Usage: movie.enableController(); 
 


public int getControllerHeight()

Returns the height of the QuickTime controller, measured in pixels. If no controller is installed, getControllerHeight returns 0.

 
Usage: int height = movie.getControllerHeight(); 
Returns: The height of the QuickTime controller (in pixels)
 


public double getDuration()

Returns the duration of a movie (in seconds).

 
Usage: double duration = movie.getDuration(); 
Returns: The duration of a movie (in seconds)
 


public int getFrameCount()

Returns the number of frames in a movie.

 
Usage: int nFrames = movie.getFrameCount(); 
Returns: The number of frames in a movie
 


public int getFrameIndex()

Returns the current frame index in the movie.

 
Usage: int frameIndex = movie.getFrameIndex(); 
Returns: The current frame index in the movie
 


public double getFrameRate()

Returns the frame rate of the movie.

 
Usage: double frameRate = movie.getFrameRate(); 
Returns: The frame rate of the movie (in frames/second)
 


public String getName()

Returns the name of the movie, which is typically the file name from which it was read.

 
Usage: String name = movie.getName(); 
Returns: The name of the movie
 


public double getPlaybackRate()

Returns the playback rate, which is a floating-point number indicating the speed and direction of playback. The value 1.0 indicates normal speed, 2.0 indicates a movie running at double speed, and 0.5 indicates a movie running at half speed. Negative values indicate that the movie should run in reverse, so that a playback rate of -1.0 specifies that the movie should run backwards at normal speed.

 
Usage: double rate = movie.getPlaybackRate(); 
Returns: The playback rate for the movie
 


public double getVolume()

Returns the playback volume setting for the movie, which is a number between 0 (silent) and 1 (maximum volume).

 
Usage: double volume = movie.getVolume(); 
Returns: The playback volume setting for the movie
 


public boolean isControllerEnabled()

Returns true if the QuickTime controller is enabled.

 
Usage: if (movie.isControllerEnabled()) . . . 
Returns: true if the controller is enabled
 


public void loop()

Plays the movie in a continuous audio loop.

 
Usage: movie.loop(); 
 


public void play()

Starts the movie from its current position.

 
Usage: movie.play(); 
 


public void rewind()

Rewinds the movie to the beginning. This method is useful after you have stopped a movie and want to replay it from the beginning.

 
Usage: movie.rewind(); 
 


public void setFrameIndex(int frameIndex)

Sets the current frame index.

 
Usage: movie.setFrameIndex(frameIndex); 
Parameter: 
frameIndex  The current frame index in the movie
 


public void setName(String name)

Sets a name to identify the movie.

 
Usage: movie.setName(name); 
Parameter: 
name  The name to use for the movie
 


public void setPlaybackRate(double rate)

Sets the playback rate for the movie. The value 1.0 indicates normal speed, 2.0 indicates a movie running at double speed, and 0.5 indicates a movie running at half speed. Negative values indicate that the movie should run in reverse, so that a playback rate of -1.0 specifies that the movie should run backwards at normal speed.

 
Usage: sound.setPlaybackRate(rate); 
Parameter: 
rate  The new playback rate for the movie
 


public void setVolume(double volume)

Sets the playback volume setting for the movie, which is a number between 0 (silent) and 1 (maximum volume).

 
Usage: movie.setVolume(volume); 
Parameter: 
volume  The new volume setting for the movie
 


public void stop()

Stops the playback of the movie.

 
Usage: movie.stop();