Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QApplication::beep() broken on many systems. Use another API for BEL instead #985

Closed
christianparpart opened this issue Jan 16, 2023 · 3 comments · Fixed by #988
Closed
Labels
blocker:office Bug reported by my colleges, and hence should be fixed ASAP. :) bug Something isn't working enhancement New feature or request

Comments

@christianparpart
Copy link
Member

As reported by @cqexbesd, BEL is not working, even though QApplication::beep() is being invoked. Googling for that turns out that this doesn't seem to always work and other people's fix was to simply not use it but other APIs, e.g. QMediaPlayer from QtMultimedia.

This seems as simple as:

QMediaPlayer player; 

// ...

player.setMedia(QUrl::fromLocalFile("/usr/share/sounds/freedesktop/stereo/bell.oga"));
player.setVolume(50); 

// ...

player.play();

But while being at it, why not making it (per profile) configurable, such that users can tweak what's about to be played when BEL is being processed.

NB: In case of BEL spam, a new sound must not be played if an old one is still playing.

@christianparpart christianparpart added bug Something isn't working enhancement New feature or request blocker:office Bug reported by my colleges, and hence should be fixed ASAP. :) labels Jan 16, 2023
@uspasojevic96
Copy link
Member

uspasojevic96 commented Jan 16, 2023

Keep in mind that /usr/share/sounds/freedesktop/stereo/bell.oga is platform dependent... Maybe bundle audio file with contour?

@christianparpart
Copy link
Member Author

@uspasojevic96 that'll be configurable of course. that's the nice part about it :)

@christianparpart
Copy link
Member Author

NB: We'd provide a default sounds - we have one already in the qml branch, we can simply use that as default sound, so it'll always work out of the box on all platforms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker:office Bug reported by my colleges, and hence should be fixed ASAP. :) bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants