net.sf.fmj.ui.application
Class ContainerPlayer

java.lang.Object
  extended by net.sf.fmj.ui.application.ContainerPlayer
All Implemented Interfaces:
java.util.EventListener, SourcedTimerListener, TimeSource, TransportControl

public class ContainerPlayer
extends java.lang.Object
implements TransportControl, SourcedTimerListener, TimeSource

ContainerPlayer. Slider update code adapted from EJMF StandardProgressControl.

Author:
Warren Bloomer

Field Summary
 
Fields inherited from interface net.sf.fmj.ejmf.toolkit.util.TimeSource
MICROS_PER_SEC, MILLIS_PER_SEC, NANOS_PER_SEC
 
Constructor Summary
ContainerPlayer(java.awt.Container container)
          Constructor.
 
Method Summary
 void close()
          Deallocate resources and close the player.
 void deallocate()
          Deallocate all resources used by the player.
 long getConversionDivisor()
          This method is used as a divisor to convert getTime to seconds.
 long getTime()
          As part of TimeSource interface, getTime returns the current media time in nanoseconds.
 boolean isAutoLoop()
           
 void setAutoLoop(boolean autoLoop)
           
 void setContainerPlayerStatusListener(ContainerPlayerStatusListener listener)
           
 void setGain(float value)
           
 void setMediaLocation(java.lang.String mediaLocation, boolean startAutomatically)
           
 void setMediaTime(Time time)
          Set the current media time of the content.
 void setMouseListener(java.awt.event.MouseListener mouseListener)
           
 void setMute(boolean value)
           
 void setPosition(double seconds)
           
 void setRate(float rate)
          1.0 is normal playback speed.
 void setRealizedStartedProcessor(Processor p)
          Used in the case of things like RTP wizard, which create a player/processor explicitly.
 void setTransportControlListener(TransportControlListener listener)
           
 void start()
           
 void stop()
           
 void timerUpdate(SourcedTimerEvent e)
          This method implements the SourcedTimerListener interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContainerPlayer

public ContainerPlayer(java.awt.Container container)
Constructor.

Parameters:
container -
Method Detail

setMediaLocation

public void setMediaLocation(java.lang.String mediaLocation,
                             boolean startAutomatically)
                      throws NoDataSourceException,
                             NoPlayerException,
                             java.io.IOException
Throws:
NoDataSourceException
NoPlayerException
java.io.IOException

setRealizedStartedProcessor

public void setRealizedStartedProcessor(Processor p)
Used in the case of things like RTP wizard, which create a player/processor explicitly.


start

public void start()
Specified by:
start in interface TransportControl

stop

public void stop()
Specified by:
stop in interface TransportControl

setPosition

public void setPosition(double seconds)
Specified by:
setPosition in interface TransportControl

setRate

public void setRate(float rate)
Description copied from interface: TransportControl
1.0 is normal playback speed. 0 is stopped.

Specified by:
setRate in interface TransportControl

deallocate

public void deallocate()
Deallocate all resources used by the player.


close

public void close()
Deallocate resources and close the player.


setMediaTime

public void setMediaTime(Time time)
Set the current media time of the content.


setMouseListener

public void setMouseListener(java.awt.event.MouseListener mouseListener)

setTransportControlListener

public void setTransportControlListener(TransportControlListener listener)
Specified by:
setTransportControlListener in interface TransportControl

setContainerPlayerStatusListener

public void setContainerPlayerStatusListener(ContainerPlayerStatusListener listener)

timerUpdate

public void timerUpdate(SourcedTimerEvent e)
This method implements the SourcedTimerListener interface. Each timer tick causes slider thumbnail to move if a ProgressBar was built for this control panel.

Specified by:
timerUpdate in interface SourcedTimerListener
See Also:
SourcedTimer

getTime

public long getTime()
As part of TimeSource interface, getTime returns the current media time in nanoseconds.

Specified by:
getTime in interface TimeSource

getConversionDivisor

public long getConversionDivisor()
This method is used as a divisor to convert getTime to seconds.

Specified by:
getConversionDivisor in interface TimeSource

setGain

public void setGain(float value)
Specified by:
setGain in interface TransportControl

setMute

public void setMute(boolean value)
Specified by:
setMute in interface TransportControl

isAutoLoop

public boolean isAutoLoop()

setAutoLoop

public void setAutoLoop(boolean autoLoop)