1 Index: minimix/minimix.c
2 ===================================================================
3 RCS file: /cvs/gpe/base/minimix/minimix.c,v
4 retrieving revision 1.10
5 diff -u -r1.10 minimix.c
6 --- minimix/minimix.c 19 Sep 2005 15:36:02 -0000 1.10
7 +++ minimix/minimix.c 2 Aug 2006 17:06:51 -0000
9 * minimix -- volume control
11 * Copyright (c) 2002, 2003, 2004 Phil Blundell
13 + * 2005, 2006 Rene Wagner
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
20 gboolean configure_done = FALSE;
22 +#ifdef ENABLE_POLLING
24 +#endif /* ENABLE_POLLING */
26 +guint render_idle_source;
27 +gboolean render_idle_scheduled = FALSE;
32 current_vol_icon = vol_icons[level < SLIDER_MAX ? level / (SLIDER_MAX / (NUM_VOL_ICONS - 1)) + 1 : VOL_ICON_MAX];
35 +#ifdef ENABLE_POLLING
37 if (level != gtk_adjustment_get_value (adj))
38 gtk_adjustment_set_value (adj, level);
39 +#endif /* ENABLE_POLLING */
44 gtk_image_set_from_pixbuf(GTK_IMAGE(icon), dbuf);
47 +#ifdef ENABLE_POLLING
49 timeout_cb (gpointer data)
55 +#endif /* ENABLE_POLLING */
58 +render_when_idle (gpointer data)
61 + render_idle_scheduled = FALSE;
67 value_changed (GtkAdjustment *adj)
71 if (configure_done && current_vol_icon != old_icon)
74 + if (G_UNLIKELY (render_idle_scheduled))
75 + g_source_remove (render_idle_source);
77 + render_idle_scheduled = TRUE;
78 + render_idle_source = g_idle_add(render_when_idle, NULL);
81 value |= (value << 8);
82 ioctl (mixerfd, SOUND_MIXER_WRITE_VOLUME, &value);
84 gtk_widget_add_events (slider_window, GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
86 refresh (read_volume_level ());
88 +#ifdef ENABLE_POLLING
89 timeout = g_timeout_add (200,
90 (GSourceFunc) timeout_cb,
92 +#endif /* ENABLE_POLLING */
94 gtk_widget_show_all (box);