0
|
1 /* XMMS - Cross-platform multimedia player
|
|
2 * Copyright (C) 1998-2000 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies
|
|
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 "playstatus.h"
|
|
20
|
|
21 #include <glib.h>
|
|
22 #include <gdk/gdk.h>
|
|
23
|
|
24 #include "skin.h"
|
|
25 #include "widget.h"
|
|
26
|
|
27 void
|
|
28 playstatus_draw(Widget * w)
|
|
29 {
|
|
30 PlayStatus *ps = PLAY_STATUS(w);
|
|
31 GdkPixmap *obj;
|
|
32
|
|
33 obj = ps->ps_widget.parent;
|
|
34
|
|
35 if (ps->ps_status == STATUS_PLAY)
|
|
36 skin_draw_pixmap(bmp_active_skin, obj, ps->ps_widget.gc,
|
|
37 SKIN_PLAYPAUSE, 36, 0, ps->ps_widget.x,
|
|
38 ps->ps_widget.y, 3, 9);
|
|
39 else
|
|
40 skin_draw_pixmap(bmp_active_skin, obj, ps->ps_widget.gc,
|
|
41 SKIN_PLAYPAUSE, 27, 0, ps->ps_widget.x,
|
|
42 ps->ps_widget.y, 2, 9);
|
|
43 switch (ps->ps_status) {
|
|
44 case STATUS_STOP:
|
|
45 skin_draw_pixmap(bmp_active_skin, obj, ps->ps_widget.gc,
|
|
46 SKIN_PLAYPAUSE, 18, 0,
|
|
47 ps->ps_widget.x + 2, ps->ps_widget.y, 9, 9);
|
|
48 break;
|
|
49 case STATUS_PAUSE:
|
|
50 skin_draw_pixmap(bmp_active_skin, obj, ps->ps_widget.gc,
|
|
51 SKIN_PLAYPAUSE, 9, 0,
|
|
52 ps->ps_widget.x + 2, ps->ps_widget.y, 9, 9);
|
|
53 break;
|
|
54 case STATUS_PLAY:
|
|
55 skin_draw_pixmap(bmp_active_skin, obj, ps->ps_widget.gc,
|
|
56 SKIN_PLAYPAUSE, 1, 0,
|
|
57 ps->ps_widget.x + 3, ps->ps_widget.y, 8, 9);
|
|
58 break;
|
|
59 }
|
|
60 }
|
|
61
|
|
62 void
|
|
63 playstatus_set_status(PlayStatus * ps, PStatus status)
|
|
64 {
|
|
65 ps->ps_status = status;
|
|
66 widget_draw(WIDGET(ps));
|
|
67 }
|
|
68
|
|
69 PlayStatus *
|
|
70 create_playstatus(GList ** wlist, GdkPixmap * parent,
|
|
71 GdkGC * gc, gint x, gint y)
|
|
72 {
|
|
73 PlayStatus *ps;
|
|
74
|
|
75 ps = g_new0(PlayStatus, 1);
|
|
76 widget_init(&ps->ps_widget, parent, gc, x, y, 11, 9, TRUE);
|
|
77 ps->ps_widget.draw = playstatus_draw;
|
|
78
|
|
79 widget_list_add(wlist, WIDGET(ps));
|
|
80 return ps;
|
|
81 }
|