|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.lyra.Host.Pendulum
public class Pendulum
The Multimedia Player Daemon does not send updates to track the timing of the song. As a result the user is left with either forcing an update every half second to a second in order to ensure that it displays properly or to create their own timer.
In order to save on bandwidth we have created a timer and associated listener that will perform the function in between player updates. This class will also listen in on updates and always provide an update regardless of state. The difference however is that the thread will not be available unless the playback mode is set to play.
PendulumListener
,
Updater
Field Summary | |
---|---|
private static java.lang.String |
CLASS
|
private java.util.List<PendulumListener> |
Clients
|
private Status |
Information
|
private java.util.Map<java.lang.String,java.lang.String> |
Lang
|
private Ledger |
Logger
|
(package private) long |
myEnd
|
private java.lang.Thread |
myThread
|
(package private) int |
myTotal
|
private boolean |
Process
|
Constructor Summary | |
---|---|
Pendulum(Ledger logger,
Status information,
java.util.Map<java.lang.String,java.lang.String> lang)
Default constructor for the class. |
Method Summary | |
---|---|
void |
addTimerListener(PendulumListener l)
Adds an TimerListener to the updater. |
private void |
fireUpdateRequired(int elapsed,
int total)
Triggers a notification to all of the elements in order to update the time and elapsed time elements for the song. |
PendulumListener[] |
getTimerListeners()
Returns an array of all the TimerListeners added to this class with addTimerListener(). |
void |
hostUpdated(UpdateEvent update)
Updates of host information as passed through this specific method. |
void |
removeTimerListener(PendulumListener l)
Removes an TimerListener from the updater. |
void |
run()
|
void |
stopRun()
Method used to stop any given thread running on this class. |
private void |
Update()
This method will handle the actual update and decide what to so with it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.lang.Thread myThread
private java.util.List<PendulumListener> Clients
private boolean Process
long myEnd
int myTotal
private static final java.lang.String CLASS
private Ledger Logger
private Status Information
private java.util.Map<java.lang.String,java.lang.String> Lang
Constructor Detail |
---|
public Pendulum(Ledger logger, Status information, java.util.Map<java.lang.String,java.lang.String> lang)
logger
- Ledger instance for logging events.information
- Status instance for keeping track of states.lang
- Language map.Method Detail |
---|
private void Update()
public void addTimerListener(PendulumListener l)
l
- Class implementing the TimerListener interface.public void removeTimerListener(PendulumListener l)
l
- Instance of class implementing the TimerListener interface.public PendulumListener[] getTimerListeners()
private void fireUpdateRequired(int elapsed, int total)
elapsed
- Integer carrying current runtime.total
- Integer representing total play time.public void hostUpdated(UpdateEvent update)
UpdateListener
hostUpdated
in interface UpdateListener
update
- Update notification method.UpdateEvent
public void run()
run
in interface java.lang.Runnable
public void stopRun()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |