|
jAER project on SourceForge | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.jaer.graphics.AEViewer.AEPlayer
public class AEViewer.AEPlayer
Handles file input of AEs to control the number of events/sample or period of time in the sample, etc. It handles the file input stream, opening a dialog box, etc. It also handles synchronization of different AEViewers as follows (this refers to multiple-AEViewer time-locked playback sychronization, not java object locking):
If the viewer is not synchronized, then all calls from the GUI are passed directly to this instance of AEPlayer. Thus local control always happens.
If the viewer is synchronized, then all GUI calls pass instead to the CaviarViewer instance that contains (or started) this viewer. Then the CaviarViewer AEPlayer calls all the viewers to take the player action (e.g. rewind, go to next slice, change direction).
Thus whichever controls the user uses to control playback, the viewers are all sychronized properly without recursively. The "master" is indicated by the GUI action, which routes the request either to this instance's AEPlayer or to the CaviarViewer AEPlayer.
| Nested Class Summary | |
|---|---|
class |
AEViewer.AEPlayer.FileDeleter
|
| Constructor Summary | |
|---|---|
AEViewer.AEPlayer()
|
|
| Method Summary | |
|---|---|
AEFileInputStream |
getAEInputStream()
|
float |
getFractionalPosition()
|
AEPacketRaw |
getNextPacket()
|
AEPacketRaw |
getNextPacket(AEPlayerInterface player)
|
int |
getSampleNumEvents()
|
int |
getSamplePeriodUs()
|
int |
getTime()
Return time in us in player |
boolean |
isChoosingFile()
returns true if user is choosing a file |
boolean |
isFlexTimeEnabled()
|
boolean |
isNonMonotonicTimeExceptionsChecked()
Checking for wrapped time exceptions can be disabled for reasons of speed or corrupted data files. |
boolean |
isPaused()
gets the AEViewer paused flag |
boolean |
isPlayingForwards()
|
void |
mark()
mark the current position. |
void |
openAEInputFileDialog()
called when user asks to open data file file dialog |
void |
pause()
|
int |
position()
return position in events |
void |
position(int event)
set position in units of the file, e.g. |
AEPacketRaw |
readPacketByNumber(int n)
Reads a raw event packet of n events |
AEPacketRaw |
readPacketByTime(int dt)
returns an AEPacketRaw at least dt long up to the max size of the buffer or until end-of-file. |
void |
resume()
|
void |
rewind()
rewind to the start, or to the marked position, if it has been set |
void |
setFlexTimeEnabled(boolean flexTimeEnabled)
|
void |
setFractionalPosition(float frac)
Sets fractional position in units of the file |
void |
setNonMonotonicTimeExceptionsChecked(boolean yes)
Sets whether the input stream is checked for timestamp nonmonotonicity. |
void |
setPaused(boolean yes)
sets the AEViewer paused flag |
void |
setSampleNumEvents(int sampleNumEvents)
|
void |
setSamplePeriodUs(int samplePeriodUs)
|
void |
setTime(int time)
|
long |
size()
|
void |
slowDown()
|
void |
speedUp()
|
void |
startPlayback(java.io.File file)
Starts playback on the data file. |
void |
stopPlayback()
stops playback. |
void |
toggleDirection()
|
void |
unmark()
clear any marked position |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AEViewer.AEPlayer()
| Method Detail |
|---|
public boolean isChoosingFile()
PlayerInterface
isChoosingFile in interface PlayerInterfacepublic void openAEInputFileDialog()
openAEInputFileDialog in interface AEPlayerInterface
public void startPlayback(java.io.File file)
throws java.io.IOException
startPlayback in interface PlayerInterfacefile - the File to play
java.io.IOExceptionpublic void stopPlayback()
stopPlayback in interface PlayerInterfacepublic void rewind()
InputDataFileInterface
rewind in interface InputDataFileInterfacerewind in interface PlayerInterfacepublic void pause()
pause in interface PlayerInterfacepublic void resume()
resume in interface PlayerInterfacepublic void setPaused(boolean yes)
setPaused in interface PlayerInterfacepublic boolean isPaused()
isPaused in interface PlayerInterfacepublic AEPacketRaw getNextPacket()
getNextPacket in interface AEPlayerInterfacepublic AEPacketRaw getNextPacket(AEPlayerInterface player)
getNextPacket in interface AEPlayerInterfacepublic void toggleDirection()
toggleDirection in interface PlayerInterfacepublic void speedUp()
speedUp in interface AEPlayerInterfacepublic void slowDown()
slowDown in interface AEPlayerInterfacepublic boolean isPlayingForwards()
isPlayingForwards in interface PlayerInterfacepublic float getFractionalPosition()
getFractionalPosition in interface InputDataFileInterface
public void mark()
throws java.io.IOException
InputDataFileInterface
mark in interface InputDataFileInterfacemark in interface PlayerInterfacejava.io.IOException - if there is some error in reading the datapublic int position()
InputDataFileInterface
position in interface InputDataFileInterfacepublic void position(int event)
InputDataFileInterface
position in interface InputDataFileInterfaceevent - the number to position to
public AEPacketRaw readPacketByNumber(int n)
throws java.io.IOException
AEFileInputStreamInterface
readPacketByNumber in interface AEFileInputStreamInterfacen - the number of events to read
java.io.IOException - if there is a problem, e.g. end of file
public AEPacketRaw readPacketByTime(int dt)
throws java.io.IOException
AEFileInputStreamInterface
readPacketByTime in interface AEFileInputStreamInterfacedt - the timestamp different in units of the timestamp (usually us)
java.io.IOException - if there is any problempublic long size()
size in interface InputDataFileInterfacepublic void unmark()
InputDataFileInterface
unmark in interface InputDataFileInterfaceunmark in interface PlayerInterfacepublic void setFractionalPosition(float frac)
InputDataFileInterface
setFractionalPosition in interface InputDataFileInterfacefrac - 0-1 float range, 0 at start, 1 at endpublic void setTime(int time)
setTime in interface PlayerInterfacepublic int getTime()
PlayerInterface
getTime in interface PlayerInterfacepublic boolean isFlexTimeEnabled()
public void setFlexTimeEnabled(boolean flexTimeEnabled)
public int getSamplePeriodUs()
getSamplePeriodUs in interface AEPlayerInterfacepublic void setSamplePeriodUs(int samplePeriodUs)
public int getSampleNumEvents()
getSampleNumEvents in interface AEPlayerInterfacepublic void setSampleNumEvents(int sampleNumEvents)
public AEFileInputStream getAEInputStream()
getAEInputStream in interface AEPlayerInterfacepublic boolean isNonMonotonicTimeExceptionsChecked()
AEFileInputStreamInterface
isNonMonotonicTimeExceptionsChecked in interface AEFileInputStreamInterfacepublic void setNonMonotonicTimeExceptionsChecked(boolean yes)
AEFileInputStreamInterface
setNonMonotonicTimeExceptionsChecked in interface AEFileInputStreamInterfaceyes - true to check (default).
|
jAER project on SourceForge | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||