Ref T494, audio settings for notification

* use new sounds
* fixed bug that changes of notifications were never set in settings
* play sound if box is checked (how hoes it sound?)
This commit is contained in:
Klaus Basan
2018-12-31 06:47:15 +01:00
committed by Mat Sutcliffe
parent 3137af30bb
commit 3be93ab753
3 changed files with 97 additions and 23 deletions

View File

@@ -12,17 +12,16 @@
#ifndef BLACKGUI_AUDIOSETUPCOMPONENT_H
#define BLACKGUI_AUDIOSETUPCOMPONENT_H
#include "blackcore/audio/audiosettings.h"
#include "blackgui/blackguiexport.h"
#include "blackcore/audio/audiosettings.h"
#include "blackmisc/audio/audiodeviceinfolist.h"
#include "blackmisc/settingscache.h"
#include <QFrame>
#include <QCheckBox>
#include <QObject>
#include <QScopedPointer>
class QWidget;
namespace Ui { class CAudioSetupComponent; }
namespace BlackGui
{
@@ -40,7 +39,7 @@ namespace BlackGui
//! Destructor
virtual ~CAudioSetupComponent();
//! Play notification sounds (at all)
//! Play any sounds?
bool playNotificationSounds() const;
private:
@@ -60,12 +59,18 @@ namespace BlackGui
//! Loopback toggled
void onLoopbackToggled(bool loopback);
//! Notification flags toggled
void onNotificationsToggled(bool checked);
//! Audio device lists from settings
void initAudioDeviceLists();
//! Audio is optional, check if available
bool hasAudio() const;
//! CheckBox to flag
BlackMisc::Audio::CNotificationSounds::NotificationFlag checkBoxToFlag(const QCheckBox *cb) const;
QScopedPointer<Ui::CAudioSetupComponent> ui;
BlackMisc::CSetting<BlackCore::Audio::TSettings> m_audioSettings { this, &CAudioSetupComponent::reloadSettings };
};