View | Details | Raw Unified | Return to bug 623837
Collapse All | Expand All

(-)/usr/bin/setup-pulseaudio.old (-51 lines)
Lines 25-44 Link Here
25
    fi
25
    fi
26
}
26
}
27
27
28
enable_phonon() {
29
    echo "Enabling PulseAudio for Phonon..."
30
    perl -pi -e "s|PHONON_PULSEAUDIO_DISABLE=1||g;" /etc/environment
31
}
32
33
enable_alsa() {
34
    echo "Enabling PulseAudio for ALSA..."
35
    if grep "ALSA_CONFIG_PATH" /etc/environment; then
36
	echo "PulseAudio config for ALSA already in use"
37
    else
38
	echo "ALSA_CONFIG_PATH=/etc/alsa-pulse.conf" >> /etc/environment
39
    fi
40
}
41
42
enable_libao() {
28
enable_libao() {
43
    echo "Enabling PulseAudio for libao..."
29
    echo "Enabling PulseAudio for libao..."
44
    if test -f /etc/libao.conf; then
30
    if test -f /etc/libao.conf; then
Lines 86-101 Link Here
86
    done
72
    done
87
}
73
}
88
74
89
enable_sdl() {
90
    echo "Enabling PulseAudio for SDL..."
91
    # For SDL, we just add an environment variable, so that apps use the PA audio driver
92
    if grep SDL_AUDIODRIVER /etc/environment; then
93
	echo "SDL already setup to use PulseAudio"
94
    else
95
	echo "SDL_AUDIODRIVER=pulse" >> /etc/environment
96
    fi
97
}
98
99
enable_timidity() {
75
enable_timidity() {
100
    # this is broken. /etc/environment must only contain environment
76
    # this is broken. /etc/environment must only contain environment
101
    # variables. It's not a shell script
77
    # variables. It's not a shell script
Lines 125-144 Link Here
125
    fi
101
    fi
126
}
102
}
127
103
128
disable_alsa() {
129
    echo "Disabling PulseAudio for ALSA..."
130
    perl -pi -e "s|ALSA_CONFIG_PATH=/etc/alsa-pulse.conf||g;" /etc/environment
131
}
132
133
disable_phonon() {
134
    echo "Disabling PulseAudio for Phonon..."
135
    if grep "PHONON_PULSEAUDIO_DISABLE" /etc/environment; then
136
	echo "PulseAudio config for Phonon already in use"
137
    else
138
	echo "PHONON_PULSEAUDIO_DISABLE=1" >> /etc/environment
139
    fi
140
}
141
142
disable_libao() {
104
disable_libao() {
143
    if test -f /etc/libao.conf; then
105
    if test -f /etc/libao.conf; then
144
	echo "Disabling PulseAudio for libao..."
106
	echo "Disabling PulseAudio for libao..."
Lines 169-181 Link Here
169
    done
131
    done
170
}
132
}
171
133
172
disable_sdl() {
173
    echo "Disabling PulseAudio for SDL..."
174
    if grep "SDL_AUDIODRIVER=pulse" /etc/environment; then
175
	perl -pi -e "s|SDL_AUDIODRIVER=pulse||g;" /etc/environment
176
    fi
177
}
178
179
disable_timidity() {
134
disable_timidity() {
180
    # this is broken. /etc/environment must only contain environment
135
    # this is broken. /etc/environment must only contain environment
181
    # variables. It's not a shell script
136
    # variables. It's not a shell script
Lines 204-233 Link Here
204
    --enable)
159
    --enable)
205
	check_root || exit
160
	check_root || exit
206
	ENABLE=1
161
	ENABLE=1
207
	enable_alsa
208
	enable_libao
162
	enable_libao
209
	enable_mplayer
163
	enable_mplayer
210
	enable_openal
164
	enable_openal
211
	enable_oss
165
	enable_oss
212
	enable_sdl
213
	enable_timidity
166
	enable_timidity
214
	enable_xine
167
	enable_xine
215
	enable_autospawn
168
	enable_autospawn
216
	enable_phonon
217
	;;
169
	;;
218
    --disable)
170
    --disable)
219
	check_root || exit
171
	check_root || exit
220
	ENABLE=0
172
	ENABLE=0
221
	disable_alsa
222
	disable_libao
173
	disable_libao
223
	disable_mplayer
174
	disable_mplayer
224
	disable_openal
175
	disable_openal
225
	disable_oss
176
	disable_oss
226
	disable_sdl
227
	disable_timidity
177
	disable_timidity
228
	disable_xine
178
	disable_xine
229
	disable_autospawn
179
	disable_autospawn
230
	disable_phonon
231
	;;
180
	;;
232
    --status)
181
    --status)
233
	STATUS=`grep PULSEAUDIO_ENABLE /etc/sysconfig/sound | cut -f2 -d= | cut -f2 -d\"`
182
	STATUS=`grep PULSEAUDIO_ENABLE /etc/sysconfig/sound | cut -f2 -d= | cut -f2 -d\"`

Return to bug 623837