qt: Replace QSound with QSoundEffect
This commit is contained in:
parent
281f2b832b
commit
0f77c59319
|
@ -23,7 +23,7 @@
|
||||||
#include <QKeyEvent>
|
#include <QKeyEvent>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QSound>
|
#include <QSoundEffect>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QAbstractButton>
|
#include <QAbstractButton>
|
||||||
#include <QPropertyAnimation>
|
#include <QPropertyAnimation>
|
||||||
|
@ -571,7 +571,10 @@ void Game::playSound(GameSound soundType, Color c)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasSound) {
|
if (hasSound) {
|
||||||
QSound::play(soundPath);
|
QSoundEffect *effect = new QSoundEffect;
|
||||||
|
effect->setSource(QUrl::fromLocalFile(soundPath));
|
||||||
|
effect->setLoopCount(1);
|
||||||
|
effect->play();
|
||||||
}
|
}
|
||||||
#endif /* ! DONOT_PLAY_SOUND */
|
#endif /* ! DONOT_PLAY_SOUND */
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue