mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-10 05:55:33 +08:00
Move Notification sounds into CNotificationPlayer
This commit is contained in:
committed by
Mat Sutcliffe
parent
77a8c46790
commit
d5b3a336dd
45
src/blacksound/notificationplayer.h
Normal file
45
src/blacksound/notificationplayer.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/* Copyright (C) 2019
|
||||
* swift project Community / Contributors
|
||||
*
|
||||
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution. No part of swift project, including this file, may be copied, modified, propagated,
|
||||
* or distributed except according to the terms contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKSOUND_NOTIFICATIONPLAYER_H
|
||||
#define BLACKSOUND_NOTIFICATIONPLAYER_H
|
||||
|
||||
#include "blacksoundexport.h"
|
||||
#include "blackmisc/audio/notificationsounds.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <QHash>
|
||||
#include <QSoundEffect>
|
||||
|
||||
class QTimer;
|
||||
|
||||
namespace BlackSound
|
||||
{
|
||||
//! Player for notification sounds
|
||||
class BLACKSOUND_EXPORT CNotificationPlayer : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
//! Constructor
|
||||
CNotificationPlayer(QObject *parent = nullptr);
|
||||
|
||||
//! Destructor
|
||||
virtual ~CNotificationPlayer() override {}
|
||||
|
||||
//! Play notification sound
|
||||
void play(BlackMisc::Audio::CNotificationSounds::NotificationFlag notification, int volume = 100) const;
|
||||
|
||||
private:
|
||||
QHash<BlackMisc::Audio::CNotificationSounds::NotificationFlag, QSoundEffect *> m_effects;
|
||||
};
|
||||
}
|
||||
|
||||
#endif // guard
|
||||
Reference in New Issue
Block a user