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

java.lang.Object
  extended byedu.umd.cfar.lamp.viper.gui.players.DataPlayer
All Implemented Interfaces:
java.util.Iterator, java.util.ListIterator
Direct Known Subclasses:
edu.umd.cfar.lamp.viper.gui.players.DataPlayerHelper, NotFoundPlayer

public abstract class DataPlayer
extends java.lang.Object
implements java.util.ListIterator

Heavily modified version of viper.gui.DataPlayer to be more oop and so forth.

Version:
0.1.0 03/07/03
Author:
Felix Sukhenko, davidm

Field Summary
static java.lang.String B_FRAME
           
static java.lang.String EMPTY_FRAME
           
static java.lang.String I_FRAME
           
static java.util.logging.Logger logger
           
static java.lang.String P_FRAME
           
static java.lang.String UNKNOWN_FRAME
           
 
Constructor Summary
protected DataPlayer()
           
 
Method Summary
static DataPlayer createDataPlayer(java.io.File dataFile, PrefsManager prefs)
          Factory method for data players.
abstract  void destroy()
          Does any cleanup required.
abstract  java.awt.Image getImage()
          Function returns the image with the current index.
abstract  java.awt.Image getImage(Instant i)
          Get the image at the given instant.
abstract  java.lang.String getImageType(Instant i)
          Gets the type of image at location i.
 java.util.logging.Logger getLogger()
           
abstract  Instant getNow()
          Get the currently loaded instant.
abstract  Rational getPixelAspectRatio()
          Gets the pixel aspect ratio.
abstract  PrefsManager getPrefs()
           
abstract  FrameRate getRate()
          Gets the frame rate of the video.
abstract  Span getSpan()
          Gets the interval of the video clip
abstract  void setElement(MediaElement element)
          Sets the media element that this describes.
abstract  void setMediator(ViperViewMediator mediator)
           
abstract  void setNow(Instant i)
          Set the currently loaded instant/frame.
abstract  void setPrefs(PrefsManager prefs)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.ListIterator
add, hasNext, hasPrevious, next, nextIndex, previous, previousIndex, remove, set
 

Field Detail

UNKNOWN_FRAME

public static final java.lang.String UNKNOWN_FRAME
See Also:
Constant Field Values

I_FRAME

public static final java.lang.String I_FRAME
See Also:
Constant Field Values

P_FRAME

public static final java.lang.String P_FRAME
See Also:
Constant Field Values

B_FRAME

public static final java.lang.String B_FRAME
See Also:
Constant Field Values

EMPTY_FRAME

public static final java.lang.String EMPTY_FRAME
See Also:
Constant Field Values

logger

public static final java.util.logging.Logger logger
Constructor Detail

DataPlayer

protected DataPlayer()
Method Detail

createDataPlayer

public static DataPlayer createDataPlayer(java.io.File dataFile,
                                          PrefsManager prefs)
Factory method for data players.

Parameters:
dataFile - the media file
Returns:
the data player

getImage

public abstract java.awt.Image getImage()
Function returns the image with the current index.

Returns:
current Image.

getImage

public abstract java.awt.Image getImage(Instant i)
Get the image at the given instant.

Parameters:
i -
Returns:
@throws UnknownFrameRateException

getSpan

public abstract Span getSpan()
Gets the interval of the video clip

Returns:

getNow

public abstract Instant getNow()
Get the currently loaded instant.

Returns:

setNow

public abstract void setNow(Instant i)
Set the currently loaded instant/frame.

Parameters:
i -
Throws:
UnknownFrameRateException

setElement

public abstract void setElement(MediaElement element)
Sets the media element that this describes. This is useful for data types that don't have accurate frame rates or spans.

Parameters:
element - the new metadata for the file.

getRate

public abstract FrameRate getRate()
Gets the frame rate of the video.

Returns:
null if the frame rate is unknown

getPixelAspectRatio

public abstract Rational getPixelAspectRatio()
Gets the pixel aspect ratio.

Returns:
the aspect ratio of a single pixel (of the current frame, although I doubt it will change over the course of a video

getImageType

public abstract java.lang.String getImageType(Instant i)
Gets the type of image at location i.

Parameters:
i - the instant to check
Returns:
One of the valid image types, e.g. I_FRAME, B_FRAME, etc.

destroy

public abstract void destroy()
Does any cleanup required.


getLogger

public java.util.logging.Logger getLogger()
Returns:

getPrefs

public abstract PrefsManager getPrefs()

setPrefs

public abstract void setPrefs(PrefsManager prefs)

setMediator

public abstract void setMediator(ViperViewMediator mediator)