|
116
|
1 /* Iris - visualization plugin for XMMS
|
|
|
2 * Copyright (C) 2004 Marc Pompl (marc.pompl@lynorics.de)
|
|
|
3 *
|
|
|
4 * This program is free software; you can redistribute it and/or modify
|
|
|
5 * it under the terms of the GNU General Public License as published by
|
|
|
6 * the Free Software Foundation; either version 2 of the License, or
|
|
|
7 * (at your option) any later version.
|
|
|
8 *
|
|
|
9 * This program is distributed in the hope that it will be useful,
|
|
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
12 * GNU General Public License for more details.
|
|
|
13 *
|
|
|
14 * You should have received a copy of the GNU General Public License
|
|
|
15 * along with this program; if not, write to the Free Software
|
|
|
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
17 */
|
|
|
18
|
|
|
19 #include <stdlib.h>
|
|
|
20 #include <stdio.h>
|
|
|
21 #include <math.h>
|
|
|
22 #include <GL/gl.h>
|
|
|
23 #include <audacious/configdb.h>
|
|
|
24 #include "iris.h"
|
|
|
25 #include "particle.h"
|
|
|
26
|
|
|
27 static GLuint texture[1]; /* Storage For Our Particle Texture */
|
|
|
28
|
|
|
29 static gboolean flash_already_initialized = FALSE;
|
|
|
30
|
|
|
31 static float flash_timer = 0; /* timer for flash */
|
|
|
32
|
|
|
33 static struct
|
|
|
34 {
|
|
|
35 gboolean flash_on_beat;
|
|
|
36 int flash_timer;
|
|
|
37 GLfloat speed;
|
|
|
38 GLfloat r1, r2, r3;
|
|
|
39 GLfloat m,n,o;
|
|
|
40 GLfloat f,g,h;
|
|
|
41 GLfloat t;
|
|
|
42 }
|
|
|
43 conf_private, conf_private_new;
|
|
|
44
|
|
|
45 static config_theme conf = {
|
|
|
46 (config_global *) NULL,
|
|
|
47 &conf_private
|
|
|
48 };
|
|
|
49
|
|
|
50 static config_theme conf_new = {
|
|
|
51 (config_global *) NULL,
|
|
|
52 &conf_private_new
|
|
|
53 };
|
|
|
54
|
|
|
55 static char flash_flash_on_beat[] = "flashlight_flash_on_beat";
|
|
|
56 static char flash_flash_timer[] = "flashlight_flash_timer";
|
|
|
57 static char flash_speed[] = "flashlight_speed";
|
|
|
58
|
|
|
59 static void config_read (ConfigDb *, char *);
|
|
|
60 static void config_write (ConfigDb *, char *);
|
|
|
61 static void config_default (void);
|
|
|
62 static void config_create (GtkWidget *);
|
|
|
63 static void init_draw_mode (void);
|
|
|
64 static GLfloat get_x_angle (void);
|
|
|
65 static void draw_one_frame (gboolean);
|
|
|
66
|
|
|
67 iris_theme theme_flash = {
|
|
|
68 "Flash light",
|
|
|
69 "flash lights moving by a lissajou figure\n",
|
|
|
70 "Marc Pompl (marc.pompl@lynorics.de)",
|
|
|
71 "flashlight",
|
|
|
72 &conf,
|
|
|
73 &conf_new,
|
|
|
74 sizeof (conf_private),
|
|
|
75 config_read,
|
|
|
76 config_write,
|
|
|
77 config_default,
|
|
|
78 config_create,
|
|
|
79 NULL,
|
|
|
80 NULL,
|
|
|
81 init_draw_mode,
|
|
|
82 get_x_angle,
|
|
|
83 draw_one_frame
|
|
|
84 };
|
|
|
85
|
|
|
86 /* Create our particle structure */
|
|
|
87 typedef struct
|
|
|
88 {
|
|
|
89 GLint active; /* Active (Yes/No) */
|
|
|
90 GLfloat life; /* Particle Life */
|
|
|
91 GLfloat fade; /* Fade Speed */
|
|
|
92
|
|
|
93 GLfloat r; /* Red Value */
|
|
|
94 GLfloat g; /* Green Value */
|
|
|
95 GLfloat b; /* Blue Value */
|
|
|
96
|
|
|
97 GLfloat fr; /* Red Flash Value */
|
|
|
98 GLfloat fg; /* Green Flash Value */
|
|
|
99 GLfloat fb; /* Blue Flash Value */
|
|
|
100
|
|
|
101 GLfloat x; /* X Position */
|
|
|
102 GLfloat y; /* Y Position */
|
|
|
103 GLfloat z; /* Z Position */
|
|
|
104
|
|
|
105 GLfloat xi; /* X Direction */
|
|
|
106 GLfloat yi; /* Y Direction */
|
|
|
107 GLfloat zi; /* Z Direction */
|
|
|
108
|
|
|
109 GLfloat xg; /* X Gravity */
|
|
|
110 GLfloat yg; /* Y Gravity */
|
|
|
111 GLfloat zg; /* Z Gravity */
|
|
|
112 } particle;
|
|
|
113
|
|
|
114 /* Rainbow of colors */
|
|
|
115 static GLfloat flash_colors[16][3] =
|
|
|
116 {
|
|
|
117 { 1.0f, 0.5f, 0.5f},
|
|
|
118 { 1.0f, 0.75f, 0.5f},
|
|
|
119 { 1.0f, 1.0f, 0.5f},
|
|
|
120
|
|
|
121 { 0.75f, 1.0f, 0.5f},
|
|
|
122
|
|
|
123 { 0.5f, 1.0f, 0.5f},
|
|
|
124 { 0.5f, 1.0f, 0.75f},
|
|
|
125 { 0.5f, 1.0f, 1.0f},
|
|
|
126
|
|
|
127 { 0.5f, 0.75f, 1.0f},
|
|
|
128 { 0.5f, 0.5f, 1.0f},
|
|
|
129 { 0.75f, 0.5f, 1.0f},
|
|
|
130
|
|
|
131 { 1.0f, 0.5f, 1.0f},
|
|
|
132 { 1.0f, 0.5f, 0.75f},
|
|
|
133 { 0.75f, 0.5f, 0.75f},
|
|
|
134
|
|
|
135 { 0.5f, 0.5f, 0.5f},
|
|
|
136 { 0.75f, 0.75f, 0.75f},
|
|
|
137 { 1.0f, 1.0f, 1.0f},
|
|
|
138 };
|
|
|
139
|
|
|
140 /* Our beloved array of particles */
|
|
|
141 static particle particles[NUM_BANDS];
|
|
|
142
|
|
|
143 void FlashColor( int num )
|
|
|
144 {
|
|
|
145 GLfloat dr;
|
|
|
146 GLfloat dg;
|
|
|
147 GLfloat db;
|
|
|
148 dr = 1-particles[num].r;
|
|
|
149 dg = 1-particles[num].g;
|
|
|
150 db = 1-particles[num].b;
|
|
|
151 particles[num].fr = 1-dr*dr;
|
|
|
152 particles[num].fg = 1-dg*dg;
|
|
|
153 particles[num].fb = 1-db*db;
|
|
|
154 }
|
|
|
155
|
|
|
156 /* function to "load" a GL texture */
|
|
|
157 void flash_loadTexture( )
|
|
|
158 {
|
|
|
159 /* Create The Texture */
|
|
|
160 glGenTextures( 1, &texture[0] );
|
|
|
161
|
|
|
162 /* Typical Texture Generation Using Data From The Bitmap */
|
|
|
163 glBindTexture( GL_TEXTURE_2D, texture[0] );
|
|
|
164
|
|
|
165 /* Generate The Texture */
|
|
|
166 glTexImage2D( GL_TEXTURE_2D, 0, 3, particle_image.width,
|
|
|
167 particle_image.height, 0, GL_RGBA,
|
|
|
168 GL_UNSIGNED_BYTE, particle_image.pixel_data );
|
|
|
169
|
|
|
170 /* Linear Filtering */
|
|
|
171 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
|
|
|
172 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
|
|
|
173 }
|
|
|
174
|
|
|
175 /* function to reset one particle to initial state */
|
|
|
176 void ResetFlash( int num, GLfloat xDir, GLfloat yDir, GLfloat zDir )
|
|
|
177 {
|
|
|
178 /* Make the particels active */
|
|
|
179 particles[num].active = TRUE;
|
|
|
180 /* Give the particles life */
|
|
|
181 particles[num].life = 1.0f;
|
|
|
182 /* Random Fade Speed */
|
|
|
183 particles[num].fade = ( GLfloat )( rand( ) *150 )/ (RAND_MAX + 1.0) / 1000.0f + 0.003f;
|
|
|
184 /* Select Red Rainbow Color */
|
|
|
185 particles[num].r = flash_colors[num][0];
|
|
|
186 /* Select Green Rainbow Color */
|
|
|
187 particles[num].g = flash_colors[num][1];
|
|
|
188 /* Select Blue Rainbow Color */
|
|
|
189 particles[num].b = flash_colors[num][2];
|
|
|
190 /* Set the position on the X axis */
|
|
|
191 particles[num].x = 0.0f;
|
|
|
192 /* Set the position on the Y axis */
|
|
|
193 particles[num].y = 0.0f;
|
|
|
194 /* Set the position on the Z axis */
|
|
|
195 particles[num].z = 0.0f;
|
|
|
196 /* Random Speed On X Axis */
|
|
|
197 particles[num].xi = xDir;
|
|
|
198 /* Random Speed On Y Axi */
|
|
|
199 particles[num].yi = yDir;
|
|
|
200 /* Random Speed On Z Axis */
|
|
|
201 particles[num].zi = zDir;
|
|
|
202 /* Set Horizontal Pull To Zero */
|
|
|
203 particles[num].xg = 0.0f;
|
|
|
204 /* Set Vertical Pull Downward */
|
|
|
205 particles[num].yg = -0.8f;
|
|
|
206 /* Set Pull On Z Axis To Zero */
|
|
|
207 particles[num].zg = 0.0f;
|
|
|
208 FlashColor(num);
|
|
|
209 }
|
|
|
210
|
|
|
211 static void initFlash ( int num, GLfloat value )
|
|
|
212 {
|
|
|
213 GLfloat xi, yi, zi;
|
|
|
214 xi = num;
|
|
|
215 yi = 0;
|
|
|
216 zi = 0;
|
|
|
217 ResetFlash( num, xi, yi, zi );
|
|
|
218 }
|
|
|
219
|
|
|
220 static void
|
|
|
221 init_draw_mode ()
|
|
|
222 {
|
|
|
223 int loop;
|
|
|
224 conf.global->transparency = TRUE;
|
|
|
225 //conf.global->wireframe = FALSE;
|
|
|
226
|
|
|
227 flash_loadTexture();
|
|
|
228 /* Enable smooth shading */
|
|
|
229 glShadeModel( GL_SMOOTH );
|
|
|
230
|
|
|
231 /* Set the background black */
|
|
|
232 //glClearColor( 0.0f, 0.0f, 0.0f, 0.0f );
|
|
|
233
|
|
|
234 /* Depth buffer setup */
|
|
|
235 //glClearDepth( 1.0f );
|
|
|
236
|
|
|
237 /* Enables Depth Testing */
|
|
|
238 glDisable( GL_DEPTH_TEST );
|
|
|
239
|
|
|
240 /* Enable Blending */
|
|
|
241 glEnable( GL_BLEND );
|
|
|
242
|
|
|
243 glPolygonMode (GL_FRONT_AND_BACK, GL_FILL);
|
|
|
244
|
|
|
245 /* Type Of Blending To Perform */
|
|
|
246 glBlendFunc( GL_SRC_ALPHA, GL_ONE );
|
|
|
247
|
|
|
248 /* Really Nice Perspective Calculations */
|
|
|
249 glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST );
|
|
|
250 /* Really Nice Point Smoothing */
|
|
|
251 glHint( GL_POINT_SMOOTH_HINT, GL_NICEST );
|
|
|
252
|
|
|
253 /* Enable Texture Mapping */
|
|
|
254 glEnable( GL_TEXTURE_2D );
|
|
|
255 /* Select Our Texture */
|
|
|
256 glBindTexture( GL_TEXTURE_2D, texture[0] );
|
|
|
257 if (!flash_already_initialized)
|
|
|
258 {
|
|
|
259 for (loop=0; loop<NUM_BANDS; loop++)
|
|
|
260 {
|
|
|
261 initFlash(loop,0);
|
|
|
262 }
|
|
|
263 conf_private.f = 1;
|
|
|
264 conf_private.g = 1;
|
|
|
265 conf_private.h = 2;
|
|
|
266 conf_private.m = conf_private.n = conf_private.o = 0;
|
|
|
267 conf_private.t = 0.0f;
|
|
|
268 }
|
|
|
269 flash_already_initialized = TRUE;
|
|
|
270 }
|
|
|
271
|
|
|
272
|
|
|
273 static GLfloat
|
|
|
274 get_x_angle ()
|
|
|
275 {
|
|
|
276 return (15.0 + (int) (40.0 * rand () / (RAND_MAX + 1.0)));
|
|
|
277 }
|
|
|
278
|
|
|
279 static void
|
|
|
280 draw_one_frame (gboolean beat)
|
|
|
281 {
|
|
|
282 int loop;
|
|
|
283 if (beat)
|
|
|
284 flash_timer = conf_private.flash_timer;
|
|
|
285 conf_private.t += conf_private.speed;
|
|
|
286 /* Modify each of the particles */
|
|
|
287 for ( loop = 0; loop < NUM_BANDS; loop++ )
|
|
|
288 {
|
|
|
289 GLfloat x;
|
|
|
290 GLfloat y;
|
|
|
291 GLfloat z;
|
|
|
292 /* compute the position by a lissajou */
|
|
|
293 GLfloat t1 = (GLfloat)((conf_private.t+loop)/2);
|
|
|
294 conf_private.r1 = (GLfloat)(cos(t1)*sin(t1-loop)*5.0f);
|
|
|
295 conf_private.r2 = (GLfloat)(sin(t1)*cos(t1)*5.0f);
|
|
|
296 conf_private.r3 = (GLfloat)(cos(t1+conf_private.t)*sin(t1+loop)*5.0f);
|
|
|
297 x = (conf_private.r1*cos(conf_private.m*t1+conf_private.f));
|
|
|
298 y = (conf_private.r2*sin(conf_private.n*t1+conf_private.g));
|
|
|
299 z = (conf_private.r3*sin(conf_private.o*t1+conf_private.h));
|
|
|
300
|
|
|
301 if (particles[loop].active)
|
|
|
302 {
|
|
|
303 /* Draw The Particle Using Our RGB Values,
|
|
|
304 * Fade The Particle Based On It's Life
|
|
|
305 */
|
|
|
306 if ((conf_private.flash_on_beat) && (flash_timer>0))
|
|
|
307 glColor4f( particles[loop].fr,
|
|
|
308 particles[loop].fg,
|
|
|
309 particles[loop].fb,
|
|
|
310 1.0f );
|
|
|
311 else
|
|
|
312 {
|
|
|
313 glColor4f( particles[loop].r,
|
|
|
314 particles[loop].g,
|
|
|
315 particles[loop].b,
|
|
|
316 1.0f );
|
|
|
317 }
|
|
|
318
|
|
|
319 /* Build Quad From A Triangle Strip */
|
|
|
320 glBegin( GL_TRIANGLE_STRIP );
|
|
|
321 /* Top Right */
|
|
|
322 glTexCoord2d( 1, 1 );
|
|
|
323 glVertex3f( x + datas.data1[loop], y + datas.data1[loop], z );
|
|
|
324 /* Top Left */
|
|
|
325 glTexCoord2d( 0, 1 );
|
|
|
326 glVertex3f( x - datas.data1[loop], y + datas.data1[loop], z );
|
|
|
327 /* Bottom Right */
|
|
|
328 glTexCoord2d( 1, 0 );
|
|
|
329 glVertex3f( x + datas.data1[loop], y - datas.data1[loop], z );
|
|
|
330 /* Bottom Left */
|
|
|
331 glTexCoord2d( 0, 0 );
|
|
|
332 glVertex3f( x - datas.data1[loop], y - datas.data1[loop], z );
|
|
|
333 glEnd( );
|
|
|
334
|
|
|
335 glBegin( GL_TRIANGLE_STRIP );
|
|
|
336 /* Top Right */
|
|
|
337 glTexCoord2d( 1, 1 );
|
|
|
338 glVertex3f( x, y + datas.data1[loop], z+datas.data1[loop] );
|
|
|
339 /* Top Left */
|
|
|
340 glTexCoord2d( 0, 1 );
|
|
|
341 glVertex3f( x, y + datas.data1[loop], z-datas.data1[loop] );
|
|
|
342 /* Bottom Right */
|
|
|
343 glTexCoord2d( 1, 0 );
|
|
|
344 glVertex3f( x, y - datas.data1[loop], z+datas.data1[loop] );
|
|
|
345 /* Bottom Left */
|
|
|
346 glTexCoord2d( 0, 0 );
|
|
|
347 glVertex3f( x, y - datas.data1[loop], z-datas.data1[loop] );
|
|
|
348 glEnd( );
|
|
|
349
|
|
|
350 glBegin( GL_TRIANGLE_STRIP );
|
|
|
351 /* Top Right */
|
|
|
352 glTexCoord2d( 1, 1 );
|
|
|
353 glVertex3f( x+datas.data1[loop], y, z+datas.data1[loop] );
|
|
|
354 /* Top Left */
|
|
|
355 glTexCoord2d( 0, 1 );
|
|
|
356 glVertex3f( x+datas.data1[loop], y, z-datas.data1[loop] );
|
|
|
357 /* Bottom Right */
|
|
|
358 glTexCoord2d( 1, 0 );
|
|
|
359 glVertex3f( x-datas.data1[loop], y, z+datas.data1[loop] );
|
|
|
360 /* Bottom Left */
|
|
|
361 glTexCoord2d( 0, 0 );
|
|
|
362 glVertex3f( x-datas.data1[loop], y, z-datas.data1[loop] );
|
|
|
363 glEnd( );
|
|
|
364 }
|
|
|
365 }
|
|
|
366
|
|
|
367 if (flash_timer>0)
|
|
|
368 flash_timer --;
|
|
|
369 }
|
|
|
370
|
|
|
371
|
|
|
372 static void
|
|
|
373 config_read (ConfigDb * db, char *section_name)
|
|
|
374 {
|
|
|
375 config_default();
|
|
|
376 bmp_cfg_db_get_bool (db, section_name, flash_flash_on_beat, &conf_private.flash_on_beat);
|
|
|
377 bmp_cfg_db_get_int (db, section_name, flash_flash_timer, &conf_private.flash_timer);
|
|
|
378 bmp_cfg_db_get_float (db, section_name, flash_speed, &conf_private.speed);
|
|
|
379 }
|
|
|
380
|
|
|
381
|
|
|
382 static void
|
|
|
383 config_write (ConfigDb * db, char *section_name)
|
|
|
384 {
|
|
|
385 bmp_cfg_db_set_bool (db, section_name, flash_flash_on_beat, conf_private.flash_on_beat);
|
|
|
386 bmp_cfg_db_set_int (db, section_name, flash_flash_timer, conf_private.flash_timer);
|
|
|
387 bmp_cfg_db_set_float (db, section_name, flash_speed, conf_private.speed);
|
|
|
388 }
|
|
|
389
|
|
|
390
|
|
|
391 static void
|
|
|
392 config_default ()
|
|
|
393 {
|
|
|
394 conf_private.flash_on_beat = TRUE;
|
|
|
395 conf_private.flash_timer = 8;
|
|
|
396 conf_private.speed = 0.01f;
|
|
|
397 }
|
|
|
398
|
|
|
399 void
|
|
|
400 flash_flash_toggled (GtkWidget * widget, gpointer data)
|
|
|
401 {
|
|
|
402 conf_private_new.flash_on_beat = !conf_private_new.flash_on_beat;
|
|
|
403 }
|
|
|
404
|
|
|
405 static void
|
|
|
406 flash_value_flash (GtkAdjustment * adj)
|
|
|
407 {
|
|
|
408 conf_private_new.flash_timer = (int)adj->value;
|
|
|
409 }
|
|
|
410
|
|
|
411 static void
|
|
|
412 value_speed (GtkAdjustment * adj)
|
|
|
413 {
|
|
|
414 conf_private_new.speed = (GLfloat) (adj->value/1000);
|
|
|
415 }
|
|
|
416
|
|
|
417 static void
|
|
|
418 config_create (GtkWidget * vbox)
|
|
|
419 {
|
|
|
420 GtkWidget *hbox;
|
|
|
421 GtkWidget *button;
|
|
|
422 GtkWidget *label;
|
|
|
423 GtkObject *adjustment;
|
|
|
424 GtkWidget *hscale;
|
|
|
425
|
|
|
426 memcpy (&conf_private_new, &conf_private, sizeof (conf_private_new));
|
|
|
427
|
|
|
428 /* flash on beat */
|
|
|
429 hbox = gtk_hbox_new (FALSE, 2);
|
|
|
430 gtk_widget_show (hbox);
|
|
|
431 gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 4);
|
|
|
432
|
|
|
433 button = gtk_check_button_new_with_label ("Flash on beats");
|
|
|
434 gtk_widget_show (button);
|
|
|
435 gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 4);
|
|
|
436 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
|
|
437 conf_private_new.flash_on_beat);
|
|
|
438 gtk_signal_connect (GTK_OBJECT (button), "toggled",
|
|
|
439 GTK_SIGNAL_FUNC (flash_flash_toggled), NULL);
|
|
|
440
|
|
|
441 /* number of frame for the flash to propagate */
|
|
|
442 hbox = gtk_hbox_new (FALSE, 2);
|
|
|
443 gtk_widget_show (hbox);
|
|
|
444 gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 4);
|
|
|
445
|
|
|
446 label = gtk_label_new ("Flash propagation timer (in frames)");
|
|
|
447 gtk_widget_show (label);
|
|
|
448 gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 4);
|
|
|
449
|
|
|
450 hbox = gtk_hbox_new (FALSE, 2);
|
|
|
451 gtk_widget_show (hbox);
|
|
|
452 gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 4);
|
|
|
453
|
|
|
454 adjustment =
|
|
|
455 gtk_adjustment_new (conf_private_new.flash_timer, 1, 50, 1, 5, 0);
|
|
|
456 hscale = gtk_hscale_new (GTK_ADJUSTMENT (adjustment));
|
|
|
457 gtk_scale_set_digits (GTK_SCALE (hscale), 0);
|
|
|
458 gtk_widget_set_usize (GTK_WIDGET (hscale), 200, 25);
|
|
|
459 gtk_box_pack_start (GTK_BOX (hbox), hscale, FALSE, FALSE, 4);
|
|
|
460 gtk_widget_show (hscale);
|
|
|
461 gtk_signal_connect (GTK_OBJECT (adjustment), "value_changed",
|
|
|
462 GTK_SIGNAL_FUNC (flash_value_flash), NULL);
|
|
|
463
|
|
|
464 /* speed */
|
|
|
465 hbox = gtk_hbox_new (FALSE, 2);
|
|
|
466 gtk_widget_show (hbox);
|
|
|
467 gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 4);
|
|
|
468
|
|
|
469 label = gtk_label_new ("Speed");
|
|
|
470 gtk_widget_show (label);
|
|
|
471 gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 4);
|
|
|
472
|
|
|
473 hbox = gtk_hbox_new (FALSE, 2);
|
|
|
474 gtk_widget_show (hbox);
|
|
|
475 gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 4);
|
|
|
476
|
|
|
477 adjustment =
|
|
|
478 gtk_adjustment_new (conf_private_new.speed*1000, 1, 100, 1, 5, 0);
|
|
|
479 hscale = gtk_hscale_new (GTK_ADJUSTMENT (adjustment));
|
|
|
480 gtk_scale_set_digits (GTK_SCALE (hscale), 0);
|
|
|
481 gtk_widget_set_usize (GTK_WIDGET (hscale), 200, 25);
|
|
|
482 gtk_box_pack_start (GTK_BOX (hbox), hscale, FALSE, FALSE, 4);
|
|
|
483 gtk_widget_show (hscale);
|
|
|
484 gtk_signal_connect (GTK_OBJECT (adjustment), "value_changed",
|
|
|
485 GTK_SIGNAL_FUNC (value_speed), NULL);
|
|
|
486 }
|