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())); }
private void showNextMediaFile() throws MediaDoesNotExsistException, MediaListsEmptyException, PriorityDoesNotExistException { boolean fileFromPrivateQueue = false; if (!this.mediaModel.getMediaPrivateQueue().isEmpty()) { fileFromPrivateQueue = true; } ServerMediaFile fileToShow = this.mediaModel.getNext(); showMedia(fileToShow); if (fileFromPrivateQueue) { broadcastMessage( new Message(OpCode.STC_DEQUEUE_MEDIAFILE_ACK, new DequeueData(0, fileToShow.getId()))); } }