--- gnome-media-2.14.2/gst-mixer/src/track.h-orig	2006-08-07 19:05:55.657032000 -0500
+++ gnome-media-2.14.2/gst-mixer/src/track.h	2006-08-07 19:25:15.629837000 -0500
@@ -47,7 +47,8 @@ typedef struct _GnomeVolumeControlTrack 
 	    *sliderbox,
 	    *buttonbox,
 	    *toggle,
-	    *options;
+	    *options,
+	    *flagbuttonbox;
 
   GnomeVolumeControlButton *mute, *record;
 
--- gnome-media-2.14.2/gst-mixer/src/track.c-orig	2006-08-07 18:19:33.926545000 -0500
+++ gnome-media-2.14.2/gst-mixer/src/track.c	2006-08-07 19:54:35.243313000 -0500
@@ -19,6 +19,11 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#ifdef __sun
+#include <fcntl.h>
+#include <sys/audio.h>
+#endif
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -101,6 +106,136 @@ cb_option_changed (GtkComboBox *box,
   }
 }
 
+#ifdef __sun
+static gint mixer_fd;
+static GtkWidget *in_checkbox_separator;
+static GtkWidget *out_checkbox_separator;
+static gboolean out_switch_display     = FALSE;
+static gboolean in_switch_display      = FALSE;
+static GtkWidget *out_speaker_button   = NULL;
+static GtkWidget *out_headphone_button = NULL;
+static GtkWidget *out_lineout_button   = NULL;
+static GtkWidget *out_spdif_button     = NULL;
+static GtkWidget *out_aux1_button      = NULL;
+static GtkWidget *out_aux2_button      = NULL;
+static GtkWidget *in_microphone_button = NULL;
+static GtkWidget *in_line_in_button    = NULL;
+static GtkWidget *in_cd_button         = NULL;
+static GtkWidget *in_spdif_button      = NULL;
+static GtkWidget *in_aux1_button       = NULL;
+static GtkWidget *in_aux2_button       = NULL;
+static GtkWidget *in_codec_button      = NULL;
+
+static void
+sun_out_button_cb (GtkToggleButton *tb, gpointer data)
+{
+   audio_info_t ainfo;
+   int ret;
+
+   AUDIO_INITINFO (&ainfo);
+
+   if (ioctl (mixer_fd, AUDIO_GETINFO, &ainfo) < 0)
+      g_warning ("Error setting audio device information");
+
+   if (out_speaker_button != NULL) {
+      if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (out_speaker_button)))
+         ainfo.play.port |= AUDIO_SPEAKER;
+      else
+         ainfo.play.port &= ~AUDIO_SPEAKER;
+   }
+
+   if (out_headphone_button != NULL) {
+      if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (out_headphone_button)))
+         ainfo.play.port |= AUDIO_HEADPHONE;
+      else
+         ainfo.play.port &= ~AUDIO_HEADPHONE;
+   }
+      
+   if (out_lineout_button != NULL) {
+      if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (out_lineout_button)))
+         ainfo.play.port |= AUDIO_LINE_OUT;
+      else
+         ainfo.play.port &= ~AUDIO_LINE_OUT;
+   }
+
+   if (out_spdif_button != NULL) {
+      if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (out_spdif_button)))
+         ainfo.play.port |= AUDIO_SPDIF_OUT;
+      else
+         ainfo.play.port &= ~AUDIO_SPDIF_OUT;
+   }
+
+   if (out_aux1_button != NULL) {
+      if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (out_aux1_button)))
+         ainfo.play.port |= AUDIO_AUX1_OUT;
+      else
+         ainfo.play.port &= ~AUDIO_AUX1_OUT;
+   }
+
+   if (out_aux2_button != NULL) {
+      if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (out_aux2_button)))
+         ainfo.play.port |= AUDIO_AUX2_OUT;
+      else
+         ainfo.play.port &= ~AUDIO_AUX2_OUT;
+   }
+
+   if (ioctl (mixer_fd, AUDIO_SETINFO, &ainfo) < 0)
+      g_warning ("Error setting audio device information");
+}
+
+static void
+sun_in_button_cb (GtkToggleButton *tb, gpointer data)
+{
+   audio_info_t ainfo;
+   int ret;
+
+   AUDIO_INITINFO (&ainfo);
+
+   if (ioctl (mixer_fd, AUDIO_GETINFO, &ainfo) < 0)
+      g_warning ("Error getting audio device information");
+
+   if (in_microphone_button != NULL &&
+       tb == GTK_TOGGLE_BUTTON (in_microphone_button)) {
+      if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (in_microphone_button)))
+         ainfo.record.port = AUDIO_MICROPHONE;
+   }
+
+   if (in_line_in_button != NULL &&
+       tb == GTK_TOGGLE_BUTTON (in_line_in_button)) {
+      if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (in_line_in_button)))
+         ainfo.record.port = AUDIO_LINE_IN;
+   }
+
+   if (in_cd_button != NULL && tb == GTK_TOGGLE_BUTTON (in_cd_button)) {
+      if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (in_cd_button)))
+         ainfo.record.port = AUDIO_CD;
+   }
+
+   if (in_spdif_button != NULL && tb == GTK_TOGGLE_BUTTON (in_spdif_button)) {
+      if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (in_spdif_button)))
+         ainfo.record.port = AUDIO_SPDIF_IN;
+   }
+
+   if (in_aux1_button != NULL && tb == GTK_TOGGLE_BUTTON (in_aux1_button)) {
+      if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (in_aux1_button)))
+         ainfo.record.port = AUDIO_AUX1_IN;
+   }
+
+   if (in_aux2_button != NULL && tb == GTK_TOGGLE_BUTTON (in_aux2_button)) {
+      if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (in_aux2_button)))
+         ainfo.record.port = AUDIO_AUX2_IN;
+   }
+
+   if (in_codec_button != NULL && tb == GTK_TOGGLE_BUTTON (in_codec_button)) {
+      if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (in_codec_button)))
+         ainfo.record.port = AUDIO_CODEC_LOOPB_IN;
+   }
+
+   if (ioctl (mixer_fd, AUDIO_SETINFO, &ainfo) < 0)
+      g_warning ("Error setting audio device information");
+}
+#endif
+
 /*
  * Timeout to check for changes in mixer outside ourselves.
  */
@@ -149,6 +284,112 @@ cb_check (gpointer data)
    *     apps change device state.
    */
 
+#ifdef __sun
+  /*
+   * Update the Sun flag buttons, if they change.
+   */
+   {
+      audio_info_t ainfo;
+      int ret;
+
+      if (ioctl (mixer_fd, AUDIO_GETINFO, &ainfo) < 0)
+         g_warning ("Error setting audio device volume");
+
+      if (out_speaker_button != NULL &&
+          (ainfo.play.avail_ports & AUDIO_SPEAKER) &&
+          gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (out_speaker_button)) !=
+          (ainfo.play.port & AUDIO_SPEAKER)) {
+            gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (out_speaker_button),
+               (ainfo.play.port & AUDIO_SPEAKER));
+      }
+
+      if (out_headphone_button != NULL &&
+          (ainfo.play.avail_ports & AUDIO_HEADPHONE) &&
+          gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (out_headphone_button)) !=
+          (ainfo.play.port & AUDIO_HEADPHONE)) {
+         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (out_headphone_button),
+            (ainfo.play.port & AUDIO_HEADPHONE));
+      }
+
+      if (out_lineout_button != NULL && (ainfo.play.avail_ports & AUDIO_LINE_OUT) &&
+          gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (out_lineout_button)) !=
+          (ainfo.play.port & AUDIO_LINE_OUT)) {
+         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (out_lineout_button),
+            (ainfo.play.port & AUDIO_LINE_OUT));
+      }
+
+      if (out_spdif_button != NULL && (ainfo.play.avail_ports & AUDIO_SPDIF_OUT) &&
+          gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (out_spdif_button)) !=
+          (ainfo.play.port & AUDIO_SPDIF_OUT)) {
+         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (out_spdif_button),
+            (ainfo.play.port & AUDIO_SPDIF_OUT));
+      }
+
+      if (out_aux1_button != NULL && (ainfo.play.avail_ports & AUDIO_AUX1_OUT) &&
+          gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (out_aux1_button)) !=
+          (ainfo.play.port & AUDIO_AUX1_OUT)) {
+         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (out_aux1_button),
+            (ainfo.play.port & AUDIO_AUX1_OUT));
+      }
+
+      if (out_aux2_button != NULL && (ainfo.play.avail_ports & AUDIO_AUX2_OUT) &&
+          gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (out_aux2_button)) !=
+          (ainfo.play.port & AUDIO_AUX2_OUT)) {
+         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (out_aux2_button),
+            (ainfo.play.port & AUDIO_AUX2_OUT));
+      }
+
+      if (in_microphone_button != NULL && (ainfo.record.avail_ports & AUDIO_MICROPHONE) &&
+          gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (in_microphone_button)) !=
+          (ainfo.record.port & AUDIO_MICROPHONE)) {
+         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (in_microphone_button),
+            (ainfo.record.port & AUDIO_MICROPHONE));
+      }
+
+      if (in_line_in_button != NULL && (ainfo.record.avail_ports & AUDIO_LINE_IN) &&
+          gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (in_line_in_button)) !=
+          (ainfo.record.port & AUDIO_LINE_IN)) {
+         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (in_line_in_button),
+            (ainfo.record.port & AUDIO_LINE_IN));
+      }
+
+      if (in_cd_button != NULL && (ainfo.record.avail_ports & AUDIO_CD) &&
+          gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (in_cd_button)) !=
+          (ainfo.record.port & AUDIO_CD)) {
+         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (in_cd_button),
+            (ainfo.record.port & AUDIO_CD));
+      }
+
+      if (in_spdif_button != NULL && (ainfo.record.avail_ports & AUDIO_SPDIF_IN) &&
+          gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (in_spdif_button)) !=
+          (ainfo.record.port & AUDIO_SPDIF_IN)) {
+         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (in_spdif_button),
+            (ainfo.record.port & AUDIO_SPDIF_IN));
+      }
+
+      if (in_aux1_button != NULL && (ainfo.record.avail_ports & AUDIO_AUX1_IN) &&
+          gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (in_aux1_button)) !=
+          (ainfo.record.port & AUDIO_AUX1_IN)) {
+         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (in_aux1_button),
+            (ainfo.record.port & AUDIO_AUX1_IN));
+      }
+
+      if (in_aux2_button != NULL && (ainfo.record.avail_ports & AUDIO_AUX2_IN) &&
+          gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (in_aux2_button)) !=
+          (ainfo.record.port & AUDIO_AUX2_IN)) {
+         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (in_aux2_button),
+            (ainfo.record.port & AUDIO_AUX2_IN));
+      }
+
+      if (in_codec_button != NULL && (ainfo.record.avail_ports & AUDIO_CODEC_LOOPB_IN) &&
+          gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (in_codec_button)) !=
+          (ainfo.record.port & AUDIO_CODEC_LOOPB_IN)) {
+         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (in_codec_button),
+            (ainfo.record.port & AUDIO_CODEC_LOOPB_IN));
+      }
+   }
+#endif
+
   return (trkw->mute || trkw->record);
 }
 
@@ -181,6 +422,7 @@ gnome_volume_control_track_add_title (Gt
   ctrl->table = table;
   ctrl->pos = tab_pos;
   ctrl->id = g_timeout_add (100, cb_check, ctrl);
+  ctrl->flagbuttonbox = NULL;
 
   /* image (optional) */
   for (i = 0; !found && pix[i].label != NULL; i++) {
@@ -323,6 +565,105 @@ gnome_volume_control_track_add_playback	
   /* mute button */
   gnome_volume_control_track_put_switch (table, tab_pos, ctrl, appbar);
 
+#ifdef __sun
+  /*
+   * Only create the flagbuttonbox once.
+   */
+  if (out_switch_display == FALSE) {
+     audio_info_t ainfo;
+     const char *audiodev;
+
+     out_switch_display  = TRUE;
+     ctrl->flagbuttonbox = gtk_vbox_new (FALSE, 0);
+
+     audiodev = g_getenv ("AUDIODEV");
+     if (audiodev == NULL) {
+       mixer_fd = open ("/dev/audioctl", O_RDWR | O_NONBLOCK);
+     } else {
+       gchar *device = g_strdup_printf ("/dev/%sctl", audiodev);
+       mixer_fd = open (device, O_RDWR | O_NONBLOCK);
+       g_free (device);
+     }
+
+     if (ioctl (mixer_fd, AUDIO_GETINFO, &ainfo) < 0)
+        g_warning ("Error setting audio device volume");
+
+     out_checkbox_separator = gtk_hseparator_new ();
+
+     gtk_widget_show (out_checkbox_separator);
+     gtk_box_pack_start (GTK_BOX (ctrl->flagbuttonbox), out_checkbox_separator,
+			 FALSE, FALSE, 0);
+
+     if (ainfo.play.avail_ports & AUDIO_SPEAKER) {
+        out_speaker_button = gtk_check_button_new_with_mnemonic (_("_Built-in Speaker"));
+        gtk_box_pack_start (GTK_BOX (ctrl->flagbuttonbox), out_speaker_button,
+		            FALSE, FALSE, 0);
+        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (out_speaker_button),
+           ainfo.play.port & AUDIO_SPEAKER);
+        gtk_widget_show (out_speaker_button);
+        g_signal_connect (G_OBJECT (out_speaker_button), "toggled",
+           G_CALLBACK (sun_out_button_cb), NULL);
+     }
+
+     if (ainfo.play.avail_ports & AUDIO_HEADPHONE) {
+        /* Set mnemonic to "P" since "H" is already used by Help menu item */
+        out_headphone_button = gtk_check_button_new_with_mnemonic (_("Head_phone"));
+        gtk_box_pack_start (GTK_BOX (ctrl->flagbuttonbox), out_headphone_button,
+		            FALSE, FALSE, 0);
+        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (out_headphone_button),
+           ainfo.play.port & AUDIO_HEADPHONE);
+        gtk_widget_show (out_headphone_button);
+        g_signal_connect (G_OBJECT (out_headphone_button), "toggled",
+           G_CALLBACK (sun_out_button_cb), NULL);
+     }
+
+     if (ainfo.play.avail_ports & AUDIO_LINE_OUT) {
+        out_lineout_button = gtk_check_button_new_with_mnemonic (_("_Line Out"));
+        gtk_box_pack_start (GTK_BOX (ctrl->flagbuttonbox), out_lineout_button,
+		            FALSE, FALSE, 0);
+        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (out_lineout_button),
+           ainfo.play.port & AUDIO_LINE_OUT);
+        gtk_widget_show (out_lineout_button);
+        g_signal_connect (G_OBJECT (out_lineout_button), "toggled",
+           G_CALLBACK (sun_out_button_cb), NULL);
+     }
+
+     if (ainfo.play.avail_ports & AUDIO_SPDIF_OUT) {
+        out_spdif_button = gtk_check_button_new_with_mnemonic (_("_SPDIF Out"));
+        gtk_box_pack_start (GTK_BOX (ctrl->flagbuttonbox), out_spdif_button,
+		            FALSE, FALSE, 0);
+        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (out_spdif_button),
+           ainfo.play.port & AUDIO_SPDIF_OUT);
+        gtk_widget_show (out_spdif_button);
+        g_signal_connect (G_OBJECT (out_spdif_button), "toggled",
+           G_CALLBACK (sun_out_button_cb), NULL);
+     }
+
+     if (ainfo.play.avail_ports & AUDIO_AUX1_OUT) {
+        out_aux1_button = gtk_check_button_new_with_mnemonic (_("AUX_1 Out"));
+        gtk_box_pack_start (GTK_BOX (ctrl->flagbuttonbox), out_aux1_button,
+		            FALSE, FALSE, 0);
+        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (out_aux1_button),
+           ainfo.play.port & AUDIO_AUX1_OUT);
+        gtk_widget_show (out_aux1_button);
+        g_signal_connect (G_OBJECT (out_aux1_button), "toggled",
+           G_CALLBACK (sun_out_button_cb), NULL);
+     }
+
+     if (ainfo.play.avail_ports & AUDIO_AUX2_OUT) {
+        out_aux2_button = gtk_check_button_new_with_mnemonic (_("AUX_2 Out"));
+        gtk_box_pack_start (GTK_BOX (ctrl->flagbuttonbox), out_aux2_button,
+		            FALSE, FALSE, 0);
+        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (out_aux2_button),
+           ainfo.play.port & AUDIO_AUX2_OUT);
+        gtk_widget_show (out_aux2_button);
+        g_signal_connect (G_OBJECT (out_aux2_button), "toggled",
+           G_CALLBACK (sun_out_button_cb), NULL);
+     }
+     gtk_widget_show (ctrl->flagbuttonbox);
+  }
+#endif
+
   return ctrl;
 }
 
@@ -352,6 +693,7 @@ gnome_volume_control_track_add_capture (
    *     is always FALSE.
    */
 
+#ifndef __sun
   /* only the record button here */
   msg = g_strdup_printf (_("Toggle audio capture from %s"), ctrl->track->label);
   button = gnome_volume_control_button_new (GNOME_VOLUME_CONTROL_STOCK_RECORD,
@@ -379,6 +721,153 @@ gnome_volume_control_track_add_capture (
 		      FALSE, FALSE, 0);
   gtk_widget_show (button);
 
+#else
+  /*
+   * Only create the flagbuttonbox once.
+   *
+   * Note that we do not want to show the record button on Solaris,
+   * since this is managed by the flagbuttons defined below.
+   */
+  if (in_switch_display == FALSE) {
+     audio_info_t ainfo;
+     const char *audiodev;
+     GtkRadioButton *first_button = NULL;
+
+     in_switch_display   = TRUE;
+     ctrl->flagbuttonbox = gtk_vbox_new (FALSE, 0);
+
+     audiodev = g_getenv ("AUDIODEV");
+     if (audiodev == NULL) {
+       mixer_fd = open ("/dev/audioctl", O_RDWR | O_NONBLOCK);
+     } else {
+       gchar *device = g_strdup_printf ("/dev/%sctl", audiodev);
+       mixer_fd = open (device, O_RDWR | O_NONBLOCK);
+       g_free (device);
+     }
+
+     if (ioctl (mixer_fd, AUDIO_GETINFO, &ainfo) < 0)
+        g_warning ("Error setting audio device volume");
+
+     in_checkbox_separator = gtk_hseparator_new ();
+
+     gtk_widget_show (in_checkbox_separator);
+     gtk_box_pack_start (GTK_BOX (ctrl->flagbuttonbox), in_checkbox_separator,
+                         FALSE, FALSE, 0);
+
+     if (ainfo.record.avail_ports & AUDIO_MICROPHONE) {
+        in_microphone_button = gtk_radio_button_new_with_mnemonic (NULL, _("Micro_phone"));
+        first_button = GTK_RADIO_BUTTON (in_microphone_button);
+        gtk_box_pack_start (GTK_BOX (ctrl->flagbuttonbox), in_microphone_button,
+                            FALSE, FALSE, 0);
+        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (in_microphone_button),
+           ainfo.record.port & AUDIO_MICROPHONE);
+        gtk_widget_show (in_microphone_button);
+        g_signal_connect (G_OBJECT (in_microphone_button), "toggled",
+           G_CALLBACK (sun_in_button_cb), NULL);
+     }
+     if (ainfo.record.avail_ports & AUDIO_LINE_IN) {
+        if (first_button != NULL) {
+           in_line_in_button = gtk_radio_button_new_with_mnemonic_from_widget
+              (first_button, _("_Line In"));
+        } else {
+           in_line_in_button = gtk_radio_button_new_with_mnemonic (NULL, _("_Line In"));
+           first_button = GTK_RADIO_BUTTON (in_line_in_button);
+        }
+        first_button = GTK_RADIO_BUTTON (in_line_in_button);
+        gtk_box_pack_start (GTK_BOX (ctrl->flagbuttonbox), in_line_in_button,
+                            FALSE, FALSE, 0);
+        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (in_line_in_button),
+           ainfo.record.port & AUDIO_LINE_IN);
+        gtk_widget_show (in_line_in_button);
+        g_signal_connect (G_OBJECT (in_line_in_button), "toggled",
+           G_CALLBACK (sun_in_button_cb), NULL);
+     }
+     if (ainfo.record.avail_ports & AUDIO_CD) {
+        if (first_button != NULL) {
+           in_cd_button = gtk_radio_button_new_with_mnemonic_from_widget
+              (first_button, _("_Internal CD"));
+        } else {
+           in_cd_button = gtk_radio_button_new_with_mnemonic (NULL, _("_Internal CD"));
+           first_button = GTK_RADIO_BUTTON (in_cd_button);
+        }
+        first_button = GTK_RADIO_BUTTON (in_cd_button);
+        gtk_box_pack_start (GTK_BOX (ctrl->flagbuttonbox), in_cd_button,
+                            FALSE, FALSE, 0);
+        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (in_cd_button),
+           ainfo.record.port & AUDIO_CD);
+        gtk_widget_show (in_cd_button);
+        g_signal_connect (G_OBJECT (in_cd_button), "toggled",
+           G_CALLBACK (sun_in_button_cb), NULL);
+     }
+     if (ainfo.record.avail_ports & AUDIO_SPDIF_IN) {
+        if (first_button != NULL) {
+           in_spdif_button = gtk_radio_button_new_with_mnemonic_from_widget
+              (first_button, _("_SPDIF In"));
+        } else {
+           in_spdif_button = gtk_radio_button_new_with_mnemonic (NULL, _("_SPDIF In"));
+           first_button = GTK_RADIO_BUTTON (in_spdif_button);
+        }
+
+        gtk_box_pack_start (GTK_BOX (ctrl->flagbuttonbox), in_spdif_button,
+                            FALSE, FALSE, 0);
+        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (in_spdif_button),
+           ainfo.record.port & AUDIO_SPDIF_IN);
+        gtk_widget_show (in_spdif_button);
+        g_signal_connect (G_OBJECT (in_spdif_button), "toggled",
+           G_CALLBACK (sun_in_button_cb), NULL);
+     }
+     if (ainfo.record.avail_ports & AUDIO_AUX1_IN) {
+        if (first_button != NULL) {
+           in_aux1_button = gtk_radio_button_new_with_mnemonic_from_widget
+              (first_button, _("AUX_1 Input"));
+        } else {
+           in_aux1_button = gtk_radio_button_new_with_mnemonic (NULL, _("AUX_1 Input"));
+           first_button = GTK_RADIO_BUTTON (in_aux1_button);
+        }
+        gtk_box_pack_start (GTK_BOX (ctrl->flagbuttonbox), in_aux1_button,
+                            FALSE, FALSE, 0);
+        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (in_aux1_button),
+           ainfo.record.port & AUDIO_AUX1_IN);
+        gtk_widget_show (in_aux1_button);
+        g_signal_connect (G_OBJECT (in_aux1_button), "toggled",
+           G_CALLBACK (sun_in_button_cb), NULL);
+     }
+     if (ainfo.record.avail_ports & AUDIO_AUX2_IN) {
+        if (first_button != NULL) {
+           in_aux2_button = gtk_radio_button_new_with_mnemonic_from_widget
+              (first_button, _("AUX_2 Input"));
+        } else {
+           in_aux2_button = gtk_radio_button_new_with_mnemonic (NULL, _("AUX_2 Input"));
+           first_button = GTK_RADIO_BUTTON (in_aux2_button);
+        }
+        gtk_box_pack_start (GTK_BOX (ctrl->flagbuttonbox), in_aux2_button,
+                            FALSE, FALSE, 0);
+        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (in_aux2_button),
+           ainfo.record.port & AUDIO_AUX2_IN);
+        gtk_widget_show (in_aux2_button);
+        g_signal_connect (G_OBJECT (in_aux2_button), "toggled",
+           G_CALLBACK (sun_in_button_cb), NULL);
+     }
+     if (ainfo.record.avail_ports & AUDIO_CODEC_LOOPB_IN) {
+        if (first_button != NULL) {
+           in_codec_button = gtk_radio_button_new_with_mnemonic_from_widget
+              (first_button, _("_Codec Loopback"));
+        } else {
+           in_codec_button = gtk_radio_button_new_with_mnemonic (NULL, _("_Codec Loopback"));
+           first_button = GTK_RADIO_BUTTON (in_codec_button);
+        }
+        gtk_box_pack_start (GTK_BOX (ctrl->flagbuttonbox), in_codec_button,
+                            FALSE, FALSE, 0);
+        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (in_codec_button),
+           ainfo.record.port & AUDIO_CODEC_LOOPB_IN);
+        gtk_widget_show (in_codec_button);
+        g_signal_connect (G_OBJECT (in_codec_button), "toggled",
+           G_CALLBACK (sun_in_button_cb), NULL);
+     }
+     gtk_widget_show (ctrl->flagbuttonbox);
+  }
+#endif
+
   return ctrl;
 }
 
--- gnome-media-2.14.2/gst-mixer/src/element.c-orig	2006-08-07 18:31:03.147709000 -0500
+++ gnome-media-2.14.2/gst-mixer/src/element.c	2006-08-07 19:56:48.199998000 -0500
@@ -215,7 +215,7 @@ gnome_volume_control_element_change (Gno
 {
   struct {
     gchar *label;
-    GtkWidget *page, *old_sep, *new_sep;
+    GtkWidget *page, *flagbuttonbox, *old_sep, *new_sep;
     gboolean use;
     gint pos, height, width;
     GnomeVolumeControlTrack * (* get_track_widget) (GtkTable      *table,
@@ -226,13 +226,13 @@ gnome_volume_control_element_change (Gno
 						    GtkWidget     *right_sep,
 						    GnomeAppBar   *appbar);
   } content[4] = {
-    { _("Playback"), NULL, NULL, NULL, FALSE, 0, 5, 1,
+    { _("Playback"), NULL, NULL, NULL, NULL, FALSE, 0, 5, 1,
       gnome_volume_control_track_add_playback },
-    { _("Capture"),  NULL, NULL, NULL, FALSE, 0, 5, 1,
+    { _("Capture"),  NULL, NULL, NULL, NULL, FALSE, 0, 5, 1,
       gnome_volume_control_track_add_capture },
-    { _("Switches"), NULL, NULL, NULL, FALSE, 0, 1, 3,
+    { _("Switches"), NULL, NULL, NULL, NULL, FALSE, 0, 1, 3,
       gnome_volume_control_track_add_switch },
-    { _("Options"),  NULL, NULL, NULL, FALSE, 0, 1, 3,
+    { _("Options"),  NULL, NULL, NULL, NULL, FALSE, 0, 1, 3,
       gnome_volume_control_track_add_option }
   };
   gvc_whitelist list[] = whitelist_init_list;
@@ -316,6 +316,10 @@ gnome_volume_control_element_change (Gno
 					el->appbar);
     gnome_volume_control_track_show (trkw, active);
 
+    /* Only the first trkw on the page will return flagbuttonbox */
+    if (trkw->flagbuttonbox != NULL)
+       content[i].flagbuttonbox = trkw->flagbuttonbox;
+
     g_object_set_data (G_OBJECT (track),
 		       "gnome-volume-control-trkw", trkw);
 
@@ -359,8 +363,17 @@ gnome_volume_control_element_change (Gno
     viewport = gtk_viewport_new (hadjustment, vadjustment);
     gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport), GTK_SHADOW_NONE);
 
-    gtk_container_add (GTK_CONTAINER (viewport), content[i].page);
-    gtk_container_add (GTK_CONTAINER (view), viewport);
+    if (content[i].flagbuttonbox != NULL) {
+       GtkWidget *vbox = gtk_vbox_new (FALSE, 0);
+       gtk_box_pack_start (GTK_BOX (vbox), content[i].page, TRUE, TRUE, 6);
+       gtk_box_pack_start (GTK_BOX (vbox), content[i].flagbuttonbox, FALSE, FALSE, 6);
+       gtk_widget_show (vbox);
+       gtk_container_add (GTK_CONTAINER (viewport), vbox);
+       gtk_container_add (GTK_CONTAINER (view), viewport);
+    } else {
+       gtk_container_add (GTK_CONTAINER (viewport), content[i].page);
+       gtk_container_add (GTK_CONTAINER (view), viewport);
+    }
 
     label = gtk_label_new (content[i].label);
     gtk_notebook_append_page (GTK_NOTEBOOK (el), view, label);
