Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, MediaPlayer> entry : mediaPlayers.entrySet()) {
Expand Down Expand Up @@ -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));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@

public final class MainWindowController implements IAudioTimer {

@FXML
private SoundPane snpGong;
@FXML
private SoundPane snpDrumTribal;
@FXML
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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());
}
}
Expand Down Expand Up @@ -454,6 +458,7 @@ private void resetAction() {
snpFootball.getSlider().setValue(0);
snpSleepy.getSlider().setValue(0);
snpDrumTribal.getSlider().setValue(0);
snpGong.getSlider().setValue(0);
}

/**
Expand Down
Binary file added src/main/resources/audio/gong.mp3
Binary file not shown.
Binary file added src/main/resources/images/gong.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/main/resources/translations/OpalApplication.properties
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,4 @@ TribalFestival=Tribal festival
Football=Football
Sleepy=Sleepy
DrumTribalFestival=Drum tribal festival
Gong=Gong
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,4 @@ TribalFestival=Stammesfest
Football=Football
Sleepy=Schläfrig
DrumTribalFestival=Stammesfest der Trommeln
Gong=Klingel
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,4 @@ TribalFestival=Tribal festival
Football=Football
Sleepy=Sleepy
DrumTribalFestival=Drum tribal festival
Gong=Gong
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,4 @@ TribalFestival=Fiesta tribal
Football=Fútbol
Sleepy=Somnoliento
DrumTribalFestival=Festival tribal de tambores
Gong=Gongo
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,4 @@ TribalFestival=Fête tribale
Football=Football
Sleepy=Somnolent
DrumTribalFestival=Fête tribale du tambour
Gong=Gong
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,4 @@ TribalFestival=Stammenfestival
Football=Voetbal
Sleepy=Slaperig
DrumTribalFestival=Drumstammenfestival
Gong=Gong
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,4 @@ TribalFestival=Племенной фестиваль
Football=Футбол
Sleepy=Сонный
DrumTribalFestival=Племенной фестиваль барабанов
Gong=Гонг
3 changes: 3 additions & 0 deletions src/main/resources/windows/MainWindow.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@
<RowConstraints vgrow="ALWAYS"/>
<RowConstraints vgrow="ALWAYS"/>
<RowConstraints vgrow="ALWAYS"/>
<RowConstraints vgrow="ALWAYS"/>
</rowConstraints>

<columnConstraints>
Expand All @@ -236,6 +237,8 @@
image="/images/zen.png"/>
<SoundPane fx:id="snpSleepy" GridPane.rowIndex="3" volume="0" name="%Sleepy"
image="/images/sleepy.png"/>
<SoundPane fx:id="snpGong" GridPane.rowIndex="4" volume="0" name="%Gong"
image="/images/gong.png"/>
</GridPane>
</GridPane>
</ScrollPane>
Expand Down