Mercurial > audlegacy
comparison src/audacious/widgets/playstatus.c @ 2313:3149d4b1a9a9 trunk
[svn] - objective-make autodepend fixes
- move all sourcecode into src/ and adjust Makefiles accordingly
author | nenolod |
---|---|
date | Fri, 12 Jan 2007 11:43:40 -0800 |
parents | |
children | 41d3854f3625 |
comparison
equal
deleted
inserted
replaced
2312:e1a5a66fb9cc | 2313:3149d4b1a9a9 |
---|---|
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
17 */ | |
18 | |
19 #include "widgetcore.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 if (!w) | |
34 return; | |
35 | |
36 obj = ps->ps_widget.parent; | |
37 if (ps->ps_status == STATUS_STOP && ps->ps_status_buffering == TRUE) | |
38 ps->ps_status_buffering = FALSE; | |
39 if (ps->ps_status == STATUS_PLAY && ps->ps_status_buffering == TRUE) | |
40 skin_draw_pixmap(bmp_active_skin, obj, ps->ps_widget.gc, | |
41 SKIN_PLAYPAUSE, 39, 0, ps->ps_widget.x, | |
42 ps->ps_widget.y, 3, 9); | |
43 else if (ps->ps_status == STATUS_PLAY) | |
44 skin_draw_pixmap(bmp_active_skin, obj, ps->ps_widget.gc, | |
45 SKIN_PLAYPAUSE, 36, 0, ps->ps_widget.x, | |
46 ps->ps_widget.y, 3, 9); | |
47 else | |
48 skin_draw_pixmap(bmp_active_skin, obj, ps->ps_widget.gc, | |
49 SKIN_PLAYPAUSE, 27, 0, ps->ps_widget.x, | |
50 ps->ps_widget.y, 2, 9); | |
51 switch (ps->ps_status) { | |
52 case STATUS_STOP: | |
53 skin_draw_pixmap(bmp_active_skin, obj, ps->ps_widget.gc, | |
54 SKIN_PLAYPAUSE, 18, 0, | |
55 ps->ps_widget.x + 2, ps->ps_widget.y, 9, 9); | |
56 break; | |
57 case STATUS_PAUSE: | |
58 skin_draw_pixmap(bmp_active_skin, obj, ps->ps_widget.gc, | |
59 SKIN_PLAYPAUSE, 9, 0, | |
60 ps->ps_widget.x + 2, ps->ps_widget.y, 9, 9); | |
61 break; | |
62 case STATUS_PLAY: | |
63 skin_draw_pixmap(bmp_active_skin, obj, ps->ps_widget.gc, | |
64 SKIN_PLAYPAUSE, 1, 0, | |
65 ps->ps_widget.x + 3, ps->ps_widget.y, 8, 9); | |
66 break; | |
67 } | |
68 } | |
69 | |
70 void | |
71 playstatus_set_status(PlayStatus * ps, PStatus status) | |
72 { | |
73 if (!ps) | |
74 return; | |
75 | |
76 ps->ps_status = status; | |
77 widget_draw(WIDGET(ps)); | |
78 } | |
79 | |
80 void | |
81 playstatus_set_status_buffering(PlayStatus * ps, gboolean status) | |
82 { | |
83 if (!ps) | |
84 return; | |
85 | |
86 ps->ps_status_buffering = status; | |
87 widget_draw(WIDGET(ps)); | |
88 } | |
89 | |
90 PlayStatus * | |
91 create_playstatus(GList ** wlist, GdkPixmap * parent, | |
92 GdkGC * gc, gint x, gint y) | |
93 { | |
94 PlayStatus *ps; | |
95 | |
96 ps = g_new0(PlayStatus, 1); | |
97 widget_init(&ps->ps_widget, parent, gc, x, y, 11, 9, TRUE); | |
98 ps->ps_widget.draw = playstatus_draw; | |
99 | |
100 widget_list_add(wlist, WIDGET(ps)); | |
101 return ps; | |
102 } |