changeset 2520:7aca8941495b

Further tweaks, should work fine now.
author William Pitcock <nenolod@atheme.org>
date Tue, 08 Apr 2008 15:19:44 -0500
parents 2da1343a024d
children c9d6887cd5d4
files src/crystalizer/crystalizer.c
diffstat 1 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/crystalizer/crystalizer.c	Tue Apr 08 15:11:35 2008 -0500
+++ b/src/crystalizer/crystalizer.c	Tue Apr 08 15:19:44 2008 -0500
@@ -52,6 +52,7 @@
 	aud_cfg_db_close(db);
 }
 
+/* conf dialog stuff stolen from stereo plugin --nenolod */ 
 static void conf_ok_cb(GtkButton * button, gpointer data)
 {
 	ConfigDb *db;
@@ -83,7 +84,7 @@
 		return;
 
 	conf_dialog = gtk_dialog_new();
-	g_signal_connect_swapped(GTK_OBJECT(conf_dialog), "destroy",
+	g_signal_connect(GTK_OBJECT(conf_dialog), "destroy",
 			   GTK_SIGNAL_FUNC(gtk_widget_destroyed), &conf_dialog);
 	gtk_window_set_title(GTK_WINDOW(conf_dialog), _("Configure Crystalizer"));
 
@@ -111,7 +112,7 @@
 	button = gtk_button_new_with_label(_("Ok"));
 	GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
 	gtk_box_pack_start(GTK_BOX(bbox), button, TRUE, TRUE, 0);
-	g_signal_connect_swapped(GTK_OBJECT(button), "clicked",
+	g_signal_connect(GTK_OBJECT(button), "clicked",
 			   GTK_SIGNAL_FUNC(conf_ok_cb),
 			   &GTK_ADJUSTMENT(adjustment)->value);
 	gtk_widget_grab_default(button);
@@ -120,14 +121,14 @@
 	button = gtk_button_new_with_label(_("Cancel"));
 	GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
 	gtk_box_pack_start(GTK_BOX(bbox), button, TRUE, TRUE, 0);
-	g_signal_connect_swapped(GTK_OBJECT(button), "clicked",
+	g_signal_connect(GTK_OBJECT(button), "clicked",
 			   GTK_SIGNAL_FUNC(conf_cancel_cb), NULL);
 	gtk_widget_show(button);
 
 	button = gtk_button_new_with_label(_("Apply"));
 	GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
 	gtk_box_pack_start(GTK_BOX(bbox), button, TRUE, TRUE, 0);
-	g_signal_connect_swapped(GTK_OBJECT(button), "clicked",
+	g_signal_connect(GTK_OBJECT(button), "clicked",
 			   GTK_SIGNAL_FUNC(conf_apply_cb),
 			   &GTK_ADJUSTMENT(adjustment)->value);
 	gtk_widget_show(button);
@@ -154,6 +155,8 @@
 	{
 		diff[0] = data[i] - prev[0];
 		diff[1] = data[i + 1] - prev[1];
+		prev[0] = data[i];
+		prev[1] = data[i + 1];
 
 		tmp = data[i] + (diff[0] * value);
 		if (tmp < -32768)
@@ -168,9 +171,6 @@
 		if (tmp > 32767)
 			tmp = 32767;
 		data[i + 1] = tmp;
-
-		prev[0] = data[i];
-		prev[1] = data[i + 1];
 	}
 
 	return length;