annotate audacious/eq_slider.c @ 863:25f42f39c44c trunk

[svn] new xmms_show_message look
author giacomo
date Thu, 23 Mar 2006 17:24:41 -0800
parents cb178e5ad177
children f12d7e208b43
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1 /* BMP - Cross-platform multimedia player
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2 * Copyright (C) 2003-2004 BMP development team.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3 *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4 * Based on XMMS:
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5 * Copyright (C) 1998-2003 XMMS development team.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6 *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
7 * This program is free software; you can redistribute it and/or modify
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
8 * it under the terms of the GNU General Public License as published by
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
9 * the Free Software Foundation; either version 2 of the License, or
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
10 * (at your option) any later version.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
11 *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
15 * GNU General Public License for more details.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
16 *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
17 * You should have received a copy of the GNU General Public License
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
18 * along with this program; if not, write to the Free Software
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
20 */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
21
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
22 #include "eq_slider.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
23
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
24 #include <glib.h>
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
25 #include <glib/gi18n.h>
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
26 #include <gtk/gtk.h>
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
27 #include <gdk/gdk.h>
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
28
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
29 #include "equalizer.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
30 #include "mainwin.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
31 #include "skin.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
32
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
33 void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
34 eqslider_set_position(EqSlider * es,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
35 gfloat pos)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
36 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
37 es->es_position = 25 - (gint) ((pos * 25.0) / 20.0);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
38
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
39 if (es->es_position < 0)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
40 es->es_position = 0;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
41
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
42 if (es->es_position > 50)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
43 es->es_position = 50;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
44
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
45 if (es->es_position >= 24 && es->es_position <= 26)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
46 es->es_position = 25;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
47
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
48 widget_draw(WIDGET(es));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
49 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
50
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
51 gfloat
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
52 eqslider_get_position(EqSlider * es)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
53 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
54 return 20.0 - (((gfloat) es->es_position * 20.0) / 25.0);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
55 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
56
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
57 void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
58 eqslider_draw(Widget * w)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
59 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
60 EqSlider *es = (EqSlider *) w;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
61 GdkPixmap *obj;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
62 SkinPixmapId src;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
63 gint frame;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
64
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
65 src = SKIN_EQMAIN;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
66 obj = es->es_widget.parent;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
67
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
68 frame = 27 - ((es->es_position * 27) / 50);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
69 if (frame < 14)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
70 skin_draw_pixmap(bmp_active_skin, obj, es->es_widget.gc, src,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
71 (frame * 15) + 13, 164, es->es_widget.x,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
72 es->es_widget.y, es->es_widget.width,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
73 es->es_widget.height);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
74 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
75 skin_draw_pixmap(bmp_active_skin, obj, es->es_widget.gc, src,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
76 ((frame - 14) * 15) + 13, 229, es->es_widget.x,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
77 es->es_widget.y, es->es_widget.width,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
78 es->es_widget.height);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
79 if (es->es_isdragging)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
80 skin_draw_pixmap(bmp_active_skin, obj, es->es_widget.gc, src, 0,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
81 176, es->es_widget.x + 1,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
82 es->es_widget.y + es->es_position, 11, 11);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
83 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
84 skin_draw_pixmap(bmp_active_skin, obj, es->es_widget.gc, src, 0,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
85 164, es->es_widget.x + 1,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
86 es->es_widget.y + es->es_position, 11, 11);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
87 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
88
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
89 void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
90 eqslider_set_mainwin_text(EqSlider * es)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
91 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
92 gint band = 0;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
93 const gchar *bandname[11] = { N_("PREAMP"), N_("60HZ"), N_("170HZ"),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
94 N_("310HZ"), N_("600HZ"), N_("1KHZ"),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
95 N_("3KHZ"), N_("6KHZ"), N_("12KHZ"),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
96 N_("14KHZ"), N_("16KHZ")
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
97 };
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
98 gchar *tmp;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
99
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
100 if (es->es_widget.x > 21)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
101 band = ((es->es_widget.x - 78) / 18) + 1;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
102
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
103 tmp =
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
104 g_strdup_printf("EQ: %s: %+.1f DB", _(bandname[band]),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
105 eqslider_get_position(es));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
106 mainwin_lock_info_text(tmp);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
107 g_free(tmp);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
108 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
109
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
110 void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
111 eqslider_button_press_cb(GtkWidget * w,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
112 GdkEventButton * event,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
113 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
114 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
115 EqSlider *es = EQ_SLIDER(data);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
116 gint y;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
117
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
118 if (widget_contains(&es->es_widget, event->x, event->y)) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
119 if (event->button == 1) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
120 y = event->y - es->es_widget.y;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
121 es->es_isdragging = TRUE;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
122 if (y >= es->es_position && y < es->es_position + 11)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
123 es->es_drag_y = y - es->es_position;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
124 else {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
125 es->es_position = y - 5;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
126 es->es_drag_y = 5;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
127 if (es->es_position < 0)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
128 es->es_position = 0;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
129 if (es->es_position > 50)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
130 es->es_position = 50;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
131 if (es->es_position >= 24 && es->es_position <= 26)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
132 es->es_position = 25;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
133 equalizerwin_eq_changed();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
134 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
135
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
136 eqslider_set_mainwin_text(es);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
137 widget_draw(WIDGET(es));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
138 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
139 if (event->button == 4) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
140 es->es_position -= 2;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
141 if (es->es_position < 0)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
142 es->es_position = 0;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
143 equalizerwin_eq_changed();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
144 widget_draw(WIDGET(es));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
145 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
146 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
147 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
148
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
149 void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
150 eqslider_mouse_scroll_cb(GtkWidget * w,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
151 GdkEventScroll * event,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
152 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
153 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
154 EqSlider *es = EQ_SLIDER(data);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
155
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
156 if (!widget_contains(&es->es_widget, event->x, event->y))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
157 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
158
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
159 if (event->direction == GDK_SCROLL_UP) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
160 es->es_position -= 2;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
161
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
162 if (es->es_position < 0)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
163 es->es_position = 0;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
164
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
165 equalizerwin_eq_changed();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
166 widget_draw(WIDGET(es));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
167 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
168 else {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
169 es->es_position += 2;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
170
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
171 if (es->es_position > 50)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
172 es->es_position = 50;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
173
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
174 equalizerwin_eq_changed();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
175 widget_draw(WIDGET(es));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
176 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
177 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
178
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
179 void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
180 eqslider_motion_cb(GtkWidget * w,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
181 GdkEventMotion * event,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
182 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
183 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
184 EqSlider *es = EQ_SLIDER(data);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
185 gint y;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
186
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
187 y = event->y - es->es_widget.y;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
188 if (es->es_isdragging) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
189 es->es_position = y - es->es_drag_y;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
190 if (es->es_position < 0)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
191 es->es_position = 0;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
192 if (es->es_position > 50)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
193 es->es_position = 50;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
194 if (es->es_position >= 24 && es->es_position <= 26)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
195 es->es_position = 25;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
196 equalizerwin_eq_changed();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
197 eqslider_set_mainwin_text(es);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
198 widget_draw(WIDGET(es));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
199 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
200 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
201
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
202 void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
203 eqslider_button_release_cb(GtkWidget * w,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
204 GdkEventButton * event,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
205 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
206 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
207 EqSlider *es = EQ_SLIDER(data);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
208
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
209 if (es->es_isdragging) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
210 es->es_isdragging = FALSE;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
211 mainwin_release_info_text();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
212 widget_draw(WIDGET(es));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
213 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
214 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
215
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
216 EqSlider *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
217 create_eqslider(GList ** wlist,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
218 GdkPixmap * parent,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
219 GdkGC * gc,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
220 gint x, gint y)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
221 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
222 EqSlider *es;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
223
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
224 es = g_new0(EqSlider, 1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
225 widget_init(&es->es_widget, parent, gc, x, y, 14, 63, TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
226 es->es_widget.button_press_cb = eqslider_button_press_cb;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
227 es->es_widget.button_release_cb = eqslider_button_release_cb;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
228 es->es_widget.motion_cb = eqslider_motion_cb;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
229 es->es_widget.draw = eqslider_draw;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
230 es->es_widget.mouse_scroll_cb = eqslider_mouse_scroll_cb;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
231
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
232 widget_list_add(wlist, WIDGET(es));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
233
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
234 return es;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
235 }