Exemple #1
0
  private void showMedia(ServerMediaFile toShow)
      throws MediaDoesNotExsistException, MediaListsEmptyException, PriorityDoesNotExistException {
    if (this.currentFile != null) {
      this.currentFile.setCurrent(false);
    }
    this.currentFile = toShow;
    toShow.setCurrent(true).increaseShowCount();

    if (toShow instanceof VideoFile) {
      this.serverGUI.setVideoFinishedListener(
          new VideoFinishListener() {

            @Override
            public void videoFinished()
                throws MediaDoesNotExsistException, MediaListsEmptyException,
                    PriorityDoesNotExistException {
              if (MessageProxyServer.this.automodeEnabled) {
                showNextMediaFile();
              }
            }
          });
    } else {
      updateAutoModeTimer();
    }

    try {
      this.serverGUI.showMediaFileInMainComponent(this.currentFile);
    } catch (IOException e) {
      log.log(Level.WARNING, "Media file could not be shown.", e);
      return;
    }
    broadcastMessage(new Message(OpCode.STC_SHOW_MEDIA_FILE_ACK, toShow.getId()));
  }