File indexing completed on 2024-04-21 16:32:05

0001 /* This file is part of Kairo Timer
0002 
0003    SPDX-FileCopyrightText: 2016 (c) Kevin Ottens <ervin@kde.org>
0004 
0005    SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0006 
0007 */
0008 
0009 #include "soundcontrol.h"
0010 
0011 #include <QMediaPlayer>
0012 
0013 SoundControl::SoundControl(QObject *parent)
0014     : SoundControlInterface{parent},
0015       m_player{new QMediaPlayer{this}}
0016 {
0017 }
0018 
0019 void SoundControl::playShortBeep()
0020 {
0021     m_player->setMedia(QUrl("qrc:/shortbeep.wav"));
0022     m_player->play();
0023 }
0024 
0025 void SoundControl::playLongBeep()
0026 {
0027     m_player->setMedia(QUrl("qrc:/longbeep.wav"));
0028     m_player->play();
0029 }
0030 
0031 void SoundControl::playEndBeep()
0032 {
0033     m_player->setMedia(QUrl("qrc:/endbeep.wav"));
0034     m_player->play();
0035 }