parent
e196e57a04
commit
44049914e5
@ -7,6 +7,8 @@
|
|||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QMediaPlayer>
|
#include <QMediaPlayer>
|
||||||
|
|
||||||
|
QMediaPlayer *mediaPlayer = nullptr;
|
||||||
|
|
||||||
void notifications::notify(QString title, QString body, QSystemTrayIcon::MessageIcon icon) {
|
void notifications::notify(QString title, QString body, QSystemTrayIcon::MessageIcon icon) {
|
||||||
if (!MainWindow::inst() || !MainWindow::inst()->valid()) return;
|
if (!MainWindow::inst() || !MainWindow::inst()->valid()) return;
|
||||||
notifyNolog(title, body, icon);
|
notifyNolog(title, body, icon);
|
||||||
@ -28,7 +30,9 @@ void notifications::playSound(notifications::Sound soundType) {
|
|||||||
if(!settings::settings().value("playSound", true).toBool()) return;
|
if(!settings::settings().value("playSound", true).toBool()) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
QMediaPlayer*mediaPlayer = new QMediaPlayer(MainWindow::inst());
|
if (mediaPlayer == nullptr) {
|
||||||
|
mediaPlayer = new QMediaPlayer(MainWindow::inst());
|
||||||
|
}
|
||||||
|
|
||||||
switch (soundType) {
|
switch (soundType) {
|
||||||
case notifications::Sound::CAPTURE:
|
case notifications::Sound::CAPTURE:
|
||||||
|
Loading…
Reference in New Issue
Block a user