[Xfce4-commits] [apps/xfce4-volumed-pulse] 03/10: Get rid of using the xfce4-mixer channel as we have our own now
noreply at xfce.org
noreply at xfce.org
Wed Sep 14 03:15:11 CEST 2016
This is an automated email from the git hooks/post-receive script.
bluesabre pushed a commit to branch master
in repository apps/xfce4-volumed-pulse.
commit 9ab80753ead99a13543dc5edfe4c596bf317f265
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date: Sun Sep 11 22:57:48 2016 +0200
Get rid of using the xfce4-mixer channel as we have our own now
Also: xfce4-mixer is practically dead.
---
src/main.c | 1 -
src/xvd_data_types.h | 5 ++---
src/xvd_xfconf.c | 18 ++++++++++++------
3 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/src/main.c b/src/main.c
index 1f53de4..1567b6e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -102,7 +102,6 @@ xvd_instance_init(XvdInstance *i)
i->pulse_context = NULL;
i->sink_index = -1;
i->source_index = -1;
- i->mixer_chan = NULL;
i->settings = NULL;
i->loop = NULL;
#ifdef HAVE_LIBNOTIFY
diff --git a/src/xvd_data_types.h b/src/xvd_data_types.h
index 6b01777..d791f51 100644
--- a/src/xvd_data_types.h
+++ b/src/xvd_data_types.h
@@ -37,10 +37,9 @@
#include <libnotify/notification.h>
#endif
-#define XFCONF_MIXER_CHANNEL_NAME "xfce4-mixer"
-#define XFCONF_MIXER_VOL_STEP "/volume-step-size"
-#define VOL_STEP_DEFAULT_VAL 5
#define XFCONF_VOLUMED_PULSE_CHANNEL_NAME "xfce4-volumed-pulse"
+#define XFCONF_MIXER_VOL_STEP_PROP "/volume-step-size"
+#define VOL_STEP_DEFAULT_VAL 5
#define XFCONF_ICON_STYLE_PROP "/icon-style"
#define ICONS_STYLE_NORMAL 0
#define ICONS_STYLE_SYMBOLIC 1
diff --git a/src/xvd_xfconf.c b/src/xvd_xfconf.c
index 2969472..ae9e728 100644
--- a/src/xvd_xfconf.c
+++ b/src/xvd_xfconf.c
@@ -36,7 +36,7 @@ _xvd_xfconf_handle_changes(XfconfChannel *re_channel,
XvdInstance *Inst = (XvdInstance *)ptr;
g_debug ("Xfconf event on %s\n", re_property_name);
- if (g_strcmp0 (re_property_name, XFCONF_MIXER_VOL_STEP) == 0) {
+ if (g_strcmp0 (re_property_name, XFCONF_MIXER_VOL_STEP_PROP) == 0) {
_xvd_xfconf_reinit_vol_step(Inst);
}
}
@@ -57,11 +57,17 @@ xvd_xfconf_init(XvdInstance *Inst)
if (!xfconf_channel_has_property (Inst->settings, XFCONF_ICON_STYLE_PROP)) {
if (!xfconf_channel_set_uint (Inst->settings, XFCONF_ICON_STYLE_PROP,
ICONS_STYLE_NORMAL))
- g_warning ("Couldn't set icon-style property to 0.");
+ g_warning ("Couldn't initialize icon-style property (default: 0).");
}
- Inst->mixer_chan = xfconf_channel_get (XFCONF_MIXER_CHANNEL_NAME);
- g_signal_connect (G_OBJECT (Inst->mixer_chan), "property-changed", G_CALLBACK (_xvd_xfconf_handle_changes), Inst);
+ if (!xfconf_channel_has_property (Inst->settings, XFCONF_MIXER_VOL_STEP_PROP)) {
+ if (!xfconf_channel_set_uint (Inst->settings, XFCONF_MIXER_VOL_STEP_PROP,
+ VOL_STEP_DEFAULT_VAL))
+ g_warning ("Couldn't initialize the volume-step-size property (default: 5).");
+ }
+
+ //Inst->mixer_chan = xfconf_channel_get (XFCONF_MIXER_CHANNEL_NAME);
+ g_signal_connect (G_OBJECT (Inst->settings), "property-changed", G_CALLBACK (_xvd_xfconf_handle_changes), Inst);
return TRUE;
}
@@ -69,11 +75,11 @@ xvd_xfconf_init(XvdInstance *Inst)
void
xvd_xfconf_get_vol_step(XvdInstance *Inst)
{
- Inst->vol_step = xfconf_channel_get_uint (Inst->mixer_chan, XFCONF_MIXER_VOL_STEP, VOL_STEP_DEFAULT_VAL);
+ Inst->vol_step = xfconf_channel_get_uint (Inst->settings, XFCONF_MIXER_VOL_STEP_PROP, VOL_STEP_DEFAULT_VAL);
if (Inst->vol_step > 100) {
g_debug ("%s\n", "The volume step xfconf property is out of range, setting back to default");
Inst->vol_step = VOL_STEP_DEFAULT_VAL;
- xfconf_channel_set_uint (Inst->mixer_chan, XFCONF_MIXER_VOL_STEP, VOL_STEP_DEFAULT_VAL);
+ xfconf_channel_set_uint (Inst->settings, XFCONF_MIXER_VOL_STEP_PROP, VOL_STEP_DEFAULT_VAL);
}
g_debug("%s %u\n", "Xfconf volume step:", Inst->vol_step);
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list