0
|
1 /* BMP - Cross-platform multimedia player
|
|
2 * Copyright (C) 2003-2004 BMP development team.
|
|
3 *
|
|
4 * Based on XMMS:
|
|
5 * Copyright (C) 1998-2003 XMMS development team.
|
|
6 *
|
|
7 * This program is free software; you can redistribute it and/or modify
|
|
8 * it under the terms of the GNU General Public License as published by
|
|
9 * the Free Software Foundation; either version 2 of the License, or
|
|
10 * (at your option) any later version.
|
|
11 *
|
|
12 * This program is distributed in the hope that it will be useful,
|
|
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15 * GNU General Public License for more details.
|
|
16 *
|
|
17 * You should have received a copy of the GNU General Public License
|
|
18 * along with this program; if not, write to the Free Software
|
|
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
20 */
|
|
21
|
|
22 #include "monostereo.h"
|
|
23
|
|
24 #include <glib.h>
|
|
25 #include <gdk/gdk.h>
|
|
26
|
|
27 #include "skin.h"
|
|
28 #include "widget.h"
|
|
29
|
|
30 void
|
|
31 monostereo_draw(Widget * widget)
|
|
32 {
|
|
33 MonoStereo *ms = (MonoStereo *) widget;
|
|
34 GdkPixmap *obj;
|
|
35
|
|
36 obj = ms->ms_widget.parent;
|
|
37
|
|
38 switch (ms->ms_num_channels) {
|
|
39 case 0:
|
|
40 skin_draw_pixmap(bmp_active_skin, obj, ms->ms_widget.gc,
|
|
41 ms->ms_skin_index, 29, 12,
|
|
42 ms->ms_widget.x, ms->ms_widget.y, 27, 12);
|
|
43 skin_draw_pixmap(bmp_active_skin, obj, ms->ms_widget.gc,
|
|
44 ms->ms_skin_index, 0, 12,
|
|
45 ms->ms_widget.x + 27, ms->ms_widget.y, 29, 12);
|
|
46 break;
|
|
47 case 1:
|
|
48 skin_draw_pixmap(bmp_active_skin, obj, ms->ms_widget.gc,
|
|
49 ms->ms_skin_index, 29, 0,
|
|
50 ms->ms_widget.x, ms->ms_widget.y, 27, 12);
|
|
51 skin_draw_pixmap(bmp_active_skin, obj, ms->ms_widget.gc,
|
|
52 ms->ms_skin_index, 0, 12,
|
|
53 ms->ms_widget.x + 27, ms->ms_widget.y, 29, 12);
|
|
54 break;
|
|
55 case 2:
|
|
56 skin_draw_pixmap(bmp_active_skin, obj, ms->ms_widget.gc,
|
|
57 ms->ms_skin_index, 29, 12,
|
|
58 ms->ms_widget.x, ms->ms_widget.y, 27, 12);
|
|
59 skin_draw_pixmap(bmp_active_skin, obj, ms->ms_widget.gc,
|
|
60 ms->ms_skin_index, 0, 0,
|
|
61 ms->ms_widget.x + 27, ms->ms_widget.y, 29, 12);
|
|
62 break;
|
|
63 }
|
|
64 }
|
|
65
|
|
66 void
|
|
67 monostereo_set_num_channels(MonoStereo * ms,
|
|
68 gint nch)
|
|
69 {
|
|
70 ms->ms_num_channels = nch;
|
|
71 widget_draw(WIDGET(ms));
|
|
72 }
|
|
73
|
|
74 MonoStereo *
|
|
75 create_monostereo(GList ** wlist,
|
|
76 GdkPixmap * parent,
|
|
77 GdkGC * gc,
|
|
78 gint x, gint y,
|
|
79 SkinPixmapId si)
|
|
80 {
|
|
81 MonoStereo *ms;
|
|
82
|
|
83 ms = g_new0(MonoStereo, 1);
|
|
84 widget_init(&ms->ms_widget, parent, gc, x, y, 56, 12, 1);
|
|
85 ms->ms_widget.draw = monostereo_draw;
|
|
86 ms->ms_skin_index = si;
|
|
87
|
|
88 widget_list_add(wlist, WIDGET(ms));
|
|
89 return ms;
|
|
90 }
|