QTfrontend/util/SDLInteraction.cpp
changeset 6585 6225b838a630
parent 6524 416fdfb666da
child 6616 f77bb02b669f
equal deleted inserted replaced
6584:5bb48450b978 6585:6225b838a630
   191 {
   191 {
   192     SDLAudioInit();
   192     SDLAudioInit();
   193     if (!m_soundMap->contains(soundFile))
   193     if (!m_soundMap->contains(soundFile))
   194         m_soundMap->insert(soundFile, Mix_LoadWAV(soundFile.toLocal8Bit().constData()));
   194         m_soundMap->insert(soundFile, Mix_LoadWAV(soundFile.toLocal8Bit().constData()));
   195 
   195 
   196     Mix_PlayChannel(-1, m_soundMap->value(soundFile), 0);
   196     //FIXME: this is a hack, but works as long as we have few concurrent playing sounds
   197 }
   197     if (Mix_Playing(lastchannel) == false)
   198 
   198         lastchannel = Mix_PlayChannel(-1, m_soundMap->value(soundFile), 0);
       
   199 }
   199 
   200 
   200 void SDLInteraction::setMusicTrack(const QString & musicFile)
   201 void SDLInteraction::setMusicTrack(const QString & musicFile)
   201 {
   202 {
   202     bool wasPlayingMusic = m_isPlayingMusic;
   203     bool wasPlayingMusic = m_isPlayingMusic;
   203 
   204