annotate audacious/widgets/eq_slider.c @ 1603:0f2ca8c7cd98 trunk

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