Esempio n. 1
0
 /* (non-Javadoc)
  * @see v9t9.common.demo.IDemoActor#flushRecording(v9t9.common.demo.IDemoRecorder)
  */
 @Override
 public void flushRecording(IDemoRecorder recorder) throws IOException {
   if (!pauseDemoSetting.getBoolean()) {
     recorder
         .getOutputStream()
         .writeEvent(new TimerTick(recorder.getOutputStream().getElapsedTime()));
   }
 }
Esempio n. 2
0
  /* (non-Javadoc)
   * @see v9t9.common.demo.IDemoActor#connectForRecording(v9t9.common.demo.IDemoRecorder)
   */
  @Override
  public void connectForRecording(final IDemoRecorder recorder) throws IOException {
    pauseDemoSetting = Settings.get(recorder.getMachine(), IDemoHandler.settingDemoPaused);

    timerTask =
        new Runnable() {

          @Override
          public void run() {
            try {
              synchronized (recorder) {
                IDemoOutputStream os = recorder.getOutputStream();
                if (os != null) {
                  recorder.flushData();
                }
              }
            } catch (final Throwable t) {
              recorder.fail(t);
            }
          }
        };

    timer.scheduleTask(timerTask, recorder.getOutputStream().getTimerRate());
  }