summaryrefslogtreecommitdiff
blob: 96e15cad0bacc348a56ed5281417e9b19569ea60 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
--- syna_core.c.orig	2004-07-15 22:18:39.666434864 +0100
+++ syna_core.c	2004-07-15 22:19:19.330405024 +0100
@@ -150,17 +150,20 @@
 
 static void fadeFade()
 {
-	register unsigned long *ptr = (unsigned long *) output;
+	register unsigned int *ptr = (unsigned int *) output;
 	int i = outWidth * outHeight * 2 / 4;
 
 	do
 	{
 /*    //Bytewize version was: *(ptr++) -= *ptr+(*ptr>>1)>>4;*/
 		if (*ptr)
+                {
 /*      //if (*ptr & 0xf0f0f0f0ul)*/
-			*(ptr++) -=
+			*(ptr) -=
 				((*ptr & 0xf0f0f0f0ul) >> 4) +
 				((*ptr & 0xe0e0e0e0ul) >> 5);
+			ptr++;
+                }
 /*      //else {
       //  *(ptr++) = (*ptr * 14 >> 4) & 0x0f0f0f0ful;
       //}*/
@@ -203,9 +206,13 @@
 	gint x, y, i, j, start, end;
 	gint step = outWidth * 2;
 
-	lastLastOutput = lastOutput;
-	lastOutput = output;
-	output = t;
+        synx_output[2]=synx_output[1];
+        synx_output[1]=synx_output[0];
+        synx_output[0]=t;
+
+//	lastLastOutput = lastOutput;
+//	lastOutput = output;
+//	output = t;
 
 	for (x = 0, i = 0, j = outWidth * (outHeight - 1) * 2; x < outWidth; x++, i += 2, j += 2)
 	{
@@ -273,13 +280,18 @@
 
 static void fadeHeat()
 {
-	guint16 *t = (guint16 *) lastLastOutput;
+//	guint16 *t = (guint16 *) lastLastOutput;
+	guint16 *t=synx_output[2];
 	gint x, y, i, j, start, end;
 	gint step = outWidth * 2;
 
-	lastLastOutput = lastOutput;
-	lastOutput = output;
-	output = t;
+	synx_output[2]=synx_output[1];
+	synx_output[1]=synx_output[0];
+	synx_output[0]=t;
+
+//	lastLastOutput = lastOutput;
+//	lastOutput = output;
+//	output = t;
 
 	for (x = 0, i = 0, j = outWidth * (outHeight - 1) * 2; x < outWidth; x++, i += 2, j += 2)
 	{
--- syna_xmms.c.orig	2004-07-15 21:56:12.813187680 +0100
+++ syna_xmms.c	2004-07-15 22:19:29.203904024 +0100
@@ -20,6 +20,8 @@
 #include <gdk/gdkkeysyms.h>
 #include <pthread.h>
 #include <string.h>
+#include <stdlib.h>
+#include <string.h>
 #include "math.h"
 #include <xmms/plugin.h>
 #include <xmms/util.h>
@@ -285,6 +287,7 @@
                 case SYNX_MENU_FULLSCRN:
 			synx_fullscreen_toggle();
                         break;
+			break;
                 default:
 			break;
                         /* ugh */
@@ -385,22 +388,32 @@
 	gdk_draw_pixmap(area->window, area->style->white_gc, bg_pixmap, 0, 0, (win_w-LOGO_OWIDTH)/2, (win_h-LOGO_OHEIGHT)/2, LOGO_WIDTH, LOGO_HEIGHT);
 }
 
-static void *synx_main_thread(void *arg) {
+static void *synx_main_thread(void *arg)
+{
+	guchar *tmpscr=NULL;
+	int	cursize=0;
 	/* I don't care about lost conditions, darn it! */
 	pthread_mutex_lock(&dummy_mutex);
 
-	for (;;) {
+	for (;;)
+        {
 		pthread_cond_wait(&update_signal, &dummy_mutex);
 		if (synx_quit) break;
 
 		GDK_THREADS_ENTER();
 		SYNX_LOCK();
-		if (GTK_WIDGET_REALIZED(window)) {
-			guchar tmpscr[synx_img_w*synx_img_h];	/* FIXME: Probably GCC-specific. */
+		if (GTK_WIDGET_REALIZED(window))
+		{
+//			guchar tmpscr[synx_img_w*synx_img_h];	/* FIXME: Probably GCC-specific. */
+			if((tmpscr==NULL)||(cursize!=(synx_img_w*synx_img_h)))
+			{
+				tmpscr=(guchar *)realloc(tmpscr,synx_img_w*synx_img_h);
+				cursize=synx_img_w*synx_img_h;
+				memset(tmpscr,0x80,cursize);
+			}
 
 			syna_fade();
 			syna_coreGo(pcm_data);
-
 			synx_screenShow(synx_output[0], tmpscr);
 			gdk_draw_indexed_image(area->window,area->style->white_gc,(win_w-synx_img_w)/2,(win_h-synx_img_h)/2,synx_img_w,synx_img_h,GDK_RGB_DITHER_NONE,tmpscr,synx_img_w,cmap);
 		}
@@ -408,6 +421,9 @@
 		GDK_THREADS_LEAVE();
 	}
 
+	if(tmpscr!=NULL)
+		free(tmpscr);
+
 	pthread_mutex_unlock(&dummy_mutex);
 
 	pthread_exit(NULL);
@@ -480,16 +496,19 @@
 	SYNX_UNLOCK();
 }
 
-static void synx_playback_start(void) {
+static void synx_playback_start(void)
+{
 	SYNX_LOCK();
 	synx_playing = TRUE;
-	if (GTK_WIDGET_REALIZED(window) && synx_cfg.auto_fullscreen) {
+	if (GTK_WIDGET_REALIZED(window) && synx_cfg.auto_fullscreen)
+	{
 		if (!synx_am_fullscreen) synx_fullscreen_toggle();
 	}
 	SYNX_UNLOCK();
 }
 
-static void synx_playback_stop(void) {
+static void synx_playback_stop(void)
+{
 	SYNX_LOCK();
 	synx_playing = FALSE;
 
@@ -503,9 +522,10 @@
 	SYNX_UNLOCK();
 }
 
-static void synx_screenShow(guint16 *src, unsigned char *dest) {
-	register unsigned long *ptr2 = (unsigned long*)src;
-	unsigned long *ptr1 = (unsigned long*)dest;
+static void synx_screenShow(guint16 *src, unsigned char *dest)
+{
+	register unsigned int *ptr2 = (unsigned int*)src;
+	unsigned int *ptr1 = (unsigned int*)dest;
 	int i = synx_img_w*synx_img_h/4;
 
 	/* Asger Alstrup Nielsen's (alstrup@diku.dk)
@@ -563,7 +583,8 @@
 	}
 }
 
-static void synx_about(void) {
+static void synx_about(void)
+{
 	GtkWidget *dialog, *button, *label;
 
 	dialog = gtk_dialog_new();