Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • panel-plugins/xfce4-pulseaudio-plugin
  • bobby285271/xfce4-pulseaudio-plugin
  • sgn/xfce4-pulseaudio-plugin
  • bodqhrohro/xfce4-pulseaudio-plugin
  • correctmost/xfce4-pulseaudio-plugin
  • andrzejr/xfce4-pulseaudio-plugin
  • Zetta1_Reid0/xfce4-pulseaudio-plugin
7 results
Show changes
Commits on Source (483)
Showing
with 1219 additions and 349 deletions
......@@ -12,10 +12,8 @@ autom4te.cache/
compile
config.*
configure
configure.ac
depcomp
install-sh
intltool*
libtool
ltmain.sh
m4/
......@@ -23,8 +21,20 @@ missing
panel-plugin/pulseaudio.desktop
panel-plugin/pulseaudio.desktop.in
po/*.gmo
po/.intltool-merge-cache*
po/Makefile.in.in
po/POTFILES
po/stamp-it
stamp-h1
ABOUT-NLS
po/Makevars.template
po/Rules-quot
po/boldquot.sed
po/en@boldquot.header
po/en@quot.header
po/insert-header.sin
po/quot.sed
po/remove-potcdate.sed
po/remove-potcdate.sin
po/stamp-po
po/xfce4-pulseaudio-plugin.pot
xfce4-pulseaudio-plugin-*.tar.bz2
......@@ -5,21 +5,17 @@ SUBDIRS = \
panel-plugin \
po
EXTRA_DIST = \
meson.build \
meson_options.txt \
po/meson.build \
xfce-revision.h.in \
$(NULL)
distclean-local:
rm -rf *.cache *~
distuninstallcheck_listfiles = \
find . -type f -print | grep -v ./share/icons/hicolor/icon-theme.cache
EXTRA_DIST = \
intltool-extract.in \
intltool-merge.in \
intltool-update.in
DISTCLEANFILES = \
intltool-extract \
intltool-merge \
intltool-update \
po/.intltool-merge-cache.lock
# vi:set ts=8 sw=8 noet ai nocindent syntax=automake:
0.4.9 (2024-12-05)
=====
- I18n: Update po/LINGUAS list
- Fix numerous pa_operation leaks
- Fix leaks from the plug-in constructor
- Fix leaks in pulseaudio_volume_connect
- Fix leak with notify_get_server_caps
- build: Require libxfce4windowing 4.19.6
- Use new xfw_window_activate() signature in libwindowing 4.19.6
- build: Use XDT_VERSION_INIT and get rid of configure.ac.in
- I18n: Update po/LINGUAS list
- I18n: Update po/LINGUAS list
- build: Get rid of intltool
- desktop: Generate from desktop.in instead desktop.in.in
- Unconditionally require gio-2.0, gio-unix-2.0
- Properly guard X11 code paths and fix X11 requirements
- Translation Updates:
Albanian, Arabic, Armenian (Armenia), Basque, Belarusian, Bulgarian,
Catalan, Chinese (China), Chinese (Taiwan), Croatian, Czech, Danish,
Dutch, Eastern Armenian, English (Australia), English (Canada),
English (United Kingdom), Estonian, Finnish, French, Galician,
German, Greek, Hebrew, Hungarian, Icelandic, Indonesian, Interlingue,
Irish, Italian, Japanese, Kazakh, Korean, Lithuanian, Malay,
Norwegian Bokmål, Occitan (post 1500), Polish, Portuguese,
Portuguese (Brazil), Russian, Serbian, Slovak, Slovenian, Spanish,
Swedish, Thai, Ukrainian
0.4.8 (2023-10-01)
=====
- MPRIS: Use D-Bus name for identifying players
- Fix possible context menu crash with MPRIS playlist
- Add option to make mic icon persistent
- Check for mic widget visibility
- Preserve channel balance when changing sink/source volume
- MPRIS: Add option to send multimedia keys to all players
- MPRIS: Fix default controlled player by multimedia keys
- Remove dead code
- Translation Updates:
Albanian, Bulgarian, Catalan, Chinese (China), Chinese (Taiwan),
Danish, Dutch, English (United Kingdom), French, German, Greek,
Italian, Japanese, Korean, Lithuanian, Norwegian Bokmål, Polish,
Portuguese, Portuguese (Brazil), Russian, Serbian, Slovenian,
Swedish, Ukrainian
0.4.7 (2023-06-01)
=====
- Fix crash when D-Bus connection is lost before it's connected
- Fix copyright info
- MPRIS: Control recently open/used player using multimedia keys
- Deduplicate key binding code
- Bind all possible keys
- Update about authors
- MPRIS: Remove old settings when clearing known players
- MPRIS: Ignore multimedia keys for blacklisted players
- MPRIS: Add possibility to hide inactive players, improve config
storage
- MPRIS: Remove pulseaudio_mpris_player_can_launch function
- MPRIS: Fix memory leak in player finalize
- MPRIS: Remove unused pulseaudio_mpris_player_is_equal function
- MPRIS: Refactor player connection lost and finalize
- MPRIS: Deduplicate find_desktop_entry function
- MPRIS: Make pulseaudio_mpris_get_available_players static
- MPRIS: Check for filename before launching the player
- Improve connection/disconnection with server
- Menu: Don't clear structure, it's not needed
- MPRIS: Reduce player_is_usable timeout to 5 sec
- MPRIS: Memory management fixes
- MPRIS: Don't initialize struct members, GLib is doing it
- MPRIS: Micro-optimization
- MPRIS: Check for is_playing in set_can_play function
- Subscribe NameOwnerChanged to watch MPRIS changes instead of timer
- Fix removing blacklisted MPRIS players from config
- Improve run mixer button sensitivity
- Display default device name in tooltip
- Don't set has-tooltip property twice
- Don't show recording indicator for non-default monitors
- Make run mixer button sensitive for any path
- Show unplugged devices as insensitive
- Don't show rec icon if the source output doesn't belong to any client
- Don't show recording indicator when it's not connected to the source
- Fix mistake in comment
- Don't reset recording value in callback
- Allow maximum volume configuration in dialog
- Improve volume step size text
- Translation Updates:
Albanian, Arabic, Armenian (Armenia), Basque, Belarusian, Bulgarian,
Catalan, Chinese (China), Chinese (Taiwan), Croatian, Czech, Danish,
Dutch, Eastern Armenian, English (Australia), English (Canada),
English (United Kingdom), Finnish, French, Galician, German, Greek,
Hebrew, Hungarian, Icelandic, Indonesian, Interlingue, Irish,
Italian, Japanese, Kazakh, Korean, Lithuanian, Malay, Norwegian
Bokmål, Occitan (post 1500), Polish, Portuguese, Portuguese
(Brazil), Russian, Serbian, Slovak, Slovenian, Spanish, Swedish,
Thai, Ukrainian
0.4.6 (2023-03-28)
=====
- Update copyright year
- Fix changing default sink and source devices
- Fix flickering mic icon when recording application is connected
- Avoid critical from xfce4-notifyd if gauge_value > 100
- Display maximum volume of all channels instead of volume of left
channel
- Add recording base volume indicator
- Control mic volume/mute when mouse cursor is over the mic icon
- Lower warning level
- Improve volume notifications settings
- Show volume notifications from hotkeys according to comment
- Don't set negative volume from hotkeys
- Use correct variable for "volume-mic-changed" signal ID
- Don't force set the default device
- Set recording icon according to recording volume level
- Show source monitor if it is a default source
- Check for recording state on context ready
- Allow volume step configuration in dialog (Fixes #28)
- wnck: Add missing LIBS/CFLAGS in Makefile
- wnck: Use Libxfce4windowing when available
- wnck: Guard X11 code path to prevent crash on Wayland
- wnck: Improve RaiseWnck a bit
- Fix memory leak
- cleanup: Fix formatting
- Fix blurry media player icon from file when UI scale > 1
- Fix blurry icons in prefs dialog when UI scale factor > 1
- Use "logo-icon-name" instead of "logo" in about dialog
- Do not override fatal log level
- build: Bump GLib minimum required to 2.44
- Translation Updates:
Albanian, Arabic, Armenian (Armenia), Basque, Belarusian, Bulgarian,
Catalan, Chinese (China), Chinese (Taiwan), Croatian, Czech, Danish,
Dutch, Eastern Armenian, English (Australia), English (Canada),
Finnish, French, Galician, German, Greek, Hebrew, Hungarian,
Icelandic, Indonesian, Interlingue, Irish, Italian, Japanese, Kazakh,
Korean, Lithuanian, Malay, Norwegian Bokmål, Occitan (post 1500),
Polish, Portuguese, Portuguese (Brazil), Russian, Serbian, Slovak,
Slovenian, Spanish, Swedish, Thai, Ukrainian
0.4.5
======
- Use Source Output Info for recording indicator
......
......@@ -16,4 +16,4 @@ EOF
exit 1
}
XDT_AUTOGEN_REQUIRED_VERSION="4.7.3" exec xdt-autogen $@
XDT_AUTOGEN_REQUIRED_VERSION="4.19.0" exec xdt-autogen $@
......@@ -6,25 +6,24 @@ dnl
dnl ***************************
dnl *** Version information ***
dnl ***************************
m4_define([pulseaudio_version_major], [0])
m4_define([pulseaudio_version_minor], [4])
m4_define([pulseaudio_version_micro], [5])
m4_define([pulseaudio_version_nano], []) dnl leave this empty to have no nano version
m4_define([pulseaudio_version_build], [@REVISION@])
m4_define([pulseaudio_version_tag], [git])
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()])])
m4_define([copyright_year], [2025])
XDT_VERSION_INIT([0.4.9], [git])
dnl ***************************
dnl *** Initialize autoconf ***
dnl ***************************
AC_COPYRIGHT([Copyright (c) 2014-2022
AC_COPYRIGHT([Copyright (c) 2014-copyright_year()
The Xfce development team. All rights reserved.])
AC_INIT([xfce4-pulseaudio-plugin], [pulseaudio_version], [https://gitlab.xfce.org/panel-plugins/xfce4-pulseaudio-plugin], [xfce4-pulseaudio-plugin])
AC_PREREQ([2.50])
AC_INIT([xfce4-pulseaudio-plugin], [xdt_version], [https://gitlab.xfce.org/panel-plugins/xfce4-pulseaudio-plugin], [xfce4-pulseaudio-plugin])
AC_PREREQ([2.69])
AC_CONFIG_HEADERS([config.h])
AC_CANONICAL_TARGET()
AC_REVISION([@REVISION@])
AC_REVISION([xdt_version_build])
AC_CONFIG_MACRO_DIRS([m4])
AC_DEFINE([VERSION_FULL], [PACKAGE_VERSION], [Alias for VERSION and PACKAGE_VERSION for meson compatibility])
COPYRIGHT_YEAR=copyright_year()
AC_DEFINE_UNQUOTED([COPYRIGHT_YEAR], ["$COPYRIGHT_YEAR"], [Copyright year])
AC_SUBST([COPYRIGHT_YEAR])
dnl ***************************
dnl *** Initialize automake ***
......@@ -39,7 +38,6 @@ dnl ********************************
AC_PROG_CC()
LT_PATH_LD([])
AC_PROG_INSTALL()
IT_PROG_INTLTOOL([0.35.0])
dnl **************************
dnl *** Initialize libtool ***
......@@ -61,12 +59,11 @@ AC_CHECK_FUNCS([])
dnl ******************************
dnl *** Check for i18n support ***
dnl ******************************
XDT_I18N([@LINGUAS@])
dnl *******************************
dnl *** Check for X11 installed ***
dnl *******************************
XDT_CHECK_LIBX11_REQUIRE()
GETTEXT_PACKAGE="$PACKAGE"
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"], [Name of default gettext domain])
AC_SUBST([GETTEXT_PACKAGE])
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.19.8])
dnl ***********************************
dnl *** Check for required packages ***
......@@ -77,13 +74,16 @@ AC_DEFINE([LIBXFCE4PANEL_VERSION_API], "libxfce4panel_version_api()", [libxfce4p
AC_SUBST([LIBXFCE4PANEL_VERSION_API])
XDT_CHECK_PACKAGE([PULSEAUDIO], [libpulse-mainloop-glib], [0.9.19])
XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [2.44.0])
XDT_CHECK_PACKAGE([GTK], [gtk+-3.0], [3.20.0])
XDT_CHECK_PACKAGE([EXO], [exo-2], [0.11.0])
XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.9.0])
XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-2], [4.11.0])
XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-${LIBXFCE4PANEL_VERSION_API}], [4.11.0])
XDT_CHECK_PACKAGE([XFCONF], [libxfconf-0], [4.6.0])
XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [2.50.0])
XDT_CHECK_PACKAGE([GIO], [gio-2.0], [2.50.0])
XDT_CHECK_PACKAGE([GIO_UNIX], [gio-unix-2.0], [2.50.0])
XDT_CHECK_PACKAGE([GTK], [gtk+-3.0], [3.22.0])
XDT_CHECK_PACKAGE([EXO], [exo-2], [4.16.0])
XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.16.0])
XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-2], [4.16.0])
XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-${LIBXFCE4PANEL_VERSION_API}], [4.16.0])
XDT_CHECK_PACKAGE([XFCONF], [libxfconf-0], [4.16.0])
XDT_CHECK_PACKAGE_BINARY([GLIB_COMPILE_RESOURCES], [gio-2.0], [glib_compile_resources], [glib-compile-resources])
dnl **********************************
dnl *** Optional keybinder Support ***
......@@ -109,25 +109,24 @@ AC_SUBST(LIBM)
dnl *******************************
dnl *** Optional MPRIS2 Support ***
dnl *******************************
XDT_CHECK_OPTIONAL_PACKAGE([MPRIS2], [gio-2.0], [2.42], [mpris2],
[mpris2 support])
AC_ARG_ENABLE([mpris2],
[AS_HELP_STRING([--disable-mpris2],
[Do not build MPRIS2 support])],
[enable_mpris2=$enableval], [enable_mpris2=yes])
if test x"$enable_mpris2" != x"no"; then
AC_DEFINE([HAVE_MPRIS2], [1], [Define to enable MPRIS2 support])
fi
dnl *********************************************************
dnl *** Optional (experimental) Libxfce4windowing Support ***
dnl *********************************************************
XDT_CHECK_OPTIONAL_PACKAGE([LIBXFCE4WINDOWING], [libxfce4windowing-0], [4.19.1], [libxfce4windowing],
XDT_CHECK_OPTIONAL_PACKAGE([LIBXFCE4WINDOWING], [libxfce4windowing-0], [4.19.6], [libxfce4windowing],
[Libxfce4windowing support])
dnl To be removed when Libxfce4windowing reaches at least stable version 4.20
if test "$LIBXFCE4WINDOWING_FOUND" = "yes"; then
enable_wnck=no
fi
XDT_CHECK_OPTIONAL_PACKAGE([WNCK], [libwnck-3.0], [3.20], [wnck], [Libwnck support])
dnl ***********************************
dnl *** Check for debugging support ***
dnl ***********************************
XDT_FEATURE_DEBUG()
XDT_FEATURE_DEBUG([xdt_debug_default])
dnl *****************************
dnl *** Default mixer command ***
......@@ -154,6 +153,7 @@ AC_SUBST([PLATFORM_LDFLAGS])
AC_CONFIG_FILES([
Makefile
icons/Makefile
icons/32x32/Makefile
icons/48x48/Makefile
icons/scalable/Makefile
icons/scalable/apps/Makefile
......@@ -174,11 +174,7 @@ echo "* Debug Support: $enable_debug"
echo "* Use keybinder: ${KEYBINDER_FOUND:-no}"
echo "* Use libnotify: ${LIBNOTIFY_FOUND:-no}"
echo "* Use libcanberra: ${LIBCANBERRA_FOUND:-no}"
echo "* Use MPRIS2: ${MPRIS2_FOUND:-no}"
if test "$LIBXFCE4WINDOWING_FOUND" = "yes"; then
echo "* Use MPRIS2: $enable_mpris2"
echo "* Libxfce4windowing support: ${LIBXFCE4WINDOWING_FOUND:-no}"
else
echo "* Experimenal libwnck support: ${WNCK_FOUND:-no}"
fi
echo "* Default Mixer command: $DEFAULT_MIXER_COMMAND"
echo
# $Id: Makefile.am 2257 2006-12-19 19:49:00Z nick $
SUBDIRS = \
32x32 \
48x48 \
scalable
EXTRA_DIST = \
meson.build \
$(NULL)
gtk_update_icon_cache = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor
install-data-hook:
......
sizes = [32, 48]
foreach size : sizes
install_data(
'@0@x@0@'.format(size) / 'xfce4-pulseaudio-plugin.png',
install_dir: get_option('prefix') / get_option('datadir') / 'icons' / 'hicolor' / '@0@x@0@'.format(size) / 'apps',
)
endforeach
install_data(
'scalable' / 'apps' / 'xfce4-pulseaudio-plugin.svg',
install_dir: get_option('prefix') / get_option('datadir') / 'icons' / 'hicolor' / 'scalable' / 'apps',
)
scalable_status_names = [
'audio-volume-high-symbolic',
'audio-volume-low-symbolic',
'audio-volume-medium-symbolic',
'audio-volume-muted-symbolic',
'microphone-sensitivity-high-symbolic',
'microphone-sensitivity-low-symbolic',
'microphone-sensitivity-medium-symbolic',
'microphone-sensitivity-muted-symbolic',
]
foreach name : scalable_status_names
install_data(
'scalable' / 'status' / '@0@.svg'.format(name),
install_dir: get_option('prefix') / get_option('datadir') / 'icons' / 'hicolor' / 'scalable' / 'status',
)
endforeach
project(
'xfce4-pulseaudio-plugin',
'c',
version: '0.4.9-dev',
license: 'GPL-2.0-or-later',
meson_version: '>= 0.54.0',
default_options: [
'c_std=gnu11',
'buildtype=debugoptimized',
'warning_level=2',
]
)
project_namespace = 'panel-plugins'
pkgdatadir = get_option('prefix') / get_option('datadir') / meson.project_name()
copyright_year = '2025'
cc = meson.get_compiler('c')
pkgconfig = import('pkgconfig')
gnome = import('gnome')
i18n = import('i18n')
dependency_versions = {
'glib': '>= 2.50.0',
'gtk': '>= 3.22.0',
'xfce4': '>= 4.16.0',
'pulseaudio': '>= 0.9.19',
'keybinder': '>= 0.2.2',
'libnotify': '>= 0.7.0',
'libcanberra': '>= 0.30',
'libxfce4windowing': '>= 4.19.6',
}
glib = dependency('glib-2.0', version: dependency_versions['glib'])
gio = dependency('gio-2.0', version: dependency_versions['glib'])
gio_unix = dependency('gio-unix-2.0', version: dependency_versions['glib'])
gtk = dependency('gtk+-3.0', version: dependency_versions['gtk'])
libxfce4ui = dependency('libxfce4ui-2', version: dependency_versions['xfce4'])
if libxfce4ui.version().version_compare('< 4.21.0')
exo = dependency('exo-2', version: dependency_versions['xfce4'])
else
exo = dependency('', required: false)
endif
libxfce4util = dependency('libxfce4util-1.0', version: dependency_versions['xfce4'])
libxfce4panel = dependency('libxfce4panel-2.0', version: dependency_versions['xfce4'])
xfconf = dependency('libxfconf-0', version: dependency_versions['xfce4'])
pulseaudio = dependency('libpulse-mainloop-glib', version: dependency_versions['pulseaudio'])
keybinder = dependency('keybinder-3.0', version: dependency_versions['keybinder'], required: get_option('keybinder'))
libnotify = dependency('libnotify', version: dependency_versions['libnotify'], required: get_option('libnotify'))
libcanberra = dependency('libcanberra', version: dependency_versions['libcanberra'], required: get_option('libcanberra'))
libxfce4windowing = dependency('libxfce4windowing-0', version: dependency_versions['libxfce4windowing'], required: get_option('libxfce4windowing'))
libm = cc.find_library('m')
feature_cflags = []
if keybinder.found()
feature_cflags += '-DHAVE_KEYBINDER=1'
endif
if libnotify.found()
feature_cflags += '-DHAVE_LIBNOTIFY=1'
endif
if libcanberra.found()
feature_cflags += '-DHAVE_LIBCANBERRA=1'
endif
if libxfce4windowing.found()
feature_cflags += '-DHAVE_LIBXFCE4WINDOWING=1'
endif
if not get_option('mpris2').disabled()
feature_cflags += '-DHAVE_MPRIS2=1'
endif
headers = [
'math.h',
'strings.h',
]
foreach header : headers
if cc.check_header(header)
feature_cflags += '-DHAVE_@0@=1'.format(header.underscorify().to_upper())
endif
endforeach
extra_cflags = []
extra_cflags_check = [
'-Wmissing-declarations',
'-Wmissing-noreturn',
'-Wold-style-definition',
'-Wredundant-decls',
'-Wpointer-arith',
'-Wcast-align',
'-Winit-self',
'-Wshadow',
'-Wmissing-include-dirs',
'-Wundef',
'-Wformat',
'-Wformat-security',
'-Wformat-y2k',
'-Wnested-externs',
'-Wno-unused-parameter',
'-Wno-declaration-after-statement',
'-Wno-missing-field-initializers',
'-Werror=implicit-function-declaration',
'-Wno-error=deprecated-declarations',
]
optimization = get_option('optimization')
if get_option('debug') and optimization in ['0', 'g']
extra_cflags_check += '-fstack-protector-strong'
extra_cflags += [
'-DDEBUG=1',
'-DDEBUG_TRACE=1',
'-DG_ENABLE_DEBUG',
]
elif optimization in ['3', 'minsize']
extra_cflags += [
'-DNDEBUG',
'-DG_DISABLE_CAST_CHECKS',
'-DG_DISABLE_ASSERT',
]
endif
if dependency_versions.has_key('glib')
glib_version_parts = dependency_versions['glib'].split(' ')
glib_min_version_parts = glib_version_parts[1].split('.')
glib_min_version_define = 'GLIB_VERSION_@0@_@1@'.format(glib_min_version_parts[0], glib_min_version_parts[1])
extra_cflags += [
'-DGLIB_VERSION_MIN_REQUIRED=@0@'.format(glib_min_version_define),
'-DGLIB_VERSION_MAX_ALLOWED=@0@'.format(glib_min_version_define),
'-DG_LOG_DOMAIN="@0@"'.format(meson.project_name()),
'-DG_LOG_USE_STRUCTURED=1',
]
endif
version_parts = meson.project_version().split('-dev')[0].split('.')
version_short = '@0@.@1@'.format(version_parts[0], version_parts[1])
extra_cflags += [
'-DPACKAGE="@0@"'.format(meson.project_name()),
'-DPACKAGE_NAME="@0@"'.format(meson.project_name()),
'-DPACKAGE_VERSION="@0@"'.format(meson.project_version()),
'-DVERSION="@0@"'.format(meson.project_version()),
'-DVERSION_SHORT="@0@"'.format(version_short),
'-DPACKAGE_STRING="@0@ @1@"'.format(meson.project_name(), meson.project_version()),
'-DPACKAGE_DATADIR="@0@"'.format(pkgdatadir),
'-DCOPYRIGHT_YEAR="@0@"'.format(copyright_year),
'-DPACKAGE_LOCALE_DIR="@0@"'.format(get_option('prefix') / get_option('localedir')),
'-DPACKAGE_URL="https://docs.xfce.org/@0@/@1@/start"'.format(project_namespace, meson.project_name()),
'-DPACKAGE_BUGREPORT="https://gitlab.xfce.org/@0@/@1@/-/issues"'.format(project_namespace, meson.project_name()),
'-DGETTEXT_PACKAGE="@0@"'.format(meson.project_name()),
'-DPREFIX="@0@"'.format(get_option('prefix')),
'-DBINDIR="@0@"'.format(get_option('prefix') / get_option('bindir')),
'-DDATADIR="@0@"'.format(get_option('prefix') / get_option('datadir')),
'-DDOCDIR="@0@"'.format(get_option('prefix') / 'doc' / meson.project_name()),
'-DINCLUDEDIR="@0@"'.format(get_option('prefix') / get_option('includedir')),
'-DLIBDIR="@0@"'.format(get_option('prefix') / get_option('libdir')),
'-DLIBEXECDIR="@0@"'.format(get_option('prefix') / get_option('libexecdir')),
'-DLOCALEDIR="@0@"'.format(get_option('prefix') / get_option('localedir')),
'-DLOCALSTATEDIR="@0@"'.format(get_option('prefix') / get_option('localstatedir')),
'-DSBINDIR="@0@"'.format(get_option('prefix') / get_option('sbindir')),
'-DSYSCONFDIR="@0@"'.format(get_option('prefix') / get_option('sysconfdir')),
'-DHAVE_XFCE_REVISION_H=1',
]
add_project_arguments(cc.get_supported_arguments(extra_cflags_check), language: 'c')
add_project_arguments(feature_cflags, language: 'c')
add_project_arguments(extra_cflags, language: 'c')
xfce_revision_h = vcs_tag(
command: ['git', 'rev-parse', '--short', 'HEAD'],
fallback: 'UNKNOWN',
input: 'xfce-revision.h.in',
output: 'xfce-revision.h',
replace_string: '@REVISION@',
)
subdir('panel-plugin')
subdir('icons')
subdir('po')
option(
'keybinder',
type: 'feature',
value: 'auto',
description: 'keybinder support',
)
option(
'libnotify',
type: 'feature',
value: 'auto',
description: 'libnotify support',
)
option(
'libcanberra',
type: 'feature',
value: 'auto',
description: 'libcanberra support',
)
option(
'libxfce4windowing',
type: 'feature',
value: 'auto',
description: 'libxfce4windowing support',
)
option(
'mpris2',
type: 'feature',
value: 'auto',
description: 'mpris2 support',
)
option(
'mixer-command',
type: 'string',
value: 'pavucontrol',
description: 'Default mixer command',
)
......@@ -17,7 +17,8 @@ plugin_LTLIBRARIES = \
libpulseaudio-plugin.la
libpulseaudio_built_sources = \
pulseaudio-dialog_ui.h
pulseaudio-dialog-resources.c \
pulseaudio-dialog-resources.h
libpulseaudio_plugin_la_SOURCES = \
$(libpulseaudio_built_sources) \
......@@ -52,6 +53,8 @@ libpulseaudio_plugin_la_SOURCES = \
libpulseaudio_plugin_la_CFLAGS = \
$(PULSEAUDIO_CFLAGS) \
$(GLIB_CFLAGS) \
$(GIO_CFLAGS) \
$(GIO_UNIX_CFLAGS) \
$(GTK_CFLAGS) \
$(LIBXFCE4UTIL_CFLAGS) \
$(LIBXFCE4UI_CFLAGS) \
......@@ -60,9 +63,7 @@ libpulseaudio_plugin_la_CFLAGS = \
$(KEYBINDER_CFLAGS) \
$(LIBNOTIFY_CFLAGS) \
$(LIBCANBERRA_CFLAGS) \
$(MPRIS2_CFLAGS) \
$(EXO_CFLAGS) \
$(WNCK_CFLAGS) \
$(LIBXFCE4WINDOWING_CFLAGS) \
$(PLATFORM_CFLAGS)
......@@ -76,6 +77,8 @@ libpulseaudio_plugin_la_LDFLAGS = \
libpulseaudio_plugin_la_LIBADD = \
$(PULSEAUDIO_LIBS) \
$(GLIB_LIBS) \
$(GIO_LIBS) \
$(GIO_UNIX_LIBS) \
$(GTK_LIBS) \
$(LIBXFCE4UTIL_LIBS) \
$(LIBXFCE4UI_LIBS) \
......@@ -84,9 +87,7 @@ libpulseaudio_plugin_la_LIBADD = \
$(KEYBINDER_LIBS) \
$(LIBNOTIFY_LIBS) \
$(LIBCANBERRA_LIBS) \
$(MPRIS2_LIBS) \
$(EXO_LIBS) \
$(WNCK_LIBS) \
$(LIBXFCE4WINDOWING_LIBS) \
$(LIBM)
......@@ -97,28 +98,31 @@ desktopdir = \
$(datadir)/xfce4/panel/plugins
desktop_in_files = \
pulseaudio.desktop.in.in
pulseaudio.desktop.in
desktop_DATA = $(desktop_in_files:.desktop.in.in=.desktop)
desktop_in_in_files = $(desktop_in_files:.desktop.in=.desktop.in.in)
desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
@INTLTOOL_DESKTOP_RULE@
$(desktop_DATA): $(desktop_in_files) Makefile
$(AM_V_GEN)$(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@
pulseaudio_dialog_glade_files = $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies --sourcedir $(srcdir) $(srcdir)/pulseaudio-dialog.gresource.xml)
pulseaudio-dialog-resources.h: $(srcdir)/pulseaudio-dialog.gresource.xml $(pulseaudio_dialog_glade_files) Makefile
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-header --manual-register $<
pulseaudio-dialog-resources.c: $(srcdir)/pulseaudio-dialog.gresource.xml $(pulseaudio_dialog_glade_files) Makefile pulseaudio-dialog-resources.h
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-source --manual-register $<
EXTRA_DIST = \
meson.build \
pulseaudio-dialog.glade \
$(desktop_in_files)
pulseaudio-dialog.gresource.xml \
$(desktop_in_in_files)
DISTCLEANFILES = \
$(desktop_DATA)
if MAINTAINER_MODE
BUILT_SOURCES = \
$(desktop_in_files) \
$(desktop_DATA) \
$(libpulseaudio_built_sources)
DISTCLEANFILES += \
$(libpulseaudio_built_sources)
pulseaudio-dialog_ui.h: pulseaudio-dialog.glade
$(AM_V_GEN) xdt-csource --static --strip-comments --strip-content --name=pulseaudio_dialog_ui $< >$@
endif
# vi:set ts=8 sw=8 noet ai nocindent syntax=automake:
......@@ -99,7 +99,8 @@ device_menu_item_new_with_label (const gchar *label)
void
device_menu_item_add_device (DeviceMenuItem *item,
const gchar *name,
const gchar *description)
const gchar *description,
gboolean sensitive)
{
DeviceMenuItemPrivate *priv;
GtkWidget *mi;
......@@ -111,6 +112,7 @@ device_menu_item_add_device (DeviceMenuItem *item,
priv->group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (mi));
gtk_widget_set_sensitive (mi, sensitive);
gtk_widget_show (mi);
gtk_menu_shell_append (GTK_MENU_SHELL (priv->submenu), mi);
......
......@@ -57,7 +57,8 @@ GtkWidget *device_menu_item_new_with_label (const gchar *label);
void device_menu_item_add_device (DeviceMenuItem *item,
const gchar *name,
const gchar *description);
const gchar *description,
gboolean sensitive);
void device_menu_item_set_device_by_name (DeviceMenuItem *item,
const gchar *name);
......
plugin_sources = [
'devicemenuitem.c',
'devicemenuitem.h',
'mprismenuitem.c',
'mprismenuitem.h',
'pulseaudio-button.c',
'pulseaudio-button.h',
'pulseaudio-config.c',
'pulseaudio-config.h',
'pulseaudio-debug.c',
'pulseaudio-debug.h',
'pulseaudio-dialog.c',
'pulseaudio-dialog.h',
'pulseaudio-menu.c',
'pulseaudio-menu.h',
'pulseaudio-mpris.c',
'pulseaudio-mpris.h',
'pulseaudio-mpris-player.c',
'pulseaudio-mpris-player.h',
'pulseaudio-notify.c',
'pulseaudio-notify.h',
'pulseaudio-plugin.c',
'pulseaudio-plugin.h',
'pulseaudio-volume.c',
'pulseaudio-volume.h',
'scalemenuitem.c',
'scalemenuitem.h',
xfce_revision_h,
]
plugin_sources += gnome.compile_resources(
'pulseaudio-dialog-resources',
'pulseaudio-dialog.gresource.xml',
export: false,
extra_args: [
'--manual-register',
],
)
plugin_install_subdir = 'xfce4' / 'panel' / 'plugins'
plugin_lib = shared_module(
'pulseaudio-plugin',
plugin_sources,
gnu_symbol_visibility: 'hidden',
c_args: [
'-DG_LOG_DOMAIN="@0@"'.format('xfce4-pulseaudio-plugin'),
'-DDEFAULT_MIXER_COMMAND="@0@"'.format(get_option('mixer-command')),
],
include_directories: [
include_directories('..'),
],
dependencies: [
exo,
gio,
gio_unix,
glib,
gtk,
keybinder,
libcanberra,
libm,
libnotify,
libxfce4panel,
libxfce4ui,
libxfce4util,
libxfce4windowing,
pulseaudio,
xfconf,
],
install: true,
install_dir: get_option('prefix') / get_option('libdir') / plugin_install_subdir,
)
i18n.merge_file(
input: configure_file(
input: 'pulseaudio.desktop.in.in',
output: 'pulseaudio.desktop.in',
configuration: {
'LIBXFCE4PANEL_VERSION_API': libxfce4panel.get_variable(pkgconfig: 'api'),
},
install: false,
),
output: 'pulseaudio.desktop',
po_dir: '..' / 'po',
type: 'desktop',
install: true,
install_dir: get_option('prefix') / get_option('datadir') / plugin_install_subdir,
)
......@@ -34,8 +34,11 @@
#include <gdk/gdk.h>
#include <gdk/gdkkeysyms.h>
#include <gio/gdesktopappinfo.h>
#include <libxfce4ui/libxfce4ui.h>
#if !LIBXFCE4UI_CHECK_VERSION(4, 21, 0)
#include <exo/exo.h>
#endif
/* for DBG/TRACE */
......@@ -117,12 +120,11 @@ static void update_packing (MprisMenuItem *ite
/* Public API */
GtkWidget*
static GtkWidget*
mpris_menu_item_new_with_player (const gchar *player,
const gchar *title,
const gchar *icon_name,
const gchar *filename)
gchar *player_label,
gchar *icon_name,
gchar *filename)
{
MprisMenuItem *menu_item;
MprisMenuItemPrivate *priv;
......@@ -133,12 +135,9 @@ mpris_menu_item_new_with_player (const gchar *player,
priv = mpris_menu_item_get_instance_private (menu_item);
priv->player = g_strdup(player);
if (title != NULL)
priv->title = g_strdup(title);
else
priv->title = g_strdup(player);
priv->filename = g_strdup(filename);
priv->player = g_strdup (player);
priv->title = player_label;
priv->filename = filename;
update_packing (menu_item);
......@@ -153,7 +152,11 @@ mpris_menu_item_new_with_player (const gchar *player,
size = 24;
size *= scale_factor;
#if LIBXFCE4UI_CHECK_VERSION(4, 21, 0)
buf = xfce_gdk_pixbuf_new_from_file_at_max_size (icon_name, size, size, TRUE, NULL);
#else
buf = exo_gdk_pixbuf_new_from_file_at_max_size (icon_name, size, size, TRUE, NULL);
#endif
if (buf != NULL) {
cairo_surface_t *surface = gdk_cairo_surface_create_from_pixbuf (buf, scale_factor, NULL);
gtk_image_set_from_surface (GTK_IMAGE (priv->image), surface);
......@@ -171,20 +174,20 @@ mpris_menu_item_new_with_player (const gchar *player,
/* Public API */
GtkWidget*
mpris_menu_item_new_from_player_name (const gchar *player)
{
GtkWidget *widget = NULL;
gchar *name;
gchar *player_label;
gchar *icon_name;
gchar *full_path;
if (pulseaudio_mpris_get_player_summary (player, &name, &icon_name, &full_path)) {
widget = mpris_menu_item_new_with_player (player, name, icon_name, full_path);
g_free (name);
g_free (icon_name);
g_free (full_path);
}
if (pulseaudio_mpris_get_player_summary (player, &player_label, &icon_name, &full_path))
{
widget = mpris_menu_item_new_with_player (player, player_label, icon_name, full_path);
g_free (icon_name);
}
return widget;
}
......@@ -274,7 +277,12 @@ mpris_menu_item_set_can_play (MprisMenuItem *item,
priv->can_play = enabled;
if (priv->is_running)
gtk_widget_set_sensitive (priv->play_pause, priv->can_play);
{
if (!priv->is_playing)
{
gtk_widget_set_sensitive (priv->play_pause, priv->can_play);
}
}
else
gtk_widget_set_sensitive (priv->play_pause, FALSE);
}
......@@ -482,22 +490,6 @@ mpris_menu_item_class_init (MprisMenuItemClass *item_class)
static void
mpris_menu_item_init (MprisMenuItem *item)
{
MprisMenuItemPrivate *priv;
priv = mpris_menu_item_get_instance_private (item);
priv->title_label = NULL;
priv->artist_label = NULL;
priv->button_box = NULL;
priv->vbox = NULL;
priv->hbox = NULL;
priv->go_previous = NULL;
priv->play_pause = NULL;
priv->go_next = NULL;
priv->player = NULL;
priv->title = NULL;
priv->filename = NULL;
}
......@@ -511,12 +503,9 @@ mpris_menu_item_finalize (GObject *object)
item = MPRIS_MENU_ITEM (object);
priv = mpris_menu_item_get_instance_private (item);
if (priv->player)
g_free (priv->player);
if (priv->title)
g_free (priv->title);
if (priv->filename)
g_free (priv->filename);
g_free (priv->player);
g_free (priv->title);
g_free (priv->filename);
g_object_unref (priv->title_label);
g_object_unref (priv->artist_label);
......@@ -548,7 +537,7 @@ mpris_menu_item_raise (MprisMenuItem *item)
{
media_notify (item, "Raise");
}
#if defined (HAVE_WNCK) || defined (HAVE_LIBXFCE4WINDOWING)
#ifdef HAVE_LIBXFCE4WINDOWING
else if (priv->can_raise_wnck)
{
media_notify (item, "RaiseWnck");
......@@ -569,7 +558,7 @@ mpris_menu_item_launch (MprisMenuItem *item)
priv = mpris_menu_item_get_instance_private (item);
if (priv->is_running)
if (priv->is_running || !priv->filename)
return;
app_info = (GAppInfo*)g_desktop_app_info_new_from_filename (priv->filename);
......
......@@ -59,11 +59,6 @@ struct _MprisMenuItemClass
GType mpris_menu_item_get_type (void) G_GNUC_CONST;
GtkWidget *mpris_menu_item_new_with_player (const gchar *player,
const gchar *title,
const gchar *icon_name,
const gchar *filename);
GtkWidget *mpris_menu_item_new_from_player_name (const gchar *player);
const gchar *mpris_menu_item_get_player (MprisMenuItem *item);
......
......@@ -77,6 +77,11 @@ static gboolean pulseaudio_button_button_press (GtkWidget
GdkEventButton *event);
static gboolean pulseaudio_button_scroll_event (GtkWidget *widget,
GdkEventScroll *event);
static gboolean pulseaudio_query_tooltip (GtkWidget *widget,
gint x,
gint y,
gboolean keyboard_mode,
GtkTooltip *tooltip);
static void pulseaudio_button_menu_deactivate (PulseaudioButton *button,
GtkMenuShell *menu);
static void pulseaudio_button_update_icons (PulseaudioButton *button);
......@@ -94,8 +99,12 @@ struct _PulseaudioButton
PulseaudioMpris *mpris;
PulseaudioVolume *volume;
GtkWidget *box;
GtkWidget *image;
GtkWidget *recording_indicator;
GtkCssProvider *recording_indicator_style_css_provider;
gboolean recording;
gboolean recording_indicator_persistent;
/* Icon size currently used */
gint icon_size;
......@@ -104,10 +113,12 @@ struct _PulseaudioButton
PulseaudioMenu *menu;
gulong connection_changed_id;
gulong volume_changed_id;
gulong recording_volume_changed_id;
gulong recording_changed_id;
gulong deactivate_id;
gulong configuration_changed_id;
};
struct _PulseaudioButtonClass
......@@ -131,6 +142,19 @@ pulseaudio_button_class_init (PulseaudioButtonClass *klass)
gtkwidget_class = GTK_WIDGET_CLASS (klass);
gtkwidget_class->button_press_event = pulseaudio_button_button_press;
gtkwidget_class->scroll_event = pulseaudio_button_scroll_event;
gtkwidget_class->query_tooltip = pulseaudio_query_tooltip;
}
static void pulseaudio_set_recording_indicator_state (PulseaudioButton *button)
{
gtk_css_provider_load_from_data (button->recording_indicator_style_css_provider,
button->recording ? ".recording-indicator { color: @error_color; }" : "",
-1, NULL);
gtk_widget_set_visible (button->recording_indicator,
button->recording || button->recording_indicator_persistent);
}
......@@ -140,7 +164,6 @@ pulseaudio_button_init (PulseaudioButton *button)
{
GtkStyleContext *context;
GtkCssProvider *css_provider;
GtkWidget *box;
gtk_widget_set_can_focus(GTK_WIDGET(button), FALSE);
gtk_widget_set_can_default (GTK_WIDGET (button), FALSE);
......@@ -148,6 +171,9 @@ pulseaudio_button_init (PulseaudioButton *button)
gtk_button_set_use_underline (GTK_BUTTON (button), TRUE);
gtk_widget_set_focus_on_click (GTK_WIDGET (button), FALSE);
gtk_widget_set_name (GTK_WIDGET (button), "pulseaudio-button");
gtk_widget_set_has_tooltip (GTK_WIDGET (button), TRUE);
gtk_widget_set_halign (GTK_WIDGET(button), GTK_ALIGN_START);
gtk_widget_set_valign (GTK_WIDGET(button), GTK_ALIGN_START);
/* Preload icons */
g_signal_connect (G_OBJECT (button), "style-updated", G_CALLBACK (pulseaudio_button_update_icons), button);
......@@ -163,39 +189,24 @@ pulseaudio_button_init (PulseaudioButton *button)
/* Intercept scroll events */
gtk_widget_add_events (GTK_WIDGET (button), GDK_SCROLL_MASK);
button->plugin = NULL;
button->config = NULL;
button->volume = NULL;
button->icon_size = 16;
button->icon_name = NULL;
button->menu = NULL;
button->volume_changed_id = 0;
button->recording_volume_changed_id = 0;
button->recording_changed_id = 0;
button->deactivate_id = 0;
button->image = gtk_image_new ();
button->recording_indicator = gtk_image_new ();
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_container_add (GTK_CONTAINER (button), box);
gtk_box_pack_start (GTK_BOX (box), GTK_WIDGET (button->recording_indicator), TRUE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (box), GTK_WIDGET (button->image), TRUE, FALSE, 0);
gtk_widget_show_all (box);
gtk_widget_hide (button->recording_indicator);
button->box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_set_homogeneous (GTK_BOX (button->box), TRUE);
gtk_container_add (GTK_CONTAINER (button), button->box);
gtk_box_pack_start (GTK_BOX (button->box), GTK_WIDGET (button->recording_indicator), TRUE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (button->box), GTK_WIDGET (button->image), TRUE, FALSE, 0);
gtk_widget_show_all (button->box);
context = gtk_widget_get_style_context (button->recording_indicator);
css_provider = gtk_css_provider_new ();
gtk_css_provider_load_from_data (css_provider,
".recording-indicator { color: @error_color; }",
-1, NULL);
button->recording_indicator_style_css_provider = gtk_css_provider_new ();
gtk_style_context_add_provider (context,
GTK_STYLE_PROVIDER (css_provider),
GTK_STYLE_PROVIDER (button->recording_indicator_style_css_provider),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
g_object_unref (css_provider);
gtk_style_context_add_class (context, "recording-indicator");
g_object_set (G_OBJECT (button), "has-tooltip", TRUE, NULL);
}
......@@ -212,11 +223,34 @@ pulseaudio_button_finalize (GObject *object)
button->menu = NULL;
}
g_object_unref (button->recording_indicator_style_css_provider);
(*G_OBJECT_CLASS (pulseaudio_button_parent_class)->finalize) (object);
}
static gboolean
pulseaudio_button_mic_icon_under_pointer (PulseaudioButton *button,
gdouble pointer_pos_x,
gdouble pointer_pos_y)
{
GtkOrientation orientation;
if (!gtk_widget_is_visible (button->recording_indicator))
return FALSE;
orientation = gtk_orientable_get_orientation (GTK_ORIENTABLE (button->box));
/* Microphone icon is on the left/top */
if (orientation == GTK_ORIENTATION_HORIZONTAL)
return (pointer_pos_x / (gdouble) gtk_widget_get_allocated_width (GTK_WIDGET (button))) < 0.5;
else
return (pointer_pos_y / (gdouble) gtk_widget_get_allocated_height (GTK_WIDGET (button))) < 0.5;
}
static gboolean
pulseaudio_button_button_press (GtkWidget *widget,
GdkEventButton *event)
......@@ -257,7 +291,10 @@ G_GNUC_END_IGNORE_DEPRECATIONS
if (event->button == 2) /* middle button */
{
pulseaudio_volume_toggle_muted (button->volume);
if (pulseaudio_button_mic_icon_under_pointer (button, event->x, event->y))
pulseaudio_volume_toggle_muted_mic (button->volume);
else
pulseaudio_volume_toggle_muted (button->volume);
return TRUE;
}
......@@ -270,7 +307,8 @@ static gboolean
pulseaudio_button_scroll_event (GtkWidget *widget, GdkEventScroll *event)
{
PulseaudioButton *button = PULSEAUDIO_BUTTON (widget);
gdouble volume = pulseaudio_volume_get_volume (button->volume);
gboolean is_mic = pulseaudio_button_mic_icon_under_pointer (button, event->x, event->y);
gdouble volume = is_mic ? pulseaudio_volume_get_volume_mic (button->volume) : pulseaudio_volume_get_volume (button->volume);
gdouble volume_step = pulseaudio_config_get_volume_step (button->config) / 100.0;
gdouble new_volume;
......@@ -281,7 +319,61 @@ pulseaudio_button_scroll_event (GtkWidget *widget, GdkEventScroll *event)
else
new_volume = volume;
pulseaudio_volume_set_volume (button->volume, new_volume);
if (is_mic)
pulseaudio_volume_set_volume_mic (button->volume, new_volume);
else
pulseaudio_volume_set_volume (button->volume, new_volume);
return TRUE;
}
static gboolean
pulseaudio_query_tooltip (GtkWidget *widget,
gint x,
gint y,
gboolean keyboard_mode,
GtkTooltip *tooltip)
{
PulseaudioButton *button = PULSEAUDIO_BUTTON (widget);
const gchar *format;
gchar *tip_text;
const gchar *dev_name;
gboolean muted;
gdouble volume;
if (keyboard_mode)
return FALSE;
if (!pulseaudio_volume_get_connected (button->volume))
{
tip_text = g_strdup_printf (_("Not connected to the PulseAudio server"));
}
else
{
if (pulseaudio_button_mic_icon_under_pointer (button, x, y))
{
dev_name = pulseaudio_volume_get_input_by_name (button->volume, pulseaudio_volume_get_default_input (button->volume), NULL);
muted = pulseaudio_volume_get_muted_mic (button->volume);
volume = pulseaudio_volume_get_volume_mic (button->volume);
}
else
{
dev_name = pulseaudio_volume_get_output_by_name (button->volume, pulseaudio_volume_get_default_output (button->volume), NULL);
muted = pulseaudio_volume_get_muted (button->volume);
volume = pulseaudio_volume_get_volume (button->volume);
}
if (muted)
format = _("<b>Volume %d%% (muted)</b>\n<small>%s</small>");
else
format = _("<b>Volume %d%%</b>\n<small>%s</small>");
tip_text = g_strdup_printf (format, (gint) round (volume * 100), dev_name);
}
gtk_tooltip_set_markup (tooltip, tip_text);
g_free (tip_text);
return TRUE;
}
......@@ -322,23 +414,6 @@ pulseaudio_button_update_icons (PulseaudioButton *button)
static gboolean
pulseaudio_button_sink_connection_timeout (gpointer userdata)
{
PulseaudioButton *button = PULSEAUDIO_BUTTON (userdata);
gboolean sink_connected = pulseaudio_volume_get_sink_connected (button->volume);
if (sink_connected)
{
pulseaudio_button_update (button, TRUE);
return FALSE;
}
return TRUE;
}
static void
pulseaudio_button_update (PulseaudioButton *button,
gboolean force_update)
......@@ -346,11 +421,9 @@ pulseaudio_button_update (PulseaudioButton *button,
gdouble volume;
gdouble recording_volume;
gboolean connected;
gboolean sink_connected;
gboolean muted;
gboolean recording_muted;
gboolean recording;
gchar *tip_text;
const gchar *icon_name;
const gchar *recording_icon_name;
......@@ -360,7 +433,6 @@ pulseaudio_button_update (PulseaudioButton *button,
volume = pulseaudio_volume_get_volume (button->volume);
muted = pulseaudio_volume_get_muted (button->volume);
connected = pulseaudio_volume_get_connected (button->volume);
sink_connected = pulseaudio_volume_get_sink_connected (button->volume);
recording = pulseaudio_volume_get_recording (button->volume);
recording_volume = pulseaudio_volume_get_volume_mic (button->volume);
recording_muted = pulseaudio_volume_get_muted_mic (button->volume);
......@@ -391,14 +463,8 @@ pulseaudio_button_update (PulseaudioButton *button,
else
recording_icon_name = recording_icons[V_HIGH];
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));
gtk_widget_set_tooltip_text (GTK_WIDGET (button), tip_text);
g_free (tip_text);
if (!force_update)
gtk_tooltip_trigger_tooltip_query (gdk_display_get_default ());
if (force_update || icon_name != button->icon_name)
{
......@@ -414,11 +480,11 @@ pulseaudio_button_update (PulseaudioButton *button,
gtk_image_set_pixel_size (GTK_IMAGE (button->recording_indicator), button->icon_size);
}
if (gtk_widget_get_visible (button->recording_indicator) != recording)
gtk_widget_set_visible (button->recording_indicator, recording);
if (!sink_connected)
g_timeout_add (250, pulseaudio_button_sink_connection_timeout, button);
if (force_update || button->recording != recording)
{
button->recording = recording;
pulseaudio_set_recording_indicator_state (button);
}
}
......@@ -431,11 +497,27 @@ pulseaudio_button_set_size (PulseaudioButton *button,
g_return_if_fail (IS_PULSEAUDIO_BUTTON (button));
g_return_if_fail (size > 0);
gtk_widget_set_size_request (GTK_WIDGET (button), size, size);
button->icon_size = icon_size;
gtk_image_set_pixel_size (GTK_IMAGE (button->image), button->icon_size);
if (gtk_widget_get_visible (button->recording_indicator))
gtk_image_set_pixel_size (GTK_IMAGE (button->recording_indicator), button->icon_size);
gtk_image_set_pixel_size (GTK_IMAGE (button->recording_indicator), button->icon_size);
if (size > 0)
{
gtk_widget_set_size_request (button->image, size, size);
gtk_widget_set_size_request (button->recording_indicator, size, size);
}
}
void
pulseaudio_button_set_orientation (PulseaudioButton *button,
GtkOrientation orientation)
{
g_return_if_fail (IS_PULSEAUDIO_BUTTON (button));
gtk_orientable_set_orientation (GTK_ORIENTABLE (button->box), orientation);
}
......@@ -457,8 +539,11 @@ pulseaudio_button_recording_changed (PulseaudioButton *button,
{
g_return_if_fail (IS_PULSEAUDIO_BUTTON (button));
/* Show or hide the recording indicator */
gtk_widget_set_visible (button->recording_indicator, recording);
if (button->recording != recording)
{
button->recording = recording;
pulseaudio_set_recording_indicator_state (button);
}
}
......@@ -469,6 +554,42 @@ pulseaudio_button_volume_changed (PulseaudioButton *button,
{
g_return_if_fail (IS_PULSEAUDIO_BUTTON (button));
if (pulseaudio_volume_get_connected (button->volume))
pulseaudio_button_update (button, FALSE);
}
static void
pulseaudio_button_configuration_changed (PulseaudioButton *button,
PulseaudioConfig *config)
{
gboolean rec_indicator_persistent = pulseaudio_config_get_rec_indicator_persistent (config);
gint width;
if (rec_indicator_persistent != button->recording_indicator_persistent)
{
button->recording_indicator_persistent = rec_indicator_persistent;
pulseaudio_set_recording_indicator_state (button);
if (gtk_orientable_get_orientation (GTK_ORIENTABLE (button->box)) == GTK_ORIENTATION_HORIZONTAL)
gtk_widget_get_size_request (GTK_WIDGET(button), NULL, &width);
else
gtk_widget_get_size_request (GTK_WIDGET(button), &width, NULL);
if (width > 0)
pulseaudio_button_set_size (button, width, button->icon_size);
}
}
static void
pulseaudio_button_update2 (PulseaudioButton *button,
PulseaudioVolume *volume)
{
g_return_if_fail (IS_PULSEAUDIO_BUTTON (button));
pulseaudio_button_update (button, FALSE);
}
......@@ -495,6 +616,9 @@ pulseaudio_button_new (PulseaudioPlugin *plugin,
button->volume = volume;
button->config = config;
button->mpris = mpris;
button->connection_changed_id =
g_signal_connect_swapped (G_OBJECT (button->volume), "connection-changed",
G_CALLBACK (pulseaudio_button_update2), button);
button->volume_changed_id =
g_signal_connect_swapped (G_OBJECT (button->volume), "volume-changed",
G_CALLBACK (pulseaudio_button_volume_changed), button);
......@@ -504,7 +628,11 @@ pulseaudio_button_new (PulseaudioPlugin *plugin,
button->recording_changed_id =
g_signal_connect_swapped (G_OBJECT (button->volume), "recording-changed",
G_CALLBACK (pulseaudio_button_recording_changed), button);
button->configuration_changed_id =
g_signal_connect_swapped (G_OBJECT (button->config), "configuration-changed",
G_CALLBACK (pulseaudio_button_configuration_changed), button);
button->recording_indicator_persistent = pulseaudio_config_get_rec_indicator_persistent (button->config);
pulseaudio_button_update (button, TRUE);
return button;
......
......@@ -50,8 +50,12 @@ void pulseaudio_button_set_size (PulseaudioButton *button,
gint size,
gint icon_size);
void pulseaudio_button_set_orientation (PulseaudioButton *button,
GtkOrientation orientation);
PulseaudioMenu *pulseaudio_button_get_menu (PulseaudioButton *button);
G_END_DECLS
#endif /* !__PULSEAUDIO_BUTTON_H__ */
......@@ -33,7 +33,7 @@
#include <string.h>
#endif
#include <libxfce4panel/xfce-panel-plugin.h>
#include <libxfce4panel/libxfce4panel.h>
#include <libxfce4util/libxfce4util.h>
#include <libxfce4ui/libxfce4ui.h>
#include <xfconf/xfconf.h>
......@@ -44,8 +44,9 @@
#define DEFAULT_ENABLE_KEYBOARD_SHORTCUTS TRUE
#define DEFAULT_SHOW_NOTIFICATIONS TRUE
#define DEFAULT_SHOW_NOTIFICATIONS 1
#define DEFAULT_PLAY_SOUND FALSE
#define DEFAULT_REC_INDICATOR_PERSISTENT FALSE
#define DEFAULT_VOLUME_STEP 5
#define DEFAULT_VOLUME_MAX 150
......@@ -56,9 +57,11 @@
#define DEFAULT_ENABLE_MPRIS FALSE
#define DEFAULT_ENABLE_MULTIMEDIA_KEYS FALSE
#endif
#define DEFAULT_BLACKLISTED_PLAYERS ""
#define DEFAULT_MULTIMEDIA_KEYS_TO_ALL FALSE
#define DEFAULT_IGNORED_PLAYERS ""
#define DEFAULT_PERSISTENT_PLAYERS ""
#define DEFAULT_MPRIS_PLAYERS ""
#define DEFAULT_KNOWN_PLAYERS ""
#define DEFAULT_ENABLE_WNCK FALSE
......@@ -84,18 +87,24 @@ struct _PulseaudioConfig
{
GObject __parent__;
const gchar *property_base;
XfconfChannel *channel;
gboolean enable_keyboard_shortcuts;
gboolean enable_multimedia_keys;
gboolean show_notifications;
gboolean multimedia_keys_to_all;
guint show_notifications;
#ifdef HAVE_LIBCANBERRA
gboolean play_sound;
#endif
gboolean rec_indicator_persistent;
guint volume_step;
guint volume_max;
gchar *mixer_command;
gboolean enable_mpris;
gchar *mpris_players;
gchar *blacklisted_players;
gchar *known_players;
gchar *ignored_players;
gchar *persistent_players;
gboolean enable_wnck;
};
......@@ -106,16 +115,19 @@ enum
PROP_0,
PROP_ENABLE_KEYBOARD_SHORTCUTS,
PROP_ENABLE_MULTIMEDIA_KEYS,
PROP_MULTIMEDIA_KEYS_TO_ALL,
PROP_SHOW_NOTIFICATIONS,
#ifdef HAVE_LIBCANBERRA
PROP_PLAY_SOUND,
#endif
PROP_REC_INDICATOR_PERSISTENT,
PROP_VOLUME_STEP,
PROP_VOLUME_MAX,
PROP_MIXER_COMMAND,
PROP_ENABLE_MPRIS,
PROP_MPRIS_PLAYERS,
PROP_BLACKLISTED_PLAYERS,
PROP_KNOWN_PLAYERS,
PROP_IGNORED_PLAYERS,
PROP_PERSISTENT_PLAYERS,
PROP_ENABLE_WNCK,
N_PROPERTIES,
};
......@@ -163,13 +175,24 @@ pulseaudio_config_class_init (PulseaudioConfigClass *klass)
g_object_class_install_property (gobject_class,
PROP_SHOW_NOTIFICATIONS,
g_param_spec_boolean ("show-notifications", NULL, NULL,
DEFAULT_SHOW_NOTIFICATIONS,
PROP_MULTIMEDIA_KEYS_TO_ALL,
g_param_spec_boolean ("multimedia-keys-to-all", NULL, NULL,
DEFAULT_MULTIMEDIA_KEYS_TO_ALL,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class,
PROP_SHOW_NOTIFICATIONS,
g_param_spec_uint ("show-notifications", NULL, NULL,
VOLUME_NOTIFICATIONS_NONE,
VOLUME_NOTIFICATIONS_COUNT - 1,
DEFAULT_SHOW_NOTIFICATIONS,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
#ifdef HAVE_LIBCANBERRA
g_object_class_install_property (gobject_class,
PROP_PLAY_SOUND,
......@@ -180,6 +203,14 @@ pulseaudio_config_class_init (PulseaudioConfigClass *klass)
#endif
g_object_class_install_property (gobject_class,
PROP_REC_INDICATOR_PERSISTENT,
g_param_spec_boolean ("rec-indicator-persistent", NULL, NULL,
DEFAULT_REC_INDICATOR_PERSISTENT,
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,
......@@ -218,20 +249,29 @@ pulseaudio_config_class_init (PulseaudioConfigClass *klass)
g_object_class_install_property (gobject_class,
PROP_MPRIS_PLAYERS,
g_param_spec_string ("mpris-players",
PROP_KNOWN_PLAYERS,
g_param_spec_string ("known-players",
NULL, NULL,
DEFAULT_MPRIS_PLAYERS,
DEFAULT_KNOWN_PLAYERS,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class,
PROP_IGNORED_PLAYERS,
g_param_spec_string ("ignored-players",
NULL, NULL,
DEFAULT_IGNORED_PLAYERS,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class,
PROP_BLACKLISTED_PLAYERS,
g_param_spec_string ("blacklisted-players",
PROP_PERSISTENT_PLAYERS,
g_param_spec_string ("persistent-players",
NULL, NULL,
DEFAULT_BLACKLISTED_PLAYERS,
DEFAULT_PERSISTENT_PLAYERS,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
......@@ -262,16 +302,19 @@ pulseaudio_config_init (PulseaudioConfig *config)
{
config->enable_keyboard_shortcuts = DEFAULT_ENABLE_KEYBOARD_SHORTCUTS;
config->enable_multimedia_keys = DEFAULT_ENABLE_MULTIMEDIA_KEYS;
config->multimedia_keys_to_all = DEFAULT_MULTIMEDIA_KEYS_TO_ALL;
config->show_notifications = DEFAULT_SHOW_NOTIFICATIONS;
#ifdef HAVE_LIBCANBERRA
config->play_sound = DEFAULT_PLAY_SOUND;
#endif
config->rec_indicator_persistent = DEFAULT_REC_INDICATOR_PERSISTENT;
config->volume_step = DEFAULT_VOLUME_STEP;
config->volume_max = DEFAULT_VOLUME_MAX;
config->mixer_command = g_strdup (DEFAULT_MIXER_COMMAND);
config->enable_mpris = DEFAULT_ENABLE_MPRIS;
config->mpris_players = g_strdup (DEFAULT_MPRIS_PLAYERS);
config->blacklisted_players = g_strdup (DEFAULT_BLACKLISTED_PLAYERS);
config->known_players = g_strdup (DEFAULT_KNOWN_PLAYERS);
config->ignored_players = g_strdup (DEFAULT_IGNORED_PLAYERS);
config->persistent_players = g_strdup (DEFAULT_PERSISTENT_PLAYERS);
config->enable_wnck = DEFAULT_ENABLE_WNCK;
}
......@@ -308,8 +351,12 @@ pulseaudio_config_get_property (GObject *object,
g_value_set_boolean (value, config->enable_multimedia_keys);
break;
case PROP_MULTIMEDIA_KEYS_TO_ALL:
g_value_set_boolean (value, config->multimedia_keys_to_all);
break;
case PROP_SHOW_NOTIFICATIONS:
g_value_set_boolean (value, config->show_notifications);
g_value_set_uint (value, config->show_notifications);
break;
#ifdef HAVE_LIBCANBERRA
......@@ -318,6 +365,10 @@ pulseaudio_config_get_property (GObject *object,
break;
#endif
case PROP_REC_INDICATOR_PERSISTENT:
g_value_set_boolean (value, config->rec_indicator_persistent);
break;
case PROP_VOLUME_STEP:
g_value_set_uint (value, config->volume_step);
break;
......@@ -334,12 +385,16 @@ pulseaudio_config_get_property (GObject *object,
g_value_set_boolean (value, config->enable_mpris);
break;
case PROP_MPRIS_PLAYERS:
g_value_set_string (value, config->mpris_players);
case PROP_KNOWN_PLAYERS:
g_value_set_string (value, config->known_players);
break;
case PROP_IGNORED_PLAYERS:
g_value_set_string (value, config->ignored_players);
break;
case PROP_BLACKLISTED_PLAYERS:
g_value_set_string (value, config->blacklisted_players);
case PROP_PERSISTENT_PLAYERS:
g_value_set_string (value, config->persistent_players);
break;
case PROP_ENABLE_WNCK:
......@@ -386,11 +441,21 @@ pulseaudio_config_set_property (GObject *object,
}
break;
case PROP_SHOW_NOTIFICATIONS:
case PROP_MULTIMEDIA_KEYS_TO_ALL:
val_bool = g_value_get_boolean (value);
if (config->show_notifications != val_bool)
if (config->multimedia_keys_to_all != val_bool)
{
config->show_notifications = val_bool;
config->multimedia_keys_to_all = val_bool;
g_object_notify (G_OBJECT (config), "multimedia-keys-to-all");
g_signal_emit (G_OBJECT (config), pulseaudio_config_signals [CONFIGURATION_CHANGED], 0);
}
break;
case PROP_SHOW_NOTIFICATIONS:
val_uint = g_value_get_uint (value);
if (config->show_notifications != val_uint)
{
config->show_notifications = val_uint;
g_object_notify (G_OBJECT (config), "show-notifications");
g_signal_emit (G_OBJECT (config), pulseaudio_config_signals [CONFIGURATION_CHANGED], 0);
}
......@@ -408,6 +473,16 @@ pulseaudio_config_set_property (GObject *object,
break;
#endif
case PROP_REC_INDICATOR_PERSISTENT:
val_bool = g_value_get_boolean (value);
if (config->rec_indicator_persistent != val_bool)
{
config->rec_indicator_persistent = val_bool;
g_object_notify (G_OBJECT (config), "rec-indicator-persistent");
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)
......@@ -453,17 +528,24 @@ pulseaudio_config_set_property (GObject *object,
}
break;
case PROP_MPRIS_PLAYERS:
g_free (config->mpris_players);
config->mpris_players = g_value_dup_string (value);
g_object_notify (G_OBJECT (config), "mpris-players");
case PROP_KNOWN_PLAYERS:
g_free (config->known_players);
config->known_players = g_value_dup_string (value);
g_object_notify (G_OBJECT (config), "known-players");
g_signal_emit (G_OBJECT (config), pulseaudio_config_signals [CONFIGURATION_CHANGED], 0);
break;
case PROP_IGNORED_PLAYERS:
g_free (config->ignored_players);
config->ignored_players = g_value_dup_string (value);
g_object_notify (G_OBJECT (config), "ignored-players");
g_signal_emit (G_OBJECT (config), pulseaudio_config_signals [CONFIGURATION_CHANGED], 0);
break;
case PROP_BLACKLISTED_PLAYERS:
g_free (config->blacklisted_players);
config->blacklisted_players = g_value_dup_string (value);
g_object_notify (G_OBJECT (config), "blacklisted-players");
case PROP_PERSISTENT_PLAYERS:
g_free (config->persistent_players);
config->persistent_players = g_value_dup_string (value);
g_object_notify (G_OBJECT (config), "persistent-players");
g_signal_emit (G_OBJECT (config), pulseaudio_config_signals [CONFIGURATION_CHANGED], 0);
break;
......@@ -506,6 +588,16 @@ pulseaudio_config_get_enable_multimedia_keys (PulseaudioConfig *config)
gboolean
pulseaudio_config_get_multimedia_keys_to_all (PulseaudioConfig *config)
{
g_return_val_if_fail (IS_PULSEAUDIO_CONFIG (config), DEFAULT_MULTIMEDIA_KEYS_TO_ALL);
return config->multimedia_keys_to_all;
}
guint
pulseaudio_config_get_show_notifications (PulseaudioConfig *config)
{
g_return_val_if_fail (IS_PULSEAUDIO_CONFIG (config), DEFAULT_SHOW_NOTIFICATIONS);
......@@ -527,6 +619,16 @@ pulseaudio_config_get_play_sound (PulseaudioConfig *config)
gboolean
pulseaudio_config_get_rec_indicator_persistent (PulseaudioConfig *config)
{
g_return_val_if_fail (IS_PULSEAUDIO_CONFIG (config), DEFAULT_REC_INDICATOR_PERSISTENT);
return config->rec_indicator_persistent;
}
guint
pulseaudio_config_get_volume_step (PulseaudioConfig *config)
{
......@@ -568,14 +670,14 @@ pulseaudio_config_get_enable_mpris (PulseaudioConfig *config)
gchar **
pulseaudio_config_get_mpris_players (PulseaudioConfig *config)
pulseaudio_config_get_known_players (PulseaudioConfig *config)
{
if (!IS_PULSEAUDIO_CONFIG (config))
{
return g_strsplit (DEFAULT_MPRIS_PLAYERS, ";", 1);
return g_strsplit (DEFAULT_KNOWN_PLAYERS, ";", 1);
}
return g_strsplit (config->mpris_players, ";", 0);
return g_strsplit (config->known_players, ";", 0);
}
......@@ -598,11 +700,14 @@ pulseaudio_config_set_mpris_players (PulseaudioConfig *config,
guint index = 0;
guint i = 0;
GSList *list = NULL;
guint num_players;
g_return_if_fail (IS_PULSEAUDIO_CONFIG (config));
num_players = g_strv_length (players);
player_array = NULL;
for (i = 0; i < g_strv_length (players); i++)
for (i = 0; i < num_players; i++)
{
player_array = g_slist_prepend (player_array, players[i]);
}
......@@ -622,7 +727,7 @@ pulseaudio_config_set_mpris_players (PulseaudioConfig *config,
g_value_init(&src, G_TYPE_STRING);
g_value_set_static_string(&src, player_string);
pulseaudio_config_set_property (G_OBJECT (config), PROP_MPRIS_PLAYERS, &src, NULL);
pulseaudio_config_set_property (G_OBJECT (config), PROP_KNOWN_PLAYERS, &src, NULL);
g_free (player_string);
}
......@@ -630,15 +735,15 @@ pulseaudio_config_set_mpris_players (PulseaudioConfig *config,
void
pulseaudio_config_add_mpris_player (PulseaudioConfig *config,
gchar *player)
pulseaudio_config_add_known_player (PulseaudioConfig *config,
const gchar *player)
{
gchar **players;
gchar **player_list;
gchar *players_string;
gchar *player_string;
players = pulseaudio_config_get_mpris_players (config);
players = pulseaudio_config_get_known_players (config);
if (g_strv_contains ((const char * const *) players, player))
{
g_strfreev(players);
......@@ -663,21 +768,35 @@ pulseaudio_config_add_mpris_player (PulseaudioConfig *config,
static gchar **
pulseaudio_config_get_blacklisted_players (PulseaudioConfig *config)
pulseaudio_config_get_ignored_players (PulseaudioConfig *config)
{
if (!IS_PULSEAUDIO_CONFIG (config))
{
return g_strsplit (DEFAULT_BLACKLISTED_PLAYERS, ";", 1);
return g_strsplit (DEFAULT_IGNORED_PLAYERS, ";", 1);
}
return g_strsplit (config->blacklisted_players, ";", 0);
return g_strsplit (config->ignored_players, ";", 0);
}
static gchar **
pulseaudio_config_get_persistent_players (PulseaudioConfig *config)
{
if (!IS_PULSEAUDIO_CONFIG (config))
{
return g_strsplit (DEFAULT_PERSISTENT_PLAYERS, ";", 1);
}
return g_strsplit (config->persistent_players, ";", 0);
}
static void
pulseaudio_config_set_blacklisted_players (PulseaudioConfig *config,
gchar **players)
pulseaudio_config_set_players (PulseaudioConfig *config,
gchar **players,
gint prop)
{
GSList *player_array;
gchar *player_string;
......@@ -685,11 +804,14 @@ pulseaudio_config_set_blacklisted_players (PulseaudioConfig *config,
guint index = 0;
guint i = 0;
GSList *list = NULL;
guint num_players;
g_return_if_fail (IS_PULSEAUDIO_CONFIG (config));
num_players = g_strv_length (players);
player_array = NULL;
for (i = 0; i < g_strv_length (players); i++)
for (i = 0; i < num_players; i++)
{
player_array = g_slist_prepend (player_array, players[i]);
}
......@@ -709,23 +831,23 @@ pulseaudio_config_set_blacklisted_players (PulseaudioConfig *config,
g_value_init(&src, G_TYPE_STRING);
g_value_set_static_string(&src, player_string);
pulseaudio_config_set_property (G_OBJECT (config), PROP_BLACKLISTED_PLAYERS, &src, NULL);
pulseaudio_config_set_property (G_OBJECT (config), prop, &src, NULL);
g_free (player_string);
}
void
pulseaudio_config_player_blacklist_add (PulseaudioConfig *config,
const gchar *player)
static void
pulseaudio_config_player_add (PulseaudioConfig *config,
gchar **players,
const gchar *player,
gint prop)
{
gchar **players;
gchar **player_list;
gchar *players_string;
gchar *player_string;
players = pulseaudio_config_get_blacklisted_players (config);
if (g_strv_contains ((const char * const *) players, player))
{
g_strfreev(players);
......@@ -740,7 +862,7 @@ pulseaudio_config_player_blacklist_add (PulseaudioConfig *config,
player_list = g_strsplit(player_string, ";", 0);
pulseaudio_config_set_blacklisted_players (config, player_list);
pulseaudio_config_set_players (config, player_list, prop);
g_strfreev (player_list);
g_free (player_string);
......@@ -750,49 +872,107 @@ pulseaudio_config_player_blacklist_add (PulseaudioConfig *config,
static void
pulseaudio_config_player_remove (PulseaudioConfig *config,
gchar **players_old,
const gchar *player,
gint prop)
{
gchar **players_new;
guint j = 0;
guint len = g_strv_length (players_old);
players_new = g_new (gchar *, len);
for (guint i = 0; i < len; i++)
if (g_strcmp0 (player, players_old[i]) != 0)
players_new[j++] = players_old[i];
if (j < len)
{
players_new[j] = NULL;
pulseaudio_config_set_players (config, players_new, prop);
}
g_free (players_new);
g_strfreev (players_old);
}
void
pulseaudio_config_player_ignored_add (PulseaudioConfig *config,
const gchar *player)
{
pulseaudio_config_player_add (config,
pulseaudio_config_get_ignored_players (config),
player,
PROP_IGNORED_PLAYERS);
}
void
pulseaudio_config_player_blacklist_remove (PulseaudioConfig *config,
const gchar *player)
pulseaudio_config_player_ignored_remove (PulseaudioConfig *config,
const gchar *player)
{
GString *string;
gchar **players;
gchar **player_list;
gchar *player_string;
guint i;
pulseaudio_config_player_remove (config,
pulseaudio_config_get_ignored_players (config),
player,
PROP_IGNORED_PLAYERS);
}
string = g_string_new ("");
players = pulseaudio_config_get_blacklisted_players (config);
if (players != NULL)
gboolean
pulseaudio_config_player_ignored_lookup (PulseaudioConfig *config,
const gchar *player)
{
gchar **players;
gboolean found = FALSE;
players = pulseaudio_config_get_ignored_players (config);
if (g_strv_contains ((const char * const *) players, player))
{
for (i = 0; i < g_strv_length (players); i++)
{
if (g_strcmp0(player, players[i]) != 0)
{
string = g_string_append (string, players[0]);
}
}
found = TRUE;
}
player_string = g_string_free (string, FALSE);
player_list = g_strsplit(player_string, ";", 0);
g_strfreev(players);
return found;
}
pulseaudio_config_set_blacklisted_players (config, player_list);
g_strfreev (player_list);
g_free (player_string);
g_strfreev (players);
void
pulseaudio_config_player_persistent_add (PulseaudioConfig *config,
const gchar *player)
{
pulseaudio_config_player_add (config,
pulseaudio_config_get_persistent_players (config),
player,
PROP_PERSISTENT_PLAYERS);
}
void
pulseaudio_config_player_persistent_remove (PulseaudioConfig *config,
const gchar *player)
{
pulseaudio_config_player_remove (config,
pulseaudio_config_get_persistent_players (config),
player,
PROP_PERSISTENT_PLAYERS);
}
gboolean
pulseaudio_config_player_blacklist_lookup (PulseaudioConfig *config,
gchar *player)
pulseaudio_config_player_persistent_lookup (PulseaudioConfig *config,
const gchar *player)
{
gchar **players;
gboolean found = FALSE;
players = pulseaudio_config_get_blacklisted_players (config);
players = pulseaudio_config_get_persistent_players (config);
if (g_strv_contains ((const char * const *) players, player))
{
found = TRUE;
......@@ -809,6 +989,7 @@ pulseaudio_config_clear_known_players (PulseaudioConfig *config)
{
gchar *player_string;
GValue src = { 0, };
gchar *property;
g_return_if_fail (IS_PULSEAUDIO_CONFIG (config));
......@@ -817,8 +998,21 @@ pulseaudio_config_clear_known_players (PulseaudioConfig *config)
g_value_init(&src, G_TYPE_STRING);
g_value_set_static_string(&src, player_string);
pulseaudio_config_set_property (G_OBJECT (config), PROP_BLACKLISTED_PLAYERS, &src, NULL);
pulseaudio_config_set_property (G_OBJECT (config), PROP_MPRIS_PLAYERS, &src, NULL);
/* Remove old properties */
if (G_LIKELY (config->channel))
{
property = g_strconcat (config->property_base, "/mpris-players", NULL);
xfconf_channel_reset_property (config->channel, property, FALSE);
g_free (property);
property = g_strconcat (config->property_base, "/blacklisted-players", NULL);
xfconf_channel_reset_property (config->channel, property, FALSE);
g_free (property);
}
pulseaudio_config_set_property (G_OBJECT (config), PROP_IGNORED_PLAYERS, &src, NULL);
pulseaudio_config_set_property (G_OBJECT (config), PROP_PERSISTENT_PLAYERS, &src, NULL);
pulseaudio_config_set_property (G_OBJECT (config), PROP_KNOWN_PLAYERS, &src, NULL);
g_free (player_string);
}
......@@ -862,6 +1056,9 @@ pulseaudio_config_new (const gchar *property_base)
{
channel = xfconf_channel_get ("xfce4-panel");
config->property_base = property_base;
config->channel = channel;
property = g_strconcat (property_base, "/enable-keyboard-shortcuts", NULL);
xfconf_g_property_bind (channel, property, G_TYPE_BOOLEAN, config, "enable-keyboard-shortcuts");
g_free (property);
......@@ -870,8 +1067,12 @@ pulseaudio_config_new (const gchar *property_base)
xfconf_g_property_bind (channel, property, G_TYPE_BOOLEAN, config, "enable-multimedia-keys");
g_free (property);
property = g_strconcat (property_base, "/multimedia-keys-to-all", NULL);
xfconf_g_property_bind (channel, property, G_TYPE_BOOLEAN, config, "multimedia-keys-to-all");
g_free (property);
property = g_strconcat (property_base, "/show-notifications", NULL);
xfconf_g_property_bind (channel, property, G_TYPE_BOOLEAN, config, "show-notifications");
xfconf_g_property_bind (channel, property, G_TYPE_UINT, config, "show-notifications");
g_free (property);
#ifdef HAVE_LIBCANBERRA
......@@ -880,6 +1081,10 @@ pulseaudio_config_new (const gchar *property_base)
g_free (property);
#endif
property = g_strconcat (property_base, "/rec-indicator-persistent", NULL);
xfconf_g_property_bind (channel, property, G_TYPE_BOOLEAN, config, "rec-indicator-persistent");
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);
......@@ -896,12 +1101,16 @@ pulseaudio_config_new (const gchar *property_base)
xfconf_g_property_bind (channel, property, G_TYPE_BOOLEAN, config, "enable-mpris");
g_free (property);
property = g_strconcat (property_base, "/mpris-players", NULL);
xfconf_g_property_bind (channel, property, G_TYPE_STRING, config, "mpris-players");
property = g_strconcat (property_base, "/known-players", NULL);
xfconf_g_property_bind (channel, property, G_TYPE_STRING, config, "known-players");
g_free (property);
property = g_strconcat (property_base, "/ignored-players", NULL);
xfconf_g_property_bind (channel, property, G_TYPE_STRING, config, "ignored-players");
g_free (property);
property = g_strconcat (property_base, "/blacklisted-players", NULL);
xfconf_g_property_bind (channel, property, G_TYPE_STRING, config, "blacklisted-players");
property = g_strconcat (property_base, "/persistent-players", NULL);
xfconf_g_property_bind (channel, property, G_TYPE_STRING, config, "persistent-players");
g_free (property);
property = g_strconcat (property_base, "/enable-wnck", NULL);
......
......@@ -34,33 +34,53 @@ typedef struct _PulseaudioConfig PulseaudioConfig;
#define IS_PULSEAUDIO_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PULSEAUDIO_CONFIG))
#define PULSEAUDIO_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PULSEAUDIO_CONFIG, PulseaudioConfigClass))
enum
{
/* First two values keeps the backward compatibility */
VOLUME_NOTIFICATIONS_NONE,
VOLUME_NOTIFICATIONS_ALL,
VOLUME_NOTIFICATIONS_OUTPUT,
VOLUME_NOTIFICATIONS_INPUT,
VOLUME_NOTIFICATIONS_COUNT,
};
GType pulseaudio_config_get_type (void) G_GNUC_CONST;
PulseaudioConfig *pulseaudio_config_new (const gchar *property_base);
gboolean pulseaudio_config_get_enable_keyboard_shortcuts (PulseaudioConfig *config);
gboolean pulseaudio_config_get_enable_multimedia_keys (PulseaudioConfig *config);
gboolean pulseaudio_config_get_show_notifications (PulseaudioConfig *config);
gboolean pulseaudio_config_get_multimedia_keys_to_all (PulseaudioConfig *config);
guint pulseaudio_config_get_show_notifications (PulseaudioConfig *config);
#ifdef HAVE_LIBCANBERRA
gboolean pulseaudio_config_get_play_sound (PulseaudioConfig *config);
#endif
gboolean pulseaudio_config_get_rec_indicator_persistent (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);
gchar **pulseaudio_config_get_mpris_players (PulseaudioConfig *config);
gchar **pulseaudio_config_get_known_players (PulseaudioConfig *config);
gboolean pulseaudio_config_get_enable_mpris (PulseaudioConfig *config);
void pulseaudio_config_set_mpris_players (PulseaudioConfig *config,
gchar **players);
void pulseaudio_config_add_mpris_player (PulseaudioConfig *config,
gchar *player);
void pulseaudio_config_add_known_player (PulseaudioConfig *config,
const gchar *player);
void pulseaudio_config_player_ignored_add (PulseaudioConfig *config,
const gchar *player);
void pulseaudio_config_player_ignored_remove (PulseaudioConfig *config,
const gchar *player);
gboolean pulseaudio_config_player_ignored_lookup (PulseaudioConfig *config,
const gchar *player);
void pulseaudio_config_player_blacklist_add (PulseaudioConfig *config,
void pulseaudio_config_player_persistent_add (PulseaudioConfig *config,
const gchar *player);
void pulseaudio_config_player_persistent_remove (PulseaudioConfig *config,
const gchar *player);
void pulseaudio_config_player_blacklist_remove (PulseaudioConfig *config,
gboolean pulseaudio_config_player_persistent_lookup (PulseaudioConfig *config,
const gchar *player);
gboolean pulseaudio_config_player_blacklist_lookup (PulseaudioConfig *config,
gchar *player);
void pulseaudio_config_clear_known_players (PulseaudioConfig *config);
......
......@@ -36,24 +36,14 @@
#include <glib.h>
#include <gtk/gtk.h>
#include <libxfce4panel/xfce-panel-plugin.h>
#include <libxfce4panel/libxfce4panel.h>
#include <libxfce4util/libxfce4util.h>
#include <libxfce4ui/libxfce4ui.h>
#include "pulseaudio-dialog.h"
#include "pulseaudio-dialog_ui.h"
#include "pulseaudio-dialog-resources.h"
#include "pulseaudio-mpris.h"
#include <exo/exo.h>
#define PLUGIN_WEBSITE "https://docs.xfce.org/apps/pulseaudio-plugin/start"
#ifdef LIBXFCE4UI_CHECK_VERSION
#if LIBXFCE4UI_CHECK_VERSION (4, 9, 0)
#define HAS_ONLINE_HELP
#endif
#endif
static void pulseaudio_dialog_build (PulseaudioDialog *dialog);
......@@ -108,15 +98,23 @@ pulseaudio_dialog_mixer_command_changed (PulseaudioDialog *dialog)
{
GObject *object;
gchar *path;
gchar **argvp = NULL;
gboolean sensitive = FALSE;
g_return_if_fail (GTK_IS_BUILDER (dialog));
g_return_if_fail (IS_PULSEAUDIO_CONFIG (dialog->config));
object = gtk_builder_get_object (GTK_BUILDER (dialog), "button-run-mixer");
g_return_if_fail (GTK_IS_BUTTON (object));
path = g_find_program_in_path (pulseaudio_config_get_mixer_command (dialog->config));
gtk_widget_set_sensitive (GTK_WIDGET (object), path != NULL);
g_free (path);
if (g_shell_parse_argv (pulseaudio_config_get_mixer_command (dialog->config), NULL, &argvp, NULL))
{
path = g_find_program_in_path (argvp[0]);
if (path)
sensitive = TRUE;
g_free (path);
g_strfreev (argvp);
}
gtk_widget_set_sensitive (GTK_WIDGET (object), sensitive);
}
......@@ -131,9 +129,9 @@ pulseaudio_dialog_run_mixer (PulseaudioDialog *dialog,
g_return_if_fail (IS_PULSEAUDIO_DIALOG (dialog));
g_return_if_fail (GTK_IS_BUTTON (widget));
if (!xfce_spawn_command_line_on_screen (gtk_widget_get_screen (widget),
pulseaudio_config_get_mixer_command (dialog->config),
FALSE, FALSE, &error))
if (!xfce_spawn_command_line (gtk_widget_get_screen (widget),
pulseaudio_config_get_mixer_command (dialog->config),
FALSE, FALSE, TRUE, &error))
{
message_dialog = gtk_message_dialog_new_with_markup (NULL,
GTK_DIALOG_DESTROY_WITH_PARENT,
......@@ -152,31 +150,61 @@ pulseaudio_dialog_run_mixer (PulseaudioDialog *dialog,
static void
pulseaudio_dialog_player_toggled_cb (GtkCellRendererToggle *toggle, gchar *path, gpointer user_data)
pulseaudio_dialog_persistent_toggled_cb (GtkCellRendererToggle *toggle, gchar *path, gpointer user_data)
{
PulseaudioDialog *dialog = PULSEAUDIO_DIALOG (user_data);
GtkTreeModel *model;
GtkTreePath *treepath;
GtkTreeIter iter;
GValue hidden_val = {0,}, player_val = {0,};
gboolean hidden;
GValue persistent_val = G_VALUE_INIT, player_val = G_VALUE_INIT;
gboolean persistent;
const gchar *player;
model = GTK_TREE_MODEL(gtk_tree_view_get_model(GTK_TREE_VIEW(dialog->treeview)));
treepath = gtk_tree_path_new_from_string (path);
gtk_tree_model_get_iter (model, &iter, treepath);
gtk_tree_model_get_value (model, &iter, 1, &player_val);
gtk_tree_model_get_value (model, &iter, 3, &hidden_val);
hidden = !g_value_get_boolean(&hidden_val);
gtk_tree_model_get_value (model, &iter, 4, &player_val);
gtk_tree_model_get_value (model, &iter, 2, &persistent_val);
persistent = !g_value_get_boolean(&persistent_val);
player = g_value_get_string(&player_val);
gtk_list_store_set(GTK_LIST_STORE(model), &iter, 3, hidden, -1);
gtk_list_store_set(GTK_LIST_STORE(model), &iter, 2, persistent, -1);
if (hidden)
pulseaudio_config_player_blacklist_add (dialog->config, player);
if (persistent)
pulseaudio_config_player_persistent_add (dialog->config, player);
else
pulseaudio_config_player_blacklist_remove (dialog->config, player);
pulseaudio_config_player_persistent_remove (dialog->config, player);
}
static void
pulseaudio_dialog_ignored_toggled_cb (GtkCellRendererToggle *toggle, gchar *path, gpointer user_data)
{
PulseaudioDialog *dialog = PULSEAUDIO_DIALOG (user_data);
GtkTreeModel *model;
GtkTreePath *treepath;
GtkTreeIter iter;
GValue ignored_val = G_VALUE_INIT, player_val = G_VALUE_INIT;
gboolean ignored;
const gchar *player;
model = GTK_TREE_MODEL(gtk_tree_view_get_model(GTK_TREE_VIEW(dialog->treeview)));
treepath = gtk_tree_path_new_from_string (path);
gtk_tree_model_get_iter (model, &iter, treepath);
gtk_tree_model_get_value (model, &iter, 4, &player_val);
gtk_tree_model_get_value (model, &iter, 3, &ignored_val);
ignored = !g_value_get_boolean(&ignored_val);
player = g_value_get_string(&player_val);
gtk_list_store_set(GTK_LIST_STORE(model), &iter, 3, ignored, -1);
if (ignored)
pulseaudio_config_player_ignored_add (dialog->config, player);
else
pulseaudio_config_player_ignored_remove (dialog->config, player);
}
......@@ -213,8 +241,10 @@ pulseaudio_dialog_build (PulseaudioDialog *dialog)
return;
/* load the builder data into the object */
if (gtk_builder_add_from_string (builder, pulseaudio_dialog_ui,
pulseaudio_dialog_ui_length, &error))
pulseaudio_dialog_register_resource ();
if (gtk_builder_add_from_resource (builder,
"/org/xfce/pulseaudio-plugin/pulseaudio-dialog.glade",
&error))
{
dialog->dialog = gtk_builder_get_object (builder, "dialog");
g_return_if_fail (XFCE_IS_TITLED_DIALOG (dialog->dialog));
......@@ -237,8 +267,8 @@ pulseaudio_dialog_build (PulseaudioDialog *dialog)
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));
object = gtk_builder_get_object (builder, "combobox-notifications");
g_return_if_fail (GTK_IS_COMBO_BOX (object));
#ifdef HAVE_LIBNOTIFY
g_object_bind_property (G_OBJECT (dialog->config), "show-notifications",
G_OBJECT (object), "active",
......@@ -257,12 +287,23 @@ pulseaudio_dialog_build (PulseaudioDialog *dialog)
gtk_widget_set_visible (GTK_WIDGET (object), FALSE);
#endif
object = gtk_builder_get_object (builder, "checkbutton-rec-indicator-persistent");
g_object_bind_property (G_OBJECT (dialog->config), "rec-indicator-persistent",
G_OBJECT (object), "active",
G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
object = gtk_builder_get_object (builder, "spinbutton-volume-step");
g_return_if_fail (GTK_IS_ENTRY (object));
g_object_bind_property (G_OBJECT (dialog->config), "volume-step",
G_OBJECT (object), "value",
G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
object = gtk_builder_get_object (builder, "spinbutton-max-volume");
g_return_if_fail (GTK_IS_ENTRY (object));
g_object_bind_property (G_OBJECT (dialog->config), "volume-max",
G_OBJECT (object), "value",
G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
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",
......@@ -291,7 +332,13 @@ pulseaudio_dialog_build (PulseaudioDialog *dialog)
G_OBJECT(object), "active",
G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
g_object_bind_property(G_OBJECT(dialog->config), "enable-mpris",
object = gtk_builder_get_object(builder, "checkbutton-multimedia-keys-to-all");
g_return_if_fail(GTK_IS_CHECK_BUTTON(object));
g_object_bind_property(G_OBJECT(dialog->config), "multimedia-keys-to-all",
G_OBJECT(object), "active",
G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
g_object_bind_property(G_OBJECT(dialog->config), "enable-multimedia-keys",
G_OBJECT(object), "sensitive",
G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
......@@ -308,17 +355,17 @@ pulseaudio_dialog_build (PulseaudioDialog *dialog)
/* Populate the liststore */
dialog->treeview = GTK_WIDGET(gtk_builder_get_object(builder, "player_tree_view"));
liststore = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(dialog->treeview)));
players = pulseaudio_config_get_mpris_players (dialog->config);
players = pulseaudio_config_get_known_players (dialog->config);
if (players != NULL)
{
for (i = 0; i < g_strv_length (players); i++)
const guint num_players = g_strv_length (players);
for (i = 0; i < num_players; i++)
{
gchar *name = NULL;
gchar *player_label = NULL;
gchar *icon_name = NULL;
gchar *full_path = NULL;
GIcon *icon = NULL;
if (pulseaudio_mpris_get_player_summary (players[i], &name, &icon_name, &full_path))
if (pulseaudio_mpris_get_player_summary (players[i], &player_label, &icon_name, NULL))
{
if (g_file_test (icon_name, G_FILE_TEST_EXISTS) && !g_file_test (icon_name, G_FILE_TEST_IS_DIR))
{
......@@ -338,23 +385,27 @@ pulseaudio_dialog_build (PulseaudioDialog *dialog)
gtk_list_store_append (liststore, &iter);
gtk_list_store_set (liststore, &iter,
0, icon,
1, players[i],
2, name,
3, pulseaudio_config_player_blacklist_lookup (dialog->config, players[i]),
1, player_label,
2, pulseaudio_config_player_persistent_lookup (dialog->config, players[i]),
3, pulseaudio_config_player_ignored_lookup (dialog->config, players[i]),
4, players[i],
-1);
g_free (name);
g_free (player_label);
g_free (icon_name);
g_free (full_path);
if (icon != NULL)
g_object_unref (icon);
}
}
g_strfreev (players);
}
g_strfreev (players);
object = gtk_builder_get_object(builder, "col_hidden_renderer");
g_signal_connect (object, "toggled", (GCallback) pulseaudio_dialog_player_toggled_cb, dialog);
object = gtk_builder_get_object(builder, "col_persistent_renderer");
g_signal_connect (object, "toggled", (GCallback) pulseaudio_dialog_persistent_toggled_cb, dialog);
object = gtk_builder_get_object(builder, "col_ignored_renderer");
g_signal_connect (object, "toggled", (GCallback) pulseaudio_dialog_ignored_toggled_cb, dialog);
object = gtk_builder_get_object(builder, "clear_players");
g_signal_connect (object, "clicked", (GCallback) pulseaudio_dialog_clear_players_cb, dialog);
......@@ -363,7 +414,7 @@ pulseaudio_dialog_build (PulseaudioDialog *dialog)
object = gtk_builder_get_object(builder, "checkbutton-wnck");
g_return_if_fail(GTK_IS_CHECK_BUTTON(object));
#if defined (HAVE_WNCK) || defined (HAVE_LIBXFCE4WINDOWING)
#ifdef HAVE_LIBXFCE4WINDOWING
g_object_bind_property(G_OBJECT(dialog->config), "enable-wnck",
G_OBJECT(object), "active",
G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
......@@ -390,24 +441,11 @@ static void
pulseaudio_dialog_help_button_clicked (PulseaudioDialog *dialog,
GtkWidget *button)
{
#ifndef HAS_ONLINE_HELP
gboolean result;
#endif
g_return_if_fail (IS_PULSEAUDIO_DIALOG (dialog));
g_return_if_fail (GTK_IS_BUTTON (button));
g_return_if_fail (GTK_IS_WINDOW (dialog->dialog));
#ifdef HAS_ONLINE_HELP
xfce_dialog_show_help (GTK_WINDOW (dialog->dialog), "pulseaudio-plugin", "start", NULL);
#else
result = g_spawn_command_line_async ("exo-open --launch WebBrowser " PLUGIN_WEBSITE, NULL);
if (G_UNLIKELY (result == FALSE))
g_warning ("Unable to open the following url: %s", PLUGIN_WEBSITE);
#endif
}
......