ccs.audio
Enum TrackState

java.lang.Object
  extended by java.lang.Enum<TrackState>
      extended by ccs.audio.TrackState
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<TrackState>

public enum TrackState
extends java.lang.Enum<TrackState>

The state of the currently-playing track: the GUI should reflect this. It doubles as the state of the controller. If there is no current track, then the controller is IDLE (by definition).


Enum Constant Summary
ANALYSING
          Determining what kind of audio data we're dealing with.
BUFFERING
          Downloading track data.
CONNECTING
          Opening the track data stream.
FAULT
          Stuff happens.
IDLE
          Nothing happening.
PAUSED
          Paused.
READY
          Ready to play.
RUNNING
          Track is running, ie. playing.
RUNNINGEMPTY
          This is a pseudostate: the Drive-train may indicate a transition to this state, but it'll actually stay in state RUNNING.
 
Method Summary
 java.lang.String getI18Name()
          Returns the I18N code for the name of this state.
static TrackState valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static TrackState[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

FAULT

public static final TrackState FAULT
Stuff happens.


IDLE

public static final TrackState IDLE
Nothing happening. The track has finished, or there are no tracks to play.


CONNECTING

public static final TrackState CONNECTING
Opening the track data stream. (This may take a while if it's coming in over a busy network, for example.)


BUFFERING

public static final TrackState BUFFERING
Downloading track data. We download to a largish buffer before attempting to play, to reduce the chance of playback glitches due to network stress.


ANALYSING

public static final TrackState ANALYSING
Determining what kind of audio data we're dealing with. This shouldn't take too long.


READY

public static final TrackState READY
Ready to play. This is a "resonance" (a vanishingly short-lived but real state) which the Controller collapses into either PAUSED or RUNNING. It's required so that auto-play (which triggers on transitions into READY) doesn't override manual pause commands (which would otherwise cause such transitions).


PAUSED

public static final TrackState PAUSED
Paused. Nuff said.


RUNNING

public static final TrackState RUNNING
Track is running, ie. playing.


RUNNINGEMPTY

public static final TrackState RUNNINGEMPTY
This is a pseudostate: the Drive-train may indicate a transition to this state, but it'll actually stay in state RUNNING. Indicates that the network connection is completed, and the track is running from the FIFO; this is a good time to execute the secondary drivetrain to preload the next track. Changes (pseudochanges) to this state are swallowed by the Controller, and don't propagate to its PropertyChangeListeners.

Method Detail

values

public static TrackState[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (TrackState c : TrackState.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static TrackState valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getI18Name

public final java.lang.String getI18Name()
Returns the I18N code for the name of this state.