Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
xfce4-pulseaudio-plugin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Panel Plugins
xfce4-pulseaudio-plugin
Commits
e3f8abfe
Commit
e3f8abfe
authored
9 years ago
by
Andrzej
Browse files
Options
Downloads
Patches
Plain Diff
Added a volume_max xfconf property
Defaults to 153% (pavucontrol reports 11.08dB)
parent
67e43945
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
panel-plugin/pulseaudio-config.c
+42
-0
42 additions, 0 deletions
panel-plugin/pulseaudio-config.c
panel-plugin/pulseaudio-config.h
+2
-1
2 additions, 1 deletion
panel-plugin/pulseaudio-config.h
with
44 additions
and
1 deletion
panel-plugin/pulseaudio-config.c
+
42
−
0
View file @
e3f8abfe
...
...
@@ -47,6 +47,7 @@
#define DEFAULT_ENABLE_KEYBOARD_SHORTCUTS TRUE
#define DEFAULT_VOLUME_STEP 6
#define DEFAULT_VOLUME_MAX 153
...
...
@@ -73,6 +74,7 @@ struct _PulseaudioConfig
gboolean
enable_keyboard_shortcuts
;
guint
volume_step
;
guint
volume_max
;
gchar
*
mixer_command
;
};
...
...
@@ -83,6 +85,7 @@ enum
PROP_0
,
PROP_ENABLE_KEYBOARD_SHORTCUTS
,
PROP_VOLUME_STEP
,
PROP_VOLUME_MAX
,
PROP_MIXER_COMMAND
,
N_PROPERTIES
,
};
...
...
@@ -128,6 +131,15 @@ pulseaudio_config_class_init (PulseaudioConfigClass *klass)
g_object_class_install_property
(
gobject_class
,
PROP_VOLUME_MAX
,
g_param_spec_uint
(
"volume-max"
,
NULL
,
NULL
,
1
,
300
,
DEFAULT_VOLUME_MAX
,
G_PARAM_READWRITE
|
G_PARAM_STATIC_STRINGS
));
g_object_class_install_property
(
gobject_class
,
PROP_MIXER_COMMAND
,
g_param_spec_string
(
"mixer-command"
,
...
...
@@ -153,6 +165,7 @@ pulseaudio_config_init (PulseaudioConfig *config)
{
config
->
enable_keyboard_shortcuts
=
DEFAULT_ENABLE_KEYBOARD_SHORTCUTS
;
config
->
volume_step
=
DEFAULT_VOLUME_STEP
;
config
->
volume_max
=
DEFAULT_VOLUME_MAX
;
config
->
mixer_command
=
g_strdup
(
DEFAULT_MIXER_COMMAND
);
}
...
...
@@ -189,6 +202,10 @@ pulseaudio_config_get_property (GObject *object,
g_value_set_uint
(
value
,
config
->
volume_step
);
break
;
case
PROP_VOLUME_MAX
:
g_value_set_uint
(
value
,
config
->
volume_max
);
break
;
case
PROP_MIXER_COMMAND
:
g_value_set_string
(
value
,
config
->
mixer_command
);
break
;
...
...
@@ -233,6 +250,16 @@ pulseaudio_config_set_property (GObject *object,
}
break
;
case
PROP_VOLUME_MAX
:
val_uint
=
g_value_get_uint
(
value
);
if
(
config
->
volume_max
!=
val_uint
)
{
config
->
volume_max
=
val_uint
;
g_object_notify
(
G_OBJECT
(
config
),
"volume-max"
);
g_signal_emit
(
G_OBJECT
(
config
),
pulseaudio_config_signals
[
CONFIGURATION_CHANGED
],
0
);
}
break
;
case
PROP_MIXER_COMMAND
:
g_free
(
config
->
mixer_command
);
config
->
mixer_command
=
g_value_dup_string
(
value
);
...
...
@@ -269,6 +296,17 @@ pulseaudio_config_get_volume_step (PulseaudioConfig *config)
guint
pulseaudio_config_get_volume_max
(
PulseaudioConfig
*
config
)
{
g_return_val_if_fail
(
IS_PULSEAUDIO_CONFIG
(
config
),
DEFAULT_VOLUME_MAX
);
return
config
->
volume_max
;
}
const
gchar
*
pulseaudio_config_get_mixer_command
(
PulseaudioConfig
*
config
)
{
...
...
@@ -301,6 +339,10 @@ pulseaudio_config_new (const gchar *property_base)
xfconf_g_property_bind
(
channel
,
property
,
G_TYPE_UINT
,
config
,
"volume-step"
);
g_free
(
property
);
property
=
g_strconcat
(
property_base
,
"/volume-max"
,
NULL
);
xfconf_g_property_bind
(
channel
,
property
,
G_TYPE_UINT
,
config
,
"volume-max"
);
g_free
(
property
);
property
=
g_strconcat
(
property_base
,
"/mixer-command"
,
NULL
);
xfconf_g_property_bind
(
channel
,
property
,
G_TYPE_STRING
,
config
,
"mixer-command"
);
g_free
(
property
);
...
...
This diff is collapsed.
Click to expand it.
panel-plugin/pulseaudio-config.h
+
2
−
1
View file @
e3f8abfe
...
...
@@ -40,7 +40,8 @@ PulseaudioConfig *pulseaudio_config_new (const gchar
gboolean
pulseaudio_config_get_enable_keyboard_shortcuts
(
PulseaudioConfig
*
config
);
guint
pulseaudio_config_get_volume_step
(
PulseaudioConfig
*
config
);
const
gchar
*
pulseaudio_config_get_mixer_command
(
PulseaudioConfig
*
config
);
guint
pulseaudio_config_get_volume_max
(
PulseaudioConfig
*
config
);
const
gchar
*
pulseaudio_config_get_mixer_command
(
PulseaudioConfig
*
config
);
G_END_DECLS
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment