java.lang.Object
org.monte.media.player.AbstractPlayer
org.monte.media.anim.ANIMPlayer
- All Implemented Interfaces:
Runnable,ColorCyclePlayer,Player,StateModel
Player for IFF cel animations.
- Author:
- Werner Randelshofer, Hausmatt 10, CH-6405 Goldau, Switzerland
-
Field Summary
Fields inherited from class org.monte.media.player.AbstractPlayer
dispatcher, listenerList, propertyChangeSupportFields inherited from interface org.monte.media.player.Player
CLOSED, PREFETCHED, PREFETCHING, REALIZED, REALIZING, STARTED, UNREALIZED -
Constructor Summary
ConstructorsConstructorDescriptionANIMPlayer(InputStream in, int inputFileSize, boolean loadAudio) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoClosed()Closes the player.protected voidDoes the prefetched state.protected voidDoes the prefetching state.protected voidDoes the realized state.protected voidDoes the realizing state.protected voidDoes the started state.protected voidDoes the unrealized state.Returns the bounded range model that represents the amount of data being fetched from the file the movie is stored in.Obtain the Component that provides the default user interface for controlling this Player.protected ImageProducerReturns the image producer that produces the animation frames.Returns the movie track.Returns the bounded range model that represents the time line of the player.longReturns the total duration in milliseconds.Obtain the display Component for this Player.booleanReturns true if audio is available.booleanReturns true if audio playback is enabled.booleanReturns true if colors are blended during color cycling.booleanisCached()Returns true when the player has completely cached all movie data.booleanStarts or stops color cycling.booleanReturns true if color cycling is available in the movie track.booleanisLoop()booleanbooleanbooleanReturns true, if the two wrapup frames at the end of the animation are treated like regular frames.booleanReturns true if left and right speakers are swapped.voidsetAudioEnabled(boolean newValue) Enables or disables audio playback.voidsetBlendedColorCycling(boolean newValue) Sets whether colors are blended during color cycling.voidsetColorCyclingStarted(boolean newValue) Starts or stops color cycling.voidsetDebug(boolean newValue) Set this to true to treat the two wrapup frames at the end of the animation like regular frames.voidsetFramesPerSecond(float framesPerSecond) Setting frames per second overrides all frame duration settings in the frames of the the movie track.voidsetGlobalFrameDuration(int frameDuration) Setting the global frame duration overrides all frame duration settings in the frames of the the movie track.voidsetLoop(boolean newValue) voidsetPingPong(boolean newValue) voidsetPlayEveryFrame(boolean newValue) voidsetPlayWrapupFrames(boolean newValue) Set this to true to treat the two wrapup frames at the end of the animation like regular frames.voidSets the preferred color model.voidsetSwapSpeakers(boolean newValue) Swaps left and right speakers if set to true.Methods inherited from class org.monte.media.player.AbstractPlayer
addChangeListener, addPropertyChangeListener, addStateListener, close, deallocate, fireStateChanged, fireStateChanged, getState, getTargetState, isActive, prefetch, realize, removeChangeListener, removePropertyChangeListener, removeStateListener, run, setTargetState, start, stopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.monte.media.player.Player
addChangeListener, addPropertyChangeListener, addStateListener, close, deallocate, getState, getTargetState, isActive, prefetch, realize, removeChangeListener, removePropertyChangeListener, removeStateListener, setTargetState, start, stop
-
Constructor Details
-
ANIMPlayer
-
ANIMPlayer
Creates a new instance.- Parameters:
in- InputStream containing an IFF ANIM file.inputFileSize- The size of the input file. Provide the value -1 if this is not known.loadAudio- Provide value false if this player should not load audio data.
-
-
Method Details
-
setPreferredColorModel
Sets the preferred color model. If this color model is the same as the one used by the screen device showing the animation, then this may considerably improve the performance of the player. Setting this to null will let the player choose a color model that best suits the media being played. Calling this method has no effect, if the player is already realized. -
getTimeModel
Returns the bounded range model that represents the time line of the player.- Specified by:
getTimeModelin interfacePlayer
-
setAudioEnabled
public void setAudioEnabled(boolean newValue) Enables or disables audio playback.- Specified by:
setAudioEnabledin interfacePlayer
-
isAudioEnabled
public boolean isAudioEnabled()Returns true if audio playback is enabled.- Specified by:
isAudioEnabledin interfacePlayer
-
setSwapSpeakers
public void setSwapSpeakers(boolean newValue) Swaps left and right speakers if set to true. -
isSwapSpeakers
public boolean isSwapSpeakers()Returns true if left and right speakers are swapped. -
getCachingModel
Returns the bounded range model that represents the amount of data being fetched from the file the movie is stored in.- Specified by:
getCachingModelin interfacePlayer
-
getImageProducer
Returns the image producer that produces the animation frames. -
getMovieTrack
Returns the movie track. -
getVisualComponent
Obtain the display Component for this Player. The display Component is where visual media is rendered. If this Player has no visual component, getVisualComponent returns null. For example, getVisualComponent might return null if the Player only plays audio.- Specified by:
getVisualComponentin interfacePlayer
-
getControlPanelComponent
Obtain the Component that provides the default user interface for controlling this Player. If this Player has no default control panel, getControlPanelComponent returns null.- Specified by:
getControlPanelComponentin interfacePlayer
-
doUnrealized
protected void doUnrealized()Does the unrealized state.- Specified by:
doUnrealizedin classAbstractPlayer
-
doRealizing
protected void doRealizing()Does the realizing state.- Specified by:
doRealizingin classAbstractPlayer
-
doRealized
protected void doRealized()Does the realized state.- Specified by:
doRealizedin classAbstractPlayer
-
doPrefetching
protected void doPrefetching()Does the prefetching state.- Specified by:
doPrefetchingin classAbstractPlayer
-
doPrefetched
protected void doPrefetched()Does the prefetched state.- Specified by:
doPrefetchedin classAbstractPlayer
-
setPlayEveryFrame
public void setPlayEveryFrame(boolean newValue) -
setPlayWrapupFrames
public void setPlayWrapupFrames(boolean newValue) Set this to true to treat the two wrapup frames at the end of the animation like regular frames. -
setDebug
public void setDebug(boolean newValue) Set this to true to treat the two wrapup frames at the end of the animation like regular frames. -
isPlayWrapupFrames
public boolean isPlayWrapupFrames()Returns true, if the two wrapup frames at the end of the animation are treated like regular frames. -
setFramesPerSecond
public void setFramesPerSecond(float framesPerSecond) Setting frames per second overrides all frame duration settings in the frames of the the movie track.- Parameters:
framesPerSecond- Frames per section. Set this to 0f if you do not want to override the frame durations in the frames of the movie track.
-
setGlobalFrameDuration
public void setGlobalFrameDuration(int frameDuration) Setting the global frame duration overrides all frame duration settings in the frames of the the movie track.- Parameters:
frameDuration- Frame Duration in milliseconds. Set this to -1 if you do not want to override the frame durations in the frames of the movie track.
-
isPlayEveryFrame
public boolean isPlayEveryFrame() -
setLoop
public void setLoop(boolean newValue) -
isLoop
public boolean isLoop() -
getDeltaOperationDescription
-
doStarted
protected void doStarted()Does the started state. Is called by run(). Does not change the value of targetState but may change state in case of an error.- Specified by:
doStartedin classAbstractPlayer
-
doClosed
protected void doClosed()Closes the player.- Specified by:
doClosedin classAbstractPlayer
-
getTotalDuration
public long getTotalDuration()Returns the total duration in milliseconds.- Specified by:
getTotalDurationin interfacePlayer
-
isCached
public boolean isCached()Returns true when the player has completely cached all movie data. This player informs all property change listeners, when the value of this property changes. The name of the property is 'cached'. -
isAudioAvailable
public boolean isAudioAvailable()Returns true if audio is available.- Specified by:
isAudioAvailablein interfacePlayer
-
setPingPong
public void setPingPong(boolean newValue) -
isPingPong
public boolean isPingPong() -
isColorCyclingStarted
public boolean isColorCyclingStarted()Returns true if color cycling is available in the movie track.- Specified by:
isColorCyclingStartedin interfaceColorCyclePlayer
-
setColorCyclingStarted
public void setColorCyclingStarted(boolean newValue) Starts or stops color cycling.- Specified by:
setColorCyclingStartedin interfaceColorCyclePlayer
-
isColorCyclingAvailable
public boolean isColorCyclingAvailable()Starts or stops color cycling.- Specified by:
isColorCyclingAvailablein interfaceColorCyclePlayer
-
setBlendedColorCycling
public void setBlendedColorCycling(boolean newValue) Sets whether colors are blended during color cycling.- Specified by:
setBlendedColorCyclingin interfaceColorCyclePlayer
-
isBlendedColorCycling
public boolean isBlendedColorCycling()Returns true if colors are blended during color cycling.- Specified by:
isBlendedColorCyclingin interfaceColorCyclePlayer
-