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
-
TimerMultiPlayerControl(TrackList)
- Create a TimerMultiPlayerControl for MultiPlayer
passed as argument.
-
actionPerformed(ActionEvent)
- The actionPerformed method is called in response
to timer ticks.
-
close()
- Close all the Players
-
controllerUpdateHook(ControllerEvent)
-
This method provides subclass action in
response to a ControllerEvent.
-
init()
-
Initialize the Players.
-
restart()
- Rewind Players and reposition control to start
of event list.
-
rewind()
- Reposition each Player to zero media time.
-
start()
- Start the timer, fire at next event offset.
-
stop()
- Stop the timer and stop any started Players.
-
update(TrackList)
- Update the TimerMultiPlayerControl with new
Track information.
TimerMultiPlayerControl
public TimerMultiPlayerControl(TrackList tracks)
- Create a TimerMultiPlayerControl for MultiPlayer
passed as argument.
- Parameters:
- tracks - A list of tracks to be controlled by
TimerMultiPlayerControl.
close
public void close()
- Close all the Players
- Overrides:
- close in class MultiPlayerControl
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
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
start
public void start()
- Start the timer, fire at next event offset.
- Overrides:
- start in class MultiPlayerControl
restart
public void restart()
- Rewind Players and reposition control to start
of event list.
- Overrides:
- restart in class MultiPlayerControl
rewind
public void rewind()
- Reposition each Player to zero media time.
- Overrides:
- rewind in class MultiPlayerControl
stop
public void stop()
- Stop the timer and stop any started Players.
- Overrides:
- stop in class MultiPlayerControl
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
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