diff -Nru gnome-control-center-3.4.1/debian/changelog gnome-control-center-3.4.1/debian/changelog --- gnome-control-center-3.4.1/debian/changelog 2012-04-16 15:09:42.000000000 +0000 +++ gnome-control-center-3.4.1/debian/changelog 2012-04-27 16:05:06.000000000 +0000 @@ -1,3 +1,17 @@ +gnome-control-center (1:3.4.1-0ubuntu2) precise-proposed; urgency=low + + * debian/patches/deal_with_null_ssid.patch: don't try to dereference ssid when + it's NULL (i.e. for non-broadcasting APs). (LP: #908670, #912948) + + [ Conor Curran & David Henningsson ] + * debian/patches/96_sound_nua_panel.patch: + - updated version including fixes for + - "moving running input stream fails" (lp: #984637) + - "peak detection on input tab doubles up on level"(lp: #987626) + - "SIGSEGV in gvc_mixer_ui_device_get_description()" (lp: #982495) + + -- Mathieu Trudel-Lapierre Fri, 27 Apr 2012 12:04:53 -0400 + gnome-control-center (1:3.4.1-0ubuntu1) precise-proposed; urgency=low [ Sebastien Bacher ] diff -Nru gnome-control-center-3.4.1/debian/patches/96_sound_nua_panel.patch gnome-control-center-3.4.1/debian/patches/96_sound_nua_panel.patch --- gnome-control-center-3.4.1/debian/patches/96_sound_nua_panel.patch 2012-04-16 15:09:42.000000000 +0000 +++ gnome-control-center-3.4.1/debian/patches/96_sound_nua_panel.patch 2012-04-27 16:05:06.000000000 +0000 @@ -3,10 +3,10 @@ # The new design has been discussed upstream and work is ongoing to send # changes back to GNOME === modified file 'configure.ac' -Index: gnome-control-center-3.4.0/configure.ac +Index: gnome-control-center-3.4.1/configure.ac =================================================================== ---- gnome-control-center-3.4.0.orig/configure.ac 2012-04-10 23:16:36.712159044 +0200 -+++ gnome-control-center-3.4.0/configure.ac 2012-04-10 23:16:39.108159159 +0200 +--- gnome-control-center-3.4.1.orig/configure.ac 2012-04-27 17:38:46.230336844 +0200 ++++ gnome-control-center-3.4.1/configure.ac 2012-04-27 17:38:49.642337009 +0200 @@ -120,7 +120,8 @@ libcanberra-gtk3 >= $CANBERRA_REQUIRED_VERSION libpulse >= $PA_REQUIRED_VERSION @@ -27,10 +27,10 @@ panels/sound/Makefile panels/sound/data/Makefile panels/sound/data/gnome-sound-panel.desktop.in -Index: gnome-control-center-3.4.0/panels/Makefile.am +Index: gnome-control-center-3.4.1/panels/Makefile.am =================================================================== ---- gnome-control-center-3.4.0.orig/panels/Makefile.am 2012-02-14 11:12:23.000000000 +0100 -+++ gnome-control-center-3.4.0/panels/Makefile.am 2012-04-10 23:16:36.988159058 +0200 +--- gnome-control-center-3.4.1.orig/panels/Makefile.am 2012-03-05 15:04:55.000000000 +0100 ++++ gnome-control-center-3.4.1/panels/Makefile.am 2012-04-27 17:38:46.522336858 +0200 @@ -10,6 +10,7 @@ region \ info \ @@ -39,10 +39,10 @@ keyboard \ universal-access \ user-accounts \ -Index: gnome-control-center-3.4.0/panels/sound-nua/Makefile.am +Index: gnome-control-center-3.4.1/panels/sound-nua/Makefile.am =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/Makefile.am 2012-04-10 23:16:36.988159058 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/Makefile.am 2012-04-27 17:38:46.522336858 +0200 @@ -0,0 +1,93 @@ +SUBDIRS = data + @@ -137,10 +137,10 @@ + Makefile.in + +-include $(top_srcdir)/git.mk -Index: gnome-control-center-3.4.0/panels/sound-nua/applet-main.c +Index: gnome-control-center-3.4.1/panels/sound-nua/applet-main.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/applet-main.c 2012-04-10 23:16:36.988159058 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/applet-main.c 2012-04-27 17:38:46.526336858 +0200 @@ -0,0 +1,110 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * @@ -252,10 +252,10 @@ + + return 0; +} -Index: gnome-control-center-3.4.0/panels/sound-nua/cc-sound-panel.c +Index: gnome-control-center-3.4.1/panels/sound-nua/cc-sound-panel.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/cc-sound-panel.c 2012-04-10 23:16:36.992159058 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/cc-sound-panel.c 2012-04-27 17:38:46.526336858 +0200 @@ -0,0 +1,141 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * @@ -398,10 +398,10 @@ +{ +} + -Index: gnome-control-center-3.4.0/panels/sound-nua/cc-sound-panel.h +Index: gnome-control-center-3.4.1/panels/sound-nua/cc-sound-panel.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/cc-sound-panel.h 2012-04-10 23:16:36.992159058 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/cc-sound-panel.h 2012-04-27 17:38:46.530336859 +0200 @@ -0,0 +1,60 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * @@ -463,10 +463,10 @@ + +#endif /* _CC_SOUND_PANEL_H */ + -Index: gnome-control-center-3.4.0/panels/sound-nua/data/Makefile.am +Index: gnome-control-center-3.4.1/panels/sound-nua/data/Makefile.am =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/data/Makefile.am 2012-04-10 23:16:36.992159058 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/data/Makefile.am 2012-04-27 17:38:46.530336859 +0200 @@ -0,0 +1,17 @@ +NULL = + @@ -485,10 +485,10 @@ + $(NULL) + +-include $(top_srcdir)/git.mk -Index: gnome-control-center-3.4.0/panels/sound-nua/data/gnome-sound-nua-panel.desktop.in.in +Index: gnome-control-center-3.4.1/panels/sound-nua/data/gnome-sound-nua-panel.desktop.in.in =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/data/gnome-sound-nua-panel.desktop.in.in 2012-04-10 23:16:36.992159058 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/data/gnome-sound-nua-panel.desktop.in.in 2012-04-27 17:38:46.530336859 +0200 @@ -0,0 +1,17 @@ +[Desktop Entry] +_Name=Sound @@ -507,10 +507,10 @@ +X-GNOME-Settings-Panel=sound-nua +# Translators: those are keywords for the sound control-center panel +_Keywords=Card;Microphone;Volume;Fade;Balance;Bluetooth;Headset; -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-applet.c +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-applet.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-applet.c 2012-04-10 23:16:36.992159058 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-applet.c 2012-04-27 17:38:46.534336859 +0200 @@ -0,0 +1,305 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * @@ -817,10 +817,10 @@ + + return GVC_APPLET (applet); +} -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-applet.h +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-applet.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-applet.h 2012-04-10 23:16:36.996159057 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-applet.h 2012-04-27 17:38:46.534336859 +0200 @@ -0,0 +1,55 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * @@ -877,10 +877,10 @@ +G_END_DECLS + +#endif /* __GVC_APPLET_H */ -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-balance-bar.c +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-balance-bar.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-balance-bar.c 2012-04-10 23:16:36.996159057 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-balance-bar.c 2012-04-27 17:38:46.538336859 +0200 @@ -0,0 +1,556 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * @@ -1438,10 +1438,10 @@ + + return GTK_WIDGET (bar); +} -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-balance-bar.h +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-balance-bar.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-balance-bar.h 2012-04-10 23:16:36.996159057 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-balance-bar.h 2012-04-27 17:38:46.538336859 +0200 @@ -0,0 +1,70 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * @@ -1513,10 +1513,10 @@ +G_END_DECLS + +#endif /* __GVC_BALANCE_BAR_H */ -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-channel-bar.c +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-channel-bar.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-channel-bar.c 2012-04-10 23:16:37.000159057 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-channel-bar.c 2012-04-27 17:38:46.542336859 +0200 @@ -0,0 +1,963 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * @@ -2481,10 +2481,10 @@ + NULL); + return GTK_WIDGET (bar); +} -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-channel-bar.h +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-channel-bar.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-channel-bar.h 2012-04-10 23:16:37.000159057 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-channel-bar.h 2012-04-27 17:38:46.542336859 +0200 @@ -0,0 +1,89 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * @@ -2575,10 +2575,10 @@ +G_END_DECLS + +#endif /* __GVC_CHANNEL_BAR_H */ -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-channel-map-private.h +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-channel-map-private.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-channel-map-private.h 2012-04-10 23:16:37.000159057 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-channel-map-private.h 2012-04-27 17:38:46.546336859 +0200 @@ -0,0 +1,39 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * @@ -2619,10 +2619,10 @@ +G_END_DECLS + +#endif /* __GVC_CHANNEL_MAP_PRIVATE_H */ -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-channel-map.c +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-channel-map.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-channel-map.c 2012-04-10 23:16:37.000159057 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-channel-map.c 2012-04-27 17:38:46.546336859 +0200 @@ -0,0 +1,254 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * @@ -2878,10 +2878,10 @@ + + return GVC_CHANNEL_MAP (map); +} -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-channel-map.h +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-channel-map.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-channel-map.h 2012-04-10 23:16:37.000159057 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-channel-map.h 2012-04-27 17:38:46.546336859 +0200 @@ -0,0 +1,73 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * @@ -2956,10 +2956,10 @@ +G_END_DECLS + +#endif /* __GVC_CHANNEL_MAP_H */ -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-combo-box.c +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-combo-box.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-combo-box.c 2012-04-10 23:17:18.032161044 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-combo-box.c 2012-04-27 17:38:46.550336860 +0200 @@ -0,0 +1,410 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * @@ -3371,10 +3371,10 @@ + return GTK_WIDGET (combo_box); +} + -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-combo-box.h +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-combo-box.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-combo-box.h 2012-04-10 23:16:37.000159057 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-combo-box.h 2012-04-27 17:38:46.550336860 +0200 @@ -0,0 +1,66 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * @@ -3442,10 +3442,10 @@ +G_END_DECLS + +#endif /* __GVC_COMBO_BOX_H */ -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-level-bar.c +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-level-bar.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-level-bar.c 2012-04-10 23:16:37.004159058 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-level-bar.c 2012-04-27 17:38:46.554336860 +0200 @@ -0,0 +1,770 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * @@ -4217,10 +4217,10 @@ + NULL); + return GTK_WIDGET (bar); +} -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-level-bar.h +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-level-bar.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-level-bar.h 2012-04-10 23:16:37.004159058 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-level-bar.h 2012-04-27 17:38:46.554336860 +0200 @@ -0,0 +1,75 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * @@ -4297,10 +4297,10 @@ +G_END_DECLS + +#endif /* __GVC_LEVEL_BAR_H */ -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-log.c +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-log.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-log.c 2012-04-10 23:16:37.004159058 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-log.c 2012-04-27 17:38:46.554336860 +0200 @@ -0,0 +1,64 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * @@ -4366,10 +4366,10 @@ + log_levels &= ~ (G_LOG_LEVEL_DEBUG | G_LOG_LEVEL_INFO); + } +} -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-log.h +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-log.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-log.h 2012-04-10 23:16:37.004159058 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-log.h 2012-04-27 17:38:46.566336860 +0200 @@ -0,0 +1,35 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * @@ -4406,10 +4406,10 @@ +G_END_DECLS + +#endif /* __GVC_LOG_H */ -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-card-private.h +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-card-private.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-card-private.h 2012-04-10 23:16:37.004159058 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-card-private.h 2012-04-27 17:38:46.566336860 +0200 @@ -0,0 +1,35 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * @@ -4446,15 +4446,16 @@ +G_END_DECLS + +#endif /* __GVC_MIXER_CARD_PRIVATE_H */ -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-card.c +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-card.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-card.c 2012-04-10 23:16:37.004159058 +0200 -@@ -0,0 +1,549 @@ ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-card.c 2012-04-27 17:38:56.662337352 +0200 +@@ -0,0 +1,550 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * + * Copyright (C) 2008 William Jon McCann + * Copyright (C) 2009 Bastien Nocera ++ * Copyright (C) Conor Curran 2011 + * + * 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 @@ -5000,15 +5001,16 @@ + G_OBJECT_CLASS (gvc_mixer_card_parent_class)->finalize (object); +} + -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-card.h +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-card.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-card.h 2012-04-10 23:16:37.004159058 +0200 -@@ -0,0 +1,108 @@ ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-card.h 2012-04-27 17:38:56.662337352 +0200 +@@ -0,0 +1,109 @@ +/* -*- 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 ++ + * 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 + * the Free Software Foundation; either version 2 of the License, or @@ -5113,10 +5115,10 @@ +G_END_DECLS + +#endif /* __GVC_MIXER_CARD_H */ -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-control-private.h +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-control-private.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-control-private.h 2012-04-10 23:16:37.008159059 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-control-private.h 2012-04-27 17:38:46.570336861 +0200 @@ -0,0 +1,35 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * @@ -5153,11 +5155,11 @@ +G_END_DECLS + +#endif /* __GVC_MIXER_CONTROL_PRIVATE_H */ -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-control.c +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-control.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-control.c 2012-04-10 23:17:18.036161043 +0200 -@@ -0,0 +1,3419 @@ ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-control.c 2012-04-27 17:38:56.670337349 +0200 +@@ -0,0 +1,3454 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * + * Copyright (C) 2006-2008 Lennart Poettering @@ -5241,10 +5243,25 @@ + GHashTable *clients; + GHashTable *cards; + GHashTable *ui_outputs; /* Ui visible outputs */ -+ GHashTable *ui_inputs; /* Ui visible inputs */ -+ guint cached_desired_output_id; ++ GHashTable *ui_inputs; /* Ui visible inputs */ ++ /* ++ Handle the edge case whereby inorder to satisfy a user instruction to swap ++ to an output which was on a different profile we first need to swap profile, ++ this will then trigger the sink/stream creation. ++ The two IDs below are used to store the cached desired device ID so that when the triggered update_source/sink ++ is called we know to set the port on that stream to the port of that desired input/output. ++ */ ++ guint cached_desired_output_id; + guint cached_desired_input_id; -+ GvcMixerStream *new_default_stream; /* new default stream, used in gvc_mixer_control_set_default_sink () */ ++ GvcMixerStream *new_default_stream; /* new default stream, used in gvc_mixer_control_set_default_sink/source () */ ++ gboolean new_default_is_source; /* true if currently setting the default source, false if setting the default sink */ ++ ++ /* ++ When we change profile on a device that is not the server default sink, ++ it will jump back to the default sink set by the server to prevent the audio setup from being 'outputless'. ++ All well and good but then when we get the new stream created for the new profile how do we know ++ that this is the intended default or selected device the user wishes to use. ++ */ + guint profile_swapping_device_id; + GvcMixerControlState state; +}; @@ -5308,12 +5325,18 @@ + void *userdata) +{ + pa_operation *o; ++ char *prefix; + GvcMixerControl *control = (GvcMixerControl *) userdata; + pa_ext_stream_restore_info new_info; + + if (eol || control->priv->new_default_stream == NULL) + return; + ++ /* Don't change inputs to outputs and vice versa */ ++ prefix = control->priv->new_default_is_source ? "source-output-by" : "sink-input-by"; ++ if (!g_str_has_prefix(info->name, prefix)) ++ return; ++ + new_info.name = info->name; + new_info.channel_map = info->channel_map; + new_info.volume = info->volume; @@ -5332,15 +5355,12 @@ + return; + } + -+ g_debug ("Changed default device for %s to %s", info->name, info->device); ++ g_debug ("Changed default device for %s to %s", info->name, new_info.device); + + pa_operation_unref (o); +} + +/** -+ * TODO : make utililty methods for common needs. -+ * Fetching the appropriate array -+ * Determining whether the stream is a network stream + * gvc_mixer_control_lookup_device_from_stream: + * @control: + * @stream: @@ -5364,8 +5384,8 @@ + const GList *ports; + ports = gvc_mixer_stream_get_ports (stream); + ++ // really this should be called 'is_network_or_bluetooth_stream' + is_network_stream = ports == NULL; -+ //g_debug ("\n is_network or bluetooth stream = %i \n", is_network_stream); + + for (d = devices; d != NULL; d = d->next) { + device = d->data; @@ -5386,8 +5406,6 @@ + const GvcMixerStreamPort *port; + port = gvc_mixer_stream_get_port (stream); + -+ //g_debug ("\n \n lookup device from stream - get port from stream %s", gvc_mixer_stream_get_description (stream)); -+ + if (stream_id == gvc_mixer_stream_get_id (stream) && + g_strcmp0 (gvc_mixer_ui_device_get_port(device), + port->port) == 0) { @@ -5402,7 +5420,7 @@ + } + } + } -+ g_debug ("\n gvc_mixer_control_lookup_device_from_stream - Could not find a device ? %s \n", gvc_mixer_stream_get_description (stream)); ++ g_debug ("\n gvc_mixer_control_lookup_device_from_stream - Could not find a device ? %s \n",gvc_mixer_stream_get_description (stream)); + return NULL; +} + @@ -5429,6 +5447,7 @@ + pa_operation_unref (o); + + control->priv->new_default_stream = stream; ++ control->priv->new_default_is_source = FALSE; + g_object_add_weak_pointer (G_OBJECT (stream), (gpointer *) &control->priv->new_default_stream); + + o = pa_ext_stream_restore_read (control->priv->pa_context, @@ -5465,6 +5484,23 @@ + } + + pa_operation_unref (o); ++ ++ control->priv->new_default_stream = stream; ++ control->priv->new_default_is_source = TRUE; ++ g_object_add_weak_pointer (G_OBJECT (stream), (gpointer *) &control->priv->new_default_stream); ++ ++ o = pa_ext_stream_restore_read (control->priv->pa_context, ++ gvc_mixer_control_stream_restore_cb, ++ control); ++ ++ if (o == NULL) { ++ g_warning ("pa_ext_stream_restore_read() failed: %s", ++ pa_strerror (pa_context_errno (control->priv->pa_context))); ++ return FALSE; ++ } ++ ++ pa_operation_unref (o); ++ + // source change successfull => update the UI. + GvcMixerUIDevice* input; + input = gvc_mixer_control_lookup_device_from_stream (control, stream); @@ -5473,7 +5509,6 @@ + 0, + gvc_mixer_ui_device_get_id (input)); + -+ + return TRUE; +} + @@ -5596,6 +5631,14 @@ + return gvc_mixer_control_lookup_id (control->priv->ui_inputs, id); +} + ++/** ++ * gvc_mixer_control_get_active_profile_from_ui_device: ++ * @control: GvcMixerControl* ++ * @device: GvcMixerUIDevice* ++ * Returns: (transfer container) (element-type gchar*): ++ The profile full name stored in that device ++ TODO: This belongs within the GvcMixerUIDevice. ++ */ +gchar* +gvc_mixer_control_get_active_profile_from_ui_device (GvcMixerControl* control, + GvcMixerUIDevice* device) @@ -5634,7 +5677,16 @@ + } + return gvc_mixer_control_lookup_stream_id (control, stream_id); +} -+ ++/** ++ * gvc_mixer_control_change_profile_on_selected_device: ++ * @control: ++ * @device: ++ * @profile: ++ * Returns: (transfer container) (element-type gboolean): ++ This method will attempt to swap the profle on the card of the device with given profile name ++ If successfull it will set the preferred profile on that device so as we know the next time the user ++ moves to that device it should have this profile active. ++ */ +gboolean +gvc_mixer_control_change_profile_on_selected_device (GvcMixerControl *control, + GvcMixerUIDevice *device, @@ -5668,12 +5720,22 @@ + return FALSE; +} + -+// TODO refactor - this should return a boolean determining as much as it can the success of the change -+// => the UI on the frontend can be reset to its previous entry if for any reason the change should fail. +/** + * gvc_mixer_control_change_output: + * @control: + * @output: ++ This method is called from the UI when the user selects a previously unselected device. ++ - Firstly it queries the stream from the device. ++ - It assumes that if the stream is null that it cannot be a bluetooth or network stream (they never show unless they have valid sinks and sources) ++ In the scenario of a NULL stream on the device ++ - It fetches the device's preferred profile or if NUll the profile with the highest priority on that device. ++ - It then caches this device in control->priv->cached_desired_output_id so that when the update_sink triggered ++ from when we attempt to change profile we will know exactly what device to highlight on that stream. ++ - It attempts to swap the profile on the card from that device and returns. ++ - Next, it handles network or bluetooth streams that only require their stream to be made the default. ++ - Next it deals with port changes so if the stream's active port is not the same as the port on the device ++ it will attempt to change the port on that stream to be same as the device. If this fails it will return. ++ - Finally it will set this new stream to be the default stream and emit a signal for the UI confirming the active output device. + */ +void +gvc_mixer_control_change_output (GvcMixerControl *control, @@ -5771,7 +5833,19 @@ + * gvc_mixer_control_change_input: + * @control: + * @input: -+ */ ++ This method is called from the UI when the user selects a previously unselected device. ++ - Firstly it queries the stream from the device. ++ - It assumes that if the stream is null that it cannot be a bluetooth or network stream (they never show unless they have valid sinks and sources) ++ In the scenario of a NULL stream on the device ++ - It fetches the device's preferred profile or if NUll the profile with the highest priority on that device. ++ - It then caches this device in control->priv->cached_desired_output_id so that when the update_sink triggered ++ from when we attempt to change profile we will know exactly what device to highlight on that stream. ++ - It attempts to swap the profile on the card from that device and returns. ++ - Next, it handles network or bluetooth streams that only require their stream to be made the default. ++ - Next it deals with port changes so if the stream's active port is not the same as the port on the device ++ it will attempt to change the port on that stream to be same as the device. If this fails it will return. ++ - Finally it will set this new stream to be the default stream and emit a signal for the UI confirming the active input device. ++ */ +void +gvc_mixer_control_change_input (GvcMixerControl *control, + GvcMixerUIDevice* input) @@ -5811,17 +5885,11 @@ + // Handle a network sink => a portless/cardless device + if (gvc_mixer_ui_device_is_software (input) || gvc_mixer_ui_device_is_bluetooth (input)){ + g_debug ("\n Did we try to move to a software/bluetooth source ? \n"); -+ if (gvc_mixer_control_set_default_source (control, stream)) { -+ g_signal_emit (G_OBJECT (control), -+ signals[ACTIVE_INPUT_UPDATE], -+ 0, -+ gvc_mixer_ui_device_get_id (input)); -+ } -+ else{ ++ if (! gvc_mixer_control_set_default_source (control, stream)) { + g_warning ("Failed to set default source with stream from input %s \n", + gvc_mixer_ui_device_get_description (input)); ++ return; + } -+ return; + } + + const GvcMixerStreamPort* active_port = gvc_mixer_stream_get_port (stream); @@ -6060,11 +6128,12 @@ + g_object_get (object, "port", &port, NULL); + GvcMixerUIDevice* input; + input = gvc_mixer_control_lookup_device_from_stream (control, -+ gvc_mixer_control_get_default_source (control)); ++ GVC_MIXER_STREAM (object)); + + g_debug ("\n\n on_default_source_port_notify - moved to port %s \n which SHOULD ?? correspond to output \n %s \n", + port, + gvc_mixer_ui_device_get_description (input)); ++ + g_signal_emit (G_OBJECT (control), + signals[ACTIVE_INPUT_UPDATE], + 0, @@ -6100,7 +6169,7 @@ + 0, + new_id); + -+ if (control->priv->default_sink_is_set){ ++ if (control->priv->default_source_is_set){ + g_signal_handlers_disconnect_by_func (gvc_mixer_control_get_default_source (control), + on_default_source_port_notify, + control); @@ -6131,17 +6200,17 @@ + g_object_get (object, "port", &port, NULL); + GvcMixerUIDevice* output; + output = gvc_mixer_control_lookup_device_from_stream (control, -+ gvc_mixer_control_get_default_sink (control)); -+ -+ g_debug ("\n\n on_default_sink_port_notify - moved to port %s \n which SHOULD correspond to output %s \n", -+ port, -+ gvc_mixer_ui_device_get_description (output)); -+ g_signal_emit (G_OBJECT (control), -+ signals[ACTIVE_OUTPUT_UPDATE], -+ 0, -+ gvc_mixer_ui_device_get_id (output)); -+ -+ g_free (port); ++ GVC_MIXER_STREAM (object)); ++ if (output != NULL){ ++ g_debug ("\n\n on_default_sink_port_notify - moved to port %s \n which SHOULD correspond to output %s \n", ++ port, ++ gvc_mixer_ui_device_get_description (output)); ++ g_signal_emit (G_OBJECT (control), ++ signals[ACTIVE_OUTPUT_UPDATE], ++ 0, ++ gvc_mixer_ui_device_get_id (output)); ++ } ++ g_free(port); +} + + @@ -6329,6 +6398,13 @@ + gvc_mixer_stream_get_id (stream)); +} + ++/* ++This method will match individual stream ports against it's corresponding device ++It does this by: ++- iterates through our devices and finds the one where the card-id on the device is the same as the card-id on the stream ++ && the port-name on the device is the same as the streamport-name. ++This should always find a match and is used exclusively by @sync_devices. ++*/ +static gboolean +match_stream_with_devices (GvcMixerControl *control, + GvcMixerStreamPort* stream_port, @@ -6343,13 +6419,7 @@ + stream_id = gvc_mixer_stream_get_id (stream); + stream_card_id = gvc_mixer_stream_get_card_index (stream); + -+ if (GVC_IS_MIXER_SOURCE (stream)){ -+ devices = g_hash_table_get_values (control->priv->ui_inputs); -+ } -+ else{ -+ devices = g_hash_table_get_values (control->priv->ui_outputs); -+ } -+ ++ devices = g_hash_table_get_values (GVC_IS_MIXER_SOURCE (stream) ? control->priv->ui_inputs : control->priv->ui_outputs); + gboolean in_possession = FALSE; + + for (d = devices; d != NULL; d = d->next) { @@ -6369,13 +6439,13 @@ + "port-name", &device_port_name, + NULL); + -+ /*g_debug ("\n Attempt to match_stream update_with_existing_outputs \n Try description : %s \n, origin : %s \n device port name : %s \n card id : %i \n AGAINST stream port: %s \n sink card id %i \n\n ", ++ g_debug ("\n Attempt to match_stream update_with_existing_outputs \n Try description : %s \n, origin : %s \n device port name : %s \n card id : %i \n AGAINST stream port: %s \n sink card id %i \n\n ", + description, + origin, + device_port_name, + card_id, + stream_port->port, -+ stream_card_id);*/ ++ stream_card_id); + + if ( stream_card_id == card_id && + g_strcmp0 (device_port_name, stream_port->port) == 0) { @@ -6401,30 +6471,39 @@ + return in_possession; +} + ++/* ++This method attempts to match a sink or source with it's relevant UI device. ++GvcMixerStream can represent both a sink or source. ++Using static card port introspection implies that we know beforehand what outputs and inputs are available to the user. ++But that does not mean that all of these inputs and outputs are available to be used. ++For instance we might be able to see that there is a HDMI port available but if we are on the default analog stereo output profile there is no valid sink for that HDMI device. We first need to change profile and when update_sink is called only then can we match the new hdmi sink with it's corresponding device. ++It works like this: ++Firstly it checks to see if the incoming stream has no ports. ++- If a stream has no ports but has a valid card ID (bluetooth), it will attempt to match the device with the stream using the card id. ++- If a stream has no ports and no valid card id, it goes ahead and makes a new device (software/network devices are only detectable at the sink/source level) ++If the stream has ports it will match each port against the stream using @match_stream_with_devices. ++This method should always find a match ! ++*/ +static void +sync_devices (GvcMixerControl *control, -+ GvcMixerStream* stream, int is_output) ++ GvcMixerStream* stream) +{ + // Go through ports to see what outputs can be created. + const GList *stream_ports = NULL; + const GList *n = NULL; + const GList *d; -+ ++ gboolean is_output = !GVC_IS_MIXER_SOURCE (stream); + stream_ports = gvc_mixer_stream_get_ports (stream); + gint stream_port_count = 0; + + if (g_list_length (stream_ports) == 0){ + GvcMixerUIDevice* device; -+ ++ // Bluetooth ++ // => no ports && a valid card + if (gvc_mixer_stream_get_card_index (stream) != PA_INVALID_INDEX) { + GList *devices; + -+ if (GVC_IS_MIXER_SOURCE (stream)){ -+ devices = g_hash_table_get_values (control->priv->ui_inputs); -+ } -+ else{ -+ devices = g_hash_table_get_values (control->priv->ui_outputs); -+ } ++ devices = g_hash_table_get_values ( is_output ? control->priv->ui_outputs : control->priv->ui_inputs); + + gboolean in_possession = FALSE; + @@ -6457,6 +6536,7 @@ + "port-available", TRUE, + NULL); + } ++ // Network sink/source => no ports && no card. + else{ + GObject *object; + @@ -6494,11 +6574,10 @@ + stream)) + continue; + -+ g_warning ("\n\n\n\n\n !!!!!!!!!!!!!!!!! why am I here !!! \n\n"); -+ g_debug ("\n Failed to match \n stream id: %u \n description : %s \n origin : %s \n \n ", -+ gvc_mixer_stream_get_id (stream), -+ stream_port->human_port, -+ gvc_mixer_stream_get_description (stream)); ++ g_warning ("\n Sync_devices : Failed to match \n stream id: %u \n description : %s \n origin : %s \n \n ", ++ gvc_mixer_stream_get_id (stream), ++ stream_port->human_port, ++ gvc_mixer_stream_get_description (stream)); + } +} + @@ -6554,6 +6633,9 @@ + gvc_mixer_stream_set_icon_name (stream, t); +} + ++/* ++* Called when anything changes with a sink. ++*/ +static void +update_sink (GvcMixerControl *control, + const pa_sink_info *info) @@ -6621,7 +6703,7 @@ + gvc_mixer_stream_set_base_volume (stream, (guint32) info->base_volume); + + // Messy I know but to set the port everytime regardless of whether it has changed will cost us a -+ // port change notify signal which caused the frontend to resync. ++ // port change notify signal which causes the frontend to resync. + // Only update the UI when something has changed. + if (info->active_port != NULL){ + if (is_new){ @@ -6646,16 +6728,16 @@ + g_object_ref (stream)); + add_stream (control, stream); + // Always sink on a new stream to able to assign the right stream id -+ // to the appropriate outputs (=>multiple potential outputs per stream). -+ sync_devices (control, stream, TRUE); ++ // to the appropriate outputs (=> multiple potential outputs per stream). ++ sync_devices (control, stream); + } + -+ + // Handle the edge case whereby inorder to satisfy a user instruction to swap + // to an output which was on a different profile we first need to swap profile, + // this will then trigger the sink/stream creation. + // At this point catch the stream, if necessary swap the port and return. + // anticipating another update sink call from the port change to finish the volume mapping. ++ + if (control->priv->cached_desired_output_id != GVC_MIXER_UI_DEVICE_INVALID){ + GvcMixerUIDevice *output = NULL; + output = gvc_mixer_control_lookup_output_id (control, @@ -6716,8 +6798,7 @@ + if (map == NULL) + map = (GvcChannelMap *) gvc_mixer_stream_get_channel_map (stream); + -+ gvc_channel_map_volume_changed (map, &info->volume, FALSE); -+ ++ gvc_channel_map_volume_changed (map, &info->volume, FALSE); +} + +static void @@ -6742,7 +6823,6 @@ + } + + is_new = FALSE; -+ + stream = g_hash_table_lookup (control->priv->sources, + GUINT_TO_POINTER (info->index)); + if (stream == NULL) { @@ -6784,6 +6864,7 @@ + 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_base_volume (stream, (guint32) info->base_volume); ++ g_debug ("\n update source \n"); + + if (info->active_port != NULL){ + if (is_new){ @@ -6806,7 +6887,7 @@ + g_object_ref (stream)); + add_stream (control, stream); + -+ sync_devices (control, stream, FALSE); ++ sync_devices (control, stream); + } + + if (control->priv->default_source_name != NULL @@ -7015,8 +7096,9 @@ + g_free (sources_str); + return ret; +} -+ -+//TODO - does this not belong with the ui-device ++/** ++* A utility method to gather which card profiles are relevant to the port . ++*/ +static GList* +determine_profiles_for_port (pa_card_port_info *port, + GList* card_profiles) @@ -7045,6 +7127,9 @@ + return port->direction == PA_DIRECTION_OUTPUT ? TRUE : FALSE; +} + ++/* ++* This method will create a ui device for the given port. ++*/ +static void +create_ui_device_from_port (GvcMixerControl* control, + GvcMixerCardPort* port, @@ -7068,32 +7153,17 @@ + GvcMixerUIDevice* uidevice = GVC_MIXER_UI_DEVICE (object); + gvc_mixer_ui_device_set_profiles (uidevice, port->profiles); + ++ g_hash_table_insert (is_card_port_an_output (port) ? control->priv->ui_outputs : control->priv->ui_inputs, ++ GUINT_TO_POINTER (gvc_mixer_ui_device_get_id (uidevice)), ++ g_object_ref (uidevice)); + -+ if (is_card_port_an_output (port)) { -+ g_hash_table_insert (control->priv->ui_outputs, -+ GUINT_TO_POINTER (gvc_mixer_ui_device_get_id (uidevice)), -+ g_object_ref (uidevice)); -+ -+ if (available) { -+ g_signal_emit (G_OBJECT (control), -+ signals[OUTPUT_ADDED], -+ 0, -+ gvc_mixer_ui_device_get_id (uidevice)); -+ } -+ -+ } -+ else{ -+ g_hash_table_insert (control->priv->ui_inputs, -+ GUINT_TO_POINTER (gvc_mixer_ui_device_get_id (uidevice)), -+ g_object_ref (uidevice)); + -+ if (available) { -+ g_signal_emit (G_OBJECT (control), -+ signals[INPUT_ADDED], -+ 0, -+ gvc_mixer_ui_device_get_id (uidevice)); -+ } -+ } ++ if (available) { ++ g_signal_emit (G_OBJECT (control), ++ signals[is_card_port_an_output (port) ? OUTPUT_ADDED : INPUT_ADDED], ++ 0, ++ gvc_mixer_ui_device_get_id (uidevice)); ++ } + + g_debug ("\n create_ui_device_from_port, direction %u \n description %s \n origin %s \n port available %i \n \n", + direction, @@ -7102,6 +7172,12 @@ + available); +} + ++/* ++This method will match up GvcMixerCardPorts with existing devices. ++A match is achieved if the device's card-id and the port's card-id are the same ++&& the device's port-name and the card-port's port member are the same. ++A signal is then sent adding or removing that device from the UI depending on the availability of the port. ++*/ +static void +match_card_port_with_existing_device (GvcMixerControl *control, + GvcMixerCardPort* card_port, @@ -7114,12 +7190,7 @@ + gboolean in_possession = FALSE; + gboolean is_output = is_card_port_an_output (card_port); + -+ if (is_output){ -+ devices = g_hash_table_get_values (control->priv->ui_outputs); -+ } -+ else{ -+ devices = g_hash_table_get_values (control->priv->ui_inputs); -+ } ++ devices = g_hash_table_get_values (is_output ? control->priv->ui_outputs : control->priv->ui_inputs); + + for (d = devices; d != NULL; d = d->next) { + device = d->data; @@ -7139,39 +7210,24 @@ + is_output); + g_object_set ( G_OBJECT (device), + "port-available", available, NULL); -+ if (is_output) { -+ if (available) { -+ g_signal_emit (G_OBJECT (control), -+ signals[OUTPUT_ADDED], -+ 0, -+ gvc_mixer_ui_device_get_id (device)); -+ } -+ else{ -+ g_signal_emit (G_OBJECT (control), -+ signals[OUTPUT_REMOVED], -+ 0, -+ gvc_mixer_ui_device_get_id (device)); -+ } -+ } -+ else{ -+ if (available) { -+ g_signal_emit (G_OBJECT (control), -+ signals[INPUT_ADDED], -+ 0, -+ gvc_mixer_ui_device_get_id (device)); -+ } -+ else{ -+ g_signal_emit (G_OBJECT (control), -+ signals[INPUT_REMOVED], -+ 0, -+ gvc_mixer_ui_device_get_id (device)); -+ } -+ } ++ g_signal_emit (G_OBJECT (control), ++ is_output ? signals[available ? OUTPUT_ADDED : OUTPUT_REMOVED] : signals[available ? INPUT_ADDED : INPUT_REMOVED], ++ 0, ++ gvc_mixer_ui_device_get_id (device)); + } + g_free (device_port_name); + } +} -+ ++/* ++At this point we can determine all devices available to us (besides network 'ports') ++This is done by the following: ++ ++ - gvc_mixer_card and gvc_mixer_card_ports are created and relevant setters are called. ++ - First it checks to see if it's a portless card. Bluetooth devices are portless AFAIHS. ++ If so it creates two devices, an input and an output. ++ - If it's a 'normal' card with ports it will create a new ui-device or ++ synchronise port availability with the existing device cached for that port on this card. ++*/ +static void +update_card (GvcMixerControl *control, + const pa_card_info *info) @@ -7183,9 +7239,6 @@ + const char *key; + void *state; + -+ /*g_debug ("Udpating card %s (index: %u driver: %s):", -+ info->name, info->index, info->driver);*/ -+ + for (i = 0; i < info->n_profiles; i++) { + struct pa_card_profile_info pi = info->profiles[i]; + gboolean is_default; @@ -7235,8 +7288,7 @@ + port->available = info->ports[i]->available; + port->direction = info->ports[i]->direction; + port->profiles = determine_profiles_for_port (info->ports[i], profile_list); -+ port_list = g_list_prepend (port_list, port); -+ ++ port_list = g_list_prepend (port_list, port); + } + gvc_mixer_card_set_ports (card, port_list); + is_new = TRUE; @@ -7259,7 +7311,6 @@ + + guint port_count; + port_count = g_list_length (card_ports); -+ g_debug ("\n update card- %s \n", gvc_mixer_card_get_name (card)); + + if (port_count == 0 && is_new){ + // TODO : move to its own method. @@ -7787,7 +7838,7 @@ + devices = g_list_concat (g_hash_table_get_values (control->priv->ui_inputs), + g_hash_table_get_values (control->priv->ui_outputs)); + -+ GList *d; ++ GList *d; + GvcMixerUIDevice *device; + + for (d = devices; d != NULL; d = d->next) { @@ -7797,28 +7848,14 @@ + "card-id", &card_id, + NULL); + if (card_id == index) { -+ if (gvc_mixer_ui_device_is_output (device)) { -+ g_signal_emit (G_OBJECT (control), -+ signals[OUTPUT_REMOVED], -+ 0, -+ gvc_mixer_ui_device_get_id (device)); -+ g_debug ("\n Card removal remove output device %s \n", -+ gvc_mixer_ui_device_get_description (device)); -+ g_hash_table_remove (control->priv->ui_outputs, -+ GUINT_TO_POINTER (gvc_mixer_ui_device_get_id (device))); -+ -+ } -+ else{ -+ g_signal_emit (G_OBJECT (control), -+ signals[INPUT_REMOVED], -+ 0, -+ gvc_mixer_ui_device_get_id (device)); -+ g_debug ("\n Card removal remove input device %s \n", -+ gvc_mixer_ui_device_get_description (device)); -+ g_hash_table_remove (control->priv->ui_inputs, -+ GUINT_TO_POINTER (gvc_mixer_ui_device_get_id (device))); -+ -+ } ++ g_signal_emit (G_OBJECT (control), ++ signals[gvc_mixer_ui_device_is_output (device) ? OUTPUT_REMOVED : INPUT_REMOVED], ++ 0, ++ gvc_mixer_ui_device_get_id (device)); ++ g_debug ("\n Card removal remove device %s \n", ++ gvc_mixer_ui_device_get_description (device)); ++ g_hash_table_remove (gvc_mixer_ui_device_is_output (device) ? control->priv->ui_outputs : control->priv->ui_inputs, ++ GUINT_TO_POINTER (gvc_mixer_ui_device_get_id (device))); + } + } + @@ -8577,10 +8614,10 @@ +{ + return (gdouble) PA_VOLUME_UI_MAX; +} -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-control.h +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-control.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-control.h 2012-04-10 23:16:37.012159059 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-control.h 2012-04-27 17:38:46.586336861 +0200 @@ -0,0 +1,139 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * @@ -8721,11 +8758,11 @@ +G_END_DECLS + +#endif /* __GVC_MIXER_CONTROL_H */ -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-dialog.c +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-dialog.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-dialog.c 2012-04-10 23:17:18.040161043 +0200 -@@ -0,0 +1,2174 @@ ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-dialog.c 2012-04-27 17:38:56.670337349 +0200 +@@ -0,0 +1,2198 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * + * Copyright (C) 2008 William Jon McCann @@ -9037,10 +9074,12 @@ + gboolean has_monitor; + + if (stream == NULL) { ++ g_debug ("\n create_monitor_stream_for_source - stream is null - returning\n"); + return; + } + has_monitor = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (stream), "has-monitor")); + if (has_monitor != FALSE) { ++ g_debug ("\n create_monitor_stream_for_source, has monitor is not false - returning \n"); + return; + } + @@ -9050,6 +9089,7 @@ + context = gvc_mixer_control_get_pa_context (dialog->priv->mixer_control); + + if (pa_context_get_server_protocol_version (context) < 13) { ++ g_debug ("\n create_monitor_stream_for_source - protocol version is less 13 \n"); + return; + } + @@ -9091,6 +9131,7 @@ + } +} + ++ +static void +stop_monitor_stream_for_source (GvcMixerDialog *dialog) +{ @@ -9099,24 +9140,36 @@ + int res; + GvcMixerStream *stream; + -+ s = g_object_get_data (G_OBJECT (dialog->priv->input_level_bar), "pa_stream"); -+ if (s == NULL) -+ return; + stream = g_object_get_data (G_OBJECT (dialog->priv->input_level_bar), "stream"); -+ g_assert (stream != NULL); + -+ g_debug ("Stopping monitor for %u", pa_stream_get_index (s)); ++ if (stream == NULL){ ++ g_debug ("\n stop_monitor_stream_for_source - gvcstream is null - returning \n"); ++ return; ++ } ++ else{ ++ g_debug ("\n stop_monitor_stream_for_source - gvcstream is not null - continue \n"); ++ } ++ ++ s = g_object_get_data (G_OBJECT (dialog->priv->input_level_bar), "pa_stream"); + ++ if (s != NULL){ ++ res = pa_stream_disconnect (s); ++ if (res == 0) { ++ g_debug("stream has been disconnected"); ++ pa_stream_unref (s); ++ } ++ g_object_set_data (G_OBJECT (dialog->priv->input_level_bar), "pa_stream", NULL); ++ } ++ + context = gvc_mixer_control_get_pa_context (dialog->priv->mixer_control); + + if (pa_context_get_server_protocol_version (context) < 13) { + return; + } -+ -+ res = pa_stream_disconnect (s); -+ if (res == 0) ++ if (res == 0) { + g_object_set_data (G_OBJECT (stream), "has-monitor", GINT_TO_POINTER (FALSE)); -+ g_object_set_data (G_OBJECT (dialog->priv->input_level_bar), "pa_stream", NULL); ++ } ++ g_debug ("Stopping monitor for %u", pa_stream_get_index (s)); + g_object_set_data (G_OBJECT (dialog->priv->input_level_bar), "stream", NULL); +} + @@ -9414,6 +9467,8 @@ + return bar; +} + ++static gint test_it = 0; ++ +/* active_input_update + * Handle input update change from the backend (control). + * Trust the backend whole-heartedly to deliver the correct input @@ -9458,7 +9513,6 @@ + + }while (gtk_tree_model_iter_next (model, &iter)); + -+ stop_monitor_stream_for_source (dialog); + + // Not ideal but for now destroy the combo and recreate below. + if (dialog->priv->input_profile_combo != NULL) { @@ -9481,6 +9535,9 @@ + } + + // Set the label accordingly ++ adj = GTK_ADJUSTMENT (gvc_channel_bar_get_adjustment (GVC_CHANNEL_BAR (dialog->priv->input_bar))); ++ g_signal_handlers_disconnect_by_func(adj, on_adjustment_value_changed, dialog); ++ + gtk_label_set_label (GTK_LABEL(dialog->priv->selected_input_label), + g_strdup_printf(_("Settings for %s"), + gvc_mixer_ui_device_get_description (active_input))); @@ -9495,10 +9552,14 @@ + gtk_adjustment_set_value (adj, + gvc_mixer_stream_get_volume (stream)); + ++ stop_monitor_stream_for_source (dialog); ++ //if (test_it < 6){ + create_monitor_stream_for_source (dialog, stream); ++ test_it += 1; ++ //} ++ bar_set_stream (dialog, dialog->priv->input_bar, stream); + // remove any previous stream that might have been pointed at + // the static input bar and connect new signals from new stream. -+ bar_set_stream (dialog, dialog->priv->input_bar, stream); + + const GHashTable *profs_entries; + profs_entries = gvc_mixer_ui_device_get_profiles (active_input); @@ -9697,14 +9758,13 @@ + GvcMixerStream *stream) +{ + GtkAdjustment *adj; -+ GvcMixerStream *old_stream; + + g_assert (bar != NULL); + + gtk_widget_set_sensitive (bar, (stream != NULL)); + + adj = GTK_ADJUSTMENT (gvc_channel_bar_get_adjustment (GVC_CHANNEL_BAR (bar))); -+ ++ + g_signal_handlers_disconnect_by_func (adj, on_adjustment_value_changed, dialog); + + g_object_set_data (G_OBJECT (bar), "gvc-mixer-dialog-stream", stream); @@ -9779,6 +9839,7 @@ + + g_signal_handlers_disconnect_by_func (old_stream, on_stream_is_muted_notify, dialog); + g_signal_handlers_disconnect_by_func (old_stream, on_stream_volume_notify, dialog); ++ g_print ("\n in add stream \n"); + g_hash_table_remove (dialog->priv->bars, GUINT_TO_POINTER (gvc_mixer_stream_get_id (old_stream))); + } + save_bar_for_stream (dialog, stream, bar); @@ -10900,10 +10961,10 @@ + + return TRUE; +} -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-dialog.h +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-dialog.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-dialog.h 2012-04-10 23:16:37.016159058 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-dialog.h 2012-04-27 17:38:46.594336862 +0200 @@ -0,0 +1,56 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * @@ -10961,10 +11022,10 @@ +G_END_DECLS + +#endif /* __GVC_MIXER_DIALOG_H */ -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-event-role.c +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-event-role.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-event-role.c 2012-04-10 23:16:37.016159058 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-event-role.c 2012-04-27 17:38:46.598336861 +0200 @@ -0,0 +1,231 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * @@ -11197,10 +11258,10 @@ + + return GVC_MIXER_STREAM (object); +} -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-event-role.h +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-event-role.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-event-role.h 2012-04-10 23:16:37.016159058 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-event-role.h 2012-04-27 17:38:46.602336861 +0200 @@ -0,0 +1,57 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * @@ -11259,10 +11320,10 @@ +G_END_DECLS + +#endif /* __GVC_MIXER_EVENT_ROLE_H */ -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-sink-input.c +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-sink-input.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-sink-input.c 2012-04-10 23:16:37.016159058 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-sink-input.c 2012-04-27 17:38:46.606336862 +0200 @@ -0,0 +1,166 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * @@ -11430,10 +11491,10 @@ + + return GVC_MIXER_STREAM (object); +} -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-sink-input.h +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-sink-input.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-sink-input.h 2012-04-10 23:16:37.016159058 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-sink-input.h 2012-04-27 17:38:46.606336862 +0200 @@ -0,0 +1,57 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * @@ -11492,10 +11553,10 @@ +G_END_DECLS + +#endif /* __GVC_MIXER_SINK_INPUT_H */ -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-sink.c +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-sink.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-sink.c 2012-04-10 23:16:37.016159058 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-sink.c 2012-04-27 17:38:46.610336863 +0200 @@ -0,0 +1,196 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * @@ -11693,10 +11754,10 @@ + + return GVC_MIXER_STREAM (object); +} -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-sink.h +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-sink.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-sink.h 2012-04-10 23:16:37.016159058 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-sink.h 2012-04-27 17:38:46.614336864 +0200 @@ -0,0 +1,57 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * @@ -11755,10 +11816,10 @@ +G_END_DECLS + +#endif /* __GVC_MIXER_SINK_H */ -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-source-output.c +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-source-output.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-source-output.c 2012-04-10 23:16:37.016159058 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-source-output.c 2012-04-27 17:38:46.614336864 +0200 @@ -0,0 +1,121 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * @@ -11881,10 +11942,10 @@ + + return GVC_MIXER_STREAM (object); +} -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-source-output.h +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-source-output.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-source-output.h 2012-04-10 23:16:37.016159058 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-source-output.h 2012-04-27 17:38:46.626336863 +0200 @@ -0,0 +1,57 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * @@ -11943,10 +12004,10 @@ +G_END_DECLS + +#endif /* __GVC_MIXER_SOURCE_OUTPUT_H */ -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-source.c +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-source.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-source.c 2012-04-10 23:16:37.020159058 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-source.c 2012-04-27 17:38:46.630336863 +0200 @@ -0,0 +1,196 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * @@ -12144,10 +12205,10 @@ + + return GVC_MIXER_STREAM (object); +} -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-source.h +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-source.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-source.h 2012-04-10 23:16:37.020159058 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-source.h 2012-04-27 17:38:46.630336863 +0200 @@ -0,0 +1,57 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * @@ -12206,10 +12267,10 @@ +G_END_DECLS + +#endif /* __GVC_MIXER_SOURCE_H */ -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-stream-private.h +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-stream-private.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-stream-private.h 2012-04-10 23:16:37.020159058 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-stream-private.h 2012-04-27 17:38:46.634336864 +0200 @@ -0,0 +1,34 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * @@ -12245,10 +12306,10 @@ +G_END_DECLS + +#endif /* __GVC_MIXER_STREAM_PRIVATE_H */ -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-stream.c +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-stream.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-stream.c 2012-04-10 23:16:37.020159058 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-stream.c 2012-04-27 17:38:46.638336864 +0200 @@ -0,0 +1,968 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * @@ -13218,10 +13279,10 @@ + + G_OBJECT_CLASS (gvc_mixer_stream_parent_class)->finalize (object); +} -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-stream.h +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-stream.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-stream.h 2012-04-10 23:16:37.020159058 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-stream.h 2012-04-27 17:38:46.666336865 +0200 @@ -0,0 +1,128 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * @@ -13351,11 +13412,11 @@ +G_END_DECLS + +#endif /* __GVC_MIXER_STREAM_H */ -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-ui-device.c +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-ui-device.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-ui-device.c 2012-04-10 23:17:18.040161043 +0200 -@@ -0,0 +1,649 @@ ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-ui-device.c 2012-04-27 17:38:56.670337349 +0200 +@@ -0,0 +1,640 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */ +/* + * gvc-mixer-ui-device.c @@ -13480,38 +13541,38 @@ + case PROP_DESC_LINE_1: + g_free (self->priv->first_line_desc); + self->priv->first_line_desc = g_value_dup_string (value); -+ /*g_debug ("gvc-mixer-output-set-property - 1st line: %s\n", -+ self->priv->first_line_desc);*/ ++ g_debug ("gvc-mixer-output-set-property - 1st line: %s\n", ++ self->priv->first_line_desc); + break; + case PROP_DESC_LINE_2: + g_free (self->priv->second_line_desc); + self->priv->second_line_desc = g_value_dup_string (value); -+ /*g_debug ("gvc-mixer-output-set-property - 2nd line: %s\n", -+ self->priv->second_line_desc);*/ ++ g_debug ("gvc-mixer-output-set-property - 2nd line: %s\n", ++ self->priv->second_line_desc); + break; + case PROP_CARD_ID: + self->priv->card_id = g_value_get_int (value); -+ /*g_debug ("gvc-mixer-output-set-property - card id: %i\n", -+ self->priv->gvc_card_id);*/ ++ g_debug ("gvc-mixer-output-set-property - card id: %i\n", ++ self->priv->card_id); + break; + case PROP_PORT_NAME: + g_free (self->priv->port_name); + self->priv->port_name = g_value_dup_string (value); -+ /*g_debug ("gvc-mixer-output-set-property - card port name: %s\n", -+ self->priv->card_port_name);*/ ++ g_debug ("gvc-mixer-output-set-property - card port name: %s\n", ++ self->priv->port_name); + break; + case PROP_STREAM_ID: + self->priv->stream_id = g_value_get_int (value); -+ /*g_debug ("gvc-mixer-output-set-property - sink id: %i\n", -+ self->priv->stream_id);*/ ++ g_debug ("gvc-mixer-output-set-property - sink id: %i\n", ++ self->priv->stream_id); + break; + case PROP_UI_DEVICE_TYPE: + self->priv->type = (UiDeviceDirection)g_value_get_uint (value); + break; + case PROP_PORT_AVAILABLE: + self->priv->port_available = g_value_get_boolean (value); -+ /*g_debug ("gvc-mixer-output-set-property - port available %i, value passed in %i \n", -+ self->priv->port_available, g_value_get_boolean (value));*/ ++ g_debug ("gvc-mixer-output-set-property - port available %i, value passed in %i \n", ++ self->priv->port_available, g_value_get_boolean (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); @@ -13673,33 +13734,56 @@ + g_type_class_add_private (klass, sizeof (GvcMixerUIDevicePrivate)); +} + -+// TODO -+// Optimise so as on the first pass you can 'choose' which profiles to hold on to and -+// which are useles because they are essentially duplicates. -+// => a Breadthfirst approach is needed ... ++/* ++ gvc_mixer_ui_device_set_profiles (GvcMixerUIDevice *device, const GList *in_profiles) ++ ++ This method attempts to reduce the list of profiles visible to the user by figuring out ++ from the context of that device (whether it's an input or an output) what profiles actually provide an alternative. ++ ++ It does this by the following. ++ - It ignores off profiles. ++ - Sorts the incoming profiles by attempting to split each profile on the char '+'. ++ -- This will pull out the relevant aspect of the profile for the type of device this is. ++ e.g stereo analog out, bluetooth or HDMI for an output, stereo analog in or bluetooth for the input coming from ++ a typical setup of a onboard HDA intel card and bluetooth headset. ++ -- Will store this shortened string against the profile full length name. ++ ++ - Next it tries to determine from our prepared hash above if we want to allow the user to change ++ the profile on the device i.e. if the profile combo should be visible to the user on the UI. ++ -- Is there any actual choice or just much of the same thing from the ++ context of the direction on this device. ++ -If there is a choice ++ -- It will gather the groups of identical profiles and choose the one that has the highest priority to insert ++ into the final list to be presented to the user. ++ - if the shortened profiles are identical so that the profile combo is to be hidden from the user ++ -- It will choose the profile with the highest priority. (the pattern assumes a device will always have a profile in it's profile list) ++Note: ++ I think this algorithm is inherently flawed. ++ https://bugs.launchpad.net/ubuntu/+source/gnome-control-center/+bug/972554 ++ An issue arises in this bug whereby the user needs to get at a specific profile which allows him a certain input and output ++ configuration. But this algorithem because of priority values etc will reject that one profile that he needs to get at. ++TODO ++ Optimise so as on the first pass you can 'choose' which profiles to hold on to and ++ which are useles because they are essentially duplicates. ++ => a depthfirst like approach is needed ... ++*/ +void +gvc_mixer_ui_device_set_profiles (GvcMixerUIDevice *device, const GList *in_profiles) +{ + g_debug ("\n SET PROFILES %s", gvc_mixer_ui_device_get_description(device)); + -+ gint profile_count; + GList* t; -+ + GHashTable *profile_descriptions; ++ + if (in_profiles == NULL) + return; + + device->priv->supported_profiles = g_list_copy (in_profiles); -+ -+ // Is this being used ? TODO -+ profile_count = g_list_length (in_profiles); -+ + profile_descriptions = g_hash_table_new_full (g_str_hash, + g_str_equal, + g_free, + g_free); + -+ + // Store each profile in a hash with the shortened relevant string as the key + for (t = in_profiles; t != NULL; t = t->next) { + @@ -13771,7 +13855,7 @@ + n = g_list_next (t); + next_prof = n->data; + identical = g_strcmp0 (prof, next_prof) == 0; -+ //g_debug ("try to compare %s with %s", prof, next_prof); ++ g_debug ("try to compare %s with %s", prof, next_prof); + } + if (!identical){ + break; @@ -13788,7 +13872,6 @@ + + if (!identical) { + for (y = in_profiles; y != NULL; y = y->next) { -+ + GList *profiles_with_identical_shortened_names = NULL; + GvcMixerCardProfile* p; + p = y->data; @@ -13799,9 +13882,9 @@ + gchar* short_name; + short_name = g_hash_table_lookup (profile_descriptions, p->profile); + -+ //g_debug ("\n Not identical - examine %s -> %s \n\n", short_name, p->profile); ++ g_debug ("\n Not identical - examine %s -> %s \n\n", short_name, p->profile); + -+ // If we have already populated for this short name - trust our prioritisation below and move on. ++ // If we have already populated for this short name - trust?? our prioritisation below and move on + if (g_hash_table_contains (device->priv->profiles, short_name) == TRUE){ + g_debug ("\n already populated for %s => ignore %s \n", short_name, p->profile); + continue; @@ -13828,7 +13911,7 @@ + l); + } + } -+ ++ // Algorithm flaw + GList* ordered = NULL; + ordered = g_list_sort (profiles_with_identical_shortened_names, + (GCompareFunc) sort_profiles); @@ -13845,48 +13928,17 @@ + } + } + else{ -+ // If it's identical (=> combo is insensitive) we want to find the profile that is -+ // relevant to the context of the device for the sake of the UI - avoid user confusion. -+ GList* profile_descriptions_keys; -+ profile_descriptions_keys = g_hash_table_get_keys (profile_descriptions); -+ GList* c; -+ gboolean matched = FALSE; -+ for (c = profile_descriptions_keys; c != NULL; c = c->next) { -+ gchar* prof; -+ prof = c->data; -+ gchar* shortened_value; -+ shortened_value = g_hash_table_lookup (profile_descriptions, prof); -+ if (g_strcmp0 (shortened_value, prof) == 0){ -+ GList *j; -+ for (j = in_profiles; j != NULL; j = j->next) { -+ GvcMixerCardProfile* l; -+ l = j->data; -+ if (g_strcmp0 (l->profile, prof) == 0){ -+ g_hash_table_insert (device->priv->profiles, -+ g_strdup(shortened_value), -+ l); -+ -+ matched = TRUE; -+ } -+ } -+ } -+ } -+ // We can't find the ideal profile for the insensitive combo -+ // just pick the one with the highest priority. -+ if (!matched){ -+ GvcMixerCardProfile* p = NULL; -+ // Since the profile list was already sorted on card port creation -+ // we just need to take the last one as this will have the highest priority -+ p = g_list_last (in_profiles)->data; -+ if (p != NULL && p->human_profile != NULL) -+ //g_debug ("\n fail to match on profile %s \n", p->human_profile); -+ g_hash_table_insert (device->priv->profiles, -+ p->human_profile, -+ p); -+ } ++ // Since the profile list was already sorted on card port creation ++ // we just need to take the last one as this will have the highest priority ++ GvcMixerCardProfile* p = NULL; ++ p = g_list_last (in_profiles)->data; ++ if (p != NULL && p->human_profile != NULL) ++ g_hash_table_insert (device->priv->profiles, ++ p->human_profile, ++ p); + } + /* DEBUG */ -+ GList* final_keys; ++ /*GList* final_keys; + final_keys = g_hash_table_get_keys (device->priv->profiles); + GList* o; + g_debug ("\n\n Profile population \n FOR DEVICE %s", gvc_mixer_ui_device_get_description (device)); @@ -13898,7 +13950,7 @@ + g_debug ("\n key %s against \n profile %s \n", + key, + l->profile); -+ } ++ }*/ + g_hash_table_destroy (profile_descriptions); +} + @@ -14005,10 +14057,10 @@ + return dev->priv->type == UiDeviceOutput; +} + -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-ui-device.h +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-ui-device.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-mixer-ui-device.h 2012-04-10 23:16:37.024159059 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-mixer-ui-device.h 2012-04-27 17:38:46.670336865 +0200 @@ -0,0 +1,74 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */ +/* @@ -14084,10 +14136,10 @@ +G_END_DECLS + +#endif /* _GVC_MIXER_UI_DEVICE_H_ */ -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-pulseaudio-fake.h +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-pulseaudio-fake.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-pulseaudio-fake.h 2012-04-10 23:16:37.024159059 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-pulseaudio-fake.h 2012-04-27 17:38:46.670336865 +0200 @@ -0,0 +1,34 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * @@ -14123,10 +14175,10 @@ +#endif /* WITH_INTROSPECTION */ + +#endif /* __GVC_PULSEAUDIO_FAKE_H */ -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-sound-theme-chooser.c +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-sound-theme-chooser.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-sound-theme-chooser.c 2012-04-10 23:16:37.024159059 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-sound-theme-chooser.c 2012-04-27 17:38:46.670336865 +0200 @@ -0,0 +1,856 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * @@ -14984,10 +15036,10 @@ + NULL); + return GTK_WIDGET (chooser); +} -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-sound-theme-chooser.h +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-sound-theme-chooser.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-sound-theme-chooser.h 2012-04-10 23:16:37.024159059 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-sound-theme-chooser.h 2012-04-27 17:38:46.670336865 +0200 @@ -0,0 +1,54 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * @@ -15043,10 +15095,10 @@ +G_END_DECLS + +#endif /* __GVC_SOUND_THEME_CHOOSER_H */ -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-speaker-test.c +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-speaker-test.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-speaker-test.c 2012-04-10 23:16:37.024159059 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-speaker-test.c 2012-04-27 17:38:46.674336866 +0200 @@ -0,0 +1,531 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * @@ -15579,10 +15631,10 @@ + return GTK_WIDGET (speaker_test); +} + -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-speaker-test.h +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-speaker-test.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-speaker-test.h 2012-04-10 23:16:37.024159059 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-speaker-test.h 2012-04-27 17:38:46.682336867 +0200 @@ -0,0 +1,57 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * @@ -15641,10 +15693,10 @@ +G_END_DECLS + +#endif /* __GVC_SPEAKER_TEST_H */ -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-stream-status-icon.c +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-stream-status-icon.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-stream-status-icon.c 2012-04-10 23:16:37.028159060 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-stream-status-icon.c 2012-04-27 17:38:46.686336867 +0200 @@ -0,0 +1,780 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * @@ -16426,10 +16478,10 @@ + NULL); + return GVC_STREAM_STATUS_ICON (icon); +} -Index: gnome-control-center-3.4.0/panels/sound-nua/gvc-stream-status-icon.h +Index: gnome-control-center-3.4.1/panels/sound-nua/gvc-stream-status-icon.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/gvc-stream-status-icon.h 2012-04-10 23:16:37.028159060 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/gvc-stream-status-icon.h 2012-04-27 17:38:46.706336867 +0200 @@ -0,0 +1,63 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * @@ -16494,10 +16546,10 @@ +G_END_DECLS + +#endif /* __GVC_STREAM_STATUS_ICON_H */ -Index: gnome-control-center-3.4.0/panels/sound-nua/sound-theme-file-utils.c +Index: gnome-control-center-3.4.1/panels/sound-nua/sound-theme-file-utils.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/sound-theme-file-utils.c 2012-04-10 23:16:37.028159060 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/sound-theme-file-utils.c 2012-04-27 17:38:46.710336867 +0200 @@ -0,0 +1,305 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * Copyright (C) 2008 Bastien Nocera @@ -16804,10 +16856,10 @@ + + custom_theme_update_time (); +} -Index: gnome-control-center-3.4.0/panels/sound-nua/sound-theme-file-utils.h +Index: gnome-control-center-3.4.1/panels/sound-nua/sound-theme-file-utils.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gnome-control-center-3.4.0/panels/sound-nua/sound-theme-file-utils.h 2012-04-10 23:16:37.028159060 +0200 ++++ gnome-control-center-3.4.1/panels/sound-nua/sound-theme-file-utils.h 2012-04-27 17:38:46.710336867 +0200 @@ -0,0 +1,37 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * Copyright (C) 2008 Bastien Nocera @@ -16846,10 +16898,10 @@ +void custom_theme_update_time (void); + +#endif /* __SOUND_THEME_FILE_UTILS_HH__ */ -Index: gnome-control-center-3.4.0/panels/sound/data/gnome-sound-panel.desktop.in.in +Index: gnome-control-center-3.4.1/panels/sound/data/gnome-sound-panel.desktop.in.in =================================================================== ---- gnome-control-center-3.4.0.orig/panels/sound/data/gnome-sound-panel.desktop.in.in 2012-02-14 11:13:17.000000000 +0100 -+++ gnome-control-center-3.4.0/panels/sound/data/gnome-sound-panel.desktop.in.in 2012-04-10 23:16:37.028159060 +0200 +--- gnome-control-center-3.4.1.orig/panels/sound/data/gnome-sound-panel.desktop.in.in 2012-03-05 15:04:55.000000000 +0100 ++++ gnome-control-center-3.4.1/panels/sound/data/gnome-sound-panel.desktop.in.in 2012-04-27 17:38:46.710336867 +0200 @@ -7,7 +7,7 @@ Type=Application StartupNotify=true @@ -16859,10 +16911,10 @@ X-GNOME-Bugzilla-Bugzilla=GNOME X-GNOME-Bugzilla-Product=gnome-control-center X-GNOME-Bugzilla-Component=sound -Index: gnome-control-center-3.4.0/panels/universal-access/cc-ua-panel.c +Index: gnome-control-center-3.4.1/panels/universal-access/cc-ua-panel.c =================================================================== ---- gnome-control-center-3.4.0.orig/panels/universal-access/cc-ua-panel.c 2012-04-10 23:16:36.948159056 +0200 -+++ gnome-control-center-3.4.0/panels/universal-access/cc-ua-panel.c 2012-04-10 23:16:38.496159131 +0200 +--- gnome-control-center-3.4.1.orig/panels/universal-access/cc-ua-panel.c 2012-04-27 17:38:46.482336856 +0200 ++++ gnome-control-center-3.4.1/panels/universal-access/cc-ua-panel.c 2012-04-27 17:38:49.058336980 +0200 @@ -589,7 +589,10 @@ CcShell *shell; @@ -16875,10 +16927,10 @@ return TRUE; } -Index: gnome-control-center-3.4.0/shell/gnome-control-center.c +Index: gnome-control-center-3.4.1/shell/gnome-control-center.c =================================================================== ---- gnome-control-center-3.4.0.orig/shell/gnome-control-center.c 2012-04-10 23:16:36.912159054 +0200 -+++ gnome-control-center-3.4.0/shell/gnome-control-center.c 2012-04-10 23:16:38.760159142 +0200 +--- gnome-control-center-3.4.1.orig/shell/gnome-control-center.c 2012-04-27 17:38:46.442336854 +0200 ++++ gnome-control-center-3.4.1/shell/gnome-control-center.c 2012-04-27 17:38:49.322336994 +0200 @@ -887,6 +887,10 @@ GIcon *gicon; GnomeControlCenterPrivate *priv = GNOME_CONTROL_CENTER (shell)->priv; diff -Nru gnome-control-center-3.4.1/debian/patches/deal_with_null_ssid.patch gnome-control-center-3.4.1/debian/patches/deal_with_null_ssid.patch --- gnome-control-center-3.4.1/debian/patches/deal_with_null_ssid.patch 1970-01-01 00:00:00.000000000 +0000 +++ gnome-control-center-3.4.1/debian/patches/deal_with_null_ssid.patch 2012-04-27 16:05:06.000000000 +0000 @@ -0,0 +1,33 @@ +From: Dan Williams +Subject: Avoid crashing when SSIDs are NULL. +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gnome-control-center/+bug/908670 +Bug: https://bugzilla.gnome.org/show_bug.cgi?id=672922 + +--- + panels/network/cc-network-panel.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +Index: b/panels/network/cc-network-panel.c +=================================================================== +--- a/panels/network/cc-network-panel.c ++++ b/panels/network/cc-network-panel.c +@@ -1118,13 +1118,19 @@ panel_get_strongest_unique_aps (const GP + if (aps != NULL) + for (i = 0; i < aps->len; i++) { + ap = NM_ACCESS_POINT (g_ptr_array_index (aps, i)); ++ ++ /* Hidden SSIDs don't get shown in the list */ + ssid = nm_access_point_get_ssid (ap); ++ if (!ssid) ++ continue; ++ + add_ap = TRUE; + + /* get already added list */ + for (j=0; jlen; j++) { + ap_tmp = NM_ACCESS_POINT (g_ptr_array_index (aps_unique, j)); + ssid_tmp = nm_access_point_get_ssid (ap_tmp); ++ g_assert (ssid_tmp); + + /* is this the same type and data? */ + if (nm_utils_same_ssid (ssid, ssid_tmp, TRUE)) { diff -Nru gnome-control-center-3.4.1/debian/patches/series gnome-control-center-3.4.1/debian/patches/series --- gnome-control-center-3.4.1/debian/patches/series 2012-04-16 15:09:42.000000000 +0000 +++ gnome-control-center-3.4.1/debian/patches/series 2012-04-27 16:05:06.000000000 +0000 @@ -35,3 +35,4 @@ classic_use_sound_indicator.patch accounts_fix_unsetting_icon.patch git_wacom_translations.patch +deal_with_null_ssid.patch