Renamed SoundManager into MusicManager, since this makes it much clearer what it does (it was just confusing to have SoundManager and SFXManager)

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@5228 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2010-04-21 17:24:02 +00:00
parent c12618a48a
commit 297f0cceb4
20 changed files with 68 additions and 72 deletions

View File

@ -25,11 +25,11 @@ supertuxkart_SOURCES = \
audio/music.hpp \
audio/music_information.cpp \
audio/music_information.hpp \
audio/music_manager.cpp \
audio/music_manager.hpp \
audio/music_ogg.cpp \
audio/music_ogg.hpp \
audio/sfx_base.hpp \
audio/sfx_manager.cpp \
audio/sfx_manager.hpp \
audio/sfx_openal.cpp \
audio/sfx_openal.hpp \
audio/sound_manager.cpp \

View File

@ -18,7 +18,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "audio/sound_manager.hpp"
#include "audio/music_manager.hpp"
#include <assert.h>
#include <fstream>
@ -36,10 +36,10 @@
#include "io/file_manager.hpp"
#include "utils/string_utils.hpp"
SoundManager* sound_manager= NULL;
MusicManager* music_manager= NULL;
SoundManager::SoundManager()
MusicManager::MusicManager()
{
m_current_music= NULL;
setMasterMusicVolume(UserConfigParams::m_music_volume);
@ -70,10 +70,10 @@ SoundManager::SoundManager()
alGetError(); //Called here to clear any non-important errors found
loadMusicInformation();
} // SoundManager
} // MusicManager
//-----------------------------------------------------------------------------
SoundManager::~SoundManager()
MusicManager::~MusicManager()
{
stopMusic();
@ -87,10 +87,10 @@ SoundManager::~SoundManager()
alcCloseDevice( device );
}
} // ~SoundManager
} // ~MusicManager
//-----------------------------------------------------------------------------
void SoundManager::loadMusicInformation()
void MusicManager::loadMusicInformation()
{
// Load music files from data/music, and dirs defined in SUPERTUXKART_MUSIC_PATH
std::vector<std::string> allMusicDirs=file_manager->getMusicDirs();
@ -102,7 +102,7 @@ void SoundManager::loadMusicInformation()
} // loadMusicInformation
//-----------------------------------------------------------------------------
void SoundManager::loadMusicFromOneDir(const std::string& dir)
void MusicManager::loadMusicFromOneDir(const std::string& dir)
{
std::set<std::string> files;
file_manager->listFiles(files, dir, /*is_full_path*/ true,
@ -115,7 +115,7 @@ void SoundManager::loadMusicFromOneDir(const std::string& dir)
} // loadMusicFromOneDir
//-----------------------------------------------------------------------------
void SoundManager::addMusicToTracks()
void MusicManager::addMusicToTracks()
{
for(std::map<std::string,MusicInformation*>::iterator i=m_allMusic.begin();
i!=m_allMusic.end(); i++)
@ -131,7 +131,7 @@ void SoundManager::addMusicToTracks()
} // addMusicToTracks
//-----------------------------------------------------------------------------
void SoundManager::startMusic(MusicInformation* mi)
void MusicManager::startMusic(MusicInformation* mi)
{
// It is possible here that startMusic() will be called without first calling stopMusic().
// This would cause a memory leak by overwriting m_current_music without first releasing it's resources.
@ -146,13 +146,13 @@ void SoundManager::startMusic(MusicInformation* mi)
} // startMusic
//-----------------------------------------------------------------------------
void SoundManager::stopMusic()
void MusicManager::stopMusic()
{
if(m_current_music) m_current_music->stopMusic();
} // stopMusic
//-----------------------------------------------------------------------------
void SoundManager::setMasterMusicVolume(float gain)
void MusicManager::setMasterMusicVolume(float gain)
{
if(gain > 1.0)
gain = 1.0f;
@ -167,7 +167,7 @@ void SoundManager::setMasterMusicVolume(float gain)
//-----------------------------------------------------------------------------
MusicInformation* SoundManager::getMusicInformation(const std::string& filename)
MusicInformation* MusicManager::getMusicInformation(const std::string& filename)
{
if(filename=="")
{

View File

@ -18,8 +18,8 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef HEADER_SOUNDMANAGER_HPP
#define HEADER_SOUNDMANAGER_HPP
#ifndef HEADER_MUSICMANAGER_HPP
#define HEADER_MUSICMANAGER_HPP
#include <map>
#include <vector>
@ -30,7 +30,7 @@
class Vec3;
class SoundManager
class MusicManager
{
private:
MusicInformation *m_current_music;
@ -46,8 +46,8 @@ private:
float m_masterGain;
public:
SoundManager();
virtual ~SoundManager();
MusicManager();
virtual ~MusicManager();
void startMusic(MusicInformation* mi);
void stopMusic();
@ -76,7 +76,7 @@ public:
};
extern SoundManager* sound_manager;
extern MusicManager* music_manager;
#endif // HEADER_SOUNDMANAGER_HPP

View File

@ -28,7 +28,7 @@
# include <AL/al.h>
#endif
#include "audio/sound_manager.hpp"
#include "audio/music_manager.hpp"
#include "config/user_config.hpp"
#include "utils/constants.hpp"

View File

@ -17,7 +17,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "audio/sound_manager.hpp"
#include "audio/music_manager.hpp"
#include <sstream>
#include <stdexcept>
@ -53,7 +53,7 @@ std::map<std::string, SFXBase*> SFXManager::m_quick_sounds;
SFXManager::SFXManager()
{
// The sound manager initialises OpenAL
m_initialized = sound_manager->initialized();
m_initialized = music_manager->initialized();
m_master_gain = 1.0f;
loadSfx();

View File

@ -22,7 +22,7 @@
#include "math.h"
#include "audio/sound_manager.hpp"
#include "audio/music_manager.hpp"
#include "config/user_config.hpp"
#include "graphics/irr_driver.hpp"
#include "karts/kart.hpp"

View File

@ -21,7 +21,7 @@
#include <vector>
#include "main_loop.hpp"
#include "audio/sound_manager.hpp"
#include "audio/music_manager.hpp"
#include "guiengine/engine.hpp"
#include "guiengine/screen.hpp"
#include "input/device_manager.hpp"
@ -194,7 +194,7 @@ void AbstractStateManager::setGameState(GameState state)
if (m_game_mode == MENU)
{
//FIXME: not up to the *abstract* state manager to do this
sound_manager->startMusic(stk_config->m_title_music);
music_manager->startMusic(stk_config->m_title_music);
}
}
}

View File

@ -53,7 +53,6 @@
9551C8280FC1B72500DB481B /* music_ogg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95C2AC2A0F296540000D3E5D /* music_ogg.cpp */; };
9551C8290FC1B72500DB481B /* sfx_manager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95C2AC2D0F296540000D3E5D /* sfx_manager.cpp */; };
9551C82A0FC1B72500DB481B /* sfx_openal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95C2AC2F0F296540000D3E5D /* sfx_openal.cpp */; };
9551C82B0FC1B72500DB481B /* sound_manager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95C2AC310F296540000D3E5D /* sound_manager.cpp */; };
9551C8350FC1B72500DB481B /* btAxisSweep3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95C2AD2E0F296541000D3E5D /* btAxisSweep3.cpp */; };
9551C8360FC1B72500DB481B /* btBroadphaseProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95C2AD310F296541000D3E5D /* btBroadphaseProxy.cpp */; };
9551C8370FC1B72500DB481B /* btCollisionAlgorithm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95C2AD330F296541000D3E5D /* btCollisionAlgorithm.cpp */; };
@ -258,6 +257,7 @@
95833240101243ED00C5137E /* player_info_dialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95833239101243ED00C5137E /* player_info_dialog.cpp */; };
95833241101243ED00C5137E /* press_a_key_dialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9583323B101243ED00C5137E /* press_a_key_dialog.cpp */; };
95833242101243ED00C5137E /* track_info_dialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9583323D101243ED00C5137E /* track_info_dialog.cpp */; };
958BD770117F6AE90095B483 /* music_manager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 958BD76E117F6AE90095B483 /* music_manager.cpp */; };
958D8C54104F523000A81934 /* race_paused_dialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 958D8C53104F523000A81934 /* race_paused_dialog.cpp */; };
959482D310EBC0790031BADF /* track_object_manager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 959482CF10EBC0790031BADF /* track_object_manager.cpp */; };
959482D410EBC0790031BADF /* track_object.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 959482D110EBC0790031BADF /* track_object.cpp */; };
@ -466,6 +466,8 @@
9583323C101243ED00C5137E /* press_a_key_dialog.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = press_a_key_dialog.hpp; path = ../../states_screens/dialogs/press_a_key_dialog.hpp; sourceTree = SOURCE_ROOT; };
9583323D101243ED00C5137E /* track_info_dialog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = track_info_dialog.cpp; path = ../../states_screens/dialogs/track_info_dialog.cpp; sourceTree = SOURCE_ROOT; };
9583323E101243ED00C5137E /* track_info_dialog.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = track_info_dialog.hpp; path = ../../states_screens/dialogs/track_info_dialog.hpp; sourceTree = SOURCE_ROOT; };
958BD76E117F6AE90095B483 /* music_manager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = music_manager.cpp; path = ../../audio/music_manager.cpp; sourceTree = SOURCE_ROOT; };
958BD76F117F6AE90095B483 /* music_manager.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = music_manager.hpp; path = ../../audio/music_manager.hpp; sourceTree = SOURCE_ROOT; };
958D8C52104F523000A81934 /* race_paused_dialog.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = race_paused_dialog.hpp; path = ../../states_screens/dialogs/race_paused_dialog.hpp; sourceTree = SOURCE_ROOT; };
958D8C53104F523000A81934 /* race_paused_dialog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = race_paused_dialog.cpp; path = ../../states_screens/dialogs/race_paused_dialog.cpp; sourceTree = SOURCE_ROOT; };
959482CF10EBC0790031BADF /* track_object_manager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = track_object_manager.cpp; path = ../../tracks/track_object_manager.cpp; sourceTree = SOURCE_ROOT; };
@ -493,8 +495,6 @@
95C2AC2E0F296540000D3E5D /* sfx_manager.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = sfx_manager.hpp; path = ../../audio/sfx_manager.hpp; sourceTree = SOURCE_ROOT; };
95C2AC2F0F296540000D3E5D /* sfx_openal.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = sfx_openal.cpp; path = ../../audio/sfx_openal.cpp; sourceTree = SOURCE_ROOT; };
95C2AC300F296540000D3E5D /* sfx_openal.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = sfx_openal.hpp; path = ../../audio/sfx_openal.hpp; sourceTree = SOURCE_ROOT; };
95C2AC310F296540000D3E5D /* sound_manager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = sound_manager.cpp; path = ../../audio/sound_manager.cpp; sourceTree = SOURCE_ROOT; };
95C2AC320F296540000D3E5D /* sound_manager.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = sound_manager.hpp; path = ../../audio/sound_manager.hpp; sourceTree = SOURCE_ROOT; };
95C2ACD30F296541000D3E5D /* btBulletCollisionCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = btBulletCollisionCommon.h; path = ../../bullet/src/btBulletCollisionCommon.h; sourceTree = SOURCE_ROOT; };
95C2ACD40F296541000D3E5D /* btBulletDynamicsCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = btBulletDynamicsCommon.h; path = ../../bullet/src/btBulletDynamicsCommon.h; sourceTree = SOURCE_ROOT; };
95C2AD2A0F296541000D3E5D /* Bullet-C-Api.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "Bullet-C-Api.h"; path = "../../bullet/src/Bullet-C-Api.h"; sourceTree = SOURCE_ROOT; };
@ -1377,6 +1377,8 @@
95C2AC270F296540000D3E5D /* music.hpp */,
95C2AC280F296540000D3E5D /* music_information.cpp */,
95C2AC290F296540000D3E5D /* music_information.hpp */,
958BD76E117F6AE90095B483 /* music_manager.cpp */,
958BD76F117F6AE90095B483 /* music_manager.hpp */,
95C2AC2A0F296540000D3E5D /* music_ogg.cpp */,
95C2AC2B0F296540000D3E5D /* music_ogg.hpp */,
95C2AC2C0F296540000D3E5D /* sfx_base.hpp */,
@ -1384,8 +1386,6 @@
95C2AC2E0F296540000D3E5D /* sfx_manager.hpp */,
95C2AC2F0F296540000D3E5D /* sfx_openal.cpp */,
95C2AC300F296540000D3E5D /* sfx_openal.hpp */,
95C2AC310F296540000D3E5D /* sound_manager.cpp */,
95C2AC320F296540000D3E5D /* sound_manager.hpp */,
);
name = audio;
path = ../../audio;
@ -2306,7 +2306,6 @@
9551C8280FC1B72500DB481B /* music_ogg.cpp in Sources */,
9551C8290FC1B72500DB481B /* sfx_manager.cpp in Sources */,
9551C82A0FC1B72500DB481B /* sfx_openal.cpp in Sources */,
9551C82B0FC1B72500DB481B /* sound_manager.cpp in Sources */,
9551C8350FC1B72500DB481B /* btAxisSweep3.cpp in Sources */,
9551C8360FC1B72500DB481B /* btBroadphaseProxy.cpp in Sources */,
9551C8370FC1B72500DB481B /* btCollisionAlgorithm.cpp in Sources */,
@ -2564,6 +2563,7 @@
956830E01132EC9E00088D14 /* irr_debug_drawer.cpp in Sources */,
957ED4801163FF18002AB42C /* ai_base_controller.cpp in Sources */,
95F912CD117E761700EA9F20 /* explosion_animation.cpp in Sources */,
958BD770117F6AE90095B483 /* music_manager.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

View File

@ -23,7 +23,7 @@
#include <math.h>
#include <iostream>
#include "audio/sound_manager.hpp"
#include "audio/music_manager.hpp"
#include "audio/sfx_manager.hpp"
#include "audio/sfx_base.hpp"
#include "config/user_config.hpp"

View File

@ -40,7 +40,7 @@
#include <algorithm>
#include "main_loop.hpp"
#include "audio/sound_manager.hpp"
#include "audio/music_manager.hpp"
#include "audio/sfx_manager.hpp"
#include "challenges/unlock_manager.hpp"
#include "config/stk_config.hpp"
@ -509,7 +509,7 @@ void initUserConfig(char *argv[])
void initRest()
{
irr_driver = new IrrDriver();
sound_manager = new SoundManager();
music_manager = new MusicManager();
sfx_manager = new SFXManager();
// The order here can be important, e.g. KartPropertiesManager needs
// defaultKartProperties, which are defined in stk_config.
@ -528,7 +528,7 @@ void initRest()
stk_config->load(file_manager->getConfigFile("stk_config.xml"));
track_manager->loadTrackList();
sound_manager->addMusicToTracks();
music_manager->addMusicToTracks();
race_manager = new RaceManager ();
// default settings for Quickstart
@ -565,7 +565,7 @@ void cleanTuxKart()
if(material_manager) delete material_manager;
if(history) delete history;
if(sfx_manager) delete sfx_manager;
if(sound_manager) delete sound_manager;
if(music_manager) delete music_manager;
if(user_config) delete user_config;
if(unlock_manager) delete unlock_manager;
if(translations) delete translations;

View File

@ -21,7 +21,7 @@
#include <assert.h>
#include "audio/sound_manager.hpp"
#include "audio/music_manager.hpp"
#include "config/user_config.hpp"
#include "graphics/irr_driver.hpp"
#include "graphics/material_manager.hpp"
@ -133,8 +133,8 @@ void MainLoop::run()
if (!music_on && !World::getWorld())
{
//FIXME: that code can't really work, I don't think "music_on" is updated everytime it should
sound_manager->stopMusic(); // stop potential 'left over' music from race
sound_manager->startMusic(stk_config->m_title_music);
music_manager->stopMusic(); // stop potential 'left over' music from race
music_manager->startMusic(stk_config->m_title_music);
music_on = true;
}
network_manager->update(dt);
@ -148,7 +148,7 @@ void MainLoop::run()
music_on = false;
} // if race is active
sound_manager->update(dt);
music_manager->update(dt);
input_manager->update(dt);
irr_driver->update(dt);
} // while !m_exit

View File

@ -17,7 +17,7 @@
#include "modes/follow_the_leader.hpp"
#include "audio/sound_manager.hpp"
#include "audio/music_manager.hpp"
#include "challenges/unlock_manager.hpp"
#include "config/user_config.hpp"
#include "items/powerup_manager.hpp"
@ -83,7 +83,7 @@ void FollowTheLeaderRace::countdownReachedZero()
// almost over, use fast music
if(getCurrentNumKarts()==3)
{
sound_manager->switchToFastMusic();
music_manager->switchToFastMusic();
}
if (isRaceOver())

View File

@ -20,7 +20,7 @@
#include <sstream>
#include "audio/sound_manager.hpp"
#include "audio/music_manager.hpp"
#include "network/network_manager.hpp"
#include "race/history.hpp"
#include "tracks/track.hpp"
@ -733,7 +733,7 @@ void LinearWorld::updateRacePosition()
kart_info.m_estimated_finish > 0 &&
kart_info.m_estimated_finish - getTime() < 30.0f )
{
sound_manager->switchToFastMusic();
music_manager->switchToFastMusic();
m_faster_music_active=true;
}
} // for i<kart_amount

View File

@ -20,7 +20,7 @@
#include <string>
#include "states_screens/race_gui.hpp"
#include "audio/sound_manager.hpp"
#include "audio/music_manager.hpp"
#include "tracks/track.hpp"
//-----------------------------------------------------------------------------
@ -103,7 +103,7 @@ void ThreeStrikesBattle::kartHit(const int kart_id)
// when almost over, use fast music
if (num_karts_many_lives<=1 && !m_faster_music_active)
{
sound_manager->switchToFastMusic();
music_manager->switchToFastMusic();
m_faster_music_active = true;
}
} // kartHit

View File

@ -25,7 +25,7 @@
#include <algorithm>
#include <ctime>
#include "audio/sound_manager.hpp"
#include "audio/music_manager.hpp"
#include "audio/sfx_manager.hpp"
#include "audio/sfx_base.hpp"
#include "challenges/unlock_manager.hpp"
@ -251,7 +251,7 @@ World::~World()
if(m_physics)
delete m_physics;
sound_manager -> stopMusic();
music_manager->stopMusic();
m_world = NULL;
} // ~World
@ -634,7 +634,7 @@ void World::restartRace()
resetAllKarts();
// Start music from beginning
sound_manager->stopMusic();
music_manager->stopMusic();
m_track->reset();
m_track->startMusic();
@ -648,7 +648,7 @@ void World::restartRace()
//-----------------------------------------------------------------------------
void World::pause()
{
sound_manager->pauseMusic();
music_manager->pauseMusic();
sfx_manager->pauseAll();
WorldStatus::pause();
} // pause
@ -656,7 +656,7 @@ void World::pause()
//-----------------------------------------------------------------------------
void World::unpause()
{
sound_manager->resumeMusic() ;
music_manager->resumeMusic() ;
sfx_manager->resumeAll();
WorldStatus::unpause();
for(unsigned int i=0; i<m_karts.size(); i++)

View File

@ -1,7 +1,7 @@
#include "states_screens/grand_prix_over.hpp"
#include "audio/sound_manager.hpp"
#include "audio/music_manager.hpp"
#include "audio/sfx_manager.hpp"
#include "challenges/unlock_manager.hpp"
#include "graphics/irr_driver.hpp"
@ -122,7 +122,7 @@ void GrandPrixOver::init()
unlocked_label->add();
}
sound_manager->startMusic(sound_manager->getMusicInformation(file_manager->getMusicFile("win_theme.music")));
music_manager->startMusic(music_manager->getMusicInformation(file_manager->getMusicFile("win_theme.music")));
m_phase = 1;
m_sky_angle = 0.0f;
@ -202,10 +202,6 @@ void GrandPrixOver::tearDown()
m_kart_node[n] = NULL;
}
// restore menu music when leaving (FIXME: this assume we always go to menu after)
sound_manager->stopMusic();
sound_manager->startMusic(stk_config->m_title_music);
}
// -------------------------------------------------------------------------------------

View File

@ -19,7 +19,7 @@
#include "states_screens/options_screen_av.hpp"
#include "states_screens/options_screen_players.hpp"
#include "audio/sound_manager.hpp"
#include "audio/music_manager.hpp"
#include "audio/sfx_manager.hpp"
#include "audio/sfx_base.hpp"
#include "guiengine/screen.hpp"
@ -57,7 +57,7 @@ void OptionsScreenAV::init()
gauge = this->getWidget<SpinnerWidget>("music_volume");
assert(gauge != NULL);
gauge->setValue( (int)(sound_manager->getMasterMusicVolume()*10.f) );
gauge->setValue( (int)(music_manager->getMasterMusicVolume()*10.f) );
// ---- music volume
CheckBoxWidget* sfx = this->getWidget<CheckBoxWidget>("sfx_enabled");
@ -157,7 +157,7 @@ void OptionsScreenAV::eventCallback(Widget* widget, const std::string& name, con
SpinnerWidget* w = dynamic_cast<SpinnerWidget*>(widget);
assert(w != NULL);
sound_manager->setMasterMusicVolume( w->getValue()/10.0f );
music_manager->setMasterMusicVolume( w->getValue()/10.0f );
}
else if(name == "sfx_volume")
{
@ -189,9 +189,9 @@ void OptionsScreenAV::eventCallback(Widget* widget, const std::string& name, con
std::cout << "music state is now " << (bool)UserConfigParams::m_music << std::endl;
if(w->getState() == false)
sound_manager->stopMusic();
music_manager->stopMusic();
else
sound_manager->startMusic(sound_manager->getCurrentMusic());
music_manager->startMusic(music_manager->getCurrentMusic());
}
else if(name == "sfx_enabled")
{

View File

@ -23,7 +23,7 @@
#include "irrlicht.h"
using namespace irr;
#include "audio/sound_manager.hpp"
#include "audio/music_manager.hpp"
#include "config/user_config.hpp"
#include "graphics/camera.hpp"
#include "graphics/irr_driver.hpp"
@ -739,7 +739,7 @@ void RaceGUI::drawGlobalMusicDescription()
const float resize3 = resize*resize*resize;
// ---- Get song name, and calculate its size, allowing us to position stuff
const MusicInformation* mi=sound_manager->getCurrentMusic();
const MusicInformation* mi = music_manager->getCurrentMusic();
if (!mi) return;
std::string s="\""+mi->getTitle()+"\"";

View File

@ -28,7 +28,7 @@
using namespace irr;
#include "animations/animation_manager.hpp"
#include "audio/sound_manager.hpp"
#include "audio/music_manager.hpp"
#include "config/stk_config.hpp"
#include "config/user_config.hpp"
#include "graphics/irr_driver.hpp"
@ -263,7 +263,7 @@ void Track::getMusicInformation(std::vector<std::string>& filenames,
MusicInformation* mi;
try
{
mi = sound_manager->getMusicInformation(full_path);
mi = music_manager->getMusicInformation(full_path);
}
catch(std::runtime_error)
{
@ -276,7 +276,7 @@ void Track::getMusicInformation(std::vector<std::string>& filenames,
{
try
{
mi = sound_manager->getMusicInformation(shared_name);
mi = music_manager->getMusicInformation(shared_name);
}
catch(std::runtime_error)
{
@ -299,7 +299,7 @@ void Track::startMusic() const
{
// In case that the music wasn't found (a warning was already printed)
if(m_music.size()>0)
sound_manager->startMusic(m_music[rand()% m_music.size()]);
music_manager->startMusic(m_music[rand()% m_music.size()]);
} // startMusic
//-----------------------------------------------------------------------------

View File

@ -25,7 +25,7 @@
#include <sstream>
#include <iostream>
#include "audio/sound_manager.hpp"
#include "audio/music_manager.hpp"
#include "config/stk_config.hpp"
#include "io/file_manager.hpp"
#include "tracks/track.hpp"
@ -167,7 +167,7 @@ bool TrackManager::loadTrack(const std::string& dirname)
m_track_avail.push_back(true);
updateGroups(track);
// Read music files in that dir as well
sound_manager->loadMusicFromOneDir(dirname);
music_manager->loadMusicFromOneDir(dirname);
return true;
} // loadTrack