Allow to play the default system sound (beep) instead of a specific sound file (WIP)
Review Request #128043 - Created May 29, 2016 and updated
|René J.V. Bertin|
This is a follow-up to discussion on the plasma-devel ML. When not running under a Plasma session it would be preferable if generic alert sounds are (can be) delivered using the default system sound. The easiest way to do that is to call
QApplication::beep(); at least on OS X this will play the user's selected alert sound.
I have implemented this for now by assuming the existence of a virtual (relative)
beepsound file that always plays the default sound.
In addition, this patch provides better warning feedback if a soundfile isn't found (making it easier to figure out which alert is misconfigured), and will play the sysbeep in that case (so that the alert doesn't go lost if it's sound-only).
Finally, no Phonon::AudioOutput object is created until that is actually required.
Works as expected on OS X 10.9.5
I wonder why this is in QApplication and not QGuiApplication, internally it just does: QMetaObject::invokeMethod(QGuiApplication::platformNativeInterface(), "beep"); So, perhaps we should do that, to avoid depending on QtWidgets/QApplication?
compare with QLatin1String
So if the user upgrades from Plasma 5 to Plasma 6, and the old sound file no longer exists, the user is going to be rewarded with an awful BEEEP ?
I truly hate audio notifications, but the system beep is even 10 times higher on my hate list. What if my wife is sleeping on the sofa next to me?
Is QApplication::beep() muted by the laptop's mute button btw? On old desktop PCs I remember it was completely independent from the mixer settings.