[PATCH[ make gmix use correct gconf paths



hi

	this patch fixes some problems that gmix has when the name of the
soundcard returned by OSS has spaces in it.

regards,
Diego


Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gnome-media/ChangeLog,v
retrieving revision 1.98
diff -u -r1.98 ChangeLog
--- ChangeLog	4 Apr 2002 00:58:33 -0000	1.98
+++ ChangeLog	13 Apr 2002 02:43:05 -0000
@@ -1,3 +1,9 @@
+2002-04-13	Diego González <diego pemas net>
+
+	* gmix/gmix.c (substitute_whitespaces): new function
+	* open_device: use substitute_whitespaces to get rid of the spaces in
+	  the name of the sound card, so that gconf gives no problem.
+		
 2002-04-04  Iain <iain ximian com>
 
 	* configure.in: Fix the check for the host name
Index: gmix/gmix.c
===================================================================
RCS file: /cvs/gnome/gnome-media/gmix/gmix.c,v
retrieving revision 1.70
diff -u -r1.70 gmix.c
--- gmix/gmix.c	10 Apr 2002 00:12:35 -0000	1.70
+++ gmix/gmix.c	13 Apr 2002 02:43:07 -0000
@@ -90,6 +90,7 @@
 static void scan_devices(void);
 static void free_devices(void);
 static void init_devices(void);
+static void substitute_whitespaces (gchar *string);
 
 static void quit_cb (GtkWidget *widget, gpointer data);
 static void lock_cb (GtkWidget *widget, channel_info *data);
@@ -618,6 +619,7 @@
 		return NULL;
 	}
 	
+	substitute_whitespaces (new_device->info.name);
 	new_device->card_name = g_strdup_printf ("OSS-%s-%d", new_device->info.name, num + 1);
 	
 	if (!g_ascii_isalpha (new_device->info.name[0])) {
@@ -1676,6 +1678,17 @@
 
 	if (GTK_TOGGLE_BUTTON (data->mute)->active) {
 		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (data->lock), FALSE);
+	}
+}
+
+static void
+substitute_whitespaces (gchar *string)
+{
+	gint i;
+
+	for (i = 0; i < strlen (string); i++) {
+		if (string[i] == ' ') 
+			string[i] = '_';
 	}
 }
 


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