|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.nite.time.DefaultClock
public class DefaultClock
An implementation of the Clock interface.
Field Summary | |
---|---|
static int |
PAUSE
|
java.util.Set |
timeHandlers
|
static int |
WARN
|
Constructor Summary | |
---|---|
DefaultClock()
|
|
DefaultClock(NMetaData meta,
java.lang.String observation)
this constructor takes the list of 'NSignal's to be (potentially) synced by the clock. |
Method Summary | |
---|---|
void |
deregisterTimeHandler(TimeHandler display)
Deregister a TimeHandler so that it can no longer set and get times from this Clock |
void |
ensureVisible(java.awt.Container desk)
ensure visibility of interface |
void |
ensureVisible(java.awt.Rectangle rect,
java.awt.Container desk)
ensure we have some buttons to play with! |
javax.swing.JInternalFrame |
getDisplay()
Return the visual display of this clock (as a control strip) |
NMediaHandler |
getMediaHandler()
return the handler for all PlayingTimeHandlers on this clock |
double |
getSystemTime()
Return the current system time |
int |
getWindSkip()
get the number of seconds the fast-forward and rewind buttons jump |
boolean |
isMediaPlaying()
return true if the media is in the 'playing' state |
void |
pause()
pass a pause message to any ClockFace ui component, causing any media files to be paused |
void |
play()
pass a play message to any ClockFace ui component, causing any media files to start playing |
double |
pollMediaTime()
Finds out the time from the master media - also sends sync signals if neccesary. |
void |
registerMaxTime(int max,
PlayingTimeHandler display)
Called by registered displays to allow the slider to be set correctly. |
void |
registerTimeHandler(TimeHandler display)
Register a TimeHandler that will henceforth be able to set and get times from this Clock. |
void |
setInterventionType(int ervention)
set the intervention type when signal drift exceeds the threshold: PAUSE to reset all the signals by pausing and restarting; WARN to simply print a message |
void |
setMasterPlayer(PlayingTimeHandler pth)
set the PlayingTimeHandler that controls time for this Clock |
void |
setMaximumDrift(double drift)
set the high-end cutoff - if video or audio drift from the master signal by more than this number, we intervene either by pausing and restarting all the signals, or by printing a warning message |
void |
setSendSynchronization(boolean val)
set the player to send synchronize messages to registered TimeHandlers |
void |
setSystemTime(double newTime)
Set the time and notify all handlers. |
void |
setSystemTime(double newTime,
TimeHandler setter)
Set the time and notify all handlers, except the one that just set the time. |
void |
setTimeSpan(double start,
double end)
Receive notification of a new span and pass the new span to all registered TimeHandlers. |
void |
setTimeSpan(double start,
double end,
boolean play)
Receive notification of a new span and pass the new span to all registered TimeHandlers; the third argument specifies whether the segment is 'played' in real time by the clock. |
void |
setTimeSpan(double start,
double end,
TimeHandler setter)
Receive notification of a new span and pass the new span to all registered TimeHandlers other than the one passed as an argument. |
void |
setTimeSpan(double start,
double end,
TimeHandler setter,
boolean play)
Receive notification of a new span and pass the new span to all registered TimeHandlers other than the one passed as an argument; the third argument specifies whether the segment is 'played' in real time by the clock. |
void |
setVerbose(boolean verb)
set the verbosity. |
void |
setWindSkip(int seconds)
set the number of seconds the fast-forward and rewind buttons jump |
void |
showSignal(java.lang.String filename,
NSignal signal,
java.lang.String agent)
show the signal: this will involve either finding the already-registered signal and moving that window to the front, or actually starting up a new media player and registering it |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public java.util.Set timeHandlers
public static final int PAUSE
public static final int WARN
Constructor Detail |
---|
public DefaultClock()
public DefaultClock(NMetaData meta, java.lang.String observation)
Method Detail |
---|
public void registerTimeHandler(TimeHandler display)
registerTimeHandler
in interface Clock
public void registerMaxTime(int max, PlayingTimeHandler display)
registerMaxTime
in interface Clock
public double pollMediaTime()
public void deregisterTimeHandler(TimeHandler display)
deregisterTimeHandler
in interface Clock
public NMediaHandler getMediaHandler()
public double getSystemTime()
getSystemTime
in interface Clock
public void setTimeSpan(double start, double end)
setTimeSpan
in interface Clock
public void setTimeSpan(double start, double end, boolean play)
setTimeSpan
in interface Clock
public void setTimeSpan(double start, double end, TimeHandler setter)
setTimeSpan
in interface Clock
public void setTimeSpan(double start, double end, TimeHandler setter, boolean play)
setTimeSpan
in interface Clock
public void setSystemTime(double newTime)
setSystemTime
in interface Clock
public void setSystemTime(double newTime, TimeHandler setter)
setSystemTime
in interface Clock
public javax.swing.JInternalFrame getDisplay()
getDisplay
in interface Clock
public void setWindSkip(int seconds)
setWindSkip
in interface Clock
public int getWindSkip()
getWindSkip
in interface Clock
public void ensureVisible(java.awt.Container desk)
ensureVisible
in interface Clock
public void ensureVisible(java.awt.Rectangle rect, java.awt.Container desk)
ensureVisible
in interface Clock
public void setSendSynchronization(boolean val)
public void showSignal(java.lang.String filename, NSignal signal, java.lang.String agent)
public boolean isMediaPlaying()
public void play()
play
in interface Clock
public void pause()
pause
in interface Clock
public void setMasterPlayer(PlayingTimeHandler pth)
setMasterPlayer
in interface Clock
public void setMaximumDrift(double drift)
public void setVerbose(boolean verb)
public void setInterventionType(int ervention)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |