Subversion Repositories tpanel

Rev

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

Rev 182 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
 
18
 
19
#include <QPushButton>
19
#include <QPushButton>
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 244... Line 244...
244
 
244
 
245
    if (getSystemSoundState())
245
    if (getSystemSoundState())
246
    {
246
    {
247
        std::string snd = getTouchFeedbackSound();
247
        std::string snd = getTouchFeedbackSound();
248
        MSG_DEBUG("Playing sound: " << snd);
248
        MSG_DEBUG("Playing sound: " << snd);
249
#ifdef QT6_LINUX
249
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
250
        QMediaPlayer *player = new QMediaPlayer;
250
        QMediaPlayer *player = new QMediaPlayer;
251
        QAudioOutput *audioOutput = new QAudioOutput;
251
        QAudioOutput *audioOutput = new QAudioOutput;
252
        player->setAudioOutput(audioOutput);
252
        player->setAudioOutput(audioOutput);
253
        // ...
253
        // ...
254
        player->setSource(QUrl::fromLocalFile(snd.c_str()));
254
        player->setSource(QUrl::fromLocalFile(snd.c_str()));