mirror of
https://github.com/correl/mage.git
synced 2025-04-08 17:00:07 -09:00
Some changes to play of audio clips.
This commit is contained in:
parent
53421a9719
commit
213275de5a
8 changed files with 14 additions and 7 deletions
Mage.Client
sounds
OnGameStart.wavOnPlayerJoined.wavOnPlayerJoinedTable.wavOnSummon-.wavOnTournamentStart.wavOnYourGameStarted.wav
src/main/java/mage/client
BIN
Mage.Client/sounds/OnGameStart.wav
Normal file
BIN
Mage.Client/sounds/OnGameStart.wav
Normal file
Binary file not shown.
BIN
Mage.Client/sounds/OnPlayerJoined.wav
Normal file
BIN
Mage.Client/sounds/OnPlayerJoined.wav
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Mage.Client/sounds/OnTournamentStart.wav
Normal file
BIN
Mage.Client/sounds/OnTournamentStart.wav
Normal file
Binary file not shown.
Binary file not shown.
|
@ -458,6 +458,7 @@ public class CallbackClientImpl implements CallbackClient {
|
||||||
protected void tournamentStarted(UUID tournamentId, UUID playerId) {
|
protected void tournamentStarted(UUID tournamentId, UUID playerId) {
|
||||||
try {
|
try {
|
||||||
frame.showTournament(tournamentId);
|
frame.showTournament(tournamentId);
|
||||||
|
AudioManager.playTournamentStarted();
|
||||||
logger.info("Tournament " + tournamentId + " started for player " + playerId);
|
logger.info("Tournament " + tournamentId + " started for player " + playerId);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
handleException(ex);
|
handleException(ex);
|
||||||
|
|
|
@ -43,6 +43,7 @@ public class AudioManager {
|
||||||
private MageClip onCountdown1 = null;
|
private MageClip onCountdown1 = null;
|
||||||
private MageClip onDraftSelect = null;
|
private MageClip onDraftSelect = null;
|
||||||
|
|
||||||
|
private MageClip tournamentStarted = null;
|
||||||
private MageClip yourGameStarted = null;
|
private MageClip yourGameStarted = null;
|
||||||
private MageClip playerJoinedTable = null;
|
private MageClip playerJoinedTable = null;
|
||||||
private MageClip playerSubmittedDeck = null;
|
private MageClip playerSubmittedDeck = null;
|
||||||
|
@ -232,7 +233,7 @@ public class AudioManager {
|
||||||
|
|
||||||
public static void playPlayerJoinedTable() {
|
public static void playPlayerJoinedTable() {
|
||||||
if (audioManager.playerJoinedTable == null) {
|
if (audioManager.playerJoinedTable == null) {
|
||||||
audioManager.playerJoinedTable = new MageClip(audioManager.loadClip(Constants.BASE_SOUND_PATH + "OnPlayerJoinedTable.wav"),
|
audioManager.playerJoinedTable = new MageClip(audioManager.loadClip(Constants.BASE_SOUND_PATH + "OnPlayerJoined.wav"),
|
||||||
AudioGroup.OtherSounds);
|
AudioGroup.OtherSounds);
|
||||||
}
|
}
|
||||||
checkAndPlayClip(getManager().playerJoinedTable);
|
checkAndPlayClip(getManager().playerJoinedTable);
|
||||||
|
@ -240,12 +241,18 @@ public class AudioManager {
|
||||||
|
|
||||||
public static void playYourGameStarted() {
|
public static void playYourGameStarted() {
|
||||||
if (audioManager.yourGameStarted == null) {
|
if (audioManager.yourGameStarted == null) {
|
||||||
audioManager.yourGameStarted = new MageClip(audioManager.loadClip(Constants.BASE_SOUND_PATH + "OnYourGameStarted.wav"),
|
audioManager.yourGameStarted = new MageClip(audioManager.loadClip(Constants.BASE_SOUND_PATH + "OnGameStart.wav"),
|
||||||
AudioGroup.GameSounds);
|
AudioGroup.OtherSounds);
|
||||||
}
|
}
|
||||||
checkAndPlayClip(getManager().yourGameStarted);
|
checkAndPlayClip(getManager().yourGameStarted);
|
||||||
}
|
}
|
||||||
|
public static void playTournamentStarted() {
|
||||||
|
if (audioManager.tournamentStarted == null) {
|
||||||
|
audioManager.tournamentStarted = new MageClip(audioManager.loadClip(Constants.BASE_SOUND_PATH + "OnTournamentStart.wav"),
|
||||||
|
AudioGroup.OtherSounds);
|
||||||
|
}
|
||||||
|
checkAndPlayClip(getManager().tournamentStarted);
|
||||||
|
}
|
||||||
public static void playPlayerWhispered() {
|
public static void playPlayerWhispered() {
|
||||||
if (audioManager.playerWhispered == null) {
|
if (audioManager.playerWhispered == null) {
|
||||||
audioManager.playerWhispered = new MageClip(audioManager.loadClip(Constants.BASE_SOUND_PATH + "OnPlayerWhispered.wav"),
|
audioManager.playerWhispered = new MageClip(audioManager.loadClip(Constants.BASE_SOUND_PATH + "OnPlayerWhispered.wav"),
|
||||||
|
@ -328,7 +335,7 @@ public class AudioManager {
|
||||||
clip.setFramePosition(0);
|
clip.setFramePosition(0);
|
||||||
clip.start();
|
clip.start();
|
||||||
}
|
}
|
||||||
}).run();
|
}).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
private Clip loadClip(String filename) {
|
private Clip loadClip(String filename) {
|
||||||
|
@ -346,8 +353,7 @@ public class AudioManager {
|
||||||
|
|
||||||
return clip;
|
return clip;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
//e.printStackTrace();
|
log.error("Couldn't load sound: " + filename + ".", e);
|
||||||
log.error("Couldn't load sound: " + filename + ".");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Add table
Reference in a new issue