File: gui

package info (click to toggle)
sonic-pi 3.2.2~repack-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 71,872 kB
  • sloc: ruby: 30,548; cpp: 8,490; sh: 957; ansic: 461; erlang: 360; lisp: 141; makefile: 44
file content (53 lines) | stat: -rwxr-xr-x 1,155 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/sh

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

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

# start sonic pi
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

# enter code
xclip -selection clipboard -i <<EOF
live_loop :tabla do
  sample :loop_tabla
  sleep 8
end
EOF

xdotool search --sync --all --onlyvisible --name "Sonic Pi" \
  windowfocus --sync %1 \
  key --clearmodifiers --delay 1000 ctrl+v alt+o alt+r

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

# record audio
WAV=$AUTOPKGTEST_ARTIFACTS/gui.wav
jack_capture -d 10 $WAV 2>&1

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

# check recording
TEMPO=$AUTOPKGTEST_ARTIFACTS/gui.bpm
aubio tempo $WAV | tee $TEMPO
grep -q '^1[[:digit:]][[:digit:]][.][[:digit:]]* bpm$' $TEMPO