mirror of
https://gitlab.gnome.org/GNOME/libgnome-volume-control.git
synced 2024-11-21 16:30:41 -05:00
GvcMixerStream: expose form factor from PulseAudio
https://bugzilla.gnome.org/show_bug.cgi?id=675902
This commit is contained in:
parent
740bab1714
commit
c1f42d50e3
@ -1494,6 +1494,7 @@ update_sink (GvcMixerControl *control,
|
|||||||
gvc_mixer_stream_set_card_index (stream, info->card);
|
gvc_mixer_stream_set_card_index (stream, info->card);
|
||||||
gvc_mixer_stream_set_description (stream, info->description);
|
gvc_mixer_stream_set_description (stream, info->description);
|
||||||
set_icon_name_from_proplist (stream, info->proplist, "audio-card");
|
set_icon_name_from_proplist (stream, info->proplist, "audio-card");
|
||||||
|
gvc_mixer_stream_set_form_factor (stream, pa_proplist_gets (info->proplist, PA_PROP_DEVICE_FORM_FACTOR));
|
||||||
gvc_mixer_stream_set_sysfs_path (stream, pa_proplist_gets (info->proplist, "sysfs.path"));
|
gvc_mixer_stream_set_sysfs_path (stream, pa_proplist_gets (info->proplist, "sysfs.path"));
|
||||||
gvc_mixer_stream_set_volume (stream, (guint)max_volume);
|
gvc_mixer_stream_set_volume (stream, (guint)max_volume);
|
||||||
gvc_mixer_stream_set_is_muted (stream, info->mute);
|
gvc_mixer_stream_set_is_muted (stream, info->mute);
|
||||||
@ -1620,6 +1621,7 @@ update_source (GvcMixerControl *control,
|
|||||||
gvc_mixer_stream_set_card_index (stream, info->card);
|
gvc_mixer_stream_set_card_index (stream, info->card);
|
||||||
gvc_mixer_stream_set_description (stream, info->description);
|
gvc_mixer_stream_set_description (stream, info->description);
|
||||||
set_icon_name_from_proplist (stream, info->proplist, "audio-input-microphone");
|
set_icon_name_from_proplist (stream, info->proplist, "audio-input-microphone");
|
||||||
|
gvc_mixer_stream_set_form_factor (stream, pa_proplist_gets (info->proplist, PA_PROP_DEVICE_FORM_FACTOR));
|
||||||
gvc_mixer_stream_set_volume (stream, (guint)max_volume);
|
gvc_mixer_stream_set_volume (stream, (guint)max_volume);
|
||||||
gvc_mixer_stream_set_is_muted (stream, info->mute);
|
gvc_mixer_stream_set_is_muted (stream, info->mute);
|
||||||
gvc_mixer_stream_set_can_decibel (stream, !!(info->flags & PA_SOURCE_DECIBEL_VOLUME));
|
gvc_mixer_stream_set_can_decibel (stream, !!(info->flags & PA_SOURCE_DECIBEL_VOLUME));
|
||||||
|
@ -48,6 +48,7 @@ struct GvcMixerStreamPrivate
|
|||||||
char *description;
|
char *description;
|
||||||
char *application_id;
|
char *application_id;
|
||||||
char *icon_name;
|
char *icon_name;
|
||||||
|
char *form_factor;
|
||||||
char *sysfs_path;
|
char *sysfs_path;
|
||||||
gboolean is_muted;
|
gboolean is_muted;
|
||||||
gboolean can_decibel;
|
gboolean can_decibel;
|
||||||
@ -71,6 +72,7 @@ enum
|
|||||||
PROP_DESCRIPTION,
|
PROP_DESCRIPTION,
|
||||||
PROP_APPLICATION_ID,
|
PROP_APPLICATION_ID,
|
||||||
PROP_ICON_NAME,
|
PROP_ICON_NAME,
|
||||||
|
PROP_FORM_FACTOR,
|
||||||
PROP_SYSFS_PATH,
|
PROP_SYSFS_PATH,
|
||||||
PROP_VOLUME,
|
PROP_VOLUME,
|
||||||
PROP_DECIBEL,
|
PROP_DECIBEL,
|
||||||
@ -414,6 +416,13 @@ gvc_mixer_stream_get_icon_name (GvcMixerStream *stream)
|
|||||||
return stream->priv->icon_name;
|
return stream->priv->icon_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *
|
||||||
|
gvc_mixer_stream_get_form_factor (GvcMixerStream *stream)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (GVC_IS_MIXER_STREAM (stream), NULL);
|
||||||
|
return stream->priv->form_factor;
|
||||||
|
}
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
gvc_mixer_stream_get_sysfs_path (GvcMixerStream *stream)
|
gvc_mixer_stream_get_sysfs_path (GvcMixerStream *stream)
|
||||||
{
|
{
|
||||||
@ -449,6 +458,19 @@ gvc_mixer_stream_set_icon_name (GvcMixerStream *stream,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
gvc_mixer_stream_set_form_factor (GvcMixerStream *stream,
|
||||||
|
const char *form_factor)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (GVC_IS_MIXER_STREAM (stream), FALSE);
|
||||||
|
|
||||||
|
g_free (stream->priv->form_factor);
|
||||||
|
stream->priv->form_factor = g_strdup (form_factor);
|
||||||
|
g_object_notify (G_OBJECT (stream), "form-factor");
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
gvc_mixer_stream_set_sysfs_path (GvcMixerStream *stream,
|
gvc_mixer_stream_set_sysfs_path (GvcMixerStream *stream,
|
||||||
const char *sysfs_path)
|
const char *sysfs_path)
|
||||||
@ -641,6 +663,9 @@ gvc_mixer_stream_set_property (GObject *object,
|
|||||||
case PROP_ICON_NAME:
|
case PROP_ICON_NAME:
|
||||||
gvc_mixer_stream_set_icon_name (self, g_value_get_string (value));
|
gvc_mixer_stream_set_icon_name (self, g_value_get_string (value));
|
||||||
break;
|
break;
|
||||||
|
case PROP_FORM_FACTOR:
|
||||||
|
gvc_mixer_stream_set_form_factor (self, g_value_get_string (value));
|
||||||
|
break;
|
||||||
case PROP_SYSFS_PATH:
|
case PROP_SYSFS_PATH:
|
||||||
gvc_mixer_stream_set_sysfs_path (self, g_value_get_string (value));
|
gvc_mixer_stream_set_sysfs_path (self, g_value_get_string (value));
|
||||||
break;
|
break;
|
||||||
@ -707,6 +732,9 @@ gvc_mixer_stream_get_property (GObject *object,
|
|||||||
case PROP_ICON_NAME:
|
case PROP_ICON_NAME:
|
||||||
g_value_set_string (value, self->priv->icon_name);
|
g_value_set_string (value, self->priv->icon_name);
|
||||||
break;
|
break;
|
||||||
|
case PROP_FORM_FACTOR:
|
||||||
|
g_value_set_string (value, self->priv->form_factor);
|
||||||
|
break;
|
||||||
case PROP_SYSFS_PATH:
|
case PROP_SYSFS_PATH:
|
||||||
g_value_set_string (value, self->priv->sysfs_path);
|
g_value_set_string (value, self->priv->sysfs_path);
|
||||||
break;
|
break;
|
||||||
@ -911,6 +939,13 @@ gvc_mixer_stream_class_init (GvcMixerStreamClass *klass)
|
|||||||
"Name of icon to display for this stream",
|
"Name of icon to display for this stream",
|
||||||
NULL,
|
NULL,
|
||||||
G_PARAM_READWRITE|G_PARAM_CONSTRUCT));
|
G_PARAM_READWRITE|G_PARAM_CONSTRUCT));
|
||||||
|
g_object_class_install_property (gobject_class,
|
||||||
|
PROP_FORM_FACTOR,
|
||||||
|
g_param_spec_string ("form-factor",
|
||||||
|
"Form Factor",
|
||||||
|
"Device form factor for this stream, as reported by PulseAudio",
|
||||||
|
NULL,
|
||||||
|
G_PARAM_READWRITE|G_PARAM_CONSTRUCT));
|
||||||
g_object_class_install_property (gobject_class,
|
g_object_class_install_property (gobject_class,
|
||||||
PROP_SYSFS_PATH,
|
PROP_SYSFS_PATH,
|
||||||
g_param_spec_string ("sysfs-path",
|
g_param_spec_string ("sysfs-path",
|
||||||
@ -996,6 +1031,9 @@ gvc_mixer_stream_finalize (GObject *object)
|
|||||||
g_free (mixer_stream->priv->icon_name);
|
g_free (mixer_stream->priv->icon_name);
|
||||||
mixer_stream->priv->icon_name = NULL;
|
mixer_stream->priv->icon_name = NULL;
|
||||||
|
|
||||||
|
g_free (mixer_stream->priv->form_factor);
|
||||||
|
mixer_stream->priv->form_factor = NULL;
|
||||||
|
|
||||||
g_free (mixer_stream->priv->sysfs_path);
|
g_free (mixer_stream->priv->sysfs_path);
|
||||||
mixer_stream->priv->sysfs_path = NULL;
|
mixer_stream->priv->sysfs_path = NULL;
|
||||||
|
|
||||||
|
@ -87,6 +87,7 @@ gboolean gvc_mixer_stream_change_is_muted (GvcMixerStream *stream,
|
|||||||
gboolean gvc_mixer_stream_is_running (GvcMixerStream *stream);
|
gboolean gvc_mixer_stream_is_running (GvcMixerStream *stream);
|
||||||
const char * gvc_mixer_stream_get_name (GvcMixerStream *stream);
|
const char * gvc_mixer_stream_get_name (GvcMixerStream *stream);
|
||||||
const char * gvc_mixer_stream_get_icon_name (GvcMixerStream *stream);
|
const char * gvc_mixer_stream_get_icon_name (GvcMixerStream *stream);
|
||||||
|
const char * gvc_mixer_stream_get_form_factor (GvcMixerStream *stream);
|
||||||
const char * gvc_mixer_stream_get_sysfs_path (GvcMixerStream *stream);
|
const char * gvc_mixer_stream_get_sysfs_path (GvcMixerStream *stream);
|
||||||
GIcon * gvc_mixer_stream_get_gicon (GvcMixerStream *stream);
|
GIcon * gvc_mixer_stream_get_gicon (GvcMixerStream *stream);
|
||||||
const char * gvc_mixer_stream_get_description (GvcMixerStream *stream);
|
const char * gvc_mixer_stream_get_description (GvcMixerStream *stream);
|
||||||
@ -110,6 +111,8 @@ gboolean gvc_mixer_stream_set_description (GvcMixerStream *stream,
|
|||||||
const char *description);
|
const char *description);
|
||||||
gboolean gvc_mixer_stream_set_icon_name (GvcMixerStream *stream,
|
gboolean gvc_mixer_stream_set_icon_name (GvcMixerStream *stream,
|
||||||
const char *name);
|
const char *name);
|
||||||
|
gboolean gvc_mixer_stream_set_form_factor (GvcMixerStream *stream,
|
||||||
|
const char *form_factor);
|
||||||
gboolean gvc_mixer_stream_set_sysfs_path (GvcMixerStream *stream,
|
gboolean gvc_mixer_stream_set_sysfs_path (GvcMixerStream *stream,
|
||||||
const char *sysfs_path);
|
const char *sysfs_path);
|
||||||
gboolean gvc_mixer_stream_set_is_event_stream (GvcMixerStream *stream,
|
gboolean gvc_mixer_stream_set_is_event_stream (GvcMixerStream *stream,
|
||||||
|
Loading…
Reference in New Issue
Block a user