diff options
author | Piotr Dziwinski <piotrdz@gmail.com> | 2013-03-30 15:01:00 +0100 |
---|---|---|
committer | Piotr Dziwinski <piotrdz@gmail.com> | 2013-03-30 15:23:05 +0100 |
commit | e218dcfdf2c58f8841e7ebd220527d08e870a6d5 (patch) | |
tree | a567db04a8a51e2db87f80e259faf222a7d4becd /src/sound/sound.h | |
parent | bfc701e286259d9a7aa2ff8240704eab2ba3a237 (diff) | |
parent | e607fed265070be8c518d4302d8b76f738421fb3 (diff) | |
download | colobot-e218dcfdf2c58f8841e7ebd220527d08e870a6d5.tar.gz colobot-e218dcfdf2c58f8841e7ebd220527d08e870a6d5.tar.bz2 colobot-e218dcfdf2c58f8841e7ebd220527d08e870a6d5.zip |
Merge branch 'dev'
Merging content from dev
Diffstat (limited to 'src/sound/sound.h')
-rw-r--r-- | src/sound/sound.h | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/src/sound/sound.h b/src/sound/sound.h index 518e2ad..70139ea 100644 --- a/src/sound/sound.h +++ b/src/sound/sound.h @@ -22,22 +22,23 @@ #pragma once +#include <boost/filesystem.hpp> #include "math/vector.h" -#include "common/iman.h" #include "common/logger.h" #include <string> #include <iostream> #include <iomanip> #include <sstream> +#include <map> /*! * Maximum possible audio volume */ -#define MAXVOLUME 100 +#define MAXVOLUME 100.0f /** @@ -47,6 +48,7 @@ **/ enum Sound { + SOUND_NONE = -1, SOUND_CLICK = 0, SOUND_BOUM = 1, SOUND_EXPLO = 2, @@ -153,11 +155,8 @@ enum SoundNext class CSoundInterface { public: - inline CSoundInterface() { - CInstanceManager::GetInstance().AddInstance(CLASS_SOUND, this); - //m_iMan->AddInstance(CLASS_SOUND, this); - }; - inline virtual ~CSoundInterface() {}; + inline CSoundInterface() {} + inline virtual ~CSoundInterface() {} /** Function to initialize sound device * \param b3D - enable support for 3D sound @@ -176,6 +175,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 @@ -327,5 +336,8 @@ class CSoundInterface * \return return true if music is playing */ inline virtual bool IsPlayingMusic() {return true;}; + + protected: + std::map<int, std::string> mMusic; }; |