event
Class UDPDrivenMetronome

java.lang.Object
  extended by event.Metronome
      extended by event.UDPDrivenMetronome
All Implemented Interfaces:
java.lang.Runnable

public class UDPDrivenMetronome
extends Metronome

A Metronome that is driven by UDP messages. Notmally, a UDPDrivenMetronome receives its time information from a UDPMetronomeBroadcaster.

See Also:
"The Design and Implementation of Multimedia Software © 2011"

Field Summary
 
Fields inherited from class event.Metronome
delay, multiplier, time, timerThread
 
Constructor Summary
UDPDrivenMetronome(int port)
          Explicit Value Constructor
 
Method Summary
 void reset()
          Reset the time Note: This method should only be called when the Metronome is not running
 void run()
          The code that is executed in the timer thread (required by Runnable)
 void setMultiplier(int multiplier)
          Set the multiplier (i.e., the apparent speed-up factor) Note: This method should only be called when the Metronome is not running
 void setTime(int time)
          Set the current time Note: This method should only be called when the Metronome is not running
 
Methods inherited from class event.Metronome
addListener, getDelay, getNumberOfListeners, notifyListeners, removeListener, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UDPDrivenMetronome

public UDPDrivenMetronome(int port)
                   throws java.io.IOException
Explicit Value Constructor

Parameters:
port - The port to receive ticks on
Throws:
java.io.IOException
Method Detail

reset

public void reset()
Reset the time Note: This method should only be called when the Metronome is not running

Overrides:
reset in class Metronome

setMultiplier

public void setMultiplier(int multiplier)
Set the multiplier (i.e., the apparent speed-up factor) Note: This method should only be called when the Metronome is not running

Overrides:
setMultiplier in class Metronome
Parameters:
multiplier - The multiplier

setTime

public void setTime(int time)
Set the current time Note: This method should only be called when the Metronome is not running

Overrides:
setTime in class Metronome
Parameters:
time - The current time

run

public void run()
The code that is executed in the timer thread (required by Runnable)

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class Metronome


Design and Implementation of Multimedia Software, Jones and Bartlett Publishers