Debian Codegraph @

meterec-init-conf

raw
1 #!/bin/bash
2
3 if [ -n "$1" ]; then
4
5 CONF_FILE=$1.mrec
6
7 rm -f $CONF_FILE;
8 touch $CONF_FILE;
9
10 echo Creating $CONF_FILE file mapping all jack system ports
11
12 INDEX=""
13
14 echo "ports=(">> $CONF_FILE
15 for CAPTURE in `jack_lsp -A | grep system:capture | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'`
16 do
17
18 if [ -n "$INDEX" ]; then
19 echo "," >> $CONF_FILE
20 fi
21
22 INDEX=`echo $CAPTURE | awk -F"_" '{print $2}'`
23 PLAYBACK=`jack_lsp -A | grep system:playback | grep $INDEX | head -1 | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'`
24
25 echo -n \{ takes=\"\"\; record=\"rec\"\; mute=false\; thru=true\; connections=\[\"$CAPTURE\"\,\"$PLAYBACK\"\]\; name=\"\"\; \} >> $CONF_FILE
26
27 done
28 echo "" >> $CONF_FILE
29 echo ");" >> $CONF_FILE
30
31 echo "version=1;" >> $CONF_FILE
32
33
34 else
35 echo "Usage: meterec-init-conf <session-name>"
36 exit 1
37 fi