A window that can play back a QuickTime movie. More...
#include <juce_QuickTimeMovieComponent.h>
Public Member Functions | |
QuickTimeMovieComponent () | |
Creates a QuickTimeMovieComponent, initially blank. More... | |
~QuickTimeMovieComponent () | |
Destructor. More... | |
void | closeMovie () |
Closes the movie, if one is open. More... | |
File | getCurrentMovieFile () const |
Returns the movie file that is currently open. More... | |
double | getMovieDuration () const |
Returns the length of the movie, in seconds. More... | |
void | getMovieNormalSize (int &width, int &height) const |
Returns the movie's natural size, in pixels. More... | |
float | getMovieVolume () const |
Returns the movie's playback volume. More... | |
double | getPosition () const |
Returns the current play position of the movie. More... | |
void | goToStart () |
Moves the movie's position back to the start. More... | |
bool | isControllerVisible () const |
True if the native QuickTime controller bar is shown in the window. More... | |
bool | isLooping () const |
Returns true if the movie is currently looping. More... | |
bool | isMovieOpen () const |
Returns true if there's currently a movie open. More... | |
bool | isPlaying () const |
Returns true if the movie is currently playing. More... | |
bool | loadMovie (const File &movieFile, bool isControllerVisible) |
Tries to load a QuickTime movie from a file into the player. More... | |
bool | loadMovie (const URL &movieURL, bool isControllerVisible) |
Tries to load a QuickTime movie from a URL into the player. More... | |
bool | loadMovie (InputStream *movieStream, bool isControllerVisible) |
Tries to load a QuickTime movie from a stream into the player. More... | |
void | paint (Graphics &) override |
void | play () |
Starts the movie playing. More... | |
void | setBoundsWithCorrectAspectRatio (const Rectangle< int > &spaceToFitWithin, RectanglePlacement placement) |
This will position the component within a given area, keeping its aspect ratio correct according to the movie's normal size. More... | |
void | setLooping (bool shouldLoop) |
Tells the movie whether it should loop. More... | |
void | setMovieVolume (float newVolume) |
Changes the movie's playback volume. More... | |
void | setPosition (double seconds) |
Sets the movie's position to a given time. More... | |
void | setSpeed (float newSpeed) |
Changes the movie playback rate. More... | |
void | stop () |
Stops the movie playing. More... | |
Static Public Member Functions | |
static bool | isQuickTimeAvailable () noexcept |
Returns true if QT is installed and working on this machine. More... | |
Private Member Functions | |
void | createControlIfNeeded () |
bool | isControlCreated () const |
void | parentHierarchyChanged () override |
void | visibilityChanged () override |
Private Attributes | |
bool | controllerVisible |
bool | looping |
File | movieFile |
bool | movieLoaded |
ScopedPointer< Pimpl > | pimpl |
Friends | |
struct | ContainerDeletePolicy< Pimpl > |
A window that can play back a QuickTime movie.
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.
void QuickTimeMovieComponent::closeMovie | ( | ) |
Closes the movie, if one is open.
|
private |
File QuickTimeMovieComponent::getCurrentMovieFile | ( | ) | const |
Returns the movie file that is currently open.
If there isn't one, this returns File()
double QuickTimeMovieComponent::getMovieDuration | ( | ) | const |
Returns the length of the movie, in seconds.
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.
float QuickTimeMovieComponent::getMovieVolume | ( | ) | const |
Returns the movie's playback volume.
double QuickTimeMovieComponent::getPosition | ( | ) | const |
Returns the current play position of the movie.
void QuickTimeMovieComponent::goToStart | ( | ) |
Moves the movie's position back to the start.
|
private |
bool QuickTimeMovieComponent::isControllerVisible | ( | ) | const |
True if the native QuickTime controller bar is shown in the window.
bool QuickTimeMovieComponent::isLooping | ( | ) | const |
Returns true if the movie is currently looping.
bool QuickTimeMovieComponent::isMovieOpen | ( | ) | const |
Returns true if there's currently a movie open.
bool QuickTimeMovieComponent::isPlaying | ( | ) | const |
Returns true if the movie is currently playing.
|
staticnoexcept |
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.
movieFile | the .mov file to open |
isControllerVisible | whether to show a controller bar at the bottom |
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.
movieURL | the .mov file to open |
isControllerVisible | whether to show a controller bar at the bottom |
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.
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 |
|
override |
|
overrideprivate |
void QuickTimeMovieComponent::play | ( | ) |
Starts the movie playing.
void QuickTimeMovieComponent::setBoundsWithCorrectAspectRatio | ( | const Rectangle< int > & | spaceToFitWithin, |
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::setLooping | ( | bool | shouldLoop | ) |
Tells the movie whether it should loop.
void QuickTimeMovieComponent::setMovieVolume | ( | float | newVolume | ) |
Changes the movie's playback volume.
newVolume | the volume in the range 0 (silent) to 1.0 (full) |
void QuickTimeMovieComponent::setPosition | ( | double | seconds | ) |
Sets the movie's position to a given time.
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::stop | ( | ) |
Stops the movie playing.
|
overrideprivate |
|
friend |
|
private |
|
private |
|
private |
|
private |
|
private |