Subversion Repositories tpanel

Rev

Rev 243 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 243 Rev 264
Line 15... Line 15...
15
 * along with this program; if not, write to the Free Software Foundation,
15
 * along with this program; if not, write to the Free Software Foundation,
16
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
16
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
17
 */
17
 */
18
#include <QPushButton>
18
#include <QPushButton>
19
#include <QLabel>
19
#include <QLabel>
20
#ifdef QT5_LINUX
20
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
21
#   include <QSound>
21
#   include <QSound>
22
#else
22
#else
23
#include <QMediaPlayer>
23
#include <QMediaPlayer>
24
#include <QAudioOutput>
24
#include <QAudioOutput>
25
#endif
25
#endif
Line 166... Line 166...
166
 
166
 
167
    if (getSystemSoundState())
167
    if (getSystemSoundState())
168
    {
168
    {
169
        std::string snd = getTouchFeedbackSound();
169
        std::string snd = getTouchFeedbackSound();
170
        MSG_DEBUG("Playing sound: " << snd);
170
        MSG_DEBUG("Playing sound: " << snd);
171
#ifdef QT6_LINUX
171
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
172
        QMediaPlayer *player = new QMediaPlayer;
172
        QMediaPlayer *player = new QMediaPlayer;
173
        QAudioOutput *audioOutput = new QAudioOutput;
173
        QAudioOutput *audioOutput = new QAudioOutput;
174
        player->setAudioOutput(audioOutput);
174
        player->setAudioOutput(audioOutput);
175
        player->setSource(QUrl::fromLocalFile(snd.c_str()));
175
        player->setSource(QUrl::fromLocalFile(snd.c_str()));
176
        player->play();
176
        player->play();