diff options
author | erihel <erihel@gmail.com> | 2013-01-14 22:55:16 +0100 |
---|---|---|
committer | erihel <erihel@gmail.com> | 2013-01-14 22:55:16 +0100 |
commit | 58f35e44ae17a8d4c55b1b19696245666d3697d3 (patch) | |
tree | 26d593e1af405939f8c8c44c605a657c15aceb6c /src/sound/sound.h | |
parent | 35faf628cf8085a9262c2b89999cacdd3f5bee79 (diff) | |
download | colobot-58f35e44ae17a8d4c55b1b19696245666d3697d3.tar.gz colobot-58f35e44ae17a8d4c55b1b19696245666d3697d3.tar.bz2 colobot-58f35e44ae17a8d4c55b1b19696245666d3697d3.zip |
* Removed alut
* Using libsndfile to load sounds and music
* Added support for playing music files
Diffstat (limited to 'src/sound/sound.h')
-rw-r--r-- | src/sound/sound.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/sound/sound.h b/src/sound/sound.h index c9ac349..d152f76 100644 --- a/src/sound/sound.h +++ b/src/sound/sound.h @@ -22,6 +22,7 @@ #pragma once +#include <boost/filesystem.hpp> #include "math/vector.h" @@ -32,6 +33,7 @@ #include <iostream> #include <iomanip> #include <sstream> +#include <map> /*! @@ -177,6 +179,16 @@ class CSoundInterface } }; + /** Function called to add all music files to list */ + inline void AddMusicFiles(std::string path) { + for ( int i = 1; i <= 12; i++ ) { + std::stringstream filename; + filename << path << "/music" << std::setfill('0') << std::setw(3) << i << ".ogg"; + if (boost::filesystem::exists(filename.str())) + mMusic[i] = filename.str(); + } + }; + /** Function called to cache sound effect file. * This function is called by plugin interface for each file. * \param bSound - id of a file, will be used to identify sound files @@ -328,5 +340,8 @@ class CSoundInterface * \return return true if music is playing */ inline virtual bool IsPlayingMusic() {return true;}; + + protected: + std::map<int, std::string> mMusic; }; |