All Packages Class Hierarchy This Package Previous Next Index
Class ejmf.toolkit.multiplayer.MultiPlayerControl
java.lang.Object
|
+----ejmf.toolkit.multiplayer.MultiPlayerControl
- public abstract class MultiPlayerControl
- extends Object
- implements ControllerListener
The MultiPlayerControl inteface defines a control
stategy pattern for use with a MultiPlayer client.
The interface defines the following methods:
- close
- init
- restart
- rewind
- start
- stop
- update
An implementation of MultiPlayerControl is responsible for
maintaining a TrackList upon which all the methods operate.
This is typically passed to the object at construction time.
Implementations of a MultiPlayerControl's methods should not
assume anything about the state of a Controller. Any
implementation to ensure the Controller is in the appropriate
state for performng an operation.
The update
takes a TrackList as an argument and
provides a mechanism of providing a new TrackList to the control
stratgey.
- See Also:
- MultiPlayer, TrackList, DefaultMultiPlayerControl, MultiPlayerTimerControl, SyncStartControl
-
MultiPlayerControl(TrackList)
-
Create a MultiPlayer from a list of Tracks.
-
close()
-
Deallocate and close all Players
-
controllerUpdate(ControllerEvent)
- Call out to controllerUpdateHook and force subclass
to provide whatever control they need.
-
controllerUpdateHook(ControllerEvent)
-
This method provides subclass action in
response to a ControllerEvent.
-
getTrackList()
-
Get the TrackList associated with this
MultiPlayerControl.
-
init()
- Initialize the MultiPlayerControl
-
prefetchPlayers()
-
Prefetch all Players under control of MultiPlayer
-
restart()
- Restart the MultiPlayer
-
rewind()
- Rewind the MultiPlayer.
-
setTrackList(TrackList)
-
Allow subclasses to set TrackList
-
start()
- Start the MultiPlayerControl.
-
stop()
- Stop the MultiPlayerControl.
-
update(TrackList)
- Update the MultiPlayerControl.
MultiPlayerControl
public MultiPlayerControl(TrackList tracks)
- Create a MultiPlayer from a list of Tracks.
close
public abstract void close()
- Deallocate and close all Players
init
public abstract boolean init()
- Initialize the MultiPlayerControl
- Returns:
- true if initialization was successful,
otherwise return false.
restart
public abstract void restart()
- Restart the MultiPlayer
rewind
public abstract void rewind()
- Rewind the MultiPlayer.
start
public abstract void start()
- Start the MultiPlayerControl. Starts all
the Players in the TrackList.
stop
public abstract void stop()
- Stop the MultiPlayerControl. Stops all
Players in the TrackList.
update
public abstract boolean update(TrackList tracks)
- Update the MultiPlayerControl. This method
is typically called when the TrackList is
changed in such a way as to impact the control
strategy, ie. an addition or deletion of a Track.
- Parameters:
- tracks - a ejmf.toolkit.multiplayer.TrackList
- Returns:
- true if update was successful, otherwise
return false.
controllerUpdateHook
protected abstract void controllerUpdateHook(ControllerEvent event)
- This method provides subclass action in
response to a ControllerEvent. It is called
by controllerUpdate.
getTrackList
public TrackList getTrackList()
- Get the TrackList associated with this
MultiPlayerControl.
setTrackList
protected void setTrackList(TrackList tracks)
- Allow subclasses to set TrackList
prefetchPlayers
protected boolean prefetchPlayers()
- Prefetch all Players under control of MultiPlayer
controllerUpdate
public void controllerUpdate(ControllerEvent event)
- Call out to controllerUpdateHook and force subclass
to provide whatever control they need.
All Packages Class Hierarchy This Package Previous Next Index