The mixer API variables are declared in a header with no explicit
linkage. This results in there being definitions of them in multiple
object files, which causes a link failure with GCC 10, since this
uses -fno-common by default.
Add `extern` to the header declarations and separate declarations with
no linkage in mixer.c where they are assigned.
Link: https://bugs.debian.org/957947
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
There may be some case where user would like to fall back to the original
behaviour, for example if grabbing these keys could get in conflict with
other applications.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
We can handle the keys AudioRaiseVolume, AudioLowerVolume and AudioMute,
so we ask the X server to send the key press event for them to us and
update the volume appropriately.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
A number of configuration options are useful only during the startup, so it
is possible to free them when ready.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Took opportunity to re-order them alphabetically so they are easier to
work with, both for devs and for users.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Management of the configuration is split in many places, the goal is to
regroup stuff together, starting with the loading from file stuff.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The PID file was created at the early beginning, but wmix can abort later
if something is not ok. It is better to create it at the end, so it will
be created only if wmix will actually be running.
Took the opportunity to move the code to a dedicated function to keep main
simple, and added a check to fix possible crash on startup if environment
variable $HOME does not exist.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The original code merely assumed that an XOpenDisplay failure was caused
only by incapacity to connect to the X server, but if $DISPLAY was not set
then the fprintf would be given a NULL pointer which it may not appreciate
(depending on the libc in use).
Let's avoid that case and try to provide more info to help the user.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>