gnome-media r4201 - in trunk/gnome-volume-control: . src



Author: hadess
Date: Tue Feb 17 16:58:41 2009
New Revision: 4201
URL: http://svn.gnome.org/viewvc/gnome-media?rev=4201&view=rev

Log:
2009-02-17  Bastien Nocera  <hadess hadess net>

	* src/gvc-channel-map.c (gvc_channel_map_can_balance),
	(set_from_pa_map):
	* src/gvc-channel-map.h: Add API to detect whether a channel
	map supports balancing
	* src/gvc-mixer-dialog.c (update_output_settings): De-sensitivise
	the balance bar if the output doesn't support balacing



Modified:
   trunk/gnome-volume-control/ChangeLog
   trunk/gnome-volume-control/src/gvc-channel-map.c
   trunk/gnome-volume-control/src/gvc-channel-map.h
   trunk/gnome-volume-control/src/gvc-mixer-dialog.c

Modified: trunk/gnome-volume-control/src/gvc-channel-map.c
==============================================================================
--- trunk/gnome-volume-control/src/gvc-channel-map.c	(original)
+++ trunk/gnome-volume-control/src/gvc-channel-map.c	Tue Feb 17 16:58:41 2009
@@ -38,6 +38,7 @@
         guint                 num_channels;
         pa_channel_position_t positions[PA_CHANNELS_MAX];
         gdouble               gains[PA_CHANNELS_MAX];
+        gboolean              can_balance;
 };
 
 enum {
@@ -74,6 +75,13 @@
         return map->priv->positions;
 }
 
+gboolean
+gvc_channel_map_can_balance (GvcChannelMap  *map)
+{
+        g_return_val_if_fail (GVC_IS_CHANNEL_MAP (map), FALSE);
+        return map->priv->can_balance;
+}
+
 static void
 gvc_channel_map_class_init (GvcChannelMapClass *klass)
 {
@@ -136,6 +144,11 @@
         guint i;
 
         map->priv->num_channels = pa_map->channels;
+#ifdef HAVE_NEW_PULSE
+        map->priv->can_balance = pa_channel_map_can_balance (pa_map);
+#else
+	map->priv->can_balance = TRUE;
+#endif
         for (i = 0; i < pa_map->channels; i++) {
                 map->priv->positions[i] = pa_map->map[i];
                 map->priv->gains[i] = 1.0;

Modified: trunk/gnome-volume-control/src/gvc-channel-map.h
==============================================================================
--- trunk/gnome-volume-control/src/gvc-channel-map.h	(original)
+++ trunk/gnome-volume-control/src/gvc-channel-map.h	Tue Feb 17 16:58:41 2009
@@ -54,6 +54,7 @@
 guint                   gvc_channel_map_get_num_channels        (GvcChannelMap  *map);
 pa_channel_position_t * gvc_channel_map_get_positions           (GvcChannelMap  *map);
 gdouble *               gvc_channel_map_get_gains               (GvcChannelMap  *map);
+gboolean                gvc_channel_map_can_balance             (GvcChannelMap  *map);
 
 void                    gvc_channel_map_gains_changed           (GvcChannelMap  *map);
 

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 Feb 17 16:58:41 2009
@@ -169,6 +169,9 @@
                             dialog->priv->output_balance_bar,
                             FALSE, FALSE, 12);
         gtk_widget_show (dialog->priv->output_balance_bar);
+
+        /* We could make this into a "No settings" label instead */
+        gtk_widget_set_sensitive (dialog->priv->output_balance_bar, gvc_channel_map_can_balance (map));
 }
 
 static void



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