Use QSound instead of QSoundEffect on Qt5

As it was before 1807d0426e,
to avoid issues with QSoundEffect on Qt5
This commit is contained in:
Alejandro Martinez
2025-02-28 09:28:10 -03:00
parent 559c8fd1d2
commit 30fdf69710

View File

@@ -40,7 +40,11 @@
#include <QKeyEvent>
#include <QMutexLocker>
#if QT_VERSION >= 0x060000
#include <QSoundEffect>
#else
#include <QSound>
#endif
// Three current realtime device types supported are:
#include "RealtimeController.h"
@@ -2078,9 +2082,13 @@ void TrainSidebar::guiUpdate() // refreshes the telemetry
if (fPlayAudio) {
lapAudioThisLap = false;
#if QT_VERSION >= 0x060000
QSoundEffect effect;
effect.setSource(QUrl::fromLocalFile(":audio/lap.wav"));
effect.play();
#else
QSound::play(":audio/lap.wav");
#endif
}
}