From a294b36cede55f247386a32abde9fbb3dbc8fb86 Mon Sep 17 00:00:00 2001 From: hikerstk Date: Thu, 13 Oct 2011 09:10:25 +0000 Subject: [PATCH] Oops - looks like the unused function I deleted was used (and I am nearly certain it compiled when I tried :( ). git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9972 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/audio/music_manager.cpp | 23 ++++++++++++++++++++++- src/audio/music_manager.hpp | 3 ++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/audio/music_manager.cpp b/src/audio/music_manager.cpp index c9d9d96b2..a774141a9 100644 --- a/src/audio/music_manager.cpp +++ b/src/audio/music_manager.cpp @@ -109,7 +109,28 @@ void MusicManager::loadMusicInformation() } // for dir } // loadMusicInformation -//----------------------------------------------------------------------------- + //----------------------------------------------------------------------------- +void MusicManager::loadMusicFromOneDir(const std::string& dir) +{ + std::set files; + file_manager->listFiles(files, dir, /*is_full_path*/ true, + /*make_full_path*/ true); + for(std::set::iterator i = files.begin(); i != files.end(); ++i) + { + if(StringUtils::getExtension(*i)!="music") continue; + try + { + m_all_music[StringUtils::getBasename(*i)] = new MusicInformation(*i); + } + catch (std::exception& e) + { + (void)e; // avoid compiler warning + continue; + } + } // for i +} // loadMusicFromOneDir + +//-----------------------------------------------------------------------------//----------------------------------------------------------------------------- void MusicManager::addMusicToTracks() { for(std::map::iterator i=m_all_music.begin(); diff --git a/src/audio/music_manager.hpp b/src/audio/music_manager.hpp index 9d4cbceb6..1a2f7f99a 100644 --- a/src/audio/music_manager.hpp +++ b/src/audio/music_manager.hpp @@ -75,7 +75,8 @@ public: * @throw runtime_error if the music file could not be found/opened */ MusicInformation *getMusicInformation(const std::string& filename); - + + void loadMusicFromOneDir(const std::string& dir); void addMusicToTracks(); };