diff --git a/Mage.Client/plugins/sounds/OnPlayerJoinedTable.wav b/Mage.Client/plugins/sounds/OnPlayerJoinedTable.wav new file mode 100644 index 0000000000..a8c11bb354 Binary files /dev/null and b/Mage.Client/plugins/sounds/OnPlayerJoinedTable.wav differ diff --git a/Mage.Client/src/main/java/mage/client/dialog/TableWaitingDialog.java b/Mage.Client/src/main/java/mage/client/dialog/TableWaitingDialog.java index 99a5dd0c6b..6d1a0666b1 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/TableWaitingDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/TableWaitingDialog.java @@ -49,6 +49,7 @@ import java.util.List; import java.util.UUID; import java.util.concurrent.CancellationException; import java.util.concurrent.ExecutionException; +import mage.client.util.AudioManager; /** * @@ -392,6 +393,7 @@ class UpdateSeatsTask extends SwingWorker { if (count > 0) { if (current > count) { MageTray.getInstance().displayMessage("New player joined your game."); + AudioManager.playPlayerJoinedTable(); } else { MageTray.getInstance().displayMessage("A player left your game."); } diff --git a/Mage.Client/src/main/java/mage/client/util/AudioManager.java b/Mage.Client/src/main/java/mage/client/util/AudioManager.java index 252ab22a30..cfed0bd6b4 100644 --- a/Mage.Client/src/main/java/mage/client/util/AudioManager.java +++ b/Mage.Client/src/main/java/mage/client/util/AudioManager.java @@ -1,12 +1,15 @@ package mage.client.util; +import java.io.File; +import javax.sound.sampled.AudioFormat; +import javax.sound.sampled.AudioInputStream; +import javax.sound.sampled.AudioSystem; +import javax.sound.sampled.Clip; +import javax.sound.sampled.DataLine; import mage.client.constants.Constants; import mage.client.dialog.PreferencesDialog; import org.apache.log4j.Logger; -import javax.sound.sampled.*; -import java.io.File; - /** * Manager class for playing audio files. * @@ -42,6 +45,8 @@ public class AudioManager { audioManager.addArtifactClip = audioManager.loadClip(Constants.BASE_SOUND_PATH + "OnAddArtifact.wav"); audioManager.updateStackClip = audioManager.loadClip(Constants.BASE_SOUND_PATH + "OnStackNew.wav"); audioManager.onHover = audioManager.loadClip(Constants.BASE_SOUND_PATH + "OnHover.wav"); + + audioManager.playerJoinedTable = audioManager.loadClip(Constants.BASE_SOUND_PATH + "OnPlayerJoinedTable.wav"); } return audioManager; } @@ -114,6 +119,10 @@ public class AudioManager { checkAndPlayClip(getManager().onHover); } + public static void playPlayerJoinedTable() { + checkAndPlayClip(getManager().playerJoinedTable); + } + private static void checkAndPlayClip(Clip clip) { try { if (clip != null) { @@ -175,4 +184,6 @@ public class AudioManager { private Clip addArtifactClip = null; private Clip updateStackClip = null; private Clip onHover = null; + + private Clip playerJoinedTable = null; }