[Xfce4-commits] <xfce4-volumed:master> Release 0.1.8, see changelog
Steve Dodier
noreply at xfce.org
Tue Nov 17 22:12:01 CET 2009
Updating branch refs/heads/master
to 52a6cfd053b6d80300e62f6bac914d7df08d6a09 (commit)
from 457f29e3340ea20180c285de5b80f48d3ad10227 (commit)
commit 52a6cfd053b6d80300e62f6bac914d7df08d6a09
Author: Steve Dodier <sidnioulz at gmail.com>
Date: Tue Nov 17 22:12:01 2009 +0100
Release 0.1.8, see changelog
ChangeLog | 9 +++++
INSTALL | 17 +++++++--
THANKS | 8 ++--
autogen.sh | 33 ++++++++---------
configure.ac | 2 +-
data/Makefile.am | 12 ++++++-
src/xvd_keys.c | 106 +++++++++++++++++++++++++++++++-----------------------
src/xvd_mixer.c | 5 ++-
src/xvd_notify.c | 4 +-
9 files changed, 121 insertions(+), 75 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 4db7caf..4f14405 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2009-11-05 Steve Dodier <sidnioulz at gmail.com>
+
+ * Use xfce4-dev-tools
+ * Now show the actual current volume with a mute icon when muting the volume
+ * Make sure the desktop file uses the correct prefix for its Exec value
+ * Fix a bug with sound cards without device names
+ * Use the low volume icon when volume is 0%, instead of the muted one
+ * Prevent a crash if there is no XF86Volume key on the system
+
2009-10-31 Steve Dodier <sidnioulz at gmail.com>
* Add debug messages when a key is pressed
diff --git a/INSTALL b/INSTALL
index 8b82ade..2550dab 100644
--- a/INSTALL
+++ b/INSTALL
@@ -2,7 +2,7 @@ Installation Instructions
*************************
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
-2006, 2007, 2008 Free Software Foundation, Inc.
+2006, 2007, 2008, 2009 Free Software Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
@@ -159,7 +159,7 @@ Particular systems
CC is not installed, it is recommended to use the following options in
order to use an ANSI C compiler:
- ./configure CC="cc -Ae"
+ ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
and if that doesn't work, install pre-built binaries of GCC for HP-UX.
@@ -174,6 +174,16 @@ and if that doesn't work, try
./configure CC="cc -nodtk"
+ On Solaris, don't put `/usr/ucb' early in your `PATH'. This
+directory contains several dysfunctional programs; working variants of
+these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
+in your `PATH', put it _after_ `/usr/bin'.
+
+ On Haiku, software installed for all users goes in `/boot/common',
+not `/usr/local'. It is recommended to use the following options:
+
+ ./configure --prefix=/boot/common
+
Specifying the System Type
==========================
@@ -189,7 +199,8 @@ type, such as `sun4', or a canonical name which has the form:
where SYSTEM can have one of these forms:
- OS KERNEL-OS
+ OS
+ KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
diff --git a/THANKS b/THANKS
index b10a389..bd17f55 100644
--- a/THANKS
+++ b/THANKS
@@ -1,6 +1,6 @@
-Thanks to Jannis Pohlmann for his extraordinary help. Most of this daemon is
-based on his code.
+Thanks to Jannis Pohlmann for his extraordinary help. This daemon has mostly
+been designed by him.
-Thanks to Mirco Muëller, for the nice notify-osd example files.
+Thanks to Lionel Le Folgoc for the packaging and autotools help.
-Thanks to Lionel Le Folgoc for the packaging help.
\ No newline at end of file
+Thanks to the XFCE developers for their advice and feedback.
diff --git a/autogen.sh b/autogen.sh
index a848b2a..6bc0c8a 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,21 +1,20 @@
#!/bin/sh
#
-# xfce4-volumed - Volume management daemon for XFCE 4
-#
-# Copyright © 2009 Steve Dodier <sidnioulz at gmail.com>
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# Copyright (c) 2002-2009
+# The Xfce development team. All rights reserved.
#
+# Written for Xfce by Benedikt Meurer <benny at xfce.org>.
+
+export XDT_AUTOGEN_REQUIRED_VERSION="4.7.0"
+
+(type xdt-autogen) >/dev/null 2>&1 || {
+ cat >&2 <<EOF
+autogen.sh: You don't seem to have the Xfce development tools installed on
+ your system, which are required to build this software.
+ Please install the xfce4-dev-tools package first, available from
+ http://xfce.org/~benny/projects/xfce4-dev-tools/.
+EOF
+ exit 1
+}
-autoreconf -vfi
+xdt-autogen $@
diff --git a/configure.ac b/configure.ac
index 5cb6393..7918776 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-AC_INIT([xfce4-volumed], [0.1.7], [http://bugs.launchpad.net/xfce4-volumed])
+AC_INIT([xfce4-volumed], [0.1.8], [http://bugs.launchpad.net/xfce4-volumed])
AM_INIT_AUTOMAKE([AC_PACKAGE_TARNAME()], [AC_PACKAGE_VERSION()])
AC_CONFIG_SRCDIR([src/main.c])
diff --git a/data/Makefile.am b/data/Makefile.am
index 71ed0f8..2cc81b9 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -1,5 +1,15 @@
desktopdir = $(sysconfdir)/xdg/autostart
-desktop_DATA = xfce4-volumed.desktop
+
+# Desktop file for the application
+desktop_in_in_files = xfce4-volumed.desktop.in.in
+desktop_in_files = $(desktop_in_in_files:.desktop.in.in=.desktop.in)
+desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
+
+xfce4-volumed.desktop.in: xfce4-volumed.desktop.in.in
+ $(AM_V_GEN) ( \
+ sed -e "s^@PREFIX@^$(prefix)^" \
+ $< > $@ \
+ )
EXTRA_DIST = $(desktop_DATA)
diff --git a/src/xvd_keys.c b/src/xvd_keys.c
index cd8b8af..51a8b11 100644
--- a/src/xvd_keys.c
+++ b/src/xvd_keys.c
@@ -115,7 +115,7 @@ _xvd_keys_handle_events(GIOChannel *source,
if (xvd_mixer_toggle_mute (Inst)) {
#ifdef HAVE_LIBNOTIFY
if (Inst->muted)
- xvd_notify_notification (Inst, "audio-volume-muted", 0);
+ xvd_notify_notification (Inst, "audio-volume-muted", Inst->current_vol);
else {
xvd_mixer_init_volume (Inst);
xvd_notify_volume_notification (Inst);
@@ -181,64 +181,80 @@ xvd_keys_init(XvdInstance *Inst)
/* Grab the XF86AudioRaiseVolume key */
#ifndef LEGACY_XCBKEYSYMS
Inst->keyRaise = xcb_key_symbols_get_keycode (Inst->kss, XF86XK_AudioRaiseVolume);
- i = 0;
- while (Inst->keyRaise[i] != XCB_NO_SYMBOL) {
- cookie = xcb_grab_key_checked (Inst->conn, TRUE, Inst->root_win,
- mod, Inst->keyRaise[i],
- XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC);
- error = xcb_request_check (Inst->conn, cookie);
- if (error) {
- fprintf (stderr, "XCB: Unable to bind RaiseVolume keycode=%d mod=0x%04x: %d\n",
- Inst->keyRaise[i], mod, error->error_code);
- }
- else {
- g_print ("XCB: RaiseVolume ok, keycode=%d mod=0x%04x\n",
- Inst->keyRaise[i], mod);
+ if (Inst->keyRaise == NULL) {
+ g_debug ("There is no X86AudioRaiseVolume key on your system.\n");
+ }
+ else {
+ i = 0;
+ while (Inst->keyRaise[i] != XCB_NO_SYMBOL) {
+ cookie = xcb_grab_key_checked (Inst->conn, TRUE, Inst->root_win,
+ mod, Inst->keyRaise[i],
+ XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC);
+ error = xcb_request_check (Inst->conn, cookie);
+ if (error) {
+ fprintf (stderr, "XCB: Unable to bind RaiseVolume keycode=%d mod=0x%04x: %d\n",
+ Inst->keyRaise[i], mod, error->error_code);
+ }
+ else {
+ g_print ("XCB: RaiseVolume ok, keycode=%d mod=0x%04x\n",
+ Inst->keyRaise[i], mod);
+ }
+ i++;
}
- i++;
}
/* Grab the XF86AudioLowerVolume key */
Inst->keyLower = xcb_key_symbols_get_keycode (Inst->kss, XF86XK_AudioLowerVolume);
- i = 0;
- while (Inst->keyLower[i] != XCB_NO_SYMBOL) {
- cookie = xcb_grab_key_checked (Inst->conn, TRUE, Inst->root_win,
- mod, Inst->keyLower[i],
- XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC);
- error = xcb_request_check (Inst->conn, cookie);
- if (error) {
- fprintf (stderr, "XCB: Unable to bind LowerVolume keycode=%d mod=0x%04x: %d\n",
- Inst->keyLower[i], mod, error->error_code);
- }
- else {
- g_print ("XCB: LowerVolume ok, keycode=%d mod=0x%04x\n",
- Inst->keyLower[i], mod);
+ if (Inst->keyLower == NULL) {
+ g_debug ("There is no X86AudioLowerVolume key on your system.\n");
+ }
+ else {
+ i = 0;
+ while (Inst->keyLower[i] != XCB_NO_SYMBOL) {
+ cookie = xcb_grab_key_checked (Inst->conn, TRUE, Inst->root_win,
+ mod, Inst->keyLower[i],
+ XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC);
+ error = xcb_request_check (Inst->conn, cookie);
+ if (error) {
+ fprintf (stderr, "XCB: Unable to bind LowerVolume keycode=%d mod=0x%04x: %d\n",
+ Inst->keyLower[i], mod, error->error_code);
+ }
+ else {
+ g_print ("XCB: LowerVolume ok, keycode=%d mod=0x%04x\n",
+ Inst->keyLower[i], mod);
+ }
+ i++;
}
- i++;
}
-
/* Grab the XF86AudioMute key */
Inst->keyMute = xcb_key_symbols_get_keycode (Inst->kss, XF86XK_AudioMute);
- i = 0;
-
- while (Inst->keyMute[i] != XCB_NO_SYMBOL) {
- cookie = xcb_grab_key_checked (Inst->conn, TRUE, Inst->root_win,
- mod, Inst->keyMute[i],
- XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC);
- error = xcb_request_check (Inst->conn, cookie);
- if (error) {
- fprintf (stderr, "XCB: Unable to bind Mute keycode=%d mod=0x%04x: %d\n",
- Inst->keyMute[i], mod, error->error_code);
- }
- else {
- g_print ("XCB: Mute ok, keycode=%d mod=0x%04x\n",
- Inst->keyMute[i], mod);
+
+ if (Inst->keyMute == NULL) {
+ g_debug ("There is no X86AudioMute key on your system.\n");
+ }
+ else {
+ i = 0;
+ while (Inst->keyMute[i] != XCB_NO_SYMBOL) {
+ cookie = xcb_grab_key_checked (Inst->conn, TRUE, Inst->root_win,
+ mod, Inst->keyMute[i],
+ XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC);
+ error = xcb_request_check (Inst->conn, cookie);
+ if (error) {
+ fprintf (stderr, "XCB: Unable to bind Mute keycode=%d mod=0x%04x: %d\n",
+ Inst->keyMute[i], mod, error->error_code);
+ }
+ else {
+ g_print ("XCB: Mute ok, keycode=%d mod=0x%04x\n",
+ Inst->keyMute[i], mod);
+ }
+ i++;
}
- i++;
}
+
+
#else
Inst->keyRaise = xcb_key_symbols_get_keycode (Inst->kss, XF86XK_AudioRaiseVolume);
diff --git a/src/xvd_mixer.c b/src/xvd_mixer.c
index 87f9c80..5c04d9d 100644
--- a/src/xvd_mixer.c
+++ b/src/xvd_mixer.c
@@ -48,10 +48,11 @@ _xvd_mixer_filter_mixer (GstMixer *tmp_mixer,
long_name = gst_element_factory_get_longname (factory);
/* Get the device name of the mixer element */
- g_object_get (tmp_mixer, "device-name", &device_name, NULL);
+ if (g_object_class_find_property (G_OBJECT_GET_CLASS (G_OBJECT (tmp_mixer)), "device-name"))
+ g_object_get (tmp_mixer, "device-name", &device_name, NULL);
/* Fall back to default name if neccessary */
- if (G_LIKELY (device_name == NULL))
+ if (G_UNLIKELY (device_name == NULL))
device_name = g_strdup_printf ("Unknown Volume Control %d", (*counter)++);
/* Build display name */
diff --git a/src/xvd_notify.c b/src/xvd_notify.c
index dc5bd29..47a88be 100644
--- a/src/xvd_notify.c
+++ b/src/xvd_notify.c
@@ -68,7 +68,7 @@ void
xvd_notify_volume_notification(XvdInstance *Inst)
{
if (Inst->current_vol == 0)
- xvd_notify_notification (Inst, "audio-volume-muted", 0);
+ xvd_notify_notification (Inst, (Inst->muted) ? "audio-volume-muted" : "audio-volume-low", 0);
else if (Inst->current_vol < 34)
xvd_notify_notification (Inst, (Inst->muted) ? "audio-volume-muted" : "audio-volume-low", Inst->current_vol);
else if (Inst->current_vol < 67)
@@ -89,7 +89,7 @@ void
xvd_notify_undershoot_notification(XvdInstance *Inst)
{
xvd_notify_notification (Inst,
- "audio-volume-muted",
+ (Inst->muted) ? "audio-volume-muted" : "audio-volume-low",
(Inst->gauge_notifications) ? -1 : 0);
}
More information about the Xfce4-commits
mailing list