gnome-media r4050 - in trunk/gnome-volume-control: . src
- From: mccann svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-media r4050 - in trunk/gnome-volume-control: . src
- Date: Tue, 11 Nov 2008 20:56:56 +0000 (UTC)
Author: mccann
Date: Tue Nov 11 20:56:56 2008
New Revision: 4050
URL: http://svn.gnome.org/viewvc/gnome-media?rev=4050&view=rev
Log:
2008-11-11 William Jon McCann <jmccann redhat com>
* src/gvc-mixer-control.c (update_sink), (update_source):
* src/gvc-mixer-dialog.c (add_stream):
* src/gvc-mixer-stream.c (gvc_mixer_stream_get_description),
(gvc_mixer_stream_set_description),
(gvc_mixer_stream_set_property), (gvc_mixer_stream_get_property),
(gvc_mixer_stream_class_init), (gvc_mixer_stream_finalize):
* src/gvc-mixer-stream.h:
Add descriptions and use them instead of names when
displaying sinks and sources.
Modified:
trunk/gnome-volume-control/ChangeLog
trunk/gnome-volume-control/src/gvc-mixer-control.c
trunk/gnome-volume-control/src/gvc-mixer-dialog.c
trunk/gnome-volume-control/src/gvc-mixer-stream.c
trunk/gnome-volume-control/src/gvc-mixer-stream.h
Modified: trunk/gnome-volume-control/src/gvc-mixer-control.c
==============================================================================
--- trunk/gnome-volume-control/src/gvc-mixer-control.c (original)
+++ trunk/gnome-volume-control/src/gvc-mixer-control.c Tue Nov 11 20:56:56 2008
@@ -301,9 +301,14 @@
info->name,
info->description);
#endif
+
+ /* for now completely ignore virtual streams */
+ if (!(info->flags & PA_SINK_HARDWARE)) {
+ return;
+ }
+
is_new = FALSE;
is_default = FALSE;
-
stream = g_hash_table_lookup (control->priv->sinks,
GUINT_TO_POINTER (info->index));
if (stream == NULL) {
@@ -321,6 +326,7 @@
avg_volume = pa_cvolume_avg (&info->volume);
gvc_mixer_stream_set_name (stream, info->name);
+ gvc_mixer_stream_set_description (stream, info->description);
gvc_mixer_stream_set_icon_name (stream, "audio-card");
gvc_mixer_stream_set_volume (stream, (guint)avg_volume);
gvc_mixer_stream_set_is_muted (stream, info->mute);
@@ -357,6 +363,12 @@
info->name,
info->description);
#endif
+
+ /* for now completely ignore virtual streams */
+ if (!(info->flags & PA_SOURCE_HARDWARE)) {
+ return;
+ }
+
is_new = FALSE;
is_default = FALSE;
@@ -377,6 +389,7 @@
avg_volume = pa_cvolume_avg (&info->volume);
gvc_mixer_stream_set_name (stream, info->name);
+ gvc_mixer_stream_set_description (stream, info->description);
gvc_mixer_stream_set_icon_name (stream, "audio-input-microphone");
gvc_mixer_stream_set_volume (stream, (guint)avg_volume);
gvc_mixer_stream_set_is_muted (stream, info->mute);
Modified: trunk/gnome-volume-control/src/gvc-mixer-dialog.c
==============================================================================
--- trunk/gnome-volume-control/src/gvc-mixer-dialog.c (original)
+++ trunk/gnome-volume-control/src/gvc-mixer-dialog.c Tue Nov 11 20:56:56 2008
@@ -335,7 +335,7 @@
gtk_list_store_append (GTK_LIST_STORE (model), &iter);
gtk_list_store_set (GTK_LIST_STORE (model),
&iter,
- NAME_COL, gvc_mixer_stream_get_name (stream),
+ NAME_COL, gvc_mixer_stream_get_description (stream),
DEVICE_COL, "",
ID_COL, gvc_mixer_stream_get_id (stream),
-1);
@@ -346,7 +346,7 @@
gtk_list_store_append (GTK_LIST_STORE (model), &iter);
gtk_list_store_set (GTK_LIST_STORE (model),
&iter,
- NAME_COL, gvc_mixer_stream_get_name (stream),
+ NAME_COL, gvc_mixer_stream_get_description (stream),
DEVICE_COL, "",
ID_COL, gvc_mixer_stream_get_id (stream),
-1);
Modified: trunk/gnome-volume-control/src/gvc-mixer-stream.c
==============================================================================
--- trunk/gnome-volume-control/src/gvc-mixer-stream.c (original)
+++ trunk/gnome-volume-control/src/gvc-mixer-stream.c Tue Nov 11 20:56:56 2008
@@ -43,6 +43,7 @@
guint num_channels;
guint volume;
char *name;
+ char *description;
char *icon_name;
gboolean is_muted;
gboolean is_default;
@@ -56,6 +57,7 @@
PROP_NUM_CHANNELS,
PROP_INDEX,
PROP_NAME,
+ PROP_DESCRIPTION,
PROP_ICON_NAME,
PROP_VOLUME,
PROP_IS_MUTED,
@@ -173,13 +175,20 @@
return TRUE;
}
-char *
+const char *
gvc_mixer_stream_get_name (GvcMixerStream *stream)
{
g_return_val_if_fail (GVC_IS_MIXER_STREAM (stream), NULL);
return stream->priv->name;
}
+const char *
+gvc_mixer_stream_get_description (GvcMixerStream *stream)
+{
+ g_return_val_if_fail (GVC_IS_MIXER_STREAM (stream), NULL);
+ return stream->priv->description;
+}
+
gboolean
gvc_mixer_stream_set_name (GvcMixerStream *stream,
const char *name)
@@ -193,7 +202,20 @@
return TRUE;
}
-char *
+gboolean
+gvc_mixer_stream_set_description (GvcMixerStream *stream,
+ const char *description)
+{
+ g_return_val_if_fail (GVC_IS_MIXER_STREAM (stream), FALSE);
+
+ g_free (stream->priv->description);
+ stream->priv->description = g_strdup (description);
+ g_object_notify (G_OBJECT (stream), "description");
+
+ return TRUE;
+}
+
+const char *
gvc_mixer_stream_get_icon_name (GvcMixerStream *stream)
{
g_return_val_if_fail (GVC_IS_MIXER_STREAM (stream), NULL);
@@ -237,6 +259,9 @@
case PROP_NAME:
gvc_mixer_stream_set_name (self, g_value_get_string (value));
break;
+ case PROP_DESCRIPTION:
+ gvc_mixer_stream_set_description (self, g_value_get_string (value));
+ break;
case PROP_ICON_NAME:
gvc_mixer_stream_set_icon_name (self, g_value_get_string (value));
break;
@@ -279,6 +304,9 @@
case PROP_NAME:
g_value_set_string (value, self->priv->name);
break;
+ case PROP_DESCRIPTION:
+ g_value_set_string (value, self->priv->description);
+ break;
case PROP_ICON_NAME:
g_value_set_string (value, self->priv->icon_name);
break;
@@ -404,6 +432,13 @@
NULL,
G_PARAM_READWRITE|G_PARAM_CONSTRUCT));
g_object_class_install_property (gobject_class,
+ PROP_DESCRIPTION,
+ g_param_spec_string ("description",
+ "Description",
+ "Description to display for this stream",
+ NULL,
+ G_PARAM_READWRITE|G_PARAM_CONSTRUCT));
+ g_object_class_install_property (gobject_class,
PROP_ICON_NAME,
g_param_spec_string ("icon-name",
"Icon Name",
@@ -450,6 +485,9 @@
g_free (mixer_stream->priv->name);
mixer_stream->priv->name = NULL;
+ g_free (mixer_stream->priv->description);
+ mixer_stream->priv->description = NULL;
+
g_free (mixer_stream->priv->icon_name);
mixer_stream->priv->icon_name = NULL;
Modified: trunk/gnome-volume-control/src/gvc-mixer-stream.h
==============================================================================
--- trunk/gnome-volume-control/src/gvc-mixer-stream.h (original)
+++ trunk/gnome-volume-control/src/gvc-mixer-stream.h Tue Nov 11 20:56:56 2008
@@ -67,8 +67,9 @@
gboolean gvc_mixer_stream_get_is_muted (GvcMixerStream *stream);
gboolean gvc_mixer_stream_change_is_muted (GvcMixerStream *stream,
gboolean is_muted);
-char * gvc_mixer_stream_get_name (GvcMixerStream *stream);
-char * gvc_mixer_stream_get_icon_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_description (GvcMixerStream *stream);
/* private */
gboolean gvc_mixer_stream_set_is_default (GvcMixerStream *stream,
@@ -79,6 +80,8 @@
gboolean is_muted);
gboolean gvc_mixer_stream_set_name (GvcMixerStream *stream,
const char *name);
+gboolean gvc_mixer_stream_set_description (GvcMixerStream *stream,
+ const char *description);
gboolean gvc_mixer_stream_set_icon_name (GvcMixerStream *stream,
const char *name);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]