diff --git a/megamek/src/megamek/client/ui/swing/audio/Sound.java b/megamek/src/megamek/client/ui/swing/audio/Sound.java index f9c010057d2..fa750721396 100644 --- a/megamek/src/megamek/client/ui/swing/audio/Sound.java +++ b/megamek/src/megamek/client/ui/swing/audio/Sound.java @@ -1,3 +1,22 @@ +/* + * Copyright (c) 2023 - The MegaMek Team. All Rights Reserved. + * + * This file is part of MegaMek. + * + * MegaMek is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * MegaMek is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MegaMek. If not, see . + */ + package megamek.client.ui.swing.audio; import javax.sound.sampled.Clip; diff --git a/megamek/src/megamek/client/ui/swing/audio/SoundManager.java b/megamek/src/megamek/client/ui/swing/audio/SoundManager.java index c1bea0ba9a4..285c221b7d8 100644 --- a/megamek/src/megamek/client/ui/swing/audio/SoundManager.java +++ b/megamek/src/megamek/client/ui/swing/audio/SoundManager.java @@ -1,3 +1,22 @@ +/* + * Copyright (c) 2023 - The MegaMek Team. All Rights Reserved. + * + * This file is part of MegaMek. + * + * MegaMek is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * MegaMek is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MegaMek. If not, see . + */ + package megamek.client.ui.swing.audio; import megamek.client.ui.Messages; @@ -26,6 +45,9 @@ public static SoundManager getInstance() { protected SoundManager() { } + /** + * Plays a sound when a chat message is entered + */ public void bingChat() { if(!GUIP.getSoundMuteChat()) { setVolume(bingChat); @@ -33,6 +55,9 @@ public void bingChat() { } } + /** + * Plays a sound when it is the user's turn during a game + */ public void bingMyTurn() { if(!GUIP.getSoundMuteMyTurn()) { setVolume(bingMyTurn); @@ -40,6 +65,9 @@ public void bingMyTurn() { } } + /** + * Plays a sound when it is another user's turn during a game + */ public void bingOthersTurn() { if(!GUIP.getSoundMuteOthersTurn()) { setVolume(bingOthersTurn); @@ -47,6 +75,9 @@ public void bingOthersTurn() { } } + /** + * Loads the sound files from the paths given in the client settings + */ public void loadSoundFiles() { final Clip bingClipChat = loadSoundClip(GUIP.getSoundBingFilenameChat()); bingChat = new Sound(bingClipChat);