quicktime.app.players
Class MoviePresenter

java.lang.Object
  |
  +--quicktime.app.image.ImagePresenter
        |
        +--quicktime.app.players.MoviePresenter
All Implemented Interfaces:
AudioSpec, Compositable, Drawable, DrawingNotifier, DynamicImage, ImageSettable, ImageSpec, Listener, MovieDrawingComplete, Playable, QTDrawable, Timeable, Transformable

Deprecated. since QTJava 6.1

public class MoviePresenter
extends ImagePresenter
implements AudioSpec, Playable, DynamicImage, MovieDrawingComplete, DrawingNotifier

The MoviePresenter is used to present typically a movie as a member of a SWCompositor. It will create an Invalidator to innvalidate its TwoDSprite that is presenting the movie in the SWCompositor when the movie redraws.

Outside of the use in the SWCompositor this Presenter also gives the ability to apply a GraphicsMode to the overall output of a movie and can be used also for easy manipulation and control of a movie's display characteristics, location and transformations. For example if you are moving a movie around the screen (for example bouncing it around) you will get better performance of the visual output using a MoviePresenter than doing these kinds of activities with a standard MoviePlayer presentation.

It uses the MovieDrawingComplete callback to either invalidate its presenting TwoDSprite or to redraw itself to the destination QDGraphics.

See Also:
quicktime.app.display.SWCompositor

Field Summary
protected  TwoDSprite spritePresenter
          Deprecated.  
 
Fields inherited from interface quicktime.app.players.Playable
kDurationUnknown
 
Constructor Summary
MoviePresenter(Movie m)
          Deprecated. since QTJava 6.1
MoviePresenter(Movie m, QDGraphics g)
          Deprecated. since QTJava 6.1
 
Method Summary
 void addDrawingListener(DrawingListener listener)
          Deprecated. since QTJava 6.1
 Invalidator addedToCompositor(SWCompositor c, TwoDSprite s)
          Deprecated. since QTJava 6.1
 int execute(Movie m)
          Deprecated. since QTJava 6.1
 int getDuration()
          Deprecated. since QTJava 6.1
 Movie getMovie()
          Deprecated. since QTJava 6.1
 QDGraphics getOffscreenBuffer()
          Deprecated. since QTJava 6.1
 float getRate()
          Deprecated. since QTJava 6.1
 int getScale()
          Deprecated. since QTJava 6.1
 int getTime()
          Deprecated. since QTJava 6.1
 TimeBase getTimeBase()
          Deprecated. since QTJava 6.1
 float getVolume()
          Deprecated. since QTJava 6.1
 boolean isMuted()
          Deprecated. since QTJava 6.1
 boolean isPresenting()
          Deprecated. since QTJava 6.1
 void movieChanged()
          Deprecated. since QTJava 6.1
 void redraw(Region invalidRgn)
          Deprecated. since QTJava 6.1
 void removedFromCompositor(SWCompositor c)
          Deprecated. since QTJava 6.1
 void removeDrawingListener(DrawingListener listener)
          Deprecated. since QTJava 6.1
 void setGWorld(QDGraphics cgp)
          Deprecated. since QTJava 6.1
 void setMuted(boolean flag)
          Deprecated. since QTJava 6.1
 void setRate(float rate)
          Deprecated. since QTJava 6.1
 void setTime(int time)
          Deprecated. since QTJava 6.1
 void setVolume(float val)
          Deprecated. since QTJava 6.1
 
Methods inherited from class quicktime.app.image.ImagePresenter
addedTo, doDraw, fromFile, fromGraphicsImporter, fromGraphicsImporterDrawer, fromGWorld, fromGWorld, fromImageSequence, fromImageSpec, fromPict, fromQTImage, getClip, getDescription, getDisplayBounds, getDSequence, getGraphicsMode, getGWorld, getImage, getInitialSize, getMatrix, getOriginalSize, isRedrawOptimised, removedFrom, removeImageData, setClip, setDisplayBounds, setGraphicsMode, setImageData, setImageData, setLocation, setMatrix, setRedrawOptimised, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface quicktime.app.image.Compositable
getGraphicsMode, setGraphicsMode
 
Methods inherited from interface quicktime.app.image.ImageSpec
getDescription, getImage
 

Field Detail

spritePresenter

protected TwoDSprite spritePresenter
Deprecated. 
Constructor Detail

MoviePresenter

public MoviePresenter(Movie m)
               throws QTException
Deprecated. since QTJava 6.1

Create a MoviePresenter with the supplied movie. The movie will be rendered into a default offscreen QDGraphics and the pixel data of the QDGraphics buffer becomes the image data that this presenter presents.

Parameters:
m - the movie that is rendered

MoviePresenter

public MoviePresenter(Movie m,
                      QDGraphics g)
               throws QTException
Deprecated. since QTJava 6.1

Create a MoviePresenter with the supplied movie. The movie will be rendered into the supplied offscreen QDGraphics and the pixel data of the QDGraphics buffer becomes the image data that this presenter presents.

Parameters:
m - the movie that is rendered
g - the offscreen QDGraphics that the effect is rendered into.
Method Detail

setGWorld

public void setGWorld(QDGraphics cgp)
               throws QTException
Deprecated. since QTJava 6.1

QTCanvas calls this method to give the client the QDGraphics object it should use to do its drawing. If the incoming QDGraphics is the QDGraphics.scratch then the drawable will not be visible and can disable itself. If a client is unable to set the graphics world it should throw an exception.

Specified by:
setGWorld in interface QTDrawable
Overrides:
setGWorld in class ImagePresenter
Parameters:
cgp - a QDGraphics object
QTException

isPresenting

public boolean isPresenting()
Deprecated. since QTJava 6.1

Returns true if the MoviePresenter is presenting its movie to a destination QDGraphics.

Returns:
a boolean

execute

public int execute(Movie m)
Deprecated. since QTJava 6.1

Implements the execute method on the MovieDrawingComplete interface. This method will set the movie changed state to true, so that a consequent call to the TwoDSprite Invalidator will invalidate its presenting sprite. If the MoviePresenter is presenting a movie to a destination QDGraphics it will redraw the movie to that destination.

The callback will be triggered as a result of a call to Movie.task and is fired whenever the Movie draws to its internal QDGraphics - the offscreen buffer that the presenter presents.

Specified by:
execute in interface MovieDrawingComplete
Parameters:
m - the Movie that is presented by this presenter
Returns:
an error code or 0 if no error
See Also:
QTCallBack, (int, quicktime.std.movies.MovieDrawingComplete)

getMovie

public Movie getMovie()
Deprecated. since QTJava 6.1

Return the movie that is being presented.

Returns:
a movie

getOffscreenBuffer

public QDGraphics getOffscreenBuffer()
Deprecated. since QTJava 6.1

Returns the offscreen buffer that the movie of the MoviePresenter is drawing into.

Returns:
a QDGraphics.

redraw

public void redraw(Region invalidRgn)
            throws QTException
Deprecated. since QTJava 6.1

QTCanvas calls this method when the client should redraw itself. If the canvas is able to discern that only a part of the client's drawing area needs to be redrawn - then this area shall be passed in using the invalidRgn. Otherwise this will be null in which case the client should redraw itself entirely.

Specified by:
redraw in interface Drawable
Overrides:
redraw in class ImagePresenter
Parameters:
invalidRgn - the invalidRgn that the client should redraw
QTException

getTimeBase

public TimeBase getTimeBase()
                     throws QTException
Deprecated. since QTJava 6.1

Returns the current time base that provides the time foundation of this object.

Specified by:
getTimeBase in interface Timeable
Returns:
a TimeBase
QTException

setRate

public void setRate(float rate)
             throws QTException
Deprecated. since QTJava 6.1

Sets the Timeable's playback rate. Typically a rate of zero will mean that the player is stopped, a positive value that the player is playing forwards, a negative value that the time values are decreasing.

Specified by:
setRate in interface Timeable
Parameters:
rate - the new playback rate.
QTException

getRate

public float getRate()
              throws QTException
Deprecated. since QTJava 6.1

Returns the current rate of the Timeable object.

Specified by:
getRate in interface Timeable
Returns:
the playback rate
QTException

setTime

public void setTime(int time)
             throws QTException
Deprecated. since QTJava 6.1

Sets the player to the time specified. This time value at this level is a totally arbitrary value - what time that means in "real time" is determined by the implementor of the interface, typically the scale value will determine what a "real" time of 1 second is.

Specified by:
setTime in interface Playable
Parameters:
time - the new time value
QTException

getTime

public int getTime()
            throws QTException
Deprecated. since QTJava 6.1

Returns the current time value of the object.

Specified by:
getTime in interface Playable
Returns:
the current time.
QTException

getDuration

public int getDuration()
                throws QTException
Deprecated. since QTJava 6.1

Returns the duration of the media attached to the player. If the player has no media, or does not know the duration of its media it can return the constant kDurationUnknown.

Specified by:
getDuration in interface Playable
Returns:
the media duration.
QTException

getScale

public int getScale()
             throws QTException
Deprecated. since QTJava 6.1

Returns the time scale of the player - how many ticks per second.

Specified by:
getScale in interface Playable
Returns:
the current scale.
QTException

getVolume

public float getVolume()
                throws QTException
Deprecated. since QTJava 6.1

Returns the volume setting (0 is silent, 1 is unity gain).

Specified by:
getVolume in interface AudioSpec
Returns:
a float
QTException

setVolume

public void setVolume(float val)
               throws QTException
Deprecated. since QTJava 6.1

Sets the volume.

Specified by:
setVolume in interface AudioSpec
Parameters:
val - the new volume
QTException

isMuted

public boolean isMuted()
                throws QTException
Deprecated. since QTJava 6.1

Returns the current mute status.

Specified by:
isMuted in interface AudioSpec
Returns:
a boolean
QTException

setMuted

public void setMuted(boolean flag)
              throws QTException
Deprecated. since QTJava 6.1

Allows the muting of the specific channel. When unmuted the AudioSpec object will return to its current volume setting.

Specified by:
setMuted in interface AudioSpec
Parameters:
flag - turn muting on - true or off - false.
QTException

movieChanged

public void movieChanged()
Deprecated. since QTJava 6.1

If an application requires the MoviePresenter to explicitly invalidate its TwoDSprite Presenter, or redraw its offscreen image due to some change in the Movie (other than normal playback of the Movie) then it should signify this by calling this method. Then in the normal course of Invalidation or Redrawing the MoviePresenter will do the correct thing. If the movie has a timeline and is playing this will be done automatically.

Thus a potential usage of this method is if the MoviePresenter is presenting a QuickTime VR movie that has no real time line, and has programatically changed some characteristic of the display of the Movie. In which case it needs to inform the MoviePresenter that the Movie has changed and it should do the appropriate invalidation or redraw.


addedToCompositor

public Invalidator addedToCompositor(SWCompositor c,
                                     TwoDSprite s)
                              throws QTException
Deprecated. since QTJava 6.1

Returns an object that invalidates a sprite. When a DynamicImage is a member of a SWompositor and the DynamicImage presents a changing image (for example a movie), the TwoDSprite that presents that image in the SWCompositor must be invalidated so that it will redraw the Sprites image in the next composit cycle. The Invalidator object is used to perform this function by the SWCompositor if the object itself cannot perform the invalidation. Can return null if the DynamicImage does not require the SWCompositor to invalidate it (or the object is in a state where its image won't change).

The Invalidators provided with objects that implement the DynamicImage interface will execute at the scale and period of the Compositor when they are created.

Specified by:
addedToCompositor in interface DynamicImage
Parameters:
c - the Compositor in which the DynamicImage is a member
s - the TwoDSprite that is presenting the DynamicImage's image in the Compositor. This is the sprite that must be invalidated.
Returns:
an Invalidator or null if invalidation is not required
QTException
See Also:
quicktime.app.display.SWCompositor

removedFromCompositor

public void removedFromCompositor(SWCompositor c)
                           throws QTException
Deprecated. since QTJava 6.1

When a dynamic image class is removed from a SWCompositor this method is called to allow the class to cleanup any of the invalidation processes it had established in the addedToCompositor call.

Specified by:
removedFromCompositor in interface DynamicImage
Parameters:
c - the SWCompositor it is being removed from
QTException

addDrawingListener

public void addDrawingListener(DrawingListener listener)
Deprecated. since QTJava 6.1

Registers an object as a listener of the MoviePlayer. The object will receive notification when the MoviePlayer draws a frame

Specified by:
addDrawingListener in interface DrawingNotifier

removeDrawingListener

public void removeDrawingListener(DrawingListener listener)
Deprecated. since QTJava 6.1

Removes an object that is a listener of the MoviePlayer. The object will no longer receive notification when the MoviePlayer draws a frame

Specified by:
removeDrawingListener in interface DrawingNotifier