diff --git a/src/main/java/com/codedead/opal/controller/AudioController.java b/src/main/java/com/codedead/opal/controller/AudioController.java index c7db512..90ffeae 100644 --- a/src/main/java/com/codedead/opal/controller/AudioController.java +++ b/src/main/java/com/codedead/opal/controller/AudioController.java @@ -66,6 +66,7 @@ public AudioController(final IAudioTimer audioTimer) throws URISyntaxException { mediaPlayers.put("drumtribal", new MediaPlayer(new Media(Objects.requireNonNull(getClass().getResource("/audio/tribal2.mp3")).toURI().toString()))); mediaPlayers.put("football", new MediaPlayer(new Media(Objects.requireNonNull(getClass().getResource("/audio/football.mp3")).toURI().toString()))); mediaPlayers.put("sleepy", new MediaPlayer(new Media(Objects.requireNonNull(getClass().getResource("/audio/sleepy.mp3")).toURI().toString()))); + mediaPlayers.put("gong", new MediaPlayer(new Media(Objects.requireNonNull(getClass().getResource("/audio/gong.mp3")).toURI().toString()))); mediaVolumes = new HashMap<>(); for (final Map.Entry entry : mediaPlayers.entrySet()) { @@ -142,7 +143,6 @@ public void setPlayerVolume(final String key, final double newVolume) { logger.debug("Setting volume for MediaPlayer with key {} to {}", key, newVolume); final MediaPlayer player = mediaPlayers.get(key); - if (player == null) throw new NullPointerException(String.format("MediaPlayer with key %s cannot be found!", key)); diff --git a/src/main/java/com/codedead/opal/controller/MainWindowController.java b/src/main/java/com/codedead/opal/controller/MainWindowController.java index f01b532..7e638f6 100644 --- a/src/main/java/com/codedead/opal/controller/MainWindowController.java +++ b/src/main/java/com/codedead/opal/controller/MainWindowController.java @@ -33,6 +33,8 @@ public final class MainWindowController implements IAudioTimer { + @FXML + private SoundPane snpGong; @FXML private SoundPane snpDrumTribal; @FXML @@ -313,6 +315,7 @@ private void initialize() { snpCoffee.getSlider().valueProperty().addListener((observableValue, oldValue, newValue) -> audioController.setPlayerVolume("coffee", newValue.doubleValue() / 100)); snpZoo.getSlider().valueProperty().addListener((observableValue, oldValue, newValue) -> audioController.setPlayerVolume("zoo", newValue.doubleValue() / 100)); snpSleepy.getSlider().valueProperty().addListener((observableValue, oldValue, newValue) -> audioController.setPlayerVolume("sleepy", newValue.doubleValue() / 100)); + snpGong.getSlider().valueProperty().addListener((observableValue, oldValue, newValue) -> audioController.setPlayerVolume("gong", newValue.doubleValue() / 100)); // Audiences snpNetworkingEvent.getSlider().valueProperty().addListener((observableValue, oldValue, newValue) -> audioController.setPlayerVolume("networking", newValue.doubleValue() / 100)); @@ -385,6 +388,7 @@ private void openSoundPreset(final String filePath) { case "football" -> snpFootball.getSlider().setValue(entry.getValue() * 100); case "sleepy" -> snpSleepy.getSlider().setValue(entry.getValue() * 100); case "drumtribal" -> snpDrumTribal.getSlider().setValue(entry.getValue() * 100); + case "gong" -> snpGong.getSlider().setValue(entry.getValue() * 100); default -> logger.info("Unknown key found: {}", entry.getKey()); } } @@ -454,6 +458,7 @@ private void resetAction() { snpFootball.getSlider().setValue(0); snpSleepy.getSlider().setValue(0); snpDrumTribal.getSlider().setValue(0); + snpGong.getSlider().setValue(0); } /** diff --git a/src/main/resources/audio/gong.mp3 b/src/main/resources/audio/gong.mp3 new file mode 100644 index 0000000..d6e6425 Binary files /dev/null and b/src/main/resources/audio/gong.mp3 differ diff --git a/src/main/resources/images/gong.png b/src/main/resources/images/gong.png new file mode 100644 index 0000000..108f0a6 Binary files /dev/null and b/src/main/resources/images/gong.png differ diff --git a/src/main/resources/translations/OpalApplication.properties b/src/main/resources/translations/OpalApplication.properties index 3287c6a..24fb876 100644 --- a/src/main/resources/translations/OpalApplication.properties +++ b/src/main/resources/translations/OpalApplication.properties @@ -73,3 +73,4 @@ TribalFestival=Tribal festival Football=Football Sleepy=Sleepy DrumTribalFestival=Drum tribal festival +Gong=Gong diff --git a/src/main/resources/translations/OpalApplication_de_DE.properties b/src/main/resources/translations/OpalApplication_de_DE.properties index dcbc754..8ad8a2d 100644 --- a/src/main/resources/translations/OpalApplication_de_DE.properties +++ b/src/main/resources/translations/OpalApplication_de_DE.properties @@ -73,3 +73,4 @@ TribalFestival=Stammesfest Football=Football Sleepy=Schläfrig DrumTribalFestival=Stammesfest der Trommeln +Gong=Klingel diff --git a/src/main/resources/translations/OpalApplication_en_US.properties b/src/main/resources/translations/OpalApplication_en_US.properties index 3287c6a..24fb876 100644 --- a/src/main/resources/translations/OpalApplication_en_US.properties +++ b/src/main/resources/translations/OpalApplication_en_US.properties @@ -73,3 +73,4 @@ TribalFestival=Tribal festival Football=Football Sleepy=Sleepy DrumTribalFestival=Drum tribal festival +Gong=Gong diff --git a/src/main/resources/translations/OpalApplication_es_ES.properties b/src/main/resources/translations/OpalApplication_es_ES.properties index e4f8c19..855712b 100644 --- a/src/main/resources/translations/OpalApplication_es_ES.properties +++ b/src/main/resources/translations/OpalApplication_es_ES.properties @@ -73,3 +73,4 @@ TribalFestival=Fiesta tribal Football=Fútbol Sleepy=Somnoliento DrumTribalFestival=Festival tribal de tambores +Gong=Gongo diff --git a/src/main/resources/translations/OpalApplication_fr_FR.properties b/src/main/resources/translations/OpalApplication_fr_FR.properties index 83346e7..b620c13 100644 --- a/src/main/resources/translations/OpalApplication_fr_FR.properties +++ b/src/main/resources/translations/OpalApplication_fr_FR.properties @@ -73,3 +73,4 @@ TribalFestival=Fête tribale Football=Football Sleepy=Somnolent DrumTribalFestival=Fête tribale du tambour +Gong=Gong diff --git a/src/main/resources/translations/OpalApplication_nl_NL.properties b/src/main/resources/translations/OpalApplication_nl_NL.properties index 67cbb30..911f871 100644 --- a/src/main/resources/translations/OpalApplication_nl_NL.properties +++ b/src/main/resources/translations/OpalApplication_nl_NL.properties @@ -73,3 +73,4 @@ TribalFestival=Stammenfestival Football=Voetbal Sleepy=Slaperig DrumTribalFestival=Drumstammenfestival +Gong=Gong diff --git a/src/main/resources/translations/OpalApplication_ru_RU.properties b/src/main/resources/translations/OpalApplication_ru_RU.properties index 8721b92..79e25d4 100644 --- a/src/main/resources/translations/OpalApplication_ru_RU.properties +++ b/src/main/resources/translations/OpalApplication_ru_RU.properties @@ -73,3 +73,4 @@ TribalFestival=Племенной фестиваль Football=Футбол Sleepy=Сонный DrumTribalFestival=Племенной фестиваль барабанов +Gong=Гонг diff --git a/src/main/resources/windows/MainWindow.fxml b/src/main/resources/windows/MainWindow.fxml index 6f5b930..152f4f6 100644 --- a/src/main/resources/windows/MainWindow.fxml +++ b/src/main/resources/windows/MainWindow.fxml @@ -222,6 +222,7 @@ + @@ -236,6 +237,8 @@ image="/images/zen.png"/> +