QuickTimeMovieComponent Class Reference

A window that can play back a QuickTime movie. More...

Inherits NSViewComponent.

List of all members.

Public Member Functions

 QuickTimeMovieComponent ()
 Creates a QuickTimeMovieComponent, initially blank.
 ~QuickTimeMovieComponent ()
 Destructor.
bool loadMovie (const File &movieFile, bool isControllerVisible)
 Tries to load a QuickTime movie from a file into the player.
bool loadMovie (const URL &movieURL, bool isControllerVisible)
 Tries to load a QuickTime movie from a URL into the player.
bool loadMovie (InputStream *movieStream, bool isControllerVisible)
 Tries to load a QuickTime movie from a stream into the player.
void closeMovie ()
 Closes the movie, if one is open.
const File getCurrentMovieFile () const
 Returns the movie file that is currently open.
bool isMovieOpen () const
 Returns true if there's currently a movie open.
double getMovieDuration () const
 Returns the length of the movie, in seconds.
void getMovieNormalSize (int &width, int &height) const
 Returns the movie's natural size, in pixels.
void setBoundsWithCorrectAspectRatio (const Rectangle< int > &spaceToFitWithin, const RectanglePlacement &placement)
 This will position the component within a given area, keeping its aspect ratio correct according to the movie's normal size.
void play ()
 Starts the movie playing.
void stop ()
 Stops the movie playing.
bool isPlaying () const
 Returns true if the movie is currently playing.
void goToStart ()
 Moves the movie's position back to the start.
void setPosition (double seconds)
 Sets the movie's position to a given time.
double getPosition () const
 Returns the current play position of the movie.
void setSpeed (float newSpeed)
 Changes the movie playback rate.
void setMovieVolume (float newVolume)
 Changes the movie's playback volume.
float getMovieVolume () const
 Returns the movie's playback volume.
void setLooping (bool shouldLoop)
 Tells the movie whether it should loop.
bool isLooping () const
 Returns true if the movie is currently looping.
bool isControllerVisible () const
 True if the native QuickTime controller bar is shown in the window.
void paint (Graphics &g)

Static Public Member Functions

static bool isQuickTimeAvailable () throw ()
 Returns true if QT is installed and working on this machine.

Detailed Description

A window that can play back a QuickTime movie.


Constructor & Destructor Documentation

QuickTimeMovieComponent::QuickTimeMovieComponent (  ) 

Creates a QuickTimeMovieComponent, initially blank.

Use the loadMovie() method to load a movie once you've added the component to a window, (or put it on the desktop as a heavyweight window). Loading a movie when the component isn't visible can cause problems, as QuickTime needs a window handle to initialise properly.

QuickTimeMovieComponent::~QuickTimeMovieComponent (  ) 

Destructor.


Member Function Documentation

static bool QuickTimeMovieComponent::isQuickTimeAvailable (  )  throw () [static]

Returns true if QT is installed and working on this machine.

bool QuickTimeMovieComponent::loadMovie ( const File movieFile,
bool  isControllerVisible 
)

Tries to load a QuickTime movie from a file into the player.

It's best to call this function once you've added the component to a window, (or put it on the desktop as a heavyweight window). Loading a movie when the component isn't visible can cause problems, because QuickTime needs a window handle to do its stuff.

Parameters:
movieFile the .mov file to open
isControllerVisible whether to show a controller bar at the bottom
Returns:
true if the movie opens successfully
bool QuickTimeMovieComponent::loadMovie ( const URL movieURL,
bool  isControllerVisible 
)

Tries to load a QuickTime movie from a URL into the player.

It's best to call this function once you've added the component to a window, (or put it on the desktop as a heavyweight window). Loading a movie when the component isn't visible can cause problems, because QuickTime needs a window handle to do its stuff.

Parameters:
movieURL the .mov file to open
isControllerVisible whether to show a controller bar at the bottom
Returns:
true if the movie opens successfully
bool QuickTimeMovieComponent::loadMovie ( InputStream movieStream,
bool  isControllerVisible 
)

Tries to load a QuickTime movie from a stream into the player.

It's best to call this function once you've added the component to a window, (or put it on the desktop as a heavyweight window). Loading a movie when the component isn't visible can cause problems, because QuickTime needs a window handle to do its stuff.

Parameters:
movieStream a stream containing a .mov file. The component may try to read the whole stream before playing, rather than streaming from it.
isControllerVisible whether to show a controller bar at the bottom
Returns:
true if the movie opens successfully
void QuickTimeMovieComponent::closeMovie (  ) 

Closes the movie, if one is open.

const File QuickTimeMovieComponent::getCurrentMovieFile (  )  const

Returns the movie file that is currently open.

If there isn't one, this returns File::nonexistent

bool QuickTimeMovieComponent::isMovieOpen (  )  const

Returns true if there's currently a movie open.

double QuickTimeMovieComponent::getMovieDuration (  )  const

Returns the length of the movie, in seconds.

void QuickTimeMovieComponent::getMovieNormalSize ( int &  width,
int &  height 
) const

Returns the movie's natural size, in pixels.

You can use this to resize the component to show the movie at its preferred scale.

If no movie is loaded, the size returned will be 0 x 0.

void QuickTimeMovieComponent::setBoundsWithCorrectAspectRatio ( const Rectangle< int > &  spaceToFitWithin,
const RectanglePlacement placement 
)

This will position the component within a given area, keeping its aspect ratio correct according to the movie's normal size.

The component will be made as large as it can go within the space, and will be aligned according to the justification value if this means there are gaps at the top or sides.

void QuickTimeMovieComponent::play (  ) 

Starts the movie playing.

void QuickTimeMovieComponent::stop (  ) 

Stops the movie playing.

bool QuickTimeMovieComponent::isPlaying (  )  const

Returns true if the movie is currently playing.

void QuickTimeMovieComponent::goToStart (  ) 

Moves the movie's position back to the start.

void QuickTimeMovieComponent::setPosition ( double  seconds  ) 

Sets the movie's position to a given time.

double QuickTimeMovieComponent::getPosition (  )  const

Returns the current play position of the movie.

Reimplemented from Component.

void QuickTimeMovieComponent::setSpeed ( float  newSpeed  ) 

Changes the movie playback rate.

A value of 1 is normal speed, greater values play it proportionately faster, smaller values play it slower.

void QuickTimeMovieComponent::setMovieVolume ( float  newVolume  ) 

Changes the movie's playback volume.

Parameters:
newVolume the volume in the range 0 (silent) to 1.0 (full)
float QuickTimeMovieComponent::getMovieVolume (  )  const

Returns the movie's playback volume.

Returns:
the volume in the range 0 (silent) to 1.0 (full)
void QuickTimeMovieComponent::setLooping ( bool  shouldLoop  ) 

Tells the movie whether it should loop.

bool QuickTimeMovieComponent::isLooping (  )  const

Returns true if the movie is currently looping.

See also:
setLooping
bool QuickTimeMovieComponent::isControllerVisible (  )  const

True if the native QuickTime controller bar is shown in the window.

See also:
loadMovie
void QuickTimeMovieComponent::paint ( Graphics g  )  [virtual]

For internal use only.

Reimplemented from NSViewComponent.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Mon Apr 26 11:42:16 2010 for JUCE by  doxygen 1.6.3