/** Controller Listener. */
 @Override
 public void controllerUpdate(ControllerEvent evt) {
   if (evt instanceof ControllerErrorEvent) {
     System.err.println("Failed to concatenate the files.");
     System.exit(-1);
   } else if (evt instanceof EndOfMediaEvent) {
     evt.getSourceController().close();
   }
 }
Esempio n. 2
0
  /** Controller Listener. This is taken from Sun's examples. */
  public void controllerUpdate(ControllerEvent evt) {

    System.err.println("Listener called");

    if (evt instanceof ConfigureCompleteEvent
        || evt instanceof RealizeCompleteEvent
        || evt instanceof PrefetchCompleteEvent
        || evt instanceof StartEvent
        || evt instanceof StopEvent) {
      // synchronized (waitSync) {
      synchronized (this) {
        stateTransitionOK = true;
        // waitSync.notifyAll();
        this.notifyAll();
      }
    } else if (evt instanceof ControllerClosedEvent) {
      // synchronized (waitSync) {
      synchronized (this) {
        stateTransitionOK = false;
        // waitSync.notifyAll();
        this.notifyAll();
      }
    } else System.err.println(" Event raised was " + evt.getClass());
  }