summaryrefslogtreecommitdiffstats
path: root/src/sound/oalsound/alsound.h
diff options
context:
space:
mode:
authorkrzys-h <krzys_h@interia.pl>2013-12-28 12:30:46 +0100
committerkrzys-h <krzys_h@interia.pl>2013-12-28 12:30:46 +0100
commite9addb5a5e072b28eecfa1739ae38d67b68a2b23 (patch)
treee46bb4510163ed0d6ad46285b1020e6edd0335e9 /src/sound/oalsound/alsound.h
parent0ff7e55b3343fbca959fb11236a009fb3790b652 (diff)
downloadcolobot-e9addb5a5e072b28eecfa1739ae38d67b68a2b23.tar.gz
colobot-e9addb5a5e072b28eecfa1739ae38d67b68a2b23.tar.bz2
colobot-e9addb5a5e072b28eecfa1739ae38d67b68a2b23.zip
Added smooth transition in music - issue #205
Diffstat (limited to 'src/sound/oalsound/alsound.h')
-rw-r--r--src/sound/oalsound/alsound.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/sound/oalsound/alsound.h b/src/sound/oalsound/alsound.h
index 2fdcff5..cd3bdd5 100644
--- a/src/sound/oalsound/alsound.h
+++ b/src/sound/oalsound/alsound.h
@@ -31,10 +31,17 @@
#include <map>
#include <string>
+#include <list>
#include <al.h>
+struct OldMusic {
+ Channel* music;
+ float fadeTime;
+ float currentTime;
+};
+
class ALSound : public CSoundInterface
{
public:
@@ -65,11 +72,11 @@ public:
bool StopAll();
bool MuteAll(bool bMute);
- bool PlayMusic(int rank, bool bRepeat);
- bool PlayMusic(const std::string &filename, bool bRepeat);
+ bool PlayMusic(int rank, bool bRepeat, float fadeTime=5.0f);
+ bool PlayMusic(const std::string &filename, bool bRepeat, float fadeTime=5.0f);
bool RestartMusic();
void SuspendMusic();
- void StopMusic();
+ void StopMusic(float fadeTime=5.0f);
bool IsPlayingMusic();
private:
@@ -86,6 +93,7 @@ private:
std::map<std::string, Buffer*> m_music;
std::map<int, Channel*> m_channels;
Channel *m_currentMusic;
+ std::list<OldMusic> m_oldMusic;
Math::Vector m_eye;
Math::Vector m_lookat;
};