--- a/patches/gnome-desktop-01-jds-about-branding.diff Thu Sep 27 20:02:39 2007 +0000
+++ b/patches/gnome-desktop-01-jds-about-branding.diff Thu Sep 27 22:30:33 2007 +0000
@@ -123,9 +123,15 @@
+Vishnu Kumar
+Yogeesh MB
diff -urN gnome-desktop-2.19.5/gnome-about/gnome-about.c gnome-desktop-2.19.5-hacked/gnome-about/gnome-about.c
---- gnome-desktop-2.19.5/gnome-about/gnome-about.c 2006-02-27 13:27:13.000000000 +1300
-+++ gnome-desktop-2.19.5-hacked/gnome-about/gnome-about.c 2006-04-28 12:31:36.874015000 +1200
-@@ -55,6 +55,9 @@
+--- gnome-desktop-2.20.0/gnome-about/gnome-about.c-orig 2007-09-26 16:16:27.836390000 -0500
++++ gnome-desktop-2.20.0/gnome-about/gnome-about.c 2007-09-26 16:14:08.394970000 -0500
+@@ -50,11 +50,14 @@
+
+ /* pick some good defaults */
+ static gdouble canvas_width = 550.0;
+-static gdouble canvas_height = 350.0;
++static gdouble canvas_height = 400.0;
+
static char **introduction_messages = NULL;
static GnomeCanvasItem *subheader = NULL;
@@ -135,16 +141,29 @@
static gdouble version_info_height = 0.0;
static gint contrib_i = 0;
-@@ -318,7 +321,7 @@
+@@ -321,8 +324,8 @@ display_introduction_message (gpointer d
+ "fill_color", "White",
+ "x1", -4.0,
+ "y1", -4.0,
+- "x2", 304.0,
+- "y2", 84.0,
++ "x2", 404.0,
++ "y2", 184.0,
+ NULL);
+
+ intro_text =
+@@ -331,8 +334,8 @@ display_introduction_message (gpointer d
"text", introduction_messages[intro_i],
"editable", FALSE,
/* FIXME */
- "width", 300.0,
-+ "width", 380.0,
- "height", 80.0,
+- "height", 80.0,
++ "width", 400.0,
++ "height",180.0,
"grow_height", TRUE,
"cursor_visible", FALSE,
-@@ -501,6 +504,7 @@
+ NULL);
+@@ -515,6 +518,7 @@ typedef struct {
const gchar *text;
const gchar *url;
@@ -152,7 +171,7 @@
} HRefItem;
static gboolean
-@@ -527,18 +531,39 @@
+@@ -541,18 +545,39 @@ href_item_event_callback (GnomeCanvasIte
case GDK_BUTTON_PRESS: {
GError *error= NULL;
@@ -202,7 +221,7 @@
return TRUE;
}
-@@ -553,6 +578,7 @@
+@@ -567,6 +592,7 @@ static HRefItem *
href_item_new (GnomeCanvasGroup *group,
const gchar *text,
const gchar *url,
@@ -210,7 +229,7 @@
gdouble *current_x,
gdouble *current_y)
{
-@@ -562,6 +588,7 @@
+@@ -576,6 +602,7 @@ href_item_new (GnomeCanvasGroup *group,
item = g_new0 (HRefItem, 1);
item->text = g_strdup (text);
item->url = g_strdup (url);
@@ -218,7 +237,7 @@
item->item =
gnome_canvas_item_new (group,
-@@ -750,8 +777,8 @@
+@@ -765,8 +792,8 @@ create_date_string (const char *value)
g_date_set_dmy (date, day, month, year);
@@ -229,7 +248,7 @@
g_date_free (date);
-@@ -823,6 +824,7 @@
+@@ -787,6 +814,7 @@ get_version_info (char **version_string,
char *platform = NULL;
char *minor = NULL;
char *micro = NULL;
@@ -237,7 +256,7 @@
file = gnome_program_locate_file (NULL,
GNOME_FILE_DOMAIN_APP_DATADIR,
-@@ -866,6 +868,8 @@
+@@ -830,6 +858,8 @@ get_version_info (char **version_string,
*distributor_string = g_strdup (value);
else if (!g_ascii_strcasecmp (name, "date") && value && value[0])
*build_date_string = create_date_string (value);
@@ -246,7 +265,7 @@
bits = bits->next;
xmlFree (value);
-@@ -880,7 +884,7 @@
+@@ -844,7 +874,7 @@ get_version_info (char **version_string,
*version_string = g_strconcat (platform, ".", minor, NULL);
if (!*version_string)
@@ -255,7 +274,7 @@
micro, NULL);
g_free (platform);
-@@ -923,6 +924,7 @@
+@@ -884,6 +914,7 @@ display_version_info (GnomeCanvasGroup *
{
char *version_string = NULL;
char *distributor_string = NULL;
@@ -263,7 +282,7 @@
char *build_date_string = NULL;
char *format = NULL;
char *text = NULL;
-@@ -939,22 +943,39 @@
+@@ -903,22 +934,39 @@ display_version_info (GnomeCanvasGroup *
format = g_strdup_printf ("<b>%s</b>%%s", _("%s: "));
@@ -313,7 +332,7 @@
height += tmp + 4.0;
}
-@@ -997,8 +1018,8 @@
+@@ -961,8 +1009,8 @@ display_version_info (GnomeCanvasGroup *
}
g_free (format);
@@ -323,7 +342,7 @@
g_free (build_date_string);
gnome_canvas_item_set (info, "y", canvas_height - height, NULL);
-@@ -919,7 +965,7 @@
+@@ -976,7 +1024,7 @@ create_canvas (void)
GtkWidget *canvas;
HRefItem *href;
@@ -332,7 +351,7 @@
GnomeCanvasItem *item;
GnomeCanvasGroup *root;
-@@ -972,8 +1018,10 @@
+@@ -1029,8 +1077,10 @@ create_canvas (void)
current_y = (gdouble)gdk_pixbuf_get_height (header) + 5.0;
href = href_item_new (root,
@@ -345,7 +364,7 @@
¤t_x, ¤t_y);
/* make a nice guess for the dot delta */
-@@ -986,8 +1034,10 @@
+@@ -1043,8 +1093,10 @@ create_canvas (void)
/* and more items on a likewise way.
*/
href = href_item_new (root,
@@ -358,7 +377,7 @@
¤t_x, ¤t_y);
item = create_dot (root, ¤t_x, ¤t_y, dot_delta);
-@@ -997,29 +1047,43 @@
+@@ -1054,29 +1106,43 @@ create_canvas (void)
*/
href = href_item_new (root,
_("Software"),
@@ -411,7 +430,7 @@
gnome_canvas_set_scroll_region (GNOME_CANVAS (canvas), 0, 0,
canvas_width, canvas_height);
gtk_widget_set_size_request (GTK_WIDGET (canvas),
-@@ -1029,7 +1093,7 @@
+@@ -1086,7 +1152,7 @@ create_canvas (void)
points = gnome_canvas_points_new (2);
points->coords[0] = 0.0;
points->coords[1] = gdk_pixbuf_get_height (header);
@@ -420,7 +439,7 @@
points->coords[3] = gdk_pixbuf_get_height (header);
item = gnome_canvas_item_new (root,
-@@ -1066,6 +1130,7 @@
+@@ -1123,6 +1189,7 @@ create_canvas (void)
"x", (canvas_width - tmp) / 2.0,
NULL);
--- a/patches/gnome-media-03-supportdevices.diff Thu Sep 27 20:02:39 2007 +0000
+++ b/patches/gnome-media-03-supportdevices.diff Thu Sep 27 22:30:33 2007 +0000
@@ -1,7 +1,6 @@
-diff -urN gnome-media-2.16.1/gst-mixer/src/element.c gnome-media-2.16.1-hacked/gst-mixer/src/element.c
---- gnome-media-2.16.1/gst-mixer/src/element.c 2006-09-04 07:44:55.000000000 +1200
-+++ gnome-media-2.16.1-hacked/gst-mixer/src/element.c 2006-09-15 12:07:01.665009000 +1200
-@@ -215,7 +215,7 @@
+--- /tmp/gst-mixer/element.c 2007-09-25 11:41:52.919920811 -0500
++++ gnome-media-2.20.1/gst-mixer/src/element.c 2007-09-25 11:47:49.710732000 -0500
+@@ -209,7 +209,7 @@ gnome_volume_control_element_change (Gno
{
struct {
gchar *label;
@@ -10,7 +9,7 @@
gboolean use;
gint pos, height, width;
GnomeVolumeControlTrack * (* get_track_widget) (GtkTable *table,
-@@ -226,13 +226,13 @@
+@@ -220,19 +220,21 @@ gnome_volume_control_element_change (Gno
GtkWidget *right_sep,
GnomeAppBar *appbar);
} content[4] = {
@@ -28,7 +27,51 @@
gnome_volume_control_track_add_option }
};
gvc_whitelist list[] = whitelist_init_list;
-@@ -316,6 +316,10 @@
+ gint i;
+ const GList *item;
+ GstMixer *mixer;
++ static gchar *devname = NULL;
++ gchar *current_devname = NULL;
+
+ /* remove old pages */
+ while (gtk_notebook_get_n_pages (GTK_NOTEBOOK (el)) > 0) {
+@@ -258,6 +260,27 @@ gnome_volume_control_element_change (Gno
+ mixer = GST_MIXER (element);
+ gst_object_replace ((GstObject **) &el->mixer, GST_OBJECT (element));
+
++#if __sun
++ /*
++ * If switching to Sun Audio, then inform the track that we are using
++ * this interface so we know when to display the additional needed
++ * buttons.
++ */
++ current_devname = g_object_get_data (G_OBJECT (mixer), "gnome-volume-control-name");
++ if (current_devname) {
++ if (devname == NULL || strcmp (current_devname, devname) != 0) {
++
++ if (current_devname != NULL)
++ g_free (current_devname);
++ devname = g_strdup (current_devname);
++ sun_reset_buttons (g_str_has_suffix (devname, "(Sun Audio Mixer)"));
++ }
++ } else {
++ /* Should never fail, just return if it does */
++ return;
++ }
++#endif
++
+ /* content pages */
+ for (i = 0; i < 4; i++) {
+ content[i].page = gtk_table_new (content[i].width, content[i].height, FALSE);
+@@ -265,6 +288,7 @@ gnome_volume_control_element_change (Gno
+ if (i >= 2)
+ gtk_table_set_row_spacings (GTK_TABLE (content[i].page), 6);
+ gtk_table_set_col_spacings (GTK_TABLE (content[i].page), 6);
++ content[i].flagbuttonbox = NULL;
+ }
+
+ /* show */
+@@ -312,6 +336,10 @@ gnome_volume_control_element_change (Gno
el->appbar);
gnome_volume_control_track_show (trkw, active);
@@ -39,24 +82,31 @@
g_object_set_data (G_OBJECT (track),
"gnome-volume-control-trkw", trkw);
-@@ -359,8 +363,24 @@
+@@ -355,8 +383,31 @@ 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);
-+ GtkWidget *hbox = gtk_hbox_new (FALSE, 6);
-+ GtkWidget *hbox2 = gtk_hbox_new (FALSE, 6);
-+ GtkWidget *separator = gtk_hseparator_new ();
-+ gtk_box_pack_start (GTK_BOX (hbox2), separator, TRUE, TRUE, 6);
++ GtkWidget *vbox = NULL;
++ GtkWidget *hbox = NULL;
++ GtkWidget *hbox2 = NULL;
++ GtkWidget *separator = NULL;
++
++ vbox = gtk_vbox_new (FALSE, 0);
++ hbox = gtk_hbox_new (FALSE, 6);
++ hbox2 = gtk_hbox_new (FALSE, 6);
++ separator = gtk_hseparator_new ();
++
+ gtk_box_pack_start (GTK_BOX (vbox), content[i].page, TRUE, TRUE, 6);
+ gtk_box_pack_start (GTK_BOX (vbox), hbox2, FALSE, FALSE, 6);
++ gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 6);
++ gtk_box_pack_start (GTK_BOX (hbox2), separator, TRUE, TRUE, 6);
+ gtk_box_pack_start (GTK_BOX (hbox), content[i].flagbuttonbox, TRUE, FALSE, 6);
-+ gtk_widget_show(hbox);
-+ gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 6);
++
+ gtk_widget_show_all (vbox);
++
+ gtk_container_add (GTK_CONTAINER (viewport), vbox);
+ gtk_container_add (GTK_CONTAINER (view), viewport);
+ } else {
@@ -66,9 +116,8 @@
label = gtk_label_new (content[i].label);
gtk_notebook_append_page (GTK_NOTEBOOK (el), view, label);
-diff -urN gnome-media-2.16.1/gst-mixer/src/track.c gnome-media-2.16.1-hacked/gst-mixer/src/track.c
---- gnome-media-2.16.1/gst-mixer/src/track.c 2005-04-16 00:59:37.000000000 +1200
-+++ gnome-media-2.16.1-hacked/gst-mixer/src/track.c 2006-09-15 12:07:01.714869000 +1200
+--- /tmp/gst-mixer/track.c 2007-09-25 11:41:52.920634325 -0500
++++ gnome-media-2.20.1/gst-mixer/src/track.c 2007-09-25 11:43:01.953846000 -0500
@@ -19,6 +19,11 @@
* Boston, MA 02111-1307, USA.
*/
@@ -81,20 +130,25 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-@@ -101,6 +106,134 @@
+@@ -113,6 +118,161 @@ cb_option_changed (GtkComboBox *box,
g_free (opt);
}
+#ifdef __sun
-+static gint mixer_fd;
-+static gboolean out_switch_display = FALSE;
-+static gboolean in_switch_display = FALSE;
++static gint mixer_fd = -1;
++static gboolean sun_audio_interface = FALSE;
++
++static gboolean out_switch_display = FALSE;
++static gboolean in_switch_display = FALSE;
++static gboolean in_recording = 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;
@@ -112,7 +166,7 @@
+ AUDIO_INITINFO (&ainfo);
+
+ if (ioctl (mixer_fd, AUDIO_GETINFO, &ainfo) < 0)
-+ g_warning ("Error setting audio device information");
++ g_warning ("Error getting audio device information");
+
+ if (out_speaker_button != NULL) {
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (out_speaker_button)))
@@ -211,25 +265,48 @@
+ if (ioctl (mixer_fd, AUDIO_SETINFO, &ainfo) < 0)
+ g_warning ("Error setting audio device information");
+}
++
++void
++sun_reset_buttons (gboolean sun_interface)
++{
++ sun_audio_interface = sun_interface;
++ out_switch_display = FALSE;
++ in_switch_display = FALSE;
++
++ out_speaker_button = NULL;
++ out_headphone_button = NULL;
++ out_lineout_button = NULL;
++ out_spdif_button = NULL;
++ out_aux1_button = NULL;
++ out_aux2_button = NULL;
++ in_microphone_button = NULL;
++ in_line_in_button = NULL;
++ in_cd_button = NULL;
++ in_spdif_button = NULL;
++ in_aux1_button = NULL;
++ in_aux2_button = NULL;
++ in_codec_button = NULL;
++}
+#endif
+
/*
* Timeout to check for changes in mixer outside ourselves.
*/
-@@ -149,6 +282,112 @@
+@@ -170,6 +330,113 @@ cb_check (gpointer data)
* - options.
*/
+#ifdef __sun
+ /*
-+ * Update the Sun flag buttons, if they change.
++ * Update the Sun flag buttons, if they change. Only do this if
++ * using SunAudio interface.
+ */
-+ {
++ if (sun_audio_interface) {
+ audio_info_t ainfo;
+ int ret;
+
+ if (ioctl (mixer_fd, AUDIO_GETINFO, &ainfo) < 0)
-+ g_warning ("Error setting audio device volume");
++ g_warning ("Error getting audio device information");
+
+ if (out_speaker_button != NULL &&
+ (ainfo.play.avail_ports & AUDIO_SPEAKER) &&
@@ -329,7 +406,7 @@
return TRUE;
}
-@@ -181,6 +420,7 @@
+@@ -202,6 +469,7 @@ gnome_volume_control_track_add_title (Gt
ctrl->table = table;
ctrl->pos = tab_pos;
ctrl->id = g_timeout_add (200, cb_check, ctrl);
@@ -337,104 +414,116 @@
/* find image from label string (optional) */
if (g_object_class_find_property (G_OBJECT_GET_CLASS (track), "untranslated-label"))
-@@ -323,6 +563,105 @@
+@@ -350,6 +618,117 @@ 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.
++ * Only create the flagbuttonbox once. Don't create if really we are
++ * in track_add_recording (if in_recording is TRUE).
+ */
-+ if (out_switch_display == FALSE) {
++ if (sun_audio_interface == TRUE &&
++ out_switch_display == FALSE &&
++ in_recording == 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 (audiodev);
-+ mixer_fd = open (device, O_RDWR | O_NONBLOCK);
-+ g_free (device);
++ if (mixer_fd == -1) {
++ audiodev = g_getenv ("AUDIODEV");
++ if (audiodev == NULL) {
++ mixer_fd = open ("/dev/audioctl", O_RDWR | O_NONBLOCK);
++ } else {
++ gchar *device = g_strdup (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");
++ g_warning ("Error getting audio device information");
+
+ if (ainfo.play.avail_ports & AUDIO_SPEAKER) {
++
+ /* SUN_BRANDING */
+ 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);
++ FALSE, FALSE, 0);
++ g_signal_connect (G_OBJECT (out_speaker_button), "toggled",
++ G_CALLBACK (sun_out_button_cb), NULL);
+ 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 */
++
+ /* SUN_BRANDING */
+ 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);
++ FALSE, FALSE, 0);
++ g_signal_connect (G_OBJECT (out_headphone_button), "toggled",
++ G_CALLBACK (sun_out_button_cb), NULL);
+ 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) {
++
+ /* SUN_BRANDING */
+ 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);
++ FALSE, FALSE, 0);
++ g_signal_connect (G_OBJECT (out_lineout_button), "toggled",
++ G_CALLBACK (sun_out_button_cb), NULL);
+ 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) {
++
+ /* SUN_BRANDING */
+ 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);
++ FALSE, FALSE, 0);
++ g_signal_connect (G_OBJECT (out_spdif_button), "toggled",
++ G_CALLBACK (sun_out_button_cb), NULL);
+ 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) {
++
+ /* SUN_BRANDING */
+ 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);
++ FALSE, FALSE, 0);
++ g_signal_connect (G_OBJECT (out_aux1_button), "toggled",
++ G_CALLBACK (sun_out_button_cb), NULL);
+ 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) {
++
+ /* SUN_BRANDING */
+ 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);
++ FALSE, FALSE, 0);
++ g_signal_connect (G_OBJECT (out_aux2_button), "toggled",
++ G_CALLBACK (sun_out_button_cb), NULL);
+ 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);
+ }
@@ -443,77 +532,102 @@
return ctrl;
}
-@@ -354,7 +690,7 @@
+@@ -367,9 +746,12 @@ gnome_volume_control_track_add_recording
+ AtkObject *accessible;
+ gchar *accessible_name, *msg;
+
++ in_recording = TRUE;
+ ctrl = gnome_volume_control_track_add_playback (table, tab_pos, mixer,
+ track, l_sep, r_sep,
+ appbar);
++ in_recording = FALSE;
++
+ if (track->num_channels == 0) {
+ return ctrl;
+ }
+@@ -378,6 +760,10 @@ gnome_volume_control_track_add_recording
* - there's something fishy about this button, it
* is always FALSE.
*/
--
-+#ifndef __sun
++#ifdef __sun
++ /* If not using Sun Audio interface, behave as default */
++ if (sun_audio_interface == FALSE) {
++#endif
+
/* only the record button here */
msg = g_strdup_printf (_("Toggle audio recording from %s"), ctrl->track->label);
- button = gnome_volume_control_button_new (GNOME_VOLUME_CONTROL_STOCK_RECORD,
-@@ -379,6 +719,160 @@
+@@ -406,6 +792,178 @@ gnome_volume_control_track_add_recording
FALSE, FALSE, 0);
gtk_widget_show (button);
-+#else
++#ifdef __sun
+ /*
-+ * Only create the flagbuttonbox once.
++ * Only create the flagbuttonbox once, and only if using Sun
++ * Audio interface.
+ *
-+ * Note that we do not want to show the record button on Solaris,
-+ * since this is managed by the flagbuttons defined below.
++ * Note that we do not want to show the record button when using
++ * SunAudio interfaces. This record button is used to switch
++ * between microphone and line-in input. Since this is managed
++ * by the flagbuttons defined below, we don't want this when
++ * using Sun Audio. So this is why we avoid the above logic
++ * when using SunAudio.
+ */
-+ if (in_switch_display == FALSE) {
++ } else if (in_switch_display == FALSE) {
++ GtkRadioButton *first_button = NULL;
+ 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 (audiodev);
-+ mixer_fd = open (device, O_RDWR | O_NONBLOCK);
-+ g_free (device);
++ if (mixer_fd == -1) {
++ audiodev = g_getenv ("AUDIODEV");
++ if (audiodev == NULL) {
++ mixer_fd = open ("/dev/audioctl", O_RDWR | O_NONBLOCK);
++ } else {
++ gchar *device = g_strdup (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");
++ g_warning ("Error getting audio device information");
+
+ if (ainfo.record.avail_ports & AUDIO_MICROPHONE) {
+ /* SUN_BRANDING */
+ in_microphone_button = gtk_radio_button_new_with_mnemonic (NULL, _("Micro_phone"));
-+ first_button = GTK_RADIO_BUTTON (in_microphone_button);
++ first_button = GTK_RADIO_BUTTON (in_microphone_button);
++
+ gtk_box_pack_start (GTK_BOX (ctrl->flagbuttonbox), in_microphone_button,
+ FALSE, FALSE, 0);
++ g_signal_connect (G_OBJECT (in_microphone_button), "toggled",
++ G_CALLBACK (sun_in_button_cb), NULL);
+ 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
+ /* SUN_BRANDING */
+ (first_button, _("_Line In"));
-+ } else {
++ } else {
+ /* SUN_BRANDING */
+ 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);
++ g_signal_connect (G_OBJECT (in_line_in_button), "toggled",
++ G_CALLBACK (sun_in_button_cb), NULL);
+ 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
@@ -524,15 +638,16 @@
+ 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);
++ g_signal_connect (G_OBJECT (in_cd_button), "toggled",
++ G_CALLBACK (sun_in_button_cb), NULL);
+ 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
@@ -546,12 +661,13 @@
+
+ gtk_box_pack_start (GTK_BOX (ctrl->flagbuttonbox), in_spdif_button,
+ FALSE, FALSE, 0);
++ g_signal_connect (G_OBJECT (in_spdif_button), "toggled",
++ G_CALLBACK (sun_in_button_cb), NULL);
+ 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
@@ -562,14 +678,16 @@
+ 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);
++ g_signal_connect (G_OBJECT (in_aux1_button), "toggled",
++ G_CALLBACK (sun_in_button_cb), NULL);
+ 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
@@ -580,14 +698,16 @@
+ 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);
++ g_signal_connect (G_OBJECT (in_aux2_button), "toggled",
++ G_CALLBACK (sun_in_button_cb), NULL);
+ 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
@@ -598,14 +718,16 @@
+ 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);
++ g_signal_connect (G_OBJECT (in_codec_button), "toggled",
++ G_CALLBACK (sun_in_button_cb), NULL);
+ 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
@@ -613,10 +735,9 @@
return ctrl;
}
-diff -urN gnome-media-2.16.1/gst-mixer/src/track.h gnome-media-2.16.1-hacked/gst-mixer/src/track.h
---- gnome-media-2.16.1/gst-mixer/src/track.h 2006-01-20 12:52:21.000000000 +1300
-+++ gnome-media-2.16.1-hacked/gst-mixer/src/track.h 2006-09-15 11:07:46.085891000 +1200
-@@ -47,7 +47,8 @@
+--- /tmp/gst-mixer/track.h 2007-09-25 11:41:52.921649297 -0500
++++ gnome-media-2.20.1/gst-mixer/src/track.h 2007-09-25 11:42:57.259582000 -0500
+@@ -47,7 +47,8 @@ typedef struct _GnomeVolumeControlTrack
*sliderbox,
*buttonbox,
*toggle,
@@ -626,3 +747,14 @@
GnomeVolumeControlButton *mute, *record;
+@@ -105,6 +106,10 @@ void gnome_volume_control_track_free (G
+ void gnome_volume_control_track_show (GnomeVolumeControlTrack *track,
+ gboolean visible);
+
++#ifdef __sun
++void sun_reset_buttons (gboolean sun_interface);
++#endif
++
+ G_END_DECLS
+
+ #endif /* __GVC_TRACK_H__ */