File: gui

package info (click to toggle)
sonic-pi 3.2.2~repack-12
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 71,960 kB
  • sloc: ruby: 30,548; cpp: 8,490; sh: 963; ansic: 461; erlang: 360; lisp: 141; makefile: 28
file content (60 lines) | stat: -rwxr-xr-x 1,277 bytes parent folder | download | duplicates (2)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/sh

# start and wait for virtual X11 server
Xvfb -shmem -screen 0 1280x1024x24 &
xvfb_pid=$!
export DISPLAY=:0
for i in $(seq 1 60); do
  if xwininfo -root; then
    break
  fi
  sleep 1
done

# prepare code
mkdir -p "$HOME/.sonic-pi/store/default/"
cat > "$HOME/.sonic-pi/store/default/workspace_zero.spi" <<EOF
live_loop :tabla do
  sample :loop_tabla
  sleep 8
end
EOF

# start audio server
jackd --no-realtime -ddummy -r48000 -p1024 2>&1 &

# start sonic pi
TMPDIR=$AUTOPKGTEST_TMP sonic-pi 2>&1 &

# wait for and close welcome window
xdotool search --sync --onlyvisible --name Welcome windowclose

# focus editor
xdotool mousemove --sync --clearmodifiers 200 200
xdotool click --clearmodifiers 1

# record audio
xdotool key alt+r
xdotool key alt+shift+r
sleep 10

# save screenshot
xwd -root -out $AUTOPKGTEST_ARTIFACTS/gui.xwd

# save recording
WAV=$(find "$AUTOPKGTEST_TMP" -name '*.wav')
if ! [ -f "$WAV" ]; then
  echo "Recording not found"
  exit 1
fi
cp "$WAV" "$AUTOPKGTEST_ARTIFACTS/test.wav"

# save logs
if [ -d ~/.sonic-pi ]; then
  cp -a ~/.sonic-pi $AUTOPKGTEST_ARTIFACTS/gui.sonic-pi
fi

# check recording
TEMPO=$AUTOPKGTEST_ARTIFACTS/test.bpm
aubio tempo "$AUTOPKGTEST_ARTIFACTS/test.wav" | tee "$TEMPO"
grep -q '^1[0-9][0-9][.][0-9]* bpm$' "$TEMPO"