Beispiel #1
0
 public void stop() {
   if (state.isRecording()) {
     try {
       runtime.stopRecording();
     } catch (MarathonRuntimeException e) {
       setState(State.STOPPED_WITH_APP_CLOSED);
       destroyRuntime();
       throw e;
     } finally {
       displayView.stopInserting();
     }
     stopApplicationIfNecessary();
     displayView.updateOMapFile();
   } else if (state.isPlaying()) {
     try {
       player.halt();
     } catch (MarathonRuntimeException e) {
       reportException(e);
     } finally {
       playbackStopped = true;
       playbackFinished(playbackResultProvider.get(), false);
     }
   } else {
     throw new IllegalStateException("must be recording or playing to stop, not '" + state + "'");
   }
 }