annotate src/audacious/widgets/vis.c @ 2746:2f5b461118a8 trunk

[svn] - adjust build order for libaudclient and audacious. reported by Crazy_Hopper.
author nenolod
date Fri, 11 May 2007 19:31:07 -0700
parents 63115d6e8ba8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1 /* BMP - Cross-platform multimedia player
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
2 * Copyright (C) 2003-2004 BMP development team.
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
3 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
4 * Based on XMMS:
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
5 * Copyright (C) 1998-2003 XMMS development team.
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
6 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
7 * This program is free software; you can redistribute it and/or modify
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
8 * it under the terms of the GNU General Public License as published by
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
9 * the Free Software Foundation; either version 2 of the License, or
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
10 * (at your option) any later version.
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
11 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
15 * GNU General Public License for more details.
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
16 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
17 * You should have received a copy of the GNU General Public License
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
18 * along with this program; if not, write to the Free Software
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
20 */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
21
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
22 #include "widgetcore.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
23
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
24 #include <glib.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
25 #include <gdk/gdk.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
26 #include <string.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
27
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
28 #include "main.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
29 #include "skin.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
30 #include "widget.h"
2328
d88558b0de0a [svn] - Added script for migration to XDG basedir.
js
parents: 2313
diff changeset
31 #include "playback.h"
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
32
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
33 static const gfloat vis_afalloff_speeds[] = { 0.34, 0.5, 1.0, 1.3, 1.6 };
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
34 static const gfloat vis_pfalloff_speeds[] = { 1.2, 1.3, 1.4, 1.5, 1.6 };
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
35 static const gint vis_redraw_delays[] = { 1, 2, 4, 8 };
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
36 static const guint8 vis_scope_colors[] =
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
37 { 21, 21, 20, 20, 19, 19, 18, 19, 19, 20, 20, 21, 21 };
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
38 static guchar voiceprint_data[76*16];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
39
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
40 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
41 vis_timeout_func(Vis * vis, guchar * data)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
42 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
43 static GTimer *timer = NULL;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
44 gulong micros = 9999999;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
45 gboolean falloff = FALSE;
2328
d88558b0de0a [svn] - Added script for migration to XDG basedir.
js
parents: 2313
diff changeset
46 gint i;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
47
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
48 if (!timer) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
49 timer = g_timer_new();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
50 g_timer_start(timer);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
51 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
52 else {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
53 g_timer_elapsed(timer, &micros);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
54 if (micros > 14000)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
55 g_timer_reset(timer);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
56 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
57 if (cfg.vis_type == VIS_ANALYZER) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
58 if (micros > 14000)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
59 falloff = TRUE;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
60 if (data || falloff) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
61 for (i = 0; i < 75; i++) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
62 if (data && data[i] > vis->vs_data[i]) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
63 vis->vs_data[i] = data[i];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
64 if (vis->vs_data[i] > vis->vs_peak[i]) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
65 vis->vs_peak[i] = vis->vs_data[i];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
66 vis->vs_peak_speed[i] = 0.01;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
67
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
68 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
69 else if (vis->vs_peak[i] > 0.0) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
70 vis->vs_peak[i] -= vis->vs_peak_speed[i];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
71 vis->vs_peak_speed[i] *=
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
72 vis_pfalloff_speeds[cfg.peaks_falloff];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
73 if (vis->vs_peak[i] < vis->vs_data[i])
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
74 vis->vs_peak[i] = vis->vs_data[i];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
75 if (vis->vs_peak[i] < 0.0)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
76 vis->vs_peak[i] = 0.0;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
77 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
78 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
79 else if (falloff) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
80 if (vis->vs_data[i] > 0.0) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
81 vis->vs_data[i] -=
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
82 vis_afalloff_speeds[cfg.analyzer_falloff];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
83 if (vis->vs_data[i] < 0.0)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
84 vis->vs_data[i] = 0.0;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
85 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
86 if (vis->vs_peak[i] > 0.0) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
87 vis->vs_peak[i] -= vis->vs_peak_speed[i];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
88 vis->vs_peak_speed[i] *=
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
89 vis_pfalloff_speeds[cfg.peaks_falloff];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
90 if (vis->vs_peak[i] < vis->vs_data[i])
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
91 vis->vs_peak[i] = vis->vs_data[i];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
92 if (vis->vs_peak[i] < 0.0)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
93 vis->vs_peak[i] = 0.0;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
94 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
95 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
96 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
97 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
98 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
99 else if (cfg.vis_type == VIS_VOICEPRINT && data){
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
100 for(i = 0; i < 16; i++)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
101 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
102 vis->vs_data[i] = data[15 - i];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
103 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
104 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
105 else if (data) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
106 for (i = 0; i < 75; i++)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
107 vis->vs_data[i] = data[i];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
108 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
109
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
110 if (micros > 14000) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
111 if (!vis->vs_refresh_delay) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
112 vis_draw((Widget *) vis);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
113 vis->vs_refresh_delay = vis_redraw_delays[cfg.vis_refresh];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
114
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
115 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
116 vis->vs_refresh_delay--;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
117 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
118 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
119 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
120 vis_draw(Widget * w)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
121 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
122 Vis *vis = (Vis *) w;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
123 gint x, y, n, h = 0, h2;
2456
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
124 gfloat delta;
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
125 guchar skin_col[2][3];
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
126 guchar vis_color[24][3];
2456
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
127 guchar vis_voice_color[256][3], voice_c[3];
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
128 guchar rgb_data[76 * 16 * 3 * 2 * 2], *ptr, c;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
129 guint32 colors[24];
2456
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
130 GdkColor *fgc, *bgc;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
131 GdkRgbCmap *cmap;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
132
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
133 if (!vis->vs_widget.visible)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
134 return;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
135
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
136 skin_get_viscolor(bmp_active_skin, vis_color);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
137 for (y = 0; y < 24; y++) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
138 colors[y] =
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
139 vis_color[y][0] << 16 | vis_color[y][1] << 8 | vis_color[y][2];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
140 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
141 cmap = gdk_rgb_cmap_new(colors, 24);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
142
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
143 if (!vis->vs_doublesize) {
2456
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
144 if(cfg.vis_type == VIS_VOICEPRINT /*&& cfg.voiceprint_mode != VOICEPRINT_NORMAL*/){
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
145 memset(rgb_data, 0, 76 * 16 * 3);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
146 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
147 else{
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
148 memset(rgb_data, 0, 76 * 16);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
149 for (y = 1; y < 16; y += 2) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
150 ptr = rgb_data + (y * 76);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
151 for (x = 0; x < 76; x += 2, ptr += 2)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
152 *ptr = 1;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
153 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
154 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
155 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
156 else{
2456
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
157 if(cfg.vis_type == VIS_VOICEPRINT /*&& cfg.voiceprint_mode != VOICEPRINT_NORMAL*/){
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
158 memset(rgb_data, 0, 3 * 4 * 16 * 76);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
159 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
160 else{
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
161 memset(rgb_data, 0, 152 * 32);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
162 for (y = 1; y < 16; y += 2) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
163 ptr = rgb_data + (y * 304);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
164 for (x = 0; x < 76; x += 2, ptr += 4) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
165 *ptr = 1;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
166 *(ptr + 1) = 1;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
167 *(ptr + 152) = 1;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
168 *(ptr + 153) = 1;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
169 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
170 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
171 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
172 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
173 if (cfg.vis_type == VIS_ANALYZER) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
174 for (x = 0; x < 75; x++) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
175 if (cfg.analyzer_type == ANALYZER_BARS && (x % 4) == 0)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
176 h = vis->vs_data[x >> 2];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
177 else if (cfg.analyzer_type == ANALYZER_LINES)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
178 h = vis->vs_data[x];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
179 if (h && (cfg.analyzer_type == ANALYZER_LINES ||
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
180 (x % 4) != 3)) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
181 if (!vis->vs_doublesize) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
182 ptr = rgb_data + ((16 - h) * 76) + x;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
183 switch (cfg.analyzer_mode) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
184 case ANALYZER_NORMAL:
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
185 for (y = 0; y < h; y++, ptr += 76)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
186 *ptr = 18 - h + y;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
187 break;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
188 case ANALYZER_FIRE:
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
189 for (y = 0; y < h; y++, ptr += 76)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
190 *ptr = y + 2;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
191 break;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
192 case ANALYZER_VLINES:
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
193 for (y = 0; y < h; y++, ptr += 76)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
194 *ptr = 18 - h;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
195 break;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
196 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
197 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
198 else{
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
199 ptr = rgb_data + ((16 - h) * 304) + (x << 1);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
200 switch (cfg.analyzer_mode) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
201 case ANALYZER_NORMAL:
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
202 for (y = 0; y < h; y++, ptr += 304) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
203 *ptr = 18 - h + y;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
204 *(ptr + 1) = 18 - h + y;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
205 *(ptr + 152) = 18 - h + y;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
206 *(ptr + 153) = 18 - h + y;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
207 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
208 break;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
209 case ANALYZER_FIRE:
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
210 for (y = 0; y < h; y++, ptr += 304) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
211 *ptr = y + 2;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
212 *(ptr + 1) = y + 2;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
213 *(ptr + 152) = y + 2;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
214 *(ptr + 153) = y + 2;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
215 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
216 break;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
217 case ANALYZER_VLINES:
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
218 for (y = 0; y < h; y++, ptr += 304) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
219 *ptr = 18 - h;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
220 *(ptr + 1) = 18 - h;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
221 *(ptr + 152) = 18 - h;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
222 *(ptr + 153) = 18 - h;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
223 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
224
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
225 break;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
226 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
227 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
228 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
229 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
230 if (cfg.analyzer_peaks) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
231 for (x = 0; x < 75; x++) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
232 if (cfg.analyzer_type == ANALYZER_BARS && (x % 4) == 0)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
233 h = vis->vs_peak[x >> 2];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
234 else if (cfg.analyzer_type == ANALYZER_LINES)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
235 h = vis->vs_peak[x];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
236 if (h && (cfg.analyzer_type == ANALYZER_LINES || (x % 4) != 3)){
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
237
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
238 if (!vis->vs_doublesize) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
239 rgb_data[(16 - h) * 76 + x] = 23;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
240 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
241 else{
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
242 ptr = rgb_data + (16 - h) * 304 + (x << 1);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
243 *ptr = 23;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
244 *(ptr + 1) = 23;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
245 *(ptr + 152) = 23;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
246 *(ptr + 153) = 23;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
247 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
248 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
249 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
250 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
251 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
252 else if (cfg.vis_type == VIS_VOICEPRINT) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
253 if(!playback_get_paused() && playback_get_playing()){/*Don't scroll when it's paused or stopped*/
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
254 for (y = 0; y < 16; y ++)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
255 for (x = 75; x > 0; x--)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
256 voiceprint_data[x + y * 76] = voiceprint_data[x-1+y*76];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
257 for(y=0;y<16;y++)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
258 voiceprint_data[y * 76] = vis->vs_data[y];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
259 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
260 if(playback_get_playing()){ /*Only draw the data if we're playing*/
2456
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
261 if(cfg.voiceprint_mode == VOICEPRINT_NORMAL){
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
262 /* Create color gradient from the skin's background- and foreground color*/
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
263 fgc = skin_get_color(bmp_active_skin, SKIN_TEXTFG);
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
264 bgc = skin_get_color(bmp_active_skin, SKIN_TEXTBG);
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
265 skin_col[0][0] = fgc->red >> 8;
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
266 skin_col[0][1] = fgc->green >> 8;
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
267 skin_col[0][2] = fgc->blue >> 8;
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
268 skin_col[1][0] = bgc->red >> 8;
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
269 skin_col[1][1] = bgc->green >> 8;
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
270 skin_col[1][2] = bgc->blue >> 8;
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
271 for(n=0;n<3;n++){
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
272 for(x=0;x<256;x++){
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
273 if(skin_col[0][n] > skin_col[1][n]){
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
274 delta = (gfloat)(skin_col[0][n] - skin_col[1][n]) / 256.0;
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
275 vis_voice_color[x][n] = skin_col[1][n] + (gfloat)(delta * x);
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
276 }
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
277 else if(skin_col[0][n] == skin_col[1][n]){
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
278 vis_voice_color[x][n] = skin_col[0][n];
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
279 }
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
280 else{
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
281 delta = (gfloat)(skin_col[1][n] - skin_col[0][n]) / 256.0;
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
282 vis_voice_color[x][n] = skin_col[1][n] - (gfloat)(delta * x);
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
283 }
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
284 }
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
285 }
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
286 }
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
287 for (y = 0; y < 16; y ++){
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
288 for (x = 0; x < 76; x++){
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
289 guint8 d = voiceprint_data[x + y*76];
2456
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
290
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
291 if(cfg.voiceprint_mode == VOICEPRINT_NORMAL){
2456
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
292 voice_c[0] = vis_voice_color[d][0];
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
293 voice_c[1] = vis_voice_color[d][1];
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
294 voice_c[2] = vis_voice_color[d][2];
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
295 }
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
296 else if(cfg.voiceprint_mode == VOICEPRINT_FIRE){
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
297 voice_c[0] = d < 64 ? (d * 2) : 255;
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
298 voice_c[1] = d < 64 ? 0 : (d < 128 ? (d-64) * 2 : 255);
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
299 voice_c[2] = d < 128 ? 0 : (d-128) * 2;
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
300 /* Test for black->blue->green->red. Isn't pretty, though...
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
301 voice_c[0] = d > 192 ? (d - 192) << 2 : 0;
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
302 voice_c[1] = d > 64 ? (d < 128 ? (d - 64) << 2 : (d < 192 ? (192 - d) << 2 : 0)) : 0;
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
303 voice_c[2] = d < 64 ? d << 2 : (d < 128 ? (128 - d) << 2 : 0);
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
304 */
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
305 }
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
306 else if(cfg.voiceprint_mode == VOICEPRINT_ICE){
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
307 voice_c[0] = d;
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
308 voice_c[1] = d < 128 ? d * 2 : 255;
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
309 voice_c[2] = d < 64 ? d * 4 : 255;
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
310 }
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
311 if(!vis->vs_doublesize){
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
312 for(n=0;n<3;n++)
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
313 rgb_data[x * 3 + y * 76*3+n] = voice_c[n];
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
314 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
315 else{
2456
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
316 ptr = rgb_data + x * 3 * 2 + y * 2 * 76 * 3 * 2;
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
317 for(n=0;n<3;n++)
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
318 {
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
319 *(ptr + n) = voice_c[n];
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
320 *(ptr + n + 3) = voice_c[n];
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
321 *(ptr + n + 76 * 2 * 3) = voice_c[n];
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
322 *(ptr + n + 3 + 76 * 2 * 3) = voice_c[n];
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
323 }
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
324 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
325 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
326 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
327 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
328 }
2456
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
329 if (cfg.vis_type == VIS_SCOPE) {
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
330 for (x = 0; x < 75; x++) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
331 switch (cfg.scope_mode) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
332 case SCOPE_DOT:
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
333 h = vis->vs_data[x];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
334 if (!vis->vs_doublesize) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
335 ptr = rgb_data + ((14 - h) * 76) + x;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
336 *ptr = vis_scope_colors[h + 1];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
337 }else{
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
338 ptr = rgb_data + ((14 - h) * 304) + (x << 1);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
339 *ptr = vis_scope_colors[h + 1];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
340 *(ptr + 1) = vis_scope_colors[h + 1];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
341 *(ptr + 152) = vis_scope_colors[h + 1];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
342 *(ptr + 153) = vis_scope_colors[h + 1];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
343 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
344 break;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
345 case SCOPE_LINE:
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
346 if (x != 74) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
347 h = 14 - vis->vs_data[x];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
348 h2 = 14 - vis->vs_data[x + 1];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
349 if (h > h2) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
350 y = h;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
351 h = h2;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
352 h2 = y;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
353 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
354 if (!vis->vs_doublesize) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
355 ptr = rgb_data + (h * 76) + x;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
356 for (y = h; y <= h2; y++, ptr += 76)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
357 *ptr = vis_scope_colors[y - 2];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
358 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
359 else{
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
360 ptr = rgb_data + (h * 304) + (x << 1);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
361 for (y = h; y <= h2; y++, ptr += 304) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
362 *ptr = vis_scope_colors[y - 2];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
363 *(ptr + 1) = vis_scope_colors[y - 2];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
364 *(ptr + 152) = vis_scope_colors[y - 2];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
365 *(ptr + 153) = vis_scope_colors[y - 2];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
366 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
367 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
368 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
369 else {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
370 h = 14 - vis->vs_data[x];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
371 if (!vis->vs_doublesize) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
372 ptr = rgb_data + (h * 76) + x;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
373 *ptr = vis_scope_colors[h + 1];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
374 }else{
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
375 ptr = rgb_data + (h * 304) + (x << 1);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
376 *ptr = vis_scope_colors[h + 1];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
377 *(ptr + 1) = vis_scope_colors[h + 1];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
378 *(ptr + 152) = vis_scope_colors[h + 1];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
379 *(ptr + 153) = vis_scope_colors[h + 1];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
380 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
381 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
382 break;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
383 case SCOPE_SOLID:
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
384 h = 14 - vis->vs_data[x];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
385 h2 = 8;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
386 c = vis_scope_colors[(gint) vis->vs_data[x]];
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
387 if (h > h2) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
388 y = h;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
389 h = h2;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
390 h2 = y;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
391 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
392 if (!vis->vs_doublesize) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
393 ptr = rgb_data + (h * 76) + x;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
394 for (y = h; y <= h2; y++, ptr += 76)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
395 *ptr = c;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
396 }else{
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
397 ptr = rgb_data + (h * 304) + (x << 1);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
398 for (y = h; y <= h2; y++, ptr += 304) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
399 *ptr = c;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
400 *(ptr + 1) = c;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
401 *(ptr + 152) = c;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
402 *(ptr + 153) = c;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
403 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
404 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
405 break;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
406 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
407 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
408 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
409
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
410
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
411
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
412 if (!vis->vs_doublesize) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
413 GDK_THREADS_ENTER();
2456
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
414 if (cfg.vis_type == VIS_VOICEPRINT /*&& cfg.voiceprint_mode != VOICEPRINT_NORMAL*/){
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
415 gdk_draw_rgb_image(vis->vs_window, vis->vs_widget.gc,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
416 vis->vs_widget.x, vis->vs_widget.y,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
417 vis->vs_widget.width, vis->vs_widget.height,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
418 GDK_RGB_DITHER_NORMAL, (guchar *) rgb_data,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
419 76 * 3);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
420 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
421 else{
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
422 gdk_draw_indexed_image(vis->vs_window, vis->vs_widget.gc,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
423 vis->vs_widget.x, vis->vs_widget.y,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
424 vis->vs_widget.width, vis->vs_widget.height,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
425 GDK_RGB_DITHER_NORMAL, (guchar *) rgb_data,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
426 76, cmap);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
427 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
428 GDK_THREADS_LEAVE();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
429 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
430 else {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
431 GDK_THREADS_ENTER();
2456
63115d6e8ba8 [svn] - Make the voiceprint use the skin's foreground and background color for the gradient in 'normal' mode
marvin
parents: 2328
diff changeset
432 if (cfg.vis_type == VIS_VOICEPRINT /*&& cfg.voiceprint_mode != VOICEPRINT_NORMAL*/){
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
433 gdk_draw_rgb_image(vis->vs_window, vis->vs_widget.gc,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
434 vis->vs_widget.x << 1,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
435 vis->vs_widget.y << 1,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
436 vis->vs_widget.width << 1,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
437 vis->vs_widget.height << 1,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
438 GDK_RGB_DITHER_NONE, (guchar *) rgb_data,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
439 76 * 2 * 3);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
440 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
441 else{
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
442 gdk_draw_indexed_image(vis->vs_window, vis->vs_widget.gc,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
443 vis->vs_widget.x << 1,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
444 vis->vs_widget.y << 1,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
445 vis->vs_widget.width << 1,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
446 vis->vs_widget.height << 1,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
447 GDK_RGB_DITHER_NONE, (guchar *) rgb_data,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
448 76 * 2 , cmap);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
449 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
450 GDK_THREADS_LEAVE();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
451 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
452 gdk_rgb_cmap_free(cmap);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
453 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
454
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
455
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
456
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
457 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
458 vis_clear_data(Vis * vis)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
459 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
460 gint i;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
461
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
462 if (!vis)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
463 return;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
464 memset(voiceprint_data, 0, 16*76);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
465 for (i = 0; i < 75; i++) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
466 vis->vs_data[i] = (cfg.vis_type == VIS_SCOPE) ? 6 : 0;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
467 vis->vs_peak[i] = 0;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
468 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
469 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
470
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
471 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
472 vis_set_doublesize(Vis * vis, gboolean doublesize)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
473 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
474 vis->vs_doublesize = doublesize;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
475 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
476
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
477 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
478 vis_clear(Vis * vis)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
479 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
480 if (!vis->vs_doublesize)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
481 gdk_window_clear_area(vis->vs_window, vis->vs_widget.x,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
482 vis->vs_widget.y, vis->vs_widget.width,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
483 vis->vs_widget.height);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
484 else
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
485 gdk_window_clear_area(vis->vs_window, vis->vs_widget.x << 1,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
486 vis->vs_widget.y << 1,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
487 vis->vs_widget.width << 1,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
488 vis->vs_widget.height << 1);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
489 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
490
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
491 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
492 vis_set_window(Vis * vis, GdkWindow * window)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
493 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
494 vis->vs_window = window;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
495 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
496
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
497 void vis_draw_pixel(Vis * vis, guchar* texture, gint x, gint y, guint8 colour){
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
498 if(vis->vs_doublesize){
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
499 texture[y * 76 + x] = colour;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
500 texture[y * 76 + x + 1] = colour;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
501 texture[y * 76 * 4 + x] = colour;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
502 texture[y * 76 * 4 + x + 1] = colour;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
503 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
504 else{
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
505 texture[y * 76 + x] = colour;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
506 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
507 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
508
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
509
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
510 Vis *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
511 create_vis(GList ** wlist,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
512 GdkPixmap * parent,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
513 GdkWindow * window,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
514 GdkGC * gc,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
515 gint x, gint y,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
516 gint width,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
517 gboolean doublesize)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
518 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
519 Vis *vis;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
520
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
521 vis = g_new0(Vis, 1);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
522 memset(voiceprint_data, 0, 16*76);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
523 widget_init(&vis->vs_widget, parent, gc, x, y, width, 16, 1);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
524
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
525 vis->vs_doublesize = doublesize;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
526
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
527 widget_list_add(wlist, WIDGET(vis));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
528
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
529 return vis;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
530 }