edu.umd.cfar.lamp.viper.gui.players
Class NativePlayer

java.lang.Object
  extended byedu.umd.cfar.lamp.viper.gui.players.DataPlayer
      extended byedu.umd.cfar.lamp.viper.gui.players.DataPlayerHelper
          extended byedu.umd.cfar.lamp.viper.gui.players.NativePlayer
All Implemented Interfaces:
java.util.Iterator, java.util.ListIterator

public class NativePlayer
extends edu.umd.cfar.lamp.viper.gui.players.DataPlayerHelper

Author:
davidm To change the template for this generated type comment go to Window>Preferences>Java>Code Generation>Code and Comments

Field Summary
protected  PrefsManager prefs
           
 
Fields inherited from class edu.umd.cfar.lamp.viper.gui.players.DataPlayer
B_FRAME, EMPTY_FRAME, I_FRAME, logger, P_FRAME, UNKNOWN_FRAME
 
Constructor Summary
NativePlayer(java.lang.String path)
           
 
Method Summary
 void add(java.lang.Object o)
           
 void destroy()
          Does any cleanup required.
 java.awt.Image getImage()
          Function returns the image with the current index.
 java.awt.Image getImage(Instant i)
          Get the image at the given instant.
 java.lang.String getImageType(Instant i)
          The default implementation says that every frame is an i-frame.
 ViperViewMediator getMediator()
           
 Instant getNow()
          Get the currently loaded instant.
 Rational getPixelAspectRatio()
          Returns the default pixel aspect ratio of one.
 PrefsManager getPrefs()
           
 FrameRate getRate()
          Gets the frame rate of the video.
 Span getSpan()
          Gets the interval of the video clip
 boolean hasNext()
           
 boolean hasPrevious()
           
protected  java.awt.Image helpGetImage(Frame f)
           
 java.lang.Object next()
           
 int nextIndex()
           
 java.lang.Object previous()
           
 int previousIndex()
           
 void remove()
           
 void set(java.lang.Object o)
           
 void setElement(MediaElement element)
          Since real data players should know their own metadata, the default behaviour of this method is to ignore it.
 void setMediator(ViperViewMediator mediator)
           
 void setNow(Instant i)
          Set the currently loaded instant/frame.
 void setPrefs(PrefsManager prefs)
           
 
Methods inherited from class edu.umd.cfar.lamp.viper.gui.players.DataPlayer
createDataPlayer, getLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

prefs

protected PrefsManager prefs
Constructor Detail

NativePlayer

public NativePlayer(java.lang.String path)
Method Detail

helpGetImage

protected java.awt.Image helpGetImage(Frame f)
                               throws java.io.IOException,
                                      java.lang.InterruptedException
Throws:
java.io.IOException
java.lang.InterruptedException

getSpan

public Span getSpan()
Description copied from class: DataPlayer
Gets the interval of the video clip

Specified by:
getSpan in class DataPlayer
Returns:

getNow

public Instant getNow()
Description copied from class: DataPlayer
Get the currently loaded instant.

Specified by:
getNow in class DataPlayer
Returns:

setNow

public void setNow(Instant i)
Description copied from class: DataPlayer
Set the currently loaded instant/frame.

Specified by:
setNow in class DataPlayer
Parameters:
i -

getRate

public FrameRate getRate()
Description copied from class: DataPlayer
Gets the frame rate of the video.

Specified by:
getRate in class DataPlayer
Returns:
null if the frame rate is unknown

getImageType

public java.lang.String getImageType(Instant i)
Description copied from class: edu.umd.cfar.lamp.viper.gui.players.DataPlayerHelper
The default implementation says that every frame is an i-frame. Override this to do something useful.

Parameters:
i - instant to check
Returns:
i-frame

getPrefs

public PrefsManager getPrefs()
Specified by:
getPrefs in class DataPlayer
Returns:
Returns the prefs.

setPrefs

public void setPrefs(PrefsManager prefs)
Specified by:
setPrefs in class DataPlayer
Parameters:
prefs - The prefs to set.

getImage

public java.awt.Image getImage()
Description copied from class: DataPlayer
Function returns the image with the current index.

Specified by:
getImage in class DataPlayer
Returns:
current Image.

getImage

public java.awt.Image getImage(Instant i)
Description copied from class: DataPlayer
Get the image at the given instant.

Specified by:
getImage in class DataPlayer
Parameters:
i -
Returns:
@throws UnknownFrameRateException

hasNext

public boolean hasNext()

next

public java.lang.Object next()

nextIndex

public int nextIndex()

hasPrevious

public boolean hasPrevious()

previous

public java.lang.Object previous()

previousIndex

public int previousIndex()

add

public void add(java.lang.Object o)

remove

public void remove()

set

public void set(java.lang.Object o)

destroy

public void destroy()
Description copied from class: DataPlayer
Does any cleanup required.

Specified by:
destroy in class DataPlayer

getMediator

public ViperViewMediator getMediator()
Returns:

setMediator

public void setMediator(ViperViewMediator mediator)
Specified by:
setMediator in class DataPlayer
Parameters:
mediator -

getPixelAspectRatio

public Rational getPixelAspectRatio()
Returns the default pixel aspect ratio of one.

Specified by:
getPixelAspectRatio in class DataPlayer
Returns:
1

setElement

public void setElement(MediaElement element)
Since real data players should know their own metadata, the default behaviour of this method is to ignore it.

Specified by:
setElement in class DataPlayer
Parameters:
element - the new metadata for the file.