All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ejmf.toolkit.multiplayer.TimerMultiPlayerControl

java.lang.Object
   |
   +----ejmf.toolkit.multiplayer.MultiPlayerControl
           |
           +----ejmf.toolkit.multiplayer.TimerMultiPlayerControl

public class TimerMultiPlayerControl
extends MultiPlayerControl
implements ActionListener
TimerMultiPlayerControl is a timer-based control mechanism for driving the operation of multiple players. Based on the start times and playing times of the Tracks associated with the MultiPlayer passed at construction, an event list is created. This list is a time-ordered list of MixerEvents. The time value recorded with each MixerEvent is an offset from the previous event. A timer is set to expire at the offset of first event. When the timer expires, the MixerCommand is executed and the timer is reset to expire at the next offset.

Note: As an implementation note, the Players coordinated by a TimerMultiPlayerControl do not need to share a TimeBase since that is effectively the role of the Timer used by TimerMultiPlayerControl.

See Also:
MixerEvent, MixerCommand

Constructor Index

 o TimerMultiPlayerControl(TrackList)
Create a TimerMultiPlayerControl for MultiPlayer passed as argument.

Method Index

 o actionPerformed(ActionEvent)
The actionPerformed method is called in response to timer ticks.
 o close()
Close all the Players
 o controllerUpdateHook(ControllerEvent)
This method provides subclass action in response to a ControllerEvent.
 o init()
Initialize the Players.
 o restart()
Rewind Players and reposition control to start of event list.
 o rewind()
Reposition each Player to zero media time.
 o start()
Start the timer, fire at next event offset.
 o stop()
Stop the timer and stop any started Players.
 o update(TrackList)
Update the TimerMultiPlayerControl with new Track information.

Constructors

 o TimerMultiPlayerControl
 public TimerMultiPlayerControl(TrackList tracks)
Create a TimerMultiPlayerControl for MultiPlayer passed as argument.

Parameters:
tracks - A list of tracks to be controlled by TimerMultiPlayerControl.

Methods

 o close
 public void close()
Close all the Players

Overrides:
close in class MultiPlayerControl
 o init
 public boolean init()
Initialize the Players. Note: This method is a no-op since Track prefetches Players.

Parameters:
Always - return true.
Overrides:
init in class MultiPlayerControl
 o update
 public boolean update(TrackList tracks)
Update the TimerMultiPlayerControl with new Track information. Initialize the event list based on new start time and playing time information.

Parameters:
tracks - A list of Tracks. Control strategy is updated based on information in these tracks.
Returns:
true if update was successful, otherwise false.
Overrides:
update in class MultiPlayerControl
 o start
 public void start()
Start the timer, fire at next event offset.

Overrides:
start in class MultiPlayerControl
 o restart
 public void restart()
Rewind Players and reposition control to start of event list.

Overrides:
restart in class MultiPlayerControl
 o rewind
 public void rewind()
Reposition each Player to zero media time.

Overrides:
rewind in class MultiPlayerControl
 o stop
 public void stop()
Stop the timer and stop any started Players.

Overrides:
stop in class MultiPlayerControl
 o actionPerformed
 public void actionPerformed(ActionEvent e)
The actionPerformed method is called in response to timer ticks. When an event arrives, those events scheduled to be fired and fired. Then timer is then reset to fire at time of next scheduled event.

Parameters:
e - A timer 'tick' appearing as an ActionEvent
 o controllerUpdateHook
 protected void controllerUpdateHook(ControllerEvent event)
This method provides subclass action in response to a ControllerEvent.

Overrides:
controllerUpdateHook in class MultiPlayerControl

All Packages  Class Hierarchy  This Package  Previous  Next  Index