[gnome-control-center] sound: Expose ports in GvcMixerCard



commit fd75ccd894e11951c7149b918759c2e3f87cb97c
Author: Conor Curran <conor curran canonical com>
Date:   Fri Jun 8 13:03:58 2012 +0100

    sound: Expose ports in GvcMixerCard
    
    https://bugzilla.gnome.org/show_bug.cgi?id=674831

 panels/sound/gvc-mixer-card.c |   32 ++++++++++++++++++++++++++++++++
 panels/sound/gvc-mixer-card.h |   15 ++++++++++++++-
 2 files changed, 46 insertions(+), 1 deletions(-)
---
diff --git a/panels/sound/gvc-mixer-card.c b/panels/sound/gvc-mixer-card.c
index 168bc79..04509b1 100644
--- a/panels/sound/gvc-mixer-card.c
+++ b/panels/sound/gvc-mixer-card.c
@@ -2,6 +2,7 @@
  *
  * Copyright (C) 2008 William Jon McCann
  * Copyright (C) 2009 Bastien Nocera
+ * Copyright (C) Conor Curran 2011 <conor curran canonical com>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -49,6 +50,7 @@ struct GvcMixerCardPrivate
         char          *human_profile;
         GList         *profiles;
         pa_operation  *profile_op;
+        GList         *ports;
 };
 
 enum
@@ -275,6 +277,19 @@ gvc_mixer_card_get_profiles (GvcMixerCard *card)
         return card->priv->profiles;
 }
 
+
+/**
+ * gvc_mixer_card_get_ports:
+ *
+ * Return value: (transfer none) (element-type GvcMixerCardPort):
+ */
+const GList *
+gvc_mixer_card_get_ports (GvcMixerCard *card)
+{
+        g_return_val_if_fail (GVC_IS_MIXER_CARD (card), NULL);
+        return card->priv->ports;
+}
+
 static int
 sort_profiles (GvcMixerCardProfile *a,
                GvcMixerCardProfile *b)
@@ -286,6 +301,7 @@ sort_profiles (GvcMixerCardProfile *a,
         return -1;
 }
 
+
 /**
  * gvc_mixer_card_set_profiles:
  * @profiles: (transfer full) (element-type GvcMixerCardProfile):
@@ -302,6 +318,22 @@ gvc_mixer_card_set_profiles (GvcMixerCard *card,
         return TRUE;
 }
 
+/**
+ * gvc_mixer_card_set_ports:
+ * @profiles: (transfer full) (element-type GvcMixerCardPort):
+ */
+gboolean
+gvc_mixer_card_set_ports (GvcMixerCard *card,
+                          GList          *ports)
+{
+        g_return_val_if_fail (GVC_IS_MIXER_CARD (card), FALSE);
+        g_return_val_if_fail (card->priv->ports == NULL, FALSE);
+
+        card->priv->ports = ports;
+
+        return TRUE;
+}
+
 static void
 gvc_mixer_card_set_property (GObject       *object,
                              guint          prop_id,
diff --git a/panels/sound/gvc-mixer-card.h b/panels/sound/gvc-mixer-card.h
index 5a3a7bc..5a46c05 100644
--- a/panels/sound/gvc-mixer-card.h
+++ b/panels/sound/gvc-mixer-card.h
@@ -1,6 +1,7 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
  *
  * Copyright (C) 2008-2009 Red Hat, Inc.
+ * Copyright (C) Conor Curran 2011 <conor curran canonical com>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -56,6 +57,16 @@ typedef struct
         guint n_sinks, n_sources;
 } GvcMixerCardProfile;
 
+typedef struct
+{
+        char  *port;
+        char  *human_port;
+        guint  priority;
+        gint   available;
+        gint   direction;
+        GList *profiles;
+} GvcMixerCardPort;
+
 GType                 gvc_mixer_card_get_type          (void);
 
 guint                 gvc_mixer_card_get_id            (GvcMixerCard *card);
@@ -64,7 +75,7 @@ const char *          gvc_mixer_card_get_name          (GvcMixerCard *card);
 const char *          gvc_mixer_card_get_icon_name     (GvcMixerCard *card);
 GvcMixerCardProfile * gvc_mixer_card_get_profile       (GvcMixerCard *card);
 const GList *         gvc_mixer_card_get_profiles      (GvcMixerCard *card);
-
+const GList *         gvc_mixer_card_get_ports         (GvcMixerCard *card);
 gboolean              gvc_mixer_card_change_profile    (GvcMixerCard *card,
                                                         const char *profile);
 
@@ -77,6 +88,8 @@ gboolean              gvc_mixer_card_set_profile       (GvcMixerCard *card,
                                                         const char   *profile);
 gboolean              gvc_mixer_card_set_profiles      (GvcMixerCard *card,
                                                         GList        *profiles);
+gboolean              gvc_mixer_card_set_ports         (GvcMixerCard *stream,
+                                                        GList        *ports);
 
 G_END_DECLS
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]