diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-12-03 17:10:39 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-12-03 17:10:39 +0300 |
commit | 494ac0ccdf545e8055c83c22b8b2fbf9e045b32a (patch) | |
tree | 29dd8c4740fa8a43ebf82037c2e4091b1700a4e4 | |
parent | aa1e8a7a7236d49d91501eac2da81bdb96f0bba5 (diff) | |
download | plus-494ac0ccdf545e8055c83c22b8b2fbf9e045b32a.tar.gz plus-494ac0ccdf545e8055c83c22b8b2fbf9e045b32a.tar.bz2 plus-494ac0ccdf545e8055c83c22b8b2fbf9e045b32a.tar.xz plus-494ac0ccdf545e8055c83c22b8b2fbf9e045b32a.zip |
Rename sound.cpp/h to soundmanager.
-rw-r--r-- | src/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/Makefile.am | 4 | ||||
-rw-r--r-- | src/actionmanager.cpp | 2 | ||||
-rw-r--r-- | src/actorsprite.cpp | 2 | ||||
-rw-r--r-- | src/being.cpp | 2 | ||||
-rw-r--r-- | src/client.cpp | 4 | ||||
-rw-r--r-- | src/effectmanager.cpp | 2 | ||||
-rw-r--r-- | src/game.cpp | 2 | ||||
-rw-r--r-- | src/gui/chatwindow.cpp | 2 | ||||
-rw-r--r-- | src/gui/confirmdialog.cpp | 2 | ||||
-rw-r--r-- | src/gui/npcdialog.cpp | 2 | ||||
-rw-r--r-- | src/gui/okdialog.cpp | 2 | ||||
-rw-r--r-- | src/gui/questswindow.cpp | 2 | ||||
-rw-r--r-- | src/gui/quitdialog.cpp | 2 | ||||
-rw-r--r-- | src/gui/setup_audio.cpp | 2 | ||||
-rw-r--r-- | src/gui/shopwindow.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/chattab.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/guildchattab.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/setupitem.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/window.cpp | 2 | ||||
-rw-r--r-- | src/localplayer.cpp | 2 | ||||
-rw-r--r-- | src/net/ea/gui/guildtab.cpp | 2 | ||||
-rw-r--r-- | src/net/ea/gui/partytab.cpp | 2 | ||||
-rw-r--r-- | src/soundmanager.cpp (renamed from src/sound.cpp) | 76 | ||||
-rw-r--r-- | src/soundmanager.h (renamed from src/sound.h) | 16 | ||||
-rw-r--r-- | src/statuseffect.cpp | 2 | ||||
-rw-r--r-- | src/test/testlauncher.cpp | 2 |
27 files changed, 74 insertions, 74 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 944423738..3cbf014a9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -635,8 +635,8 @@ SET(SRCS shopitem.h simpleanimation.cpp simpleanimation.h - sound.cpp - sound.h + soundmanager.cpp + soundmanager.h sprite.h statuseffect.cpp statuseffect.h diff --git a/src/Makefile.am b/src/Makefile.am index 1f1dd23a0..a02c5da69 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -639,8 +639,8 @@ manaplus_SOURCES += gui/widgets/avatarlistbox.cpp \ shopitem.h \ simpleanimation.cpp \ simpleanimation.h \ - sound.cpp \ - sound.h \ + soundmanager.cpp \ + soundmanager.h \ sprite.h \ statuseffect.cpp \ statuseffect.h \ diff --git a/src/actionmanager.cpp b/src/actionmanager.cpp index 3cb49f340..dd9239c12 100644 --- a/src/actionmanager.cpp +++ b/src/actionmanager.cpp @@ -31,7 +31,7 @@ #include "localplayer.h" #include "playerinfo.h" #include "playerrelations.h" -#include "sound.h" +#include "soundmanager.h" #include "gui/botcheckerwindow.h" #include "gui/buyselldialog.h" diff --git a/src/actorsprite.cpp b/src/actorsprite.cpp index edc954d28..f436047e5 100644 --- a/src/actorsprite.cpp +++ b/src/actorsprite.cpp @@ -28,7 +28,7 @@ #include "imagesprite.h" #include "localplayer.h" #include "simpleanimation.h" -#include "sound.h" +#include "soundmanager.h" #include "statuseffect.h" #include "gui/theme.h" diff --git a/src/being.cpp b/src/being.cpp index fe84cdaaf..c425f89a4 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -35,7 +35,7 @@ #include "party.h" #include "playerrelations.h" #include "simpleanimation.h" -#include "sound.h" +#include "soundmanager.h" #include "text.h" #include "gui/equipmentwindow.h" diff --git a/src/client.cpp b/src/client.cpp index 6ea0ad11f..1265d048f 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -41,7 +41,7 @@ #include "keyboardconfig.h" #include "party.h" #include "playerrelations.h" -#include "sound.h" +#include "soundmanager.h" #include "statuseffect.h" #include "units.h" #include "touchmanager.h" @@ -146,7 +146,7 @@ KeyboardConfig keyboard; UserPalette *userPalette = nullptr; Graphics *mainGraphics = nullptr; -Sound sound; +SoundManager sound; int openGLMode = 0; static uint32_t nextTick(uint32_t interval, void *param A_UNUSED); diff --git a/src/effectmanager.cpp b/src/effectmanager.cpp index f80a16972..aea3fed3c 100644 --- a/src/effectmanager.cpp +++ b/src/effectmanager.cpp @@ -25,7 +25,7 @@ #include "being.h" #include "logger.h" #include "particle.h" -#include "sound.h" +#include "soundmanager.h" #include "debug.h" diff --git a/src/game.cpp b/src/game.cpp index 8716ba0e4..f2b88769f 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -40,7 +40,7 @@ #include "localplayer.h" #include "particle.h" #include "playerinfo.h" -#include "sound.h" +#include "soundmanager.h" #include "spellshortcut.h" #include "gui/botcheckerwindow.h" diff --git a/src/gui/chatwindow.cpp b/src/gui/chatwindow.cpp index 9ba871575..7919fff24 100644 --- a/src/gui/chatwindow.cpp +++ b/src/gui/chatwindow.cpp @@ -34,7 +34,7 @@ #include "party.h" #include "playerinfo.h" #include "spellshortcut.h" -#include "sound.h" +#include "soundmanager.h" #include "gui/gui.h" #include "gui/setup.h" diff --git a/src/gui/confirmdialog.cpp b/src/gui/confirmdialog.cpp index 65fdb9fd1..0ec54c5d9 100644 --- a/src/gui/confirmdialog.cpp +++ b/src/gui/confirmdialog.cpp @@ -22,7 +22,7 @@ #include "gui/confirmdialog.h" -#include "sound.h" +#include "soundmanager.h" #include "gui/gui.h" diff --git a/src/gui/npcdialog.cpp b/src/gui/npcdialog.cpp index 1eb5e9800..f552deb60 100644 --- a/src/gui/npcdialog.cpp +++ b/src/gui/npcdialog.cpp @@ -25,7 +25,7 @@ #include "being.h" #include "configuration.h" #include "client.h" -#include "sound.h" +#include "soundmanager.h" #include "gui/gui.h" #include "gui/sdlfont.h" diff --git a/src/gui/okdialog.cpp b/src/gui/okdialog.cpp index 5d0f2a01f..ad379e656 100644 --- a/src/gui/okdialog.cpp +++ b/src/gui/okdialog.cpp @@ -22,7 +22,7 @@ #include "gui/okdialog.h" -#include "sound.h" +#include "soundmanager.h" #include "gui/gui.h" diff --git a/src/gui/questswindow.cpp b/src/gui/questswindow.cpp index 3991c8172..16fe7190b 100644 --- a/src/gui/questswindow.cpp +++ b/src/gui/questswindow.cpp @@ -21,7 +21,7 @@ #include "gui/questswindow.h" #include "configuration.h" -#include "sound.h" +#include "soundmanager.h" #include "gui/gui.h" #include "gui/sdlfont.h" diff --git a/src/gui/quitdialog.cpp b/src/gui/quitdialog.cpp index f2c6602cd..4e5cb4a05 100644 --- a/src/gui/quitdialog.cpp +++ b/src/gui/quitdialog.cpp @@ -26,7 +26,7 @@ #include "game.h" #include "keydata.h" #include "keyevent.h" -#include "sound.h" +#include "soundmanager.h" #include "gui/chatwindow.h" #include "gui/npcdialog.h" diff --git a/src/gui/setup_audio.cpp b/src/gui/setup_audio.cpp index 9ee897cd4..15fd23d33 100644 --- a/src/gui/setup_audio.cpp +++ b/src/gui/setup_audio.cpp @@ -25,7 +25,7 @@ #include "main.h" #include "configuration.h" -#include "sound.h" +#include "soundmanager.h" #include "gui/viewport.h" diff --git a/src/gui/shopwindow.cpp b/src/gui/shopwindow.cpp index a9afab262..8be665d08 100644 --- a/src/gui/shopwindow.cpp +++ b/src/gui/shopwindow.cpp @@ -49,7 +49,7 @@ #include "playerinfo.h" #include "playerrelations.h" #include "shopitem.h" -#include "sound.h" +#include "soundmanager.h" #include "units.h" #include "net/net.h" diff --git a/src/gui/widgets/chattab.cpp b/src/gui/widgets/chattab.cpp index 4e6e7c522..d2d66e681 100644 --- a/src/gui/widgets/chattab.cpp +++ b/src/gui/widgets/chattab.cpp @@ -28,7 +28,7 @@ #include "commandhandler.h" #include "configuration.h" #include "localplayer.h" -#include "sound.h" +#include "soundmanager.h" #include "gui/helpwindow.h" diff --git a/src/gui/widgets/guildchattab.cpp b/src/gui/widgets/guildchattab.cpp index 442bb44e2..5d60c2a29 100644 --- a/src/gui/widgets/guildchattab.cpp +++ b/src/gui/widgets/guildchattab.cpp @@ -26,7 +26,7 @@ #include "guild.h" #include "guildmanager.h" #include "localplayer.h" -#include "sound.h" +#include "soundmanager.h" #include "resources/iteminfo.h" #include "resources/itemdb.h" diff --git a/src/gui/widgets/setupitem.cpp b/src/gui/widgets/setupitem.cpp index 3a273e419..cb6dc378a 100644 --- a/src/gui/widgets/setupitem.cpp +++ b/src/gui/widgets/setupitem.cpp @@ -22,7 +22,7 @@ #include "configuration.h" #include "main.h" -#include "sound.h" +#include "soundmanager.h" #include "gui/editdialog.h" #include "gui/gui.h" diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index 8c1f63e29..83ae2e42b 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -25,7 +25,7 @@ #include "client.h" #include "configuration.h" #include "graphicsvertexes.h" -#include "sound.h" +#include "soundmanager.h" #include "gui/gui.h" #include "gui/viewport.h" diff --git a/src/localplayer.cpp b/src/localplayer.cpp index d387cdd40..3ec5c6b71 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -36,7 +36,7 @@ #include "playerinfo.h" #include "playerrelations.h" #include "simpleanimation.h" -#include "sound.h" +#include "soundmanager.h" #include "statuseffect.h" #include "dropshortcut.h" diff --git a/src/net/ea/gui/guildtab.cpp b/src/net/ea/gui/guildtab.cpp index 7d7c5119e..d1aef6b12 100644 --- a/src/net/ea/gui/guildtab.cpp +++ b/src/net/ea/gui/guildtab.cpp @@ -25,7 +25,7 @@ #include "chatlogger.h" #include "guild.h" #include "localplayer.h" -#include "sound.h" +#include "soundmanager.h" #include "net/net.h" diff --git a/src/net/ea/gui/partytab.cpp b/src/net/ea/gui/partytab.cpp index e5b2c586b..5a6615038 100644 --- a/src/net/ea/gui/partytab.cpp +++ b/src/net/ea/gui/partytab.cpp @@ -26,7 +26,7 @@ #include "commandhandler.h" #include "localplayer.h" #include "party.h" -#include "sound.h" +#include "soundmanager.h" #include "net/net.h" #include "net/partyhandler.h" diff --git a/src/sound.cpp b/src/soundmanager.cpp index a316abc9d..9a3bc3185 100644 --- a/src/sound.cpp +++ b/src/soundmanager.cpp @@ -20,7 +20,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "sound.h" +#include "soundmanager.h" #include "configuration.h" #include "localplayer.h" @@ -48,7 +48,7 @@ static void fadeOutCallBack() sFadingOutEnded = true; } -Sound::Sound(): +SoundManager::SoundManager(): mInstalled(false), mSfxVolume(100), mMusicVolume(60), @@ -64,7 +64,7 @@ Sound::Sound(): Mix_HookMusicFinished(fadeOutCallBack); } -Sound::~Sound() +SoundManager::~SoundManager() { config.removeListeners(this); @@ -72,7 +72,7 @@ Sound::~Sound() Mix_HookMusicFinished(nullptr); } -void Sound::optionChanged(const std::string &value) +void SoundManager::optionChanged(const std::string &value) { if (value == "playBattleSound") mPlayBattle = config.getBoolValue("playBattleSound"); @@ -86,13 +86,13 @@ void Sound::optionChanged(const std::string &value) setMusicVolume(config.getIntValue("musicVolume")); } -void Sound::init() +void SoundManager::init() { // Don't initialize sound engine twice if (mInstalled) return; - logger->log1("Sound::init() Initializing sound..."); + logger->log1("SoundManager::init() Initializing sound..."); mPlayBattle = config.getBoolValue("playBattleSound"); mPlayGui = config.getBoolValue("playGuiSound"); @@ -105,7 +105,7 @@ void Sound::init() if (SDL_InitSubSystem(SDL_INIT_AUDIO) == -1) { - logger->log1("Sound::init() Failed to initialize audio subsystem"); + logger->log1("SoundManager::init() Failed to initialize audio subsystem"); return; } @@ -128,7 +128,7 @@ void Sound::init() if (res < 0) { - logger->log("Sound::init Could not initialize audio: %s", + logger->log("SoundManager::init Could not initialize audio: %s", Mix_GetError()); if (Mix_OpenAudio(22010, MIX_DEFAULT_FORMAT, 2, audioBuffer) < 0) return; @@ -147,7 +147,7 @@ void Sound::init() playMusic(mCurrentMusicFile); } -void Sound::info() const +void SoundManager::info() const { SDL_version compiledVersion; const SDL_version *linkedVersion; @@ -174,28 +174,28 @@ void Sound::info() const default: break; } - logger->log("Sound::info() SDL_mixer: %i.%i.%i (compiled)", + logger->log("SoundManager::info() SDL_mixer: %i.%i.%i (compiled)", compiledVersion.major, compiledVersion.minor, compiledVersion.patch); if (linkedVersion) { - logger->log("Sound::info() SDL_mixer: %i.%i.%i (linked)", + logger->log("SoundManager::info() SDL_mixer: %i.%i.%i (linked)", linkedVersion->major, linkedVersion->minor, linkedVersion->patch); } else { - logger->log1("Sound::info() SDL_mixer: unknown"); + logger->log1("SoundManager::info() SDL_mixer: unknown"); } - logger->log("Sound::info() Driver: %s", driver); - logger->log("Sound::info() Format: %s", format); - logger->log("Sound::info() Rate: %i", rate); - logger->log("Sound::info() Channels: %i", channels); + logger->log("SoundManager::info() Driver: %s", driver); + logger->log("SoundManager::info() Format: %s", format); + logger->log("SoundManager::info() Rate: %i", rate); + logger->log("SoundManager::info() Channels: %i", channels); } -void Sound::setMusicVolume(const int volume) +void SoundManager::setMusicVolume(const int volume) { mMusicVolume = volume; @@ -203,7 +203,7 @@ void Sound::setMusicVolume(const int volume) Mix_VolumeMusic(mMusicVolume); } -void Sound::setSfxVolume(const int volume) +void SoundManager::setSfxVolume(const int volume) { mSfxVolume = volume; @@ -217,7 +217,7 @@ static SDLMusic *loadMusic(const std::string &fileName) return resman->getMusic(paths.getStringValue("music") + fileName); } -void Sound::playMusic(const std::string &fileName) +void SoundManager::playMusic(const std::string &fileName) { mCurrentMusicFile = fileName; @@ -234,12 +234,12 @@ void Sound::playMusic(const std::string &fileName) } } -void Sound::stopMusic() +void SoundManager::stopMusic() { haltMusic(); } -void Sound::fadeInMusic(const std::string &fileName, const int ms) +void SoundManager::fadeInMusic(const std::string &fileName, const int ms) { mCurrentMusicFile = fileName; @@ -256,14 +256,14 @@ void Sound::fadeInMusic(const std::string &fileName, const int ms) } } -void Sound::fadeOutMusic(const int ms) +void SoundManager::fadeOutMusic(const int ms) { mCurrentMusicFile.clear(); if (!mInstalled) return; - logger->log("Sound::fadeOutMusic() Fading-out (%i ms)", ms); + logger->log("SoundManager::fadeOutMusic() Fading-out (%i ms)", ms); if (mMusic) { @@ -277,15 +277,15 @@ void Sound::fadeOutMusic(const int ms) } } -void Sound::fadeOutAndPlayMusic(const std::string &fileName, const int ms) +void SoundManager::fadeOutAndPlayMusic(const std::string &fileName, const int ms) { mNextMusicFile = fileName; fadeOutMusic(ms); } -void Sound::logic() +void SoundManager::logic() { - BLOCK_START("Sound::logic") + BLOCK_START("SoundManager::logic") if (sFadingOutEnded) { if (mMusic) @@ -301,10 +301,10 @@ void Sound::logic() mNextMusicFile.clear(); } } - BLOCK_END("Sound::logic") + BLOCK_END("SoundManager::logic") } -void Sound::playSfx(const std::string &path, const int x, const int y) const +void SoundManager::playSfx(const std::string &path, const int x, const int y) const { if (!mInstalled || path.empty() || !mPlayBattle) return; @@ -318,7 +318,7 @@ void Sound::playSfx(const std::string &path, const int x, const int y) const SoundEffect *const sample = resman->getSoundEffect(tmpPath); if (sample) { - logger->log("Sound::playSfx() Playing: %s", path.c_str()); + logger->log("SoundManager::playSfx() Playing: %s", path.c_str()); int vol = 120; if (player_node && (x > 0 || y > 0)) { @@ -338,13 +338,13 @@ void Sound::playSfx(const std::string &path, const int x, const int y) const } } -void Sound::playGuiSound(const std::string &name) +void SoundManager::playGuiSound(const std::string &name) { playGuiSfx(branding.getStringValue("systemsounds") + config.getStringValue(name) + ".ogg"); } -void Sound::playGuiSfx(const std::string &path) +void SoundManager::playGuiSfx(const std::string &path) { if (!mInstalled || path.empty() || !mPlayGui) return; @@ -358,26 +358,26 @@ void Sound::playGuiSfx(const std::string &path) SoundEffect *const sample = resman->getSoundEffect(tmpPath); if (sample) { - logger->log("Sound::playGuiSfx() Playing: %s", path.c_str()); + logger->log("SoundManager::playGuiSfx() Playing: %s", path.c_str()); const int ret = sample->play(0, 120, mGuiChannel); if (ret != -1) mGuiChannel = ret; } } -void Sound::close() +void SoundManager::close() { if (!mInstalled) return; haltMusic(); - logger->log1("Sound::close() Shutting down sound..."); + logger->log1("SoundManager::close() Shutting down sound..."); Mix_CloseAudio(); mInstalled = false; } -void Sound::haltMusic() +void SoundManager::haltMusic() { if (!mMusic) return; @@ -390,7 +390,7 @@ void Sound::haltMusic() } } -void Sound::changeAudio() +void SoundManager::changeAudio() { if (mInstalled) close(); @@ -398,7 +398,7 @@ void Sound::changeAudio() init(); } -void Sound::volumeOff() const +void SoundManager::volumeOff() const { if (mInstalled) { @@ -407,7 +407,7 @@ void Sound::volumeOff() const } } -void Sound::volumeRestore() +void SoundManager::volumeRestore() { if (mInstalled) { diff --git a/src/sound.h b/src/soundmanager.h index 12b75a86b..4ea36c27e 100644 --- a/src/sound.h +++ b/src/soundmanager.h @@ -20,8 +20,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef SOUND_H -#define SOUND_H +#ifndef SOUNDMANAGER_H +#define SOUNDMANAGER_H #include <SDL_mixer.h> @@ -44,18 +44,18 @@ static const std::string SOUND_GUILD = "soundguild"; static const std::string SOUND_SHOW_WINDOW = "soundshowwindow"; static const std::string SOUND_HIDE_WINDOW = "soundhidewindow"; -/** Sound engine +/** SoundManager * * \ingroup CORE */ -class Sound final : public ConfigListener +class SoundManager final : public ConfigListener { public: - Sound(); + SoundManager(); - A_DELETE_COPY(Sound) + A_DELETE_COPY(SoundManager) - ~Sound(); + ~SoundManager(); void optionChanged(const std::string &value) override; @@ -171,6 +171,6 @@ class Sound final : public ConfigListener int mGuiChannel; }; -extern Sound sound; +extern SoundManager sound; #endif diff --git a/src/statuseffect.cpp b/src/statuseffect.cpp index 82d77a14b..ef0a8ce10 100644 --- a/src/statuseffect.cpp +++ b/src/statuseffect.cpp @@ -23,7 +23,7 @@ #include "statuseffect.h" #include "logger.h" -#include "sound.h" +#include "soundmanager.h" #include "gui/widgets/chattab.h" diff --git a/src/test/testlauncher.cpp b/src/test/testlauncher.cpp index 6d79f2e8e..2b1ea448a 100644 --- a/src/test/testlauncher.cpp +++ b/src/test/testlauncher.cpp @@ -26,7 +26,7 @@ #include "configuration.h" #include "graphics.h" #include "graphicsmanager.h" -#include "sound.h" +#include "soundmanager.h" #include "gui/theme.h" |