hmi.elckerlyc.anticipator
Class SpaceBarTempoAnticipator

java.lang.Object
  extended by hmi.elckerlyc.anticipator.Anticipator
      extended by hmi.elckerlyc.anticipator.SpaceBarTempoAnticipator
All Implemented Interfaces:
KeyInfo, KeyListener, EventListener

public class SpaceBarTempoAnticipator
extends Anticipator
implements KeyListener, KeyInfo


Nested Class Summary
private static class SpaceBarTempoAnticipator.SBAObservable
           
 
Field Summary
private  org.slf4j.Logger logger
           
private  SpaceBarTempoAnticipator.SBAObservable observable
           
private  List<TimePeg> orderedSynchs
           
private  SystemClock physicsClock
           
private static int PREDICTION_SIZE
           
private  boolean pressed
           
private  CircularBuffer<Double> tempoBuffer
           
 
Constructor Summary
SpaceBarTempoAnticipator()
           
 
Method Summary
 void addObserver(Observer o)
           
 void addSynchronisationPoint(String syncRef, TimePeg sp)
           
private  double getTempo()
           
 List<TimePeg> getTimePegs()
          Get an unmodifiable view of the time pegs handled by this anticipator
 boolean isPressed()
           
 void keyPressed(KeyEvent e)
           
 void keyReleased(KeyEvent e)
           
 void keyTyped(KeyEvent arg0)
           
 void setPhysicsClock(SystemClock phClock)
           
 void updateTempo(double tempo, double startTime)
           
 
Methods inherited from class hmi.elckerlyc.anticipator.Anticipator
getSynchronisationPoint, setSynchronisationPoint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

orderedSynchs

private List<TimePeg> orderedSynchs

physicsClock

private SystemClock physicsClock

pressed

private boolean pressed

observable

private SpaceBarTempoAnticipator.SBAObservable observable

PREDICTION_SIZE

private static final int PREDICTION_SIZE
See Also:
Constant Field Values

tempoBuffer

private CircularBuffer<Double> tempoBuffer

logger

private org.slf4j.Logger logger
Constructor Detail

SpaceBarTempoAnticipator

public SpaceBarTempoAnticipator()
Method Detail

getTimePegs

public List<TimePeg> getTimePegs()
Description copied from class: Anticipator
Get an unmodifiable view of the time pegs handled by this anticipator

Overrides:
getTimePegs in class Anticipator
Returns:
a read-only view of the time pegs handled by this anticipator

setPhysicsClock

public void setPhysicsClock(SystemClock phClock)

addSynchronisationPoint

public void addSynchronisationPoint(String syncRef,
                                    TimePeg sp)
Overrides:
addSynchronisationPoint in class Anticipator

updateTempo

public void updateTempo(double tempo,
                        double startTime)

addObserver

public void addObserver(Observer o)

getTempo

private double getTempo()

keyPressed

public void keyPressed(KeyEvent e)
Specified by:
keyPressed in interface KeyListener

keyReleased

public void keyReleased(KeyEvent e)
Specified by:
keyReleased in interface KeyListener

keyTyped

public void keyTyped(KeyEvent arg0)
Specified by:
keyTyped in interface KeyListener

isPressed

public boolean isPressed()
Specified by:
isPressed in interface KeyInfo