com.rbnb.simpleplayer
Class Player

java.lang.Object
  extended by java.lang.Thread
      extended by com.rbnb.simpleplayer.Player
All Implemented Interfaces:
Runnable

public final class Player
extends Thread

General purpose class for playing out data from a V2 RBNB server.

This class provides some simple controls for playing out one or more channels of RBNB data in a synchronized, "real-time" fashion.

Since:
V2.0
See Also:
PlayerChannelListener, PlayerTimeListener
Author:
Ian Brown
Version:
09/30/2002

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Player(String addressI)
          Builds a Player for the specified server address.
 
Method Summary
 void add(String nameI, PlayerChannelListener listenerI)
          Adds a channel and its listener.
 void addTimeListener(PlayerTimeListener timeListenerI)
          Adds a PlayerTimeListener.
 void connect()
          Connects to the server.
 void disconnect()
          Disconnects from the server.
 void gotoPosition(int positionI, int minimumI, int maximumI)
          Goes to a specified position.
 void monitor()
          Starts monitoring the current channel list.
 void move(double startI, double durationI, String referenceI)
          Moves to the specified location.
 void pause()
          Pauses the player.
 void remove(String nameI)
          Removes a channel and its listener.
 void remove(String nameI, PlayerChannelListener listenerI)
          Removes a channel and its listener.
 void removeTimeListener(PlayerTimeListener timeListenerI)
          Removes a PlayerTimeListener.
 void run()
          Runs this Player.
 void terminate()
          Terminates this player.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Player

public Player(String addressI)
Builds a Player for the specified server address.

Parameters:
addressI - the server address.
Since:
V2.0
Author:
Ian Brown
Version:
09/20/2002
Method Detail

add

public final void add(String nameI,
                      PlayerChannelListener listenerI)
Adds a channel and its listener.

Parameters:
nameI - the channel to be added.
listenerI - the listener for the channel.
Since:
V2.0
See Also:
remove(String nameI), remove(String nameI,PlayerChannelListener listenerI)
Author:
Ian Brown
Version:
09/24/2002

addTimeListener

public final void addTimeListener(PlayerTimeListener timeListenerI)
Adds a PlayerTimeListener.

Parameters:
timeListenerI - the PlayerTimeListener.
Since:
V2.0
See Also:
removeTimeListener(PlayerTimeListener timeListenerI)
Author:
Ian Brown
Version:
09/24/2002

connect

public final void connect()
                   throws InterruptedException
Connects to the server.

Throws:
InterruptedException - if the operation is interrupted.
Since:
V2.0
See Also:
disconnect()
Author:
Ian Brown
Version:
09/20/2002

disconnect

public final void disconnect()
                      throws InterruptedException
Disconnects from the server.

Throws:
InterruptedException - if the operation is interrupted.
Since:
V2.0
See Also:
connect()
Author:
Ian Brown
Version:
09/20/2002

gotoPosition

public final void gotoPosition(int positionI,
                               int minimumI,
                               int maximumI)
Goes to a specified position.

Parameters:
positionI - the position.
minimumI - the minimum of the range.
maximumI - the maximum of the range.
Since:
V2.0
Author:
Ian Brown
Version:
09/24/2002

monitor

public final void monitor()
Starts monitoring the current channel list.

Since:
V2.0
Author:
Ian Brown
Version:
09/25/2002

move

public final void move(double startI,
                       double durationI,
                       String referenceI)
Moves to the specified location.

Parameters:
startI - the starting time.
durationI - the duration to retrieve (-1. means the current).
referenceI - the reference.
Since:
V2.0
Author:
Ian Brown
Version:
09/24/2002

pause

public final void pause()
Pauses the player.

Since:
V2.0
Author:
Ian Brown
Version:
09/23/2002

remove

public final void remove(String nameI)
Removes a channel and its listener.

Parameters:
nameI - the name of the channel.
Since:
V2.0
See Also:
add(String nameI,PlayerChannelListener listenerI)
Author:
Ian Brown
Version:
09/24/2002

remove

public final void remove(String nameI,
                         PlayerChannelListener listenerI)
Removes a channel and its listener.

Parameters:
nameI - the name of the channel.
listenerI - the listener for the channel.
Since:
V2.0
See Also:
add(String nameI,PlayerChannelListener listenerI)
Author:
Ian Brown
Version:
09/24/2002

removeTimeListener

public final void removeTimeListener(PlayerTimeListener timeListenerI)
Removes a PlayerTimeListener.

Parameters:
timeListenerI - the PlayerTimeListener.
Since:
V2.0
See Also:
addTimeListener(PlayerTimeListener timeListenerI)
Author:
Ian Brown
Version:
09/24/2002

run

public final void run()
Runs this Player.

Specified by:
run in interface Runnable
Overrides:
run in class Thread
Since:
V2.0
Author:
Ian Brown
Version:
09/30/2002

terminate

public final void terminate()
                     throws InterruptedException
Terminates this player.

Throws:
InterruptedException - if the operation is interrupted.
Since:
V2.0
Author:
Ian Brown
Version:
09/20/2002