From 58f35e44ae17a8d4c55b1b19696245666d3697d3 Mon Sep 17 00:00:00 2001 From: erihel Date: Mon, 14 Jan 2013 22:55:16 +0100 Subject: * Removed alut * Using libsndfile to load sounds and music * Added support for playing music files --- src/sound/sound.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/sound/sound.h') 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 #include "math/vector.h" @@ -32,6 +33,7 @@ #include #include #include +#include /*! @@ -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 mMusic; }; -- cgit v1.2.3-1-g7c22