--- a/QTfrontend/util/SDLInteraction.cpp Wed Jan 18 01:07:07 2012 +0100
+++ b/QTfrontend/util/SDLInteraction.cpp Wed Jan 18 01:10:35 2012 +0100
@@ -193,10 +193,11 @@
if (!m_soundMap->contains(soundFile))
m_soundMap->insert(soundFile, Mix_LoadWAV(soundFile.toLocal8Bit().constData()));
- Mix_PlayChannel(-1, m_soundMap->value(soundFile), 0);
+ //FIXME: this is a hack, but works as long as we have few concurrent playing sounds
+ if (Mix_Playing(lastchannel) == false)
+ lastchannel = Mix_PlayChannel(-1, m_soundMap->value(soundFile), 0);
}
-
void SDLInteraction::setMusicTrack(const QString & musicFile)
{
bool wasPlayingMusic = m_isPlayingMusic;
--- a/QTfrontend/util/SDLInteraction.h Wed Jan 18 01:07:07 2012 +0100
+++ b/QTfrontend/util/SDLInteraction.h Wed Jan 18 01:10:35 2012 +0100
@@ -59,6 +59,8 @@
QMap<QString,Mix_Chunk*> * m_soundMap; ///< maps sound file paths to channels
+ int lastchannel; ///< channel of the last music played
+
public:
/**
* @brief Returns reference to the <i>singleton</i> instance of this class.