|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.nite.gui.mediaviewer.NMediaHandler
public class NMediaHandler
This is an in-between level class. It shouldn't be used by application programs: it's created by the Clock implementation to control all the other PlayingTimeHandlers registered with the Clock. We want this separation because the messages passed to PlayingTimeHandlers (they're continuous players like media players) should be significantly different to the behaviour of discrete players. The former should get few messages: things like 'play' and 'pause' from button presses, while the latter get an update every time the system clock changes.
Field Summary | |
---|---|
java.util.Set |
playingHandlers
|
Constructor Summary | |
---|---|
NMediaHandler(Clock clock)
|
Method Summary | |
---|---|
void |
acceptTimeChange(double systemTime)
Accept a new time (generally from another registered TimeHandler). |
void |
acceptTimeSpanChange(double start,
double end)
Accept a new time span from another registered time handler. |
void |
deregisterPlayer(TimeHandler display)
Deregister a PlayingTimeHandler so that it is no longer controlled by the parent Clock |
void |
fastForward()
fast forward the continuous stream by the pre-defined amount (defaults to 5 seconds) |
void |
fastForward(int seconds)
fast forward the continuous stream by the pre-defined amount (defaults to 5 seconds) |
Clock |
getClock()
Return the Clock that is currently syncronising this TimeHandler |
java.lang.String |
getFileName()
return the file name currently being played by this player - not relevant here! |
double |
getMaxTime()
get the latest time handled by this TimeHandler - this returns 0.0 because we leave it to the individual media players to register their times with the clock when they have pre-fetched. |
java.lang.String |
getName()
Return the file name being played. |
double |
getTime()
return the time of a media source |
boolean |
isMaster()
return true if this player has the 'master' button checked, and thus controls time for the application |
boolean |
isPlaying()
true if we're playing |
boolean |
pastEndTime(double ctime)
return a boolean: true the given time is after the end time of the media file. |
void |
pause()
pause the continuous stream |
void |
play()
start playing the continuous stream |
void |
registerPlayer(PlayingTimeHandler display)
Register a PlayingTimeHandler that will henceforth be controlled from the parent Clock. |
void |
rewind()
rewind the continuous stream by the pre-defined amount (defaults to 5 seconds) |
void |
rewind(int seconds)
rewind the continuous stream by the pre-defined amount (defaults to 5 seconds) |
void |
setClock(Clock clock)
Set the Clock to which this TimeHandler is registered |
void |
setMaster(boolean mast)
Make this player control time for the application if the argument is 'true', or stop it from being if 'false'. |
void |
setPlayRate(float rate)
fast forward the continuous stream by the pre-defined amount (defaults to 5 seconds) |
void |
setTime(double time)
Broadcast a new time from a media player, but only to the elements up the tree. |
void |
setTime(double time,
TimeHandler child)
Broadcast a new time from a media player, but only to the elements up the tree. |
void |
setTimeHighlightColor(java.awt.Color color)
Change the Color used for all registered TimeHandlers to highlight times - this is not relevant to PlayingTimeHandlers |
void |
setTimeSpan(double start,
double end)
Broadcast a new span to all registered TimeHandlers. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public java.util.Set playingHandlers
Constructor Detail |
---|
public NMediaHandler(Clock clock)
Method Detail |
---|
public void acceptTimeChange(double systemTime)
acceptTimeChange
in interface TimeHandler
public void setTime(double time)
setTime
in interface TimeHandler
public void setTime(double time, TimeHandler child)
public void acceptTimeSpanChange(double start, double end)
acceptTimeSpanChange
in interface TimeHandler
public void setTimeSpan(double start, double end)
setTimeSpan
in interface TimeHandler
public Clock getClock()
getClock
in interface TimeHandler
public void setClock(Clock clock)
setClock
in interface TimeHandler
public void setTimeHighlightColor(java.awt.Color color)
setTimeHighlightColor
in interface TimeHandler
public void play()
play
in interface PlayingTimeHandler
public void pause()
pause
in interface PlayingTimeHandler
public void fastForward()
fastForward
in interface PlayingTimeHandler
public void fastForward(int seconds)
fastForward
in interface PlayingTimeHandler
public void rewind()
rewind
in interface PlayingTimeHandler
public void rewind(int seconds)
rewind
in interface PlayingTimeHandler
public void registerPlayer(PlayingTimeHandler display)
public void deregisterPlayer(TimeHandler display)
public void setPlayRate(float rate)
setPlayRate
in interface PlayingTimeHandler
public double getMaxTime()
getMaxTime
in interface TimeHandler
public java.lang.String getFileName()
getFileName
in interface PlayingTimeHandler
public boolean isPlaying()
PlayingTimeHandler
isPlaying
in interface PlayingTimeHandler
public double getTime()
getTime
in interface PlayingTimeHandler
public boolean isMaster()
isMaster
in interface PlayingTimeHandler
public void setMaster(boolean mast)
setMaster
in interface PlayingTimeHandler
public java.lang.String getName()
public boolean pastEndTime(double ctime)
pastEndTime
in interface PlayingTimeHandler
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |