From 30fdf69710a36e3f35abbf0a928ba247e40b2e44 Mon Sep 17 00:00:00 2001 From: Alejandro Martinez Date: Fri, 28 Feb 2025 09:28:10 -0300 Subject: [PATCH] Use QSound instead of QSoundEffect on Qt5 As it was before 1807d0426e48d9042dfb3adea052a03148bb5687, to avoid issues with QSoundEffect on Qt5 --- src/Train/TrainSidebar.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Train/TrainSidebar.cpp b/src/Train/TrainSidebar.cpp index 64a43c411..d2c67a9f1 100644 --- a/src/Train/TrainSidebar.cpp +++ b/src/Train/TrainSidebar.cpp @@ -40,7 +40,11 @@ #include #include +#if QT_VERSION >= 0x060000 #include +#else +#include +#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 } }