File: mscore.sh

package info (click to toggle)
musescore 1.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 143,984 kB
  • sloc: cpp: 372,648; xml: 148,276; ansic: 6,156; python: 2,197; perl: 710; sh: 534; makefile: 230
file content (39 lines) | stat: -rw-r--r-- 1,005 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh
PATH=/bin:/usr/bin:/sbin:/usr/sbin
MSCORE=$(which mscore.real)
pgrep -f pulseaudio > /dev/null; PULSEAUDIO=$?
PACTL=$(which pactl)

if [ "$PULSEAUDIO" -eq "0" ] && [ -e "$PACTL" ]; then

	JACK=$($PACTL list | grep jack-sink)
	PAMIXINGVER="0.9.19"
	MIXING=$(echo `$PACTL stat | grep Version | cut -d" " -f3` $PAMIXINGVER | gawk '{ print ($1 >= $2) ? 1 : 0 }')
	PASUSPENDER=$(which pasuspender)

	if [ "$PACTL" -a "$JACK" ]; then
		echo "Using JACK for audio";
		$MSCORE "$@";
	elif [ "$MIXING" ]; then
	    echo "PulseAudio found, but no need to suspend. Starting mscore.real...";
	    $MSCORE "$@";
	elif [ "$PASUSPENDER" ]; then
		echo "Suspending PulseAudio";
		$PASUSPENDER -- $MSCORE "$@";
	else
		echo "Warning: Cannot suspend PulseAudio";
		$MSCORE "$@";
	fi

elif [ "$PULSEAUDIO" -eq "0" ] && [ ! -e "$PACTL" ]; then

	echo "Warning: PulseAudio enabled, but pactl not available"
	echo "Please install pulseaudio-utils to get the best experience"

	$MSCORE "$@";

else

	$MSCORE "$@";

fi