annotate audacious/playstatus.c @ 719:a403471b7429 trunk

[svn] - convert to objective make. needs testing.
author nenolod
date Sun, 26 Feb 2006 20:32:47 -0800
parents 0ee0b9b6db7e
children 3b990c26fc46
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1 /* XMMS - Cross-platform multimedia player
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2 * Copyright (C) 1998-2000 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3 *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4 * This program is free software; you can redistribute it and/or modify
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5 * it under the terms of the GNU General Public License as published by
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6 * the Free Software Foundation; either version 2 of the License, or
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
7 * (at your option) any later version.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
8 *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
9 * This program is distributed in the hope that it will be useful,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
12 * GNU General Public License for more details.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
13 *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
14 * You should have received a copy of the GNU General Public License
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
15 * along with this program; if not, write to the Free Software
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
17 */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
18
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
19 #include "playstatus.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
20
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
21 #include <glib.h>
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
22 #include <gdk/gdk.h>
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
23
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
24 #include "skin.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
25 #include "widget.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
26
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
27 void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
28 playstatus_draw(Widget * w)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
29 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
30 PlayStatus *ps = PLAY_STATUS(w);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
31 GdkPixmap *obj;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
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
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
36 obj = ps->ps_widget.parent;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
37
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
38 if (ps->ps_status == STATUS_PLAY)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
39 skin_draw_pixmap(bmp_active_skin, obj, ps->ps_widget.gc,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
40 SKIN_PLAYPAUSE, 36, 0, ps->ps_widget.x,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
41 ps->ps_widget.y, 3, 9);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
42 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
43 skin_draw_pixmap(bmp_active_skin, obj, ps->ps_widget.gc,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
44 SKIN_PLAYPAUSE, 27, 0, ps->ps_widget.x,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
45 ps->ps_widget.y, 2, 9);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
46 switch (ps->ps_status) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
47 case STATUS_STOP:
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
48 skin_draw_pixmap(bmp_active_skin, obj, ps->ps_widget.gc,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
49 SKIN_PLAYPAUSE, 18, 0,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
50 ps->ps_widget.x + 2, ps->ps_widget.y, 9, 9);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
51 break;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
52 case STATUS_PAUSE:
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
53 skin_draw_pixmap(bmp_active_skin, obj, ps->ps_widget.gc,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
54 SKIN_PLAYPAUSE, 9, 0,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
55 ps->ps_widget.x + 2, ps->ps_widget.y, 9, 9);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
56 break;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
57 case STATUS_PLAY:
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
58 skin_draw_pixmap(bmp_active_skin, obj, ps->ps_widget.gc,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
59 SKIN_PLAYPAUSE, 1, 0,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
60 ps->ps_widget.x + 3, ps->ps_widget.y, 8, 9);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
61 break;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
62 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
63 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
64
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
65 void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
66 playstatus_set_status(PlayStatus * ps, PStatus status)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
67 {
192
0ee0b9b6db7e [svn] headless now working, use --headless if you wish to experiment.
nenolod
parents: 0
diff changeset
68 if (!ps)
0ee0b9b6db7e [svn] headless now working, use --headless if you wish to experiment.
nenolod
parents: 0
diff changeset
69 return;
0ee0b9b6db7e [svn] headless now working, use --headless if you wish to experiment.
nenolod
parents: 0
diff changeset
70
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
71 ps->ps_status = status;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
72 widget_draw(WIDGET(ps));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
73 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
74
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
75 PlayStatus *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
76 create_playstatus(GList ** wlist, GdkPixmap * parent,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
77 GdkGC * gc, gint x, gint y)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
78 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
79 PlayStatus *ps;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
80
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
81 ps = g_new0(PlayStatus, 1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
82 widget_init(&ps->ps_widget, parent, gc, x, y, 11, 9, TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
83 ps->ps_widget.draw = playstatus_draw;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
84
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
85 widget_list_add(wlist, WIDGET(ps));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
86 return ps;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
87 }