octoshape.osa2
Class StreamSuperClass

java.lang.Object
  extended by octoshape.osa2.StreamSuperClass
Direct Known Subclasses:
StreamPusher

public abstract class StreamSuperClass
extends java.lang.Object


Field Summary
static byte STATUS_CLOSED
          The StreamPlayer is closed.
static byte STATUS_INITIALIZING
          The StreamPlayer is currently initializing.
static byte STATUS_READY
          The StreamPlayer is initialized.
static byte STATUS_UNINITIALIZED
          The StreamPlayer is not initialized.
 
Method Summary
 void close(java.lang.Runnable onComplete)
          Closes and disposes the object.
 byte getStatus()
           
 void setProgressListener(ProgressListener progressListener)
          Listens for progress events.
 void setStatusChangedListener(StatusChangedListener listener)
          Setting a listener to listen for changes to the status.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATUS_UNINITIALIZED

public static final byte STATUS_UNINITIALIZED
The StreamPlayer is not initialized.

Either the initialize() method have never been called, or some problem occurred.

See Also:
getStatus(), setProblemListener(ProblemListener), Constant Field Values

STATUS_INITIALIZING

public static final byte STATUS_INITIALIZING
The StreamPlayer is currently initializing.

See Also:
getStatus(), Constant Field Values

STATUS_READY

public static final byte STATUS_READY
The StreamPlayer is initialized. Calling one of the requestPlay methods should fairly quickly result in call to the registered UrlListener.

See Also:
getStatus(), Constant Field Values

STATUS_CLOSED

public static final byte STATUS_CLOSED
The StreamPlayer is closed. The close method have been called, which means that this object can not be used again.

See Also:
getStatus(), close(Runnable), Constant Field Values
Method Detail

setStatusChangedListener

public void setStatusChangedListener(StatusChangedListener listener)
Setting a listener to listen for changes to the status.

Parameters:
listener -
See Also:
getStatus()

getStatus

public byte getStatus()
Returns:
One of the STATUS_... codes
See Also:
setStatusChangedListener(StatusChangedListener), STATUS_UNINITIALIZED, STATUS_INITIALIZING, STATUS_READY, STATUS_CLOSED

setProgressListener

public void setProgressListener(ProgressListener progressListener)
Listens for progress events.

If the stream cannot start immediately we may call the progress listener until it can start. Currently we do this if and only if updates are downloaded in order to play the stream. When the listener has been called with a permille different from 1000 then it will subsequently be called with 1000.

Setting a ProgressListener removes any previously set listener. If called with null argument this will remove any previously set listener.

Parameters:
progressListener -

close

public void close(java.lang.Runnable onComplete)
Closes and disposes the object.

This object can no longer be used after calling this method.