Fixed a bug with connecting with alsa.
This commit is contained in:
parent
11e4a4d183
commit
e034c518ee
22
tojam
22
tojam
@ -147,7 +147,7 @@ configure_ninjam() {
|
||||
--no-tags \
|
||||
--menu "Select the sound card Ninjam should use" -1 -1 -1 "${soundcards[@]}" --stdout)"
|
||||
menuCode=$?
|
||||
if [ ${menuCode} -eq 1 -o ${menuCode} -eq 255]; then
|
||||
if [ ${menuCode} -eq 1 -o ${menuCode} -eq 255 ]; then
|
||||
continue
|
||||
fi
|
||||
soundDriver="$(dialog --backtitle "Tojam" --title "Alsa Configuration" \
|
||||
@ -159,7 +159,7 @@ configure_ninjam() {
|
||||
"nch:" 6 1 "2" 6 25 6 6 \
|
||||
"in:" 7 1 "${soundcard}" 7 25 25 25 \
|
||||
"out:" 8 1 "${soundcard}" 8 25 25 25 --stdout)"
|
||||
if [ ${menuCode} -eq 1 -o ${menuCode} -eq 255]; then
|
||||
if [ ${menuCode} -eq 1 -o ${menuCode} -eq 255 ]; then
|
||||
continue
|
||||
fi
|
||||
mapfile -t alsaParameters < <(echo "${soundDriver}")
|
||||
@ -168,10 +168,11 @@ configure_ninjam() {
|
||||
alsaParameters[2]="bps ${alsaParameters[2]}"
|
||||
alsaParameters[3]="srate ${alsaParameters[3]}"
|
||||
alsaParameters[4]="nch ${alsaParameters[4]}"
|
||||
alsaParameters[5]="in ${alsaParameters[5]}"
|
||||
alsaParameters[6]="out ${alsaParameters[6]}"
|
||||
soundDriver="alsaconfig '${alsaParameters[*]}'"
|
||||
sed -i "s/^soundDriver=.*/soundDriver=\"${soundDriver}\"/" "${config}/config" &&
|
||||
alsaParameters[5]="in hw:${alsaParameters[5]}"
|
||||
alsaParameters[6]="out hw:${alsaParameters[6]}"
|
||||
soundDriver="alsa"
|
||||
alsaParameters="${alsaParameters[*]}"
|
||||
sed -i -e "s/^soundDriver=.*/soundDriver=\"${soundDriver}\"/" -e "s/^alsaParameters=.*/alsaParameters=\"${alsaParameters}\"/" "${config}/config" &&
|
||||
dialog --msgbox "Sound driver set to alsa." -1 -1
|
||||
;;
|
||||
"username")
|
||||
@ -195,7 +196,8 @@ mkdir -p "${config}"
|
||||
|
||||
if ! [[ -r "${config}/config" ]]; then
|
||||
# Write initial config file
|
||||
{ echo 'anonymous="true"';
|
||||
{ echo 'alsaParameters=""';
|
||||
echo 'anonymous="true"';
|
||||
echo 'saveSourceFiles="false"';
|
||||
echo 'soundDriver="jack"';
|
||||
echo "userName='Tojam$(date '+%S')'"; } >> "${config}/config"
|
||||
@ -276,4 +278,8 @@ esac
|
||||
|
||||
ninjam="$(command -v cninjam 2> /dev/null)"
|
||||
[[ ${#ninjam} -le 3 ]] && { echo "Could not find cninjam."; exit 1; }
|
||||
$ninjam "${server}" -user "${userName}" -${soundDriver} -sessiondir "${sessiondir}" ${saveSourceFiles}
|
||||
if [[ "${soundDriver}" == "jack" ]]; then
|
||||
$ninjam "${server}" -user "${userName}" -jack -sessiondir "${sessiondir}" ${saveSourceFiles}
|
||||
else
|
||||
$ninjam "${server}" -user "${userName}" -alsaconfig "${alsaParameters}" -sessiondir "${sessiondir}" ${saveSourceFiles}
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user