diff -Nru xfce4-pulseaudio-plugin-0.2.3/ChangeLog xfce4-pulseaudio-plugin-0.2.4/ChangeLog
--- xfce4-pulseaudio-plugin-0.2.3/ChangeLog 2015-05-12 01:22:45.000000000 +0000
+++ xfce4-pulseaudio-plugin-0.2.4/ChangeLog 2015-10-27 00:44:26.000000000 +0000
@@ -1,4 +1,11 @@
# created with git log --pretty=format:"%ad %h %s %aN <%aE>" --no-merges --date=short
+2015-07-12 1bae523 Removed autogenerated po/Makefile.in.in Andrzej
+2015-06-10 398d3ee Add a gui control for show-notifications Andrzej
+2015-06-10 e676501 Added a configuration option "show-notifications" Andrzej
+2015-06-06 ad8d820 Reconnect to the PA server if the connection is lost Andrzej
+2015-06-06 f528da4 Use volume-changed signal to update notifications Andrzej
+2015-05-12 ce71544 Back to development Andrzej
+2015-05-12 9371397 Updates for a release Andrzej
2015-05-12 7cfc9a3 make distcheck fix Andrzej
2015-04-19 405f94a Corrected copyright and author list Andrzej
2015-04-19 f4b6b6c Added OSD notifications Andrzej
diff -Nru xfce4-pulseaudio-plugin-0.2.3/configure xfce4-pulseaudio-plugin-0.2.4/configure
--- xfce4-pulseaudio-plugin-0.2.3/configure 2015-05-12 01:23:19.000000000 +0000
+++ xfce4-pulseaudio-plugin-0.2.4/configure 2015-10-27 00:52:54.000000000 +0000
@@ -1,7 +1,7 @@
#! /bin/sh
-# From configure.ac 9371397.
+# From configure.ac 3f0796f.
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for xfce4-pulseaudio-plugin 0.2.3.
+# Generated by GNU Autoconf 2.69 for xfce4-pulseaudio-plugin 0.2.4.
#
# Report bugs to .
#
@@ -594,8 +594,8 @@
# Identity of this package.
PACKAGE_NAME='xfce4-pulseaudio-plugin'
PACKAGE_TARNAME='xfce4-pulseaudio-plugin'
-PACKAGE_VERSION='0.2.3'
-PACKAGE_STRING='xfce4-pulseaudio-plugin 0.2.3'
+PACKAGE_VERSION='0.2.4'
+PACKAGE_STRING='xfce4-pulseaudio-plugin 0.2.4'
PACKAGE_BUGREPORT='http://bugzilla.xfce.org/'
PACKAGE_URL=''
@@ -1438,7 +1438,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures xfce4-pulseaudio-plugin 0.2.3 to adapt to many kinds of systems.
+\`configure' configures xfce4-pulseaudio-plugin 0.2.4 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1514,7 +1514,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of xfce4-pulseaudio-plugin 0.2.3:";;
+ short | recursive ) echo "Configuration of xfce4-pulseaudio-plugin 0.2.4:";;
esac
cat <<\_ACEOF
@@ -1644,7 +1644,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-xfce4-pulseaudio-plugin configure 0.2.3
+xfce4-pulseaudio-plugin configure 0.2.4
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2016,7 +2016,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by xfce4-pulseaudio-plugin $as_me 0.2.3, which was
+It was created by xfce4-pulseaudio-plugin $as_me 0.2.4, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2994,7 +2994,7 @@
# Define the identity of the package.
PACKAGE='xfce4-pulseaudio-plugin'
- VERSION='0.2.3'
+ VERSION='0.2.4'
cat >>confdefs.h <<_ACEOF
@@ -16561,7 +16561,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by xfce4-pulseaudio-plugin $as_me 0.2.3, which was
+This file was extended by xfce4-pulseaudio-plugin $as_me 0.2.4, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -16627,7 +16627,7 @@
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-xfce4-pulseaudio-plugin config.status 0.2.3
+xfce4-pulseaudio-plugin config.status 0.2.4
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff -Nru xfce4-pulseaudio-plugin-0.2.3/configure.ac xfce4-pulseaudio-plugin-0.2.4/configure.ac
--- xfce4-pulseaudio-plugin-0.2.3/configure.ac 2015-05-12 01:23:15.000000000 +0000
+++ xfce4-pulseaudio-plugin-0.2.4/configure.ac 2015-10-27 00:52:50.000000000 +0000
@@ -13,9 +13,9 @@
dnl ***************************
m4_define([pulseaudio_version_major], [0])
m4_define([pulseaudio_version_minor], [2])
-m4_define([pulseaudio_version_micro], [3])
+m4_define([pulseaudio_version_micro], [4])
m4_define([pulseaudio_version_nano], []) dnl leave this empty to have no nano version
-m4_define([pulseaudio_version_build], [9371397])
+m4_define([pulseaudio_version_build], [3f0796f])
m4_define([pulseaudio_version_tag], [])
m4_define([pulseaudio_version], [pulseaudio_version_major().pulseaudio_version_minor().pulseaudio_version_micro()ifelse(pulseaudio_version_nano(), [], [], [.pulseaudio_version_nano()])ifelse(pulseaudio_version_tag(), [git], [pulseaudio_version_tag()-pulseaudio_version_build()], [pulseaudio_version_tag()])])
@@ -28,7 +28,7 @@
AC_PREREQ([2.50])
AC_CONFIG_HEADERS([config.h])
AC_CANONICAL_TARGET()
-AC_REVISION([9371397])
+AC_REVISION([3f0796f])
dnl ***************************
dnl *** Initialize automake ***
diff -Nru xfce4-pulseaudio-plugin-0.2.3/debian/changelog xfce4-pulseaudio-plugin-0.2.4/debian/changelog
--- xfce4-pulseaudio-plugin-0.2.3/debian/changelog 2015-10-06 22:51:54.000000000 +0000
+++ xfce4-pulseaudio-plugin-0.2.4/debian/changelog 2016-12-26 18:35:38.000000000 +0000
@@ -1,37 +1,26 @@
-xfce4-pulseaudio-plugin (0.2.3-0ubuntu1~14.04+trusty1) trusty; urgency=medium
+xfce4-pulseaudio-plugin (0.2.4-1~bpo~14.04+1) trusty; urgency=medium
- * Backport.
+ * No change backport from xenial
- -- Jack Radigan Tue, 06 Oct 2015 18:51:45 -0400
+ -- Jack Radigan Mon, 26 Dec 2016 13:35:31 -0500
-xfce4-pulseaudio-plugin (0.2.3-0ubuntu1) wily; urgency=medium
+xfce4-pulseaudio-plugin (0.2.4-1) unstable; urgency=medium
- * Imported Upstream version 0.2.3.
+ [ Unit 193 ]
+ * New upstream release.
+ * d/control: Canonicalize VCS-* fields.
- -- Unit 193 Tue, 12 May 2015 02:49:28 -0400
+ [ Yves-Alexis Perez ]
+ * debian/rules:
+ - explicitly enable notify and keybinder.
+ * debian/control:
+ - add build-dep on libnotify-dev
-xfce4-pulseaudio-plugin (0.2.2-0ubuntu1) vivid; urgency=medium
+ -- Yves-Alexis Perez Mon, 02 Nov 2015 14:02:53 +0100
- * Imported Upstream version 0.2.2.
- * d/control: No longer build-dep on libido3-0.1-dev, not used anymore.
+xfce4-pulseaudio-plugin (0.2.3-1) unstable; urgency=medium
- -- Unit 193 Thu, 26 Mar 2015 18:05:53 -0400
+ [ Unit 193 ]
+ * Initial release. closes: #781014
-xfce4-pulseaudio-plugin (0.2.1-0ubuntu1) vivid; urgency=medium
-
- * Imported Upstream version 0.2.1.
-
- -- Unit 193 Mon, 09 Mar 2015 17:32:06 -0400
-
-xfce4-pulseaudio-plugin (0.2.0-0ubuntu1) vivid; urgency=medium
-
- * Imported Upstream version 0.2.0.
- * d/rules: Remove the libm hack.
-
- -- Unit 193 Thu, 05 Mar 2015 23:44:25 -0500
-
-xfce4-pulseaudio-plugin (0.1.0-0ubuntu1) vivid; urgency=medium
-
- * Initial release.
-
- -- Unit 193 Fri, 20 Feb 2015 19:49:03 -0500
+ -- Yves-Alexis Perez Sat, 19 Sep 2015 11:34:01 +0200
diff -Nru xfce4-pulseaudio-plugin-0.2.3/debian/control xfce4-pulseaudio-plugin-0.2.4/debian/control
--- xfce4-pulseaudio-plugin-0.2.3/debian/control 2015-05-12 06:48:27.000000000 +0000
+++ xfce4-pulseaudio-plugin-0.2.4/debian/control 2015-11-02 13:02:23.000000000 +0000
@@ -1,15 +1,17 @@
Source: xfce4-pulseaudio-plugin
Section: xfce
Priority: optional
-Maintainer: Xubuntu Developers
-Uploaders: Unit 193
+Maintainer: Debian Xfce Maintainers
+Uploaders: Yves-Alexis Perez ,
+ Unit 193 , Sean Davis
Build-Depends: debhelper (>= 9), autotools-dev, autoconf, automake, intltool, libtool,
- xfce4-panel-dev, libpulse-dev, libglib2.0-dev, libgtk-3-dev, libexo-1-dev, libxfce4util-dev,
- libxfce4ui-2-dev, libxfconf-0-dev, libkeybinder-3.0-dev
+ libxfce4panel-2.0-dev, libpulse-dev, libglib2.0-dev, libgtk-3-dev,
+ libexo-1-dev, libxfce4util-dev, libxfce4ui-2-dev, libxfconf-0-dev,
+ libkeybinder-3.0-dev, libnotify-dev
Standards-Version: 3.9.6
Homepage: http://goodies.xfce.org/projects/panel-plugins/xfce4-pulseaudio-plugin
-Vcs-Browser: https://bitbucket.org/xubuntu/xfce4-pulseaudio-plugin/
-Vcs-Git: https://bitbucket.org/xubuntu/xfce4-pulseaudio-plugin/
+Vcs-Browser: http://anonscm.debian.org/viewvc/pkg-xfce/goodies/trunk/xfce4-pulseaudio-plugin/
+Vcs-Svn: svn://anonscm.debian.org/pkg-xfce/goodies/trunk/xfce4-pulseaudio-plugin/
Package: xfce4-pulseaudio-plugin
Architecture: any
diff -Nru xfce4-pulseaudio-plugin-0.2.3/debian/gbp.conf xfce4-pulseaudio-plugin-0.2.4/debian/gbp.conf
--- xfce4-pulseaudio-plugin-0.2.3/debian/gbp.conf 2015-05-12 06:48:11.000000000 +0000
+++ xfce4-pulseaudio-plugin-0.2.4/debian/gbp.conf 1970-01-01 00:00:00.000000000 +0000
@@ -1,3 +0,0 @@
-[DEFAULT]
-pristine-tar = True
-sign-tags = True
diff -Nru xfce4-pulseaudio-plugin-0.2.3/debian/rules xfce4-pulseaudio-plugin-0.2.4/debian/rules
--- xfce4-pulseaudio-plugin-0.2.3/debian/rules 2015-05-12 06:48:11.000000000 +0000
+++ xfce4-pulseaudio-plugin-0.2.4/debian/rules 2015-11-02 13:02:23.000000000 +0000
@@ -14,7 +14,9 @@
override_dh_auto_configure:
dh_auto_configure -- \
--disable-silent-rules \
- --libdir=/usr/lib/$(DEB_HOST_MULTIARCH)
+ --libdir=/usr/lib/$(DEB_HOST_MULTIARCH) \
+ --enable-keybinder \
+ --enable-libnotify
override_dh_auto_install:
dh_auto_install
diff -Nru xfce4-pulseaudio-plugin-0.2.3/panel-plugin/pulseaudio-button.c xfce4-pulseaudio-plugin-0.2.4/panel-plugin/pulseaudio-button.c
--- xfce4-pulseaudio-plugin-0.2.3/panel-plugin/pulseaudio-button.c 2015-05-03 20:52:14.000000000 +0000
+++ xfce4-pulseaudio-plugin-0.2.4/panel-plugin/pulseaudio-button.c 2015-06-06 21:57:55.000000000 +0000
@@ -239,8 +239,6 @@
pulseaudio_volume_set_volume (button->volume, new_volume);
//g_debug ("dir: %d %f -> %f", event->direction, volume, new_volume);
- pulseaudio_notify (button->plugin);
-
return TRUE;
}
@@ -282,6 +280,7 @@
gboolean force_update)
{
gdouble volume;
+ gboolean connected;
gboolean muted;
gchar *tip_text;
const gchar *icon_name;
@@ -291,7 +290,10 @@
volume = pulseaudio_volume_get_volume (button->volume);
muted = pulseaudio_volume_get_muted (button->volume);
- if (muted)
+ connected = pulseaudio_volume_get_connected (button->volume);
+ if (!connected)
+ icon_name = icons[V_MUTED];
+ else if (muted)
icon_name = icons[V_MUTED];
else if (volume <= 0.0)
icon_name = icons[V_MUTED];
@@ -302,7 +304,9 @@
else
icon_name = icons[V_HIGH];
- if (muted)
+ if (!connected)
+ tip_text = g_strdup_printf (_("Not connected to the PulseAudio server"));
+ else if (muted)
tip_text = g_strdup_printf (_("Volume %d%% (muted)"), (gint) round (volume * 100));
else
tip_text = g_strdup_printf (_("Volume %d%%"), (gint) round (volume * 100));
diff -Nru xfce4-pulseaudio-plugin-0.2.3/panel-plugin/pulseaudio-config.c xfce4-pulseaudio-plugin-0.2.4/panel-plugin/pulseaudio-config.c
--- xfce4-pulseaudio-plugin-0.2.3/panel-plugin/pulseaudio-config.c 2015-05-03 20:52:14.000000000 +0000
+++ xfce4-pulseaudio-plugin-0.2.4/panel-plugin/pulseaudio-config.c 2015-06-10 21:52:28.000000000 +0000
@@ -46,6 +46,7 @@
#define DEFAULT_ENABLE_KEYBOARD_SHORTCUTS TRUE
+#define DEFAULT_SHOW_NOTIFICATIONS TRUE
#define DEFAULT_VOLUME_STEP 6
#define DEFAULT_VOLUME_MAX 153
@@ -73,6 +74,7 @@
GObject __parent__;
gboolean enable_keyboard_shortcuts;
+ gboolean show_notifications;
guint volume_step;
guint volume_max;
gchar *mixer_command;
@@ -84,6 +86,7 @@
{
PROP_0,
PROP_ENABLE_KEYBOARD_SHORTCUTS,
+ PROP_SHOW_NOTIFICATIONS,
PROP_VOLUME_STEP,
PROP_VOLUME_MAX,
PROP_MIXER_COMMAND,
@@ -123,6 +126,15 @@
g_object_class_install_property (gobject_class,
+ PROP_SHOW_NOTIFICATIONS,
+ g_param_spec_boolean ("show-notifications", NULL, NULL,
+ DEFAULT_SHOW_NOTIFICATIONS,
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
+
+
+
+ g_object_class_install_property (gobject_class,
PROP_VOLUME_STEP,
g_param_spec_uint ("volume-step", NULL, NULL,
1, 50, DEFAULT_VOLUME_STEP,
@@ -164,6 +176,7 @@
pulseaudio_config_init (PulseaudioConfig *config)
{
config->enable_keyboard_shortcuts = DEFAULT_ENABLE_KEYBOARD_SHORTCUTS;
+ config->show_notifications = DEFAULT_SHOW_NOTIFICATIONS;
config->volume_step = DEFAULT_VOLUME_STEP;
config->volume_max = DEFAULT_VOLUME_MAX;
config->mixer_command = g_strdup (DEFAULT_MIXER_COMMAND);
@@ -198,6 +211,10 @@
g_value_set_boolean (value, config->enable_keyboard_shortcuts);
break;
+ case PROP_SHOW_NOTIFICATIONS:
+ g_value_set_boolean (value, config->show_notifications);
+ break;
+
case PROP_VOLUME_STEP:
g_value_set_uint (value, config->volume_step);
break;
@@ -240,6 +257,16 @@
}
break;
+ case PROP_SHOW_NOTIFICATIONS:
+ val_bool = g_value_get_boolean (value);
+ if (config->show_notifications != val_bool)
+ {
+ config->show_notifications = val_bool;
+ g_object_notify (G_OBJECT (config), "show-notifications");
+ g_signal_emit (G_OBJECT (config), pulseaudio_config_signals [CONFIGURATION_CHANGED], 0);
+ }
+ break;
+
case PROP_VOLUME_STEP:
val_uint = g_value_get_uint (value);
if (config->volume_step != val_uint)
@@ -285,6 +312,17 @@
+gboolean
+pulseaudio_config_get_show_notifications (PulseaudioConfig *config)
+{
+ g_return_val_if_fail (IS_PULSEAUDIO_CONFIG (config), DEFAULT_SHOW_NOTIFICATIONS);
+
+ return config->show_notifications;
+}
+
+
+
+
guint
pulseaudio_config_get_volume_step (PulseaudioConfig *config)
{
@@ -335,6 +373,10 @@
xfconf_g_property_bind (channel, property, G_TYPE_BOOLEAN, config, "enable-keyboard-shortcuts");
g_free (property);
+ property = g_strconcat (property_base, "/show-notifications", NULL);
+ xfconf_g_property_bind (channel, property, G_TYPE_BOOLEAN, config, "show-notifications");
+ g_free (property);
+
property = g_strconcat (property_base, "/volume-step", NULL);
xfconf_g_property_bind (channel, property, G_TYPE_UINT, config, "volume-step");
g_free (property);
diff -Nru xfce4-pulseaudio-plugin-0.2.3/panel-plugin/pulseaudio-config.h xfce4-pulseaudio-plugin-0.2.4/panel-plugin/pulseaudio-config.h
--- xfce4-pulseaudio-plugin-0.2.3/panel-plugin/pulseaudio-config.h 2015-05-03 20:52:14.000000000 +0000
+++ xfce4-pulseaudio-plugin-0.2.4/panel-plugin/pulseaudio-config.h 2015-06-10 21:52:56.000000000 +0000
@@ -39,6 +39,7 @@
PulseaudioConfig *pulseaudio_config_new (const gchar *property_base);
gboolean pulseaudio_config_get_enable_keyboard_shortcuts (PulseaudioConfig *config);
+gboolean pulseaudio_config_get_show_notifications (PulseaudioConfig *config);
guint pulseaudio_config_get_volume_step (PulseaudioConfig *config);
guint pulseaudio_config_get_volume_max (PulseaudioConfig *config);
const gchar *pulseaudio_config_get_mixer_command (PulseaudioConfig *config);
diff -Nru xfce4-pulseaudio-plugin-0.2.3/panel-plugin/pulseaudio-dialog.c xfce4-pulseaudio-plugin-0.2.4/panel-plugin/pulseaudio-dialog.c
--- xfce4-pulseaudio-plugin-0.2.3/panel-plugin/pulseaudio-dialog.c 2015-05-03 20:50:31.000000000 +0000
+++ xfce4-pulseaudio-plugin-0.2.4/panel-plugin/pulseaudio-dialog.c 2015-06-10 22:13:09.000000000 +0000
@@ -182,6 +182,16 @@
G_OBJECT (object), "active",
G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
+ object = gtk_builder_get_object (builder, "checkbutton-show-notifications");
+ g_return_if_fail (GTK_IS_CHECK_BUTTON (object));
+#ifdef HAVE_LIBNOTIFY
+ g_object_bind_property (G_OBJECT (dialog->config), "show-notifications",
+ G_OBJECT (object), "active",
+ G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
+#else
+ gtk_widget_set_visible (GTK_WIDGET (object), FALSE);
+#endif
+
object = gtk_builder_get_object (builder, "entry-mixer-command");
g_return_if_fail (GTK_IS_ENTRY (object));
g_object_bind_property (G_OBJECT (dialog->config), "mixer-command",
diff -Nru xfce4-pulseaudio-plugin-0.2.3/panel-plugin/pulseaudio-dialog.glade xfce4-pulseaudio-plugin-0.2.4/panel-plugin/pulseaudio-dialog.glade
--- xfce4-pulseaudio-plugin-0.2.3/panel-plugin/pulseaudio-dialog.glade 2015-05-03 20:50:31.000000000 +0000
+++ xfce4-pulseaudio-plugin-0.2.4/panel-plugin/pulseaudio-dialog.glade 2015-06-10 22:16:47.000000000 +0000
@@ -101,6 +101,22 @@
0
+
+
+
+ True
+ True
+ 1
+
+
diff -Nru xfce4-pulseaudio-plugin-0.2.3/panel-plugin/pulseaudio-dialog_ui.h xfce4-pulseaudio-plugin-0.2.4/panel-plugin/pulseaudio-dialog_ui.h
--- xfce4-pulseaudio-plugin-0.2.3/panel-plugin/pulseaudio-dialog_ui.h 2015-05-03 21:32:09.000000000 +0000
+++ xfce4-pulseaudio-plugin-0.2.4/panel-plugin/pulseaudio-dialog_ui.h 2015-06-10 22:16:51.000000000 +0000
@@ -62,70 +62,79 @@
"ine\">TrueTrue<"
"/object>TrueTrue0True<"
- "/property>FalseBehaviourFalseTrue0<"
- "/child>
Audio _MixerTrueGTK_FILLGTK_FILLTrueTrueAudio mixer command that can be executed"
- " from the context menu, e.g. \"pavucontrol\", \"unity-control-center so"
- "und\".\342\200\242FalseFalseTrueTrue12GTK_FILLTr"
- "ueFalse00<"
- "object class=\"GtkButton\" id=\"button-run-mixer\">_Run Audio Mixer...TrueTrue"
- "Trueimage1True<"
- "/object>212GTK_FILL"
- "FalseTrue0TrueFalseSound settingsFalseTrue1FalseTrue1close-buttonhelp-button"
- ""
+ "king>Show "
+ "_notifications when volume changesTrueTrueFalseEnables on-screen volume notifications.TrueTrue"
+ "TrueTrue1TrueFals"
+ "eBehaviourFalse<"
+ "/property>True0TrueFalse0noneTrueFalse12TrueFal"
+ "se66TrueFalse2212"
+ "6TrueFalseAudio _MixerTrue"
+ "GTK_FILLGTK_FILLTrueTrueAudio mixer "
+ "command that can be executed from the context menu, e.g. \"pavucontrol\""
+ ", \"unity-control-center sound\".\342\200\242FalseFalse<"
+ "/property>TrueTrue12GTK_FILLTrue
Fa"
+ "lse00_Run Audio Mixer.."
+ ".TrueTrueTrueimage1True212GTK_FILLFalseTrue0"
+ "child>TrueFalseSound settingsFalseTrue1FalseTrue1close"
+ "-buttonhelp-button"
};
-static const unsigned pulseaudio_dialog_ui_length = 7868u;
+static const unsigned pulseaudio_dialog_ui_length = 8508u;
diff -Nru xfce4-pulseaudio-plugin-0.2.3/panel-plugin/pulseaudio-notify.c xfce4-pulseaudio-plugin-0.2.4/panel-plugin/pulseaudio-notify.c
--- xfce4-pulseaudio-plugin-0.2.3/panel-plugin/pulseaudio-notify.c 2015-05-03 20:52:14.000000000 +0000
+++ xfce4-pulseaudio-plugin-0.2.4/panel-plugin/pulseaudio-notify.c 2015-06-10 21:56:50.000000000 +0000
@@ -71,6 +71,8 @@
gboolean gauge_notifications;
NotifyNotification *notification;
+
+ gulong volume_changed_id;
};
struct _PulseaudioNotifyClass
@@ -102,6 +104,7 @@
notify->gauge_notifications = TRUE;
notify->notification = NULL;
+ notify->volume_changed_id = 0;
//g_set_application_name ("Xfce volume control");
notify_init ("Xfce volume control");
@@ -119,7 +122,7 @@
g_list_free (caps_list);
}
notify->notification = notify_notification_new ("xfce4-pulseaudio-plugin", NULL, NULL);
- notify_notification_set_timeout (notify->notification, 1500);
+ notify_notification_set_timeout (notify->notification, 2000);
}
@@ -140,29 +143,41 @@
-void
+static void
pulseaudio_notify_notify (PulseaudioNotify *notify)
{
GError *error = NULL;
gdouble volume;
gint volume_i;
gboolean muted;
+ gboolean connected;
gchar *title = NULL;
const gchar *icon = NULL;
g_return_if_fail (IS_PULSEAUDIO_NOTIFY (notify));
g_return_if_fail (IS_PULSEAUDIO_VOLUME (notify->volume));
+ if (!pulseaudio_config_get_show_notifications (notify->config))
+ return;
+
volume = pulseaudio_volume_get_volume (notify->volume);
muted = pulseaudio_volume_get_muted (notify->volume);
+ connected = pulseaudio_volume_get_connected (notify->volume);
volume_i = (gint) round (volume * 100);
- if (muted)
+ if (!connected)
+ volume_i = 0;
+
+ if (!connected)
+ title = g_strdup_printf ( _("Not connected to the PulseAudio server"));
+ else if (muted)
title = g_strdup_printf ( _("Volume %d%c (muted)"), volume_i, '%');
else
title = g_strdup_printf ( _("Volume %d%c"), volume_i, '%');
- if (muted)
+ if (!connected)
+ icon = icons[V_MUTED];
+ else if (muted)
icon = icons[V_MUTED];
else if (volume <= 0.0)
icon = icons[V_MUTED];
@@ -198,6 +213,17 @@
+static void
+pulseaudio_notify_volume_changed (PulseaudioNotify *notify,
+ PulseaudioVolume *volume)
+{
+ g_return_if_fail (IS_PULSEAUDIO_NOTIFY (notify));
+
+ pulseaudio_notify_notify (notify);
+}
+
+
+
PulseaudioNotify *
pulseaudio_notify_new (PulseaudioConfig *config,
PulseaudioVolume *volume)
@@ -211,6 +237,9 @@
notify->config = config;
notify->volume = volume;
+ notify->volume_changed_id =
+ g_signal_connect_swapped (G_OBJECT (notify->volume), "volume-changed",
+ G_CALLBACK (pulseaudio_notify_volume_changed), notify);
return notify;
}
diff -Nru xfce4-pulseaudio-plugin-0.2.3/panel-plugin/pulseaudio-notify.h xfce4-pulseaudio-plugin-0.2.4/panel-plugin/pulseaudio-notify.h
--- xfce4-pulseaudio-plugin-0.2.3/panel-plugin/pulseaudio-notify.h 2015-05-03 20:52:14.000000000 +0000
+++ xfce4-pulseaudio-plugin-0.2.4/panel-plugin/pulseaudio-notify.h 2015-06-06 20:19:45.000000000 +0000
@@ -42,8 +42,6 @@
PulseaudioNotify *pulseaudio_notify_new (PulseaudioConfig *config,
PulseaudioVolume *volume);
-void pulseaudio_notify_notify (PulseaudioNotify *notify);
-
G_END_DECLS
#endif /* HAVE_LIBNOTIFY */
diff -Nru xfce4-pulseaudio-plugin-0.2.3/panel-plugin/pulseaudio-plugin.c xfce4-pulseaudio-plugin-0.2.4/panel-plugin/pulseaudio-plugin.c
--- xfce4-pulseaudio-plugin-0.2.3/panel-plugin/pulseaudio-plugin.c 2015-05-03 20:52:14.000000000 +0000
+++ xfce4-pulseaudio-plugin-0.2.4/panel-plugin/pulseaudio-plugin.c 2015-06-06 20:22:15.000000000 +0000
@@ -306,7 +306,6 @@
pulseaudio_volume_set_volume (pulseaudio_plugin->volume, MIN (volume + volume_step, MAX (volume, 1.0)));
else if (strcmp (keystring, PULSEAUDIO_PLUGIN_LOWER_VOLUME_KEY) == 0)
pulseaudio_volume_set_volume (pulseaudio_plugin->volume, volume - volume_step);
- pulseaudio_notify (pulseaudio_plugin);
}
@@ -319,21 +318,10 @@
pulseaudio_debug ("%s pressed", keystring);
pulseaudio_volume_toggle_muted (pulseaudio_plugin->volume);
- pulseaudio_notify (pulseaudio_plugin);
}
#endif
-void
-pulseaudio_notify (PulseaudioPlugin *pulseaudio_plugin)
-{
-#ifdef HAVE_LIBNOTIFY
- pulseaudio_notify_notify (pulseaudio_plugin->notify);
-#endif
-}
-
-
-
static void
pulseaudio_plugin_construct (XfcePanelPlugin *plugin)
{
diff -Nru xfce4-pulseaudio-plugin-0.2.3/panel-plugin/pulseaudio-plugin.h xfce4-pulseaudio-plugin-0.2.4/panel-plugin/pulseaudio-plugin.h
--- xfce4-pulseaudio-plugin-0.2.3/panel-plugin/pulseaudio-plugin.h 2015-05-03 20:52:14.000000000 +0000
+++ xfce4-pulseaudio-plugin-0.2.4/panel-plugin/pulseaudio-plugin.h 2015-06-06 20:22:23.000000000 +0000
@@ -37,8 +37,6 @@
void pulseaudio_plugin_register_type (XfcePanelTypeModule *type_module);
-void pulseaudio_notify (PulseaudioPlugin *pulseaudio_plugin);
-
G_END_DECLS
#endif /* !__PULSEAUDIO_PLUGIN_H__ */
diff -Nru xfce4-pulseaudio-plugin-0.2.3/panel-plugin/pulseaudio-volume.c xfce4-pulseaudio-plugin-0.2.4/panel-plugin/pulseaudio-volume.c
--- xfce4-pulseaudio-plugin-0.2.3/panel-plugin/pulseaudio-volume.c 2015-05-03 20:52:14.000000000 +0000
+++ xfce4-pulseaudio-plugin-0.2.4/panel-plugin/pulseaudio-volume.c 2015-06-06 21:55:44.000000000 +0000
@@ -37,12 +37,13 @@
#include "pulseaudio-volume.h"
-static void pulseaudio_volume_finalize (GObject *object);
-static void pulseaudio_volume_connect (PulseaudioVolume *volume);
-static gdouble pulseaudio_volume_v2d (PulseaudioVolume *volume,
- pa_volume_t vol);
-static pa_volume_t pulseaudio_volume_d2v (PulseaudioVolume *volume,
- gdouble vol);
+static void pulseaudio_volume_finalize (GObject *object);
+static void pulseaudio_volume_connect (PulseaudioVolume *volume);
+static gdouble pulseaudio_volume_v2d (PulseaudioVolume *volume,
+ pa_volume_t vol);
+static pa_volume_t pulseaudio_volume_d2v (PulseaudioVolume *volume,
+ gdouble vol);
+static gboolean pulseaudio_volume_reconnect_timeout (gpointer userdata);
struct _PulseaudioVolume
@@ -61,7 +62,7 @@
gdouble volume_mic;
gboolean muted_mic;
-
+ guint reconnect_timer_id;
};
struct _PulseaudioVolumeClass
@@ -111,6 +112,7 @@
volume->connected = FALSE;
volume->volume = 0.0;
volume->muted = FALSE;
+ volume->reconnect_timer_id = 0;
volume->pa_mainloop = pa_glib_mainloop_new (NULL);
@@ -146,8 +148,9 @@
PulseaudioVolume *volume = PULSEAUDIO_VOLUME (userdata);
if (i == NULL) return;
+ pulseaudio_debug ("sink info: %s, %s", i->name, i->description);
- muted = (gboolean) i->mute;
+ muted = !!(i->mute);
vol = pulseaudio_volume_v2d (volume, i->volume.values[0]);
if (volume->muted != muted)
@@ -163,6 +166,7 @@
volume->volume = vol;
g_signal_emit (G_OBJECT (volume), pulseaudio_volume_signals [VOLUME_CHANGED], 0);
}
+ pulseaudio_debug ("volume: %f, muted: %d", vol, muted);
}
@@ -175,7 +179,7 @@
PulseaudioVolume *volume = PULSEAUDIO_VOLUME (userdata);
if (i == NULL) return;
- pulseaudio_debug ("default sink name = %s\n", i->default_sink_name);
+ pulseaudio_debug ("server: %s@%s, v.%s", i->user_name, i->server_name, i->server_version);
pa_context_get_sink_info_by_name (context, i->default_sink_name, pulseaudio_volume_sink_info_cb, volume);
}
@@ -206,19 +210,19 @@
{
case PA_SUBSCRIPTION_EVENT_SINK :
pulseaudio_volume_sink_check (volume, context);
- pulseaudio_debug ("PulseAudio sink event");
+ pulseaudio_debug ("received sink event");
break;
case PA_SUBSCRIPTION_EVENT_SOURCE :
- pulseaudio_debug ("PulseAudio source event");
+ pulseaudio_debug ("received source event");
break;
case PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT :
- pulseaudio_debug ("PulseAudio source output event");
+ pulseaudio_debug ("received source output event");
break;
default :
- pulseaudio_debug ("Unknown PulseAudio event");
+ pulseaudio_debug ("received unknown pulseaudio event");
break;
}
}
@@ -240,12 +244,22 @@
pulseaudio_debug ("PulseAudio connection established");
volume->connected = TRUE;
+ // Check current sink volume manually. PA sink events usually not emitted.
pulseaudio_volume_sink_check (volume, context);
+ g_signal_emit (G_OBJECT (volume), pulseaudio_volume_signals [VOLUME_CHANGED], 0);
break;
case PA_CONTEXT_FAILED :
case PA_CONTEXT_TERMINATED :
- g_warning ("Disconected from PulseAudio server");
+ g_warning ("Disconected from the PulseAudio server. Attempting to reconnect in 5 seconds.");
+ volume->pa_context = NULL;
+ volume->connected = FALSE;
+ volume->volume = 0.0;
+ volume->muted = FALSE;
+ g_signal_emit (G_OBJECT (volume), pulseaudio_volume_signals [VOLUME_CHANGED], 0);
+ if (volume->reconnect_timer_id == 0)
+ volume->reconnect_timer_id = g_timeout_add_seconds
+ (5, pulseaudio_volume_reconnect_timeout, volume);
break;
case PA_CONTEXT_CONNECTING :
@@ -301,6 +315,31 @@
+static gboolean
+pulseaudio_volume_reconnect_timeout (gpointer userdata)
+{
+ PulseaudioVolume *volume = PULSEAUDIO_VOLUME (userdata);
+
+ volume->reconnect_timer_id = 0;
+ pulseaudio_volume_connect (volume);
+
+ return FALSE; // stop the timer
+}
+
+
+
+
+
+gboolean
+pulseaudio_volume_get_connected (PulseaudioVolume *volume)
+{
+ g_return_val_if_fail (IS_PULSEAUDIO_VOLUME (volume), FALSE);
+
+ return volume->connected;
+}
+
+
+
static gdouble
pulseaudio_volume_v2d (PulseaudioVolume *volume,
pa_volume_t pa_volume)
@@ -383,6 +422,7 @@
gboolean muted)
{
g_return_if_fail (IS_PULSEAUDIO_VOLUME (volume));
+ g_return_if_fail (volume->pa_context != NULL);
g_return_if_fail (pa_context_get_state (volume->pa_context) == PA_CONTEXT_READY);
if (volume->muted != muted)
@@ -456,6 +496,7 @@
gdouble vol_trim;
g_return_if_fail (IS_PULSEAUDIO_VOLUME (volume));
+ g_return_if_fail (volume->pa_context != NULL);
g_return_if_fail (pa_context_get_state (volume->pa_context) == PA_CONTEXT_READY);
vol_max = pulseaudio_config_get_volume_max (volume->config) / 100.0;
diff -Nru xfce4-pulseaudio-plugin-0.2.3/panel-plugin/pulseaudio-volume.h xfce4-pulseaudio-plugin-0.2.4/panel-plugin/pulseaudio-volume.h
--- xfce4-pulseaudio-plugin-0.2.3/panel-plugin/pulseaudio-volume.h 2015-05-03 20:52:14.000000000 +0000
+++ xfce4-pulseaudio-plugin-0.2.4/panel-plugin/pulseaudio-volume.h 2015-06-06 20:58:25.000000000 +0000
@@ -37,6 +37,8 @@
PulseaudioVolume *pulseaudio_volume_new (PulseaudioConfig *config);
+gboolean pulseaudio_volume_get_connected (PulseaudioVolume *volume);
+
gdouble pulseaudio_volume_get_volume (PulseaudioVolume *volume);
void pulseaudio_volume_set_volume (PulseaudioVolume *volume,
gdouble vol);