コード例 #1
0
 /** 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();
   }
 }
コード例 #2
0
ファイル: SimpleCapture.java プロジェクト: Qazzian/UniWork
  /** 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());
  }