mirror of
https://github.com/vicr123/theshell.git
synced 2025-01-23 04:11:49 -05:00
Add check for playing feedback sound on volume change
This commit is contained in:
parent
b45395bb59
commit
7bc7304ad1
1 changed files with 8 additions and 2 deletions
|
@ -166,11 +166,14 @@ bool NativeEventFilter::nativeEventFilter(const QByteArray &eventType, void *mes
|
|||
volume = 100;
|
||||
}
|
||||
AudioMan->changeVolume(5);
|
||||
|
||||
|
||||
//Check if the user has feedback sound on
|
||||
if (settings.value("sound/feedbackSound", true).toBool()) {
|
||||
QSoundEffect* volumeSound = new QSoundEffect();
|
||||
volumeSound->setSource(QUrl("qrc:/sounds/volfeedback.wav"));
|
||||
volumeSound->play();
|
||||
connect(volumeSound, SIGNAL(playingChanged()), volumeSound, SLOT(deleteLater()));
|
||||
}
|
||||
|
||||
Hotkeys->show(QIcon::fromTheme("audio-volume-high"), tr("Volume"), volume);
|
||||
}
|
||||
|
@ -182,11 +185,14 @@ bool NativeEventFilter::nativeEventFilter(const QByteArray &eventType, void *mes
|
|||
if (volume < 0) volume = 0;
|
||||
AudioMan->changeVolume(-5);
|
||||
|
||||
//Check if the user has feedback sound on
|
||||
if (settings.value("sound/feedbackSound", true).toBool()) {
|
||||
QSoundEffect* volumeSound = new QSoundEffect();
|
||||
volumeSound->setSource(QUrl("qrc:/sounds/volfeedback.wav"));
|
||||
volumeSound->play();
|
||||
connect(volumeSound, SIGNAL(playingChanged()), volumeSound, SLOT(deleteLater()));
|
||||
|
||||
}
|
||||
|
||||
Hotkeys->show(QIcon::fromTheme("audio-volume-high"), tr("Volume"), volume);
|
||||
}
|
||||
} else if (button->detail == XKeysymToKeycode(QX11Info::display(), XF86XK_AudioMute)) { //Toggle Quiet Mode
|
||||
|
|
Loading…
Reference in a new issue