1980
|
1 |
--- sugar-toolkit-0.84.4/configure.ac-orig 2009-07-05 08:07:38.661236000 -0500
|
|
2 |
+++ sugar-toolkit-0.84.4/configure.ac 2009-07-05 08:22:53.096803000 -0500
|
|
3 |
@@ -19,7 +19,15 @@ AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(c
|
|
4 |
|
|
5 |
AC_PATH_PROG(PYGTK_CODEGEN, pygtk-codegen-2.0, no)
|
|
6 |
|
|
7 |
-PKG_CHECK_MODULES(EXT, pygtk-2.0 gtk+-2.0 sm ice alsa)
|
|
8 |
+PKG_CHECK_MODULES(EXT, pygtk-2.0 gtk+-2.0 sm ice)
|
|
9 |
+
|
|
10 |
+PKG_CHECK_MODULES(alsa,,
|
|
11 |
+ have_alsa=yes,
|
|
12 |
+ have_alsa=no)
|
|
13 |
+if test "x$have_alsa" = "xyes" ; then
|
|
14 |
+ AC_DEFINE(HAVE_ALSA, [], [Define if we have ALSA])
|
|
15 |
+fi
|
|
16 |
+AM_CONDITIONAL(HAVE_ALSA, test x$have_alsa = xyes)
|
|
17 |
|
|
18 |
PYGTK_DEFSDIR=`$PKG_CONFIG --variable=defsdir pygtk-2.0`
|
|
19 |
AC_SUBST(PYGTK_DEFSDIR)
|
|
20 |
--- sugar-toolkit-0.84.4/src/sugar/Makefile.am-orig 2009-07-05 08:14:15.014655000 -0500
|
|
21 |
+++ sugar-toolkit-0.84.4/src/sugar/Makefile.am 2009-07-05 08:24:34.580438000 -0500
|
|
22 |
@@ -13,9 +13,13 @@ pkgpyexecdir = $(pythondir)/sugar
|
|
23 |
|
|
24 |
pkgpyexec_LTLIBRARIES = _sugarext.la
|
|
25 |
|
|
26 |
+if HAVE_ALSA
|
|
27 |
+ALSA_FLAGS="-DHAVE_ALSA"
|
|
28 |
+endif
|
|
29 |
+
|
|
30 |
_sugarext_la_CFLAGS = \
|
|
31 |
- -DHAVE_ALSA \
|
|
32 |
- $(WARN_CFLAGS) \
|
|
33 |
+ $(ALSA_FLAGS) \
|
|
34 |
+ $(WARN_CFLAGS) \
|
|
35 |
$(EXT_CFLAGS) \
|
|
36 |
$(PYTHON_INCLUDES)
|
|
37 |
|
2328
|
38 |
--- sugar-toolkit-0.87.3/src/sugar/acme-volume-alsa.c-orig 2010-02-02 14:19:37.593373355 -0600
|
|
39 |
+++ sugar-toolkit-0.87.3/src/sugar/acme-volume-alsa.c 2010-02-02 14:23:08.345907689 -0600
|
|
40 |
@@ -26,7 +26,9 @@
|
|
41 |
|
|
42 |
#include "acme-volume-alsa.h"
|
1980
|
43 |
|
|
44 |
+#ifdef HAVE_ALSA
|
2328
|
45 |
#include <alsa/asoundlib.h>
|
|
46 |
+#endif
|
|
47 |
|
|
48 |
#ifndef DEFAULT_CARD
|
|
49 |
#define DEFAULT_CARD "default"
|
|
50 |
@@ -45,8 +47,10 @@ struct AcmeVolumeAlsaPrivate
|
|
51 |
{
|
|
52 |
long pmin, pmax;
|
|
53 |
gboolean has_mute, has_master;
|
|
54 |
+#ifdef HAVE_ALSA
|
|
55 |
snd_mixer_t *handle;
|
|
56 |
snd_mixer_elem_t *elem;
|
|
57 |
+#endif
|
|
58 |
int saved_volume;
|
|
59 |
guint timer_id;
|
|
60 |
};
|
|
61 |
@@ -85,6 +89,7 @@ acme_volume_alsa_finalize (GObject *obje
|
|
62 |
static void
|
|
63 |
acme_volume_alsa_set_mute (AcmeVolume *vol, gboolean val)
|
|
64 |
{
|
|
65 |
+#ifdef HAVE_ALSA
|
|
66 |
AcmeVolumeAlsa *self = (AcmeVolumeAlsa *) vol;
|
|
67 |
|
|
68 |
if (acme_volume_alsa_open (self) == FALSE)
|
|
69 |
@@ -111,11 +116,13 @@ acme_volume_alsa_set_mute (AcmeVolume *v
|
|
70 |
acme_volume_alsa_set_volume (vol,
|
|
71 |
self->_priv->saved_volume);
|
|
72 |
}
|
|
73 |
+#endif
|
|
74 |
}
|
1980
|
75 |
|
2328
|
76 |
static gboolean
|
|
77 |
acme_volume_alsa_get_mute (AcmeVolume *vol)
|
|
78 |
{
|
|
79 |
+#ifdef HAVE_ALSA
|
|
80 |
AcmeVolumeAlsa *self = (AcmeVolumeAlsa *) vol;
|
|
81 |
int ival;
|
|
82 |
|
|
83 |
@@ -135,11 +142,15 @@ acme_volume_alsa_get_mute (AcmeVolume *v
|
|
84 |
|
|
85 |
return (acme_volume_alsa_get_volume (vol) == 0);
|
|
86 |
}
|
|
87 |
+#else
|
|
88 |
+ return FALSE;
|
|
89 |
+#endif
|
|
90 |
}
|
|
91 |
|
|
92 |
static int
|
|
93 |
acme_volume_alsa_get_volume (AcmeVolume *vol)
|
|
94 |
{
|
|
95 |
+#ifdef HAVE_ALSA
|
|
96 |
AcmeVolumeAlsa *self = (AcmeVolumeAlsa *) vol;
|
|
97 |
long lval, rval;
|
|
98 |
int tmp;
|
|
99 |
@@ -160,11 +171,15 @@ acme_volume_alsa_get_volume (AcmeVolume
|
|
100 |
tmp = ROUND (alsa_vol);
|
|
101 |
|
|
102 |
return tmp;
|
|
103 |
+#else
|
|
104 |
+ return 0;
|
|
105 |
+#endif
|
1980
|
106 |
}
|
|
107 |
|
2328
|
108 |
static void
|
|
109 |
acme_volume_alsa_set_volume (AcmeVolume *vol, int val)
|
|
110 |
{
|
|
111 |
+#ifdef HAVE_ALSA
|
|
112 |
AcmeVolumeAlsa *self = (AcmeVolumeAlsa *) vol;
|
|
113 |
float volume;
|
|
114 |
int tmp;
|
|
115 |
@@ -179,11 +194,13 @@ acme_volume_alsa_set_volume (AcmeVolume
|
|
116 |
snd_mixer_selem_set_playback_volume_all (self->_priv->elem, tmp);
|
|
117 |
|
|
118 |
acme_volume_alsa_close (self);
|
1980
|
119 |
+#endif
|
2328
|
120 |
}
|
|
121 |
|
|
122 |
static int
|
|
123 |
acme_volume_alsa_get_threshold (AcmeVolume *vol)
|
|
124 |
{
|
|
125 |
+#ifdef HAVE_ALSA
|
|
126 |
AcmeVolumeAlsa *self = (AcmeVolumeAlsa *) vol;
|
|
127 |
int steps;
|
|
128 |
|
|
129 |
@@ -194,11 +211,15 @@ acme_volume_alsa_get_threshold (AcmeVolu
|
|
130 |
|
|
131 |
steps = self->_priv->pmax - self->_priv->pmin;
|
|
132 |
return (steps > 0) ? 100 / steps + 1 : 1;
|
|
133 |
+#else
|
|
134 |
+ return 1;
|
|
135 |
+#endif
|
|
136 |
}
|
|
137 |
|
|
138 |
static gboolean
|
|
139 |
acme_volume_alsa_close_real (AcmeVolumeAlsa *self)
|
|
140 |
{
|
|
141 |
+#ifdef HAVE_ALSA
|
|
142 |
if (self->_priv == NULL)
|
|
143 |
return FALSE;
|
|
144 |
|
|
145 |
@@ -211,13 +232,14 @@ acme_volume_alsa_close_real (AcmeVolumeA
|
|
146 |
}
|
|
147 |
|
|
148 |
self->_priv->timer_id = 0;
|
|
149 |
-
|
|
150 |
+#endif
|
|
151 |
return FALSE;
|
|
152 |
}
|
|
153 |
|
|
154 |
static gboolean
|
|
155 |
acme_volume_alsa_open (AcmeVolumeAlsa *self)
|
|
156 |
{
|
|
157 |
+#ifdef HAVE_ALSA
|
|
158 |
snd_mixer_selem_id_t *sid;
|
|
159 |
snd_mixer_t *handle;
|
|
160 |
snd_mixer_elem_t *elem;
|
|
161 |
@@ -286,6 +308,7 @@ acme_volume_alsa_open (AcmeVolumeAlsa *s
|
|
162 |
|
|
163 |
bail:
|
|
164 |
acme_volume_alsa_close_real (self);
|
|
165 |
+#endif
|
|
166 |
return FALSE;
|
|
167 |
}
|
|
168 |
|
|
169 |
|