|
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 PlayerInterface
public void openAEInputFileDialog()
openAEInputFileDialog
in interface AEPlayerInterface
public void startPlayback(java.io.File file) throws java.io.IOException
startPlayback
in interface PlayerInterface
file
- the File to play
java.io.IOException
public void stopPlayback()
stopPlayback
in interface PlayerInterface
public void rewind()
InputDataFileInterface
rewind
in interface InputDataFileInterface
rewind
in interface PlayerInterface
public void pause()
pause
in interface PlayerInterface
public void resume()
resume
in interface PlayerInterface
public void setPaused(boolean yes)
setPaused
in interface PlayerInterface
public boolean isPaused()
isPaused
in interface PlayerInterface
public AEPacketRaw getNextPacket()
getNextPacket
in interface AEPlayerInterface
public AEPacketRaw getNextPacket(AEPlayerInterface player)
getNextPacket
in interface AEPlayerInterface
public void toggleDirection()
toggleDirection
in interface PlayerInterface
public void speedUp()
speedUp
in interface AEPlayerInterface
public void slowDown()
slowDown
in interface AEPlayerInterface
public boolean isPlayingForwards()
isPlayingForwards
in interface PlayerInterface
public float getFractionalPosition()
getFractionalPosition
in interface InputDataFileInterface
public void mark() throws java.io.IOException
InputDataFileInterface
mark
in interface InputDataFileInterface
mark
in interface PlayerInterface
java.io.IOException
- if there is some error in reading the datapublic int position()
InputDataFileInterface
position
in interface InputDataFileInterface
public void position(int event)
InputDataFileInterface
position
in interface InputDataFileInterface
event
- the number to position topublic AEPacketRaw readPacketByNumber(int n) throws java.io.IOException
AEFileInputStreamInterface
readPacketByNumber
in interface AEFileInputStreamInterface
n
- the number of events to read
java.io.IOException
- if there is a problem, e.g. end of filepublic AEPacketRaw readPacketByTime(int dt) throws java.io.IOException
AEFileInputStreamInterface
readPacketByTime
in interface AEFileInputStreamInterface
dt
- the timestamp different in units of the timestamp (usually us)
java.io.IOException
- if there is any problempublic long size()
size
in interface InputDataFileInterface
public void unmark()
InputDataFileInterface
unmark
in interface InputDataFileInterface
unmark
in interface PlayerInterface
public void setFractionalPosition(float frac)
InputDataFileInterface
setFractionalPosition
in interface InputDataFileInterface
frac
- 0-1 float range, 0 at start, 1 at endpublic void setTime(int time)
setTime
in interface PlayerInterface
public int getTime()
PlayerInterface
getTime
in interface PlayerInterface
public boolean isFlexTimeEnabled()
public void setFlexTimeEnabled(boolean flexTimeEnabled)
public int getSamplePeriodUs()
getSamplePeriodUs
in interface AEPlayerInterface
public void setSamplePeriodUs(int samplePeriodUs)
public int getSampleNumEvents()
getSampleNumEvents
in interface AEPlayerInterface
public void setSampleNumEvents(int sampleNumEvents)
public AEFileInputStream getAEInputStream()
getAEInputStream
in interface AEPlayerInterface
public boolean isNonMonotonicTimeExceptionsChecked()
AEFileInputStreamInterface
isNonMonotonicTimeExceptionsChecked
in interface AEFileInputStreamInterface
public void setNonMonotonicTimeExceptionsChecked(boolean yes)
AEFileInputStreamInterface
setNonMonotonicTimeExceptionsChecked
in interface AEFileInputStreamInterface
yes
- true to check (default).
|
jAER project on SourceForge | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |