Mercurial > audlegacy
annotate audacious/playstatus.c @ 1300:a5c4e748d557 trunk
[svn] - don't call filepopup_show_for_tuple() more than once
author | nenolod |
---|---|
date | Sun, 18 Jun 2006 22:28:47 -0700 |
parents | 3b990c26fc46 |
children | f12d7e208b43 |
rev | line source |
---|---|
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 | |
192
0ee0b9b6db7e
[svn] headless now working, use --headless if you wish to experiment.
nenolod
parents:
0
diff
changeset
|
33 if (!w) |
0ee0b9b6db7e
[svn] headless now working, use --headless if you wish to experiment.
nenolod
parents:
0
diff
changeset
|
34 return; |
0ee0b9b6db7e
[svn] headless now working, use --headless if you wish to experiment.
nenolod
parents:
0
diff
changeset
|
35 |
0 | 36 obj = ps->ps_widget.parent; |
1273
3b990c26fc46
[svn] - Support for the buffer indicator in playpaus.png that was apparently
nhjm449
parents:
192
diff
changeset
|
37 if (ps->ps_status == STATUS_STOP && ps->ps_status_buffering == TRUE) |
3b990c26fc46
[svn] - Support for the buffer indicator in playpaus.png that was apparently
nhjm449
parents:
192
diff
changeset
|
38 ps->ps_status_buffering = FALSE; |
3b990c26fc46
[svn] - Support for the buffer indicator in playpaus.png that was apparently
nhjm449
parents:
192
diff
changeset
|
39 if (ps->ps_status == STATUS_PLAY && ps->ps_status_buffering == TRUE) |
3b990c26fc46
[svn] - Support for the buffer indicator in playpaus.png that was apparently
nhjm449
parents:
192
diff
changeset
|
40 skin_draw_pixmap(bmp_active_skin, obj, ps->ps_widget.gc, |
3b990c26fc46
[svn] - Support for the buffer indicator in playpaus.png that was apparently
nhjm449
parents:
192
diff
changeset
|
41 SKIN_PLAYPAUSE, 39, 0, ps->ps_widget.x, |
3b990c26fc46
[svn] - Support for the buffer indicator in playpaus.png that was apparently
nhjm449
parents:
192
diff
changeset
|
42 ps->ps_widget.y, 3, 9); |
3b990c26fc46
[svn] - Support for the buffer indicator in playpaus.png that was apparently
nhjm449
parents:
192
diff
changeset
|
43 else if (ps->ps_status == STATUS_PLAY) |
0 | 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 { | |
192
0ee0b9b6db7e
[svn] headless now working, use --headless if you wish to experiment.
nenolod
parents:
0
diff
changeset
|
73 if (!ps) |
0ee0b9b6db7e
[svn] headless now working, use --headless if you wish to experiment.
nenolod
parents:
0
diff
changeset
|
74 return; |
0ee0b9b6db7e
[svn] headless now working, use --headless if you wish to experiment.
nenolod
parents:
0
diff
changeset
|
75 |
0 | 76 ps->ps_status = status; |
77 widget_draw(WIDGET(ps)); | |
78 } | |
79 | |
1273
3b990c26fc46
[svn] - Support for the buffer indicator in playpaus.png that was apparently
nhjm449
parents:
192
diff
changeset
|
80 void |
3b990c26fc46
[svn] - Support for the buffer indicator in playpaus.png that was apparently
nhjm449
parents:
192
diff
changeset
|
81 playstatus_set_status_buffering(PlayStatus * ps, gboolean status) |
3b990c26fc46
[svn] - Support for the buffer indicator in playpaus.png that was apparently
nhjm449
parents:
192
diff
changeset
|
82 { |
3b990c26fc46
[svn] - Support for the buffer indicator in playpaus.png that was apparently
nhjm449
parents:
192
diff
changeset
|
83 if (!ps) |
3b990c26fc46
[svn] - Support for the buffer indicator in playpaus.png that was apparently
nhjm449
parents:
192
diff
changeset
|
84 return; |
3b990c26fc46
[svn] - Support for the buffer indicator in playpaus.png that was apparently
nhjm449
parents:
192
diff
changeset
|
85 |
3b990c26fc46
[svn] - Support for the buffer indicator in playpaus.png that was apparently
nhjm449
parents:
192
diff
changeset
|
86 ps->ps_status_buffering = status; |
3b990c26fc46
[svn] - Support for the buffer indicator in playpaus.png that was apparently
nhjm449
parents:
192
diff
changeset
|
87 widget_draw(WIDGET(ps)); |
3b990c26fc46
[svn] - Support for the buffer indicator in playpaus.png that was apparently
nhjm449
parents:
192
diff
changeset
|
88 } |
3b990c26fc46
[svn] - Support for the buffer indicator in playpaus.png that was apparently
nhjm449
parents:
192
diff
changeset
|
89 |
0 | 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 } |