summaryrefslogtreecommitdiff
path: root/gvc-mixer-card.c
diff options
context:
space:
mode:
authorGiovanni Campagna <gcampagna@src.gnome.org>2013-02-15 22:42:41 +0100
committerGiovanni Campagna <gcampagna@src.gnome.org>2013-02-18 14:39:54 +0100
commit74c08620b45a806df7531a434449f612c87c5ea4 (patch)
tree090e6c70db405282a86b9272c9d51bfd4811bcec /gvc-mixer-card.c
parent03894efbcd010faf53bbc6e27256d27485f721b8 (diff)
downloadlibgnome-volume-control-74c08620b45a806df7531a434449f612c87c5ea4.tar.gz
Add a GIcon accessor for GvcMixerUIDevices
This will allow to have different icons for internal audio cards (which are flagged generically as "audio-card"), depending on which port is in use (ie. headphones or speakers). This requires the new icon information, which is only exported by PulseAudio 3.0. If it's not available, we fallback to card icons like before. https://bugzilla.gnome.org/show_bug.cgi?id=689931
Diffstat (limited to 'gvc-mixer-card.c')
-rw-r--r--gvc-mixer-card.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/gvc-mixer-card.c b/gvc-mixer-card.c
index c512c51..0953203 100644
--- a/gvc-mixer-card.c
+++ b/gvc-mixer-card.c
@@ -276,7 +276,6 @@ gvc_mixer_card_get_profiles (GvcMixerCard *card)
return card->priv->profiles;
}
-
/**
* gvc_mixer_card_get_ports:
*
@@ -339,6 +338,17 @@ gvc_mixer_card_get_gicon (GvcMixerCard *card)
return g_themed_icon_new_with_default_fallbacks (card->priv->icon_name);
}
+static void
+free_port (GvcMixerCardPort *port)
+{
+ g_free (port->port);
+ g_free (port->human_port);
+ g_free (port->icon_name);
+ g_list_free (port->profiles);
+
+ g_free (port);
+}
+
/**
* gvc_mixer_card_set_ports:
* @ports: (transfer full) (element-type GvcMixerCardPort):
@@ -350,6 +360,7 @@ gvc_mixer_card_set_ports (GvcMixerCard *card,
g_return_val_if_fail (GVC_IS_MIXER_CARD (card), FALSE);
g_return_val_if_fail (card->priv->ports == NULL, FALSE);
+ g_list_free_full (card->priv->ports, (GDestroyNotify) free_port);
card->priv->ports = ports;
return TRUE;
@@ -563,6 +574,9 @@ gvc_mixer_card_finalize (GObject *object)
g_list_free (mixer_card->priv->profiles);
mixer_card->priv->profiles = NULL;
+ g_list_free_full (mixer_card->priv->ports, (GDestroyNotify) free_port);
+ mixer_card->priv->ports = NULL;
+
G_OBJECT_CLASS (gvc_mixer_card_parent_class)->finalize (object);
}