Class StateTracker

java.lang.Object
org.monte.media.player.StateTracker
All Implemented Interfaces:
EventListener, StateListener

public class StateTracker extends Object implements StateListener
Tracks state changes in a StateModel.
Author:
Werner Randelshofer, Hausmatt 10, CH-6405 Goldau, Switzerland
  • Constructor Details

    • StateTracker

      public StateTracker(StateModel model)
      Creates a StateTracker for the indicated StateModel.
      Parameters:
      model - The model to be tracked.
  • Method Details

    • setStateModel

      public void setStateModel(StateModel model)
      Sets the StateModel. Note: This method must not be called while one of the waitForState methods is working.
      Parameters:
      model - StateModel to be tracked.
    • waitForState

      public void waitForState(int state)
      Waits until the StateModel reaches the indicated state. Note: waitForState methods may not be called from multiple threads simoultaneously.
      Parameters:
      state - to wait for.
    • waitForState

      public int waitForState(int[] states)
      Waits until the StateModel reaches one of the indicated states.

      Note: waitForState methods may not be called from multiple threads simoultaneously.

      Parameters:
      states - choice of states to wait for.
    • stateChanged

      public void stateChanged(StateEvent event)
      XXX This method is public as an implementation side effect. " Do not call or override.
      Specified by:
      stateChanged in interface StateListener