? gnome-volume-control.desktop.in
? ~gst-mixer-audigy-fixes-updated.patch
? src/.preferences.c.rej.swp
? src/misc.c
? src/misc.h
Index: src/Makefile.am
===================================================================
RCS file: /cvs/gnome/gnome-media/gst-mixer/src/Makefile.am,v
retrieving revision 1.8
diff -u -p -r1.8 Makefile.am
--- src/Makefile.am	16 Sep 2004 20:20:11 -0000	1.8
+++ src/Makefile.am	19 Dec 2006 14:59:35 -0000
@@ -13,7 +13,8 @@ gnome_volume_control_SOURCES = \
 	preferences.c \
 	track.c \
 	volume.c \
-	window.c
+	window.c \
+	misc.c
 
 noinst_HEADERS = \
 	button.h \
@@ -23,7 +24,8 @@ noinst_HEADERS = \
 	stock.h \
 	track.h \
 	volume.h \
-	window.h
+	window.h \
+	misc.h
 
 gnome_volume_control_LDFLAGS = \
 	$(GSTMIXER_LIBS)
Index: src/element.c
===================================================================
RCS file: /cvs/gnome/gnome-media/gst-mixer/src/element.c,v
retrieving revision 1.8
diff -u -p -r1.8 element.c
--- src/element.c	7 Aug 2006 12:37:25 -0000	1.8
+++ src/element.c	19 Dec 2006 14:59:35 -0000
@@ -30,6 +30,7 @@
 #include "keys.h"
 #include "preferences.h"
 #include "track.h"
+#include "misc.h"
 
 static void	gnome_volume_control_element_class_init	(GnomeVolumeControlElementClass *klass);
 static void	gnome_volume_control_element_init	(GnomeVolumeControlElement *el);
@@ -165,19 +166,6 @@ gnome_volume_control_element_whitelist (
 /*
  * Hide/show notebook page.
  */
-
-static gint
-get_page_num (GstMixerTrack *track)
-{
-  if (GST_IS_MIXER_OPTIONS (track))
-    return 3;
-  else if (track->num_channels == 0)
-    return 2;
-  else if (track->flags & GST_MIXER_TRACK_INPUT)
-    return 1;
-  else
-    return 0;
-}
 
 static void
 update_tab_visibility (GnomeVolumeControlElement *el, gint page)
Index: src/preferences.c
===================================================================
RCS file: /cvs/gnome/gnome-media/gst-mixer/src/preferences.c,v
retrieving revision 1.6
diff -u -p -r1.6 preferences.c
--- src/preferences.c	7 Aug 2006 12:37:25 -0000	1.6
+++ src/preferences.c	19 Dec 2006 14:59:35 -0000
@@ -31,11 +31,13 @@
 #include "preferences.h"
 #include "keys.h"
 #include "track.h"
+#include "misc.h"
 
 enum {
   COL_ACTIVE,
   COL_LABEL,
   COL_TRACK,
+  COL_TYPE,
   NUM_COLS
 };
 
@@ -134,7 +136,7 @@ gnome_volume_control_preferences_init (G
   gtk_widget_show (label);
 
   store = gtk_list_store_new (NUM_COLS, G_TYPE_BOOLEAN,
-			      G_TYPE_STRING, G_TYPE_POINTER);
+			      G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_STRING);
   prefs->treeview = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store));
   gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (prefs->treeview), FALSE);
   gtk_label_set_mnemonic_widget (GTK_LABEL(label), GTK_WIDGET (prefs->treeview));
@@ -145,7 +147,7 @@ gnome_volume_control_preferences_init (G
 				  GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
   gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (view),
 				       GTK_SHADOW_IN);
-  gtk_widget_set_usize (view, -1, 150);
+  gtk_widget_set_size_request (view, -1, 250);
 
   gtk_container_add (GTK_CONTAINER (view), prefs->treeview);
   gtk_box_pack_start (GTK_BOX (box), view, TRUE, TRUE, 0);
@@ -174,6 +176,12 @@ gnome_volume_control_preferences_init (G
 						  NULL);
   gtk_tree_view_append_column (GTK_TREE_VIEW (prefs->treeview), col);
 
+  render = gtk_cell_renderer_text_new ();
+  col = gtk_tree_view_column_new_with_attributes ("Type", render,
+                          "text", COL_TYPE,
+						  NULL);
+  gtk_tree_view_append_column (GTK_TREE_VIEW (prefs->treeview), col);
+
   gtk_tree_view_set_search_column (GTK_TREE_VIEW (prefs->treeview), COL_LABEL);
 
   /* and show */
@@ -300,6 +308,7 @@ gnome_volume_control_preferences_change 
   /* remove old */
   while (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (store), &iter)) {
     gtk_list_store_remove (store, &iter);
+	/* does this free COL_TYPE? */
   }
 
   /* take/put reference */
Index: src/track.c
===================================================================
RCS file: /cvs/gnome/gnome-media/gst-mixer/src/track.c,v
retrieving revision 1.8
diff -u -p -r1.8 track.c
--- src/track.c	15 Apr 2005 12:59:37 -0000	1.8
+++ src/track.c	19 Dec 2006 14:59:35 -0000
@@ -24,6 +24,7 @@
 #endif
 
 #include <gnome.h>
+#include <string.h>
 
 #include "button.h"
 #include "stock.h"
@@ -74,14 +75,29 @@ cb_record_toggled (GnomeVolumeControlBut
 		        gnome_volume_control_button_get_active (button));
 }
 
+/* Tells us whether toggling a switch should change the corresponding
+ * GstMixerTrack's MUTE or RECORD flag.
+ */
+static gboolean
+should_toggle_record_switch (const GstMixerTrack *track)
+{
+  return GST_MIXER_TRACK_HAS_FLAG (track, GST_MIXER_TRACK_INPUT);
+}
+ 
+
 static void
 cb_toggle_changed (GtkToggleButton *button,
 		   gpointer         data)
 {
   GnomeVolumeControlTrack *ctrl = data;
 
-  gst_mixer_set_mute (ctrl->mixer, ctrl->track,
-		      !gtk_toggle_button_get_active (button));
+  if (should_toggle_record_switch (ctrl->track)) {
+    gst_mixer_set_record (ctrl->mixer, ctrl->track,
+      gtk_toggle_button_get_active (button));
+  } else {
+    gst_mixer_set_mute (ctrl->mixer, ctrl->track,
+      !gtk_toggle_button_get_active (button));
+  }
 }
 
 static void
@@ -109,6 +125,14 @@ static gboolean
 cb_check (gpointer data)
 {
   GnomeVolumeControlTrack *trkw = data;
+
+  /* trigger an update of the mixer state */
+  if (! GST_IS_MIXER_OPTIONS (trkw->track)) {
+    gint *dummy = g_new (gint, 1);
+    gst_mixer_get_volume (trkw->mixer, GST_MIXER_TRACK (trkw->track), dummy);
+    g_free (dummy);
+  }
+  
   gboolean mute = GST_MIXER_TRACK_HAS_FLAG (trkw->track,
 				GST_MIXER_TRACK_MUTE) ? TRUE : FALSE,
            record = GST_MIXER_TRACK_HAS_FLAG (trkw->track,
@@ -136,20 +160,20 @@ cb_check (gpointer data)
   }
 
   if (trkw->toggle) {
-    if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (trkw->toggle)) ==
-            mute) {
-      gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (trkw->toggle), !mute);
+    if (should_toggle_record_switch (trkw->track)) {
+      gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (trkw->toggle),
+        GST_MIXER_TRACK_HAS_FLAG (trkw->track, GST_MIXER_TRACK_RECORD));
+    } else {
+      gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (trkw->toggle),
+        !GST_MIXER_TRACK_HAS_FLAG (trkw->track, GST_MIXER_TRACK_MUTE));
     }
   }
 
   /* FIXME:
    * - options.
-   * - we cannot check flags! We need a _get_*() function in the
-   *     mixer interface, because flags don't change if other
-   *     apps change device state.
    */
 
-  return (trkw->mute || trkw->record);
+  return TRUE;
 }
 
 /*
@@ -180,7 +204,7 @@ gnome_volume_control_track_add_title (Gt
   ctrl->visible = TRUE;
   ctrl->table = table;
   ctrl->pos = tab_pos;
-  ctrl->id = g_timeout_add (100, cb_check, ctrl);
+  ctrl->id = g_timeout_add (200, cb_check, ctrl);
 
   /* image (optional) */
   for (i = 0; !found && pix[i].label != NULL; i++) {
@@ -398,9 +422,13 @@ gnome_volume_control_track_add_switch (G
 					       GTK_ORIENTATION_HORIZONTAL,
 					       mixer, track, l_sep, r_sep);
   ctrl->toggle = gtk_check_button_new ();
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ctrl->toggle),
-				!GST_MIXER_TRACK_HAS_FLAG (ctrl->track,
-					GST_MIXER_TRACK_MUTE));
+  if (should_toggle_record_switch (ctrl->track)) {
+    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ctrl->toggle),
+      GST_MIXER_TRACK_HAS_FLAG (ctrl->track, GST_MIXER_TRACK_RECORD));
+  } else {
+    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ctrl->toggle),
+      !GST_MIXER_TRACK_HAS_FLAG (ctrl->track, GST_MIXER_TRACK_MUTE));
+  }
 
   /* attach'n'show */
   gtk_table_attach (GTK_TABLE (table), ctrl->toggle,
