muxsa-vr: small cleanups

This commit is contained in:
Sebastian Kiesel 2023-08-13 19:13:13 +02:00
parent d59643353c
commit bd99ad32ac

View File

@ -76,8 +76,8 @@ EOF
# interaction with audacity
# https://manual.audacityteam.org/man/scripting_reference.html
AUDACITY_PIPE_FROM="/tmp/audacity_script_pipe.from.$(id -u)"
AUDACITY_PIPE_TO="/tmp/audacity_script_pipe.to.$(id -u)"
AUDACITY_PIPE_FROM="/tmp/audacity_script_pipe.from.${EUID}"
AUDACITY_PIPE_TO="/tmp/audacity_script_pipe.to.${EUID}"
send_to_audacity () {
if [ -p "${AUDACITY_PIPE_TO}" ] ; then
@ -247,11 +247,23 @@ while true ; do
fi
;;
'RECORDING')
send_to_audacity 'AddLabelPlaying'
echo "Adding label while recording"
LABEL=$(( ${LABEL} + 1 ))
CLIPS[$LABEL]=0
send_to_geeqie 'next'
echo "Cannot add label while recording. Ignored."
# adding labels while recording has two problems
# as of Audacity 3.2.4
# - Audacity will steal our window focus,
# getting it back with xdotool may cause dropouts
# - we cannot set the label text, this would stop
# recording. we would have to keep a todo list
# of text to add to the labels to add later.
# not a big problem to implement, but not worth it
# as long as there is no solution for the first issue
# send_to_audacity 'AddLabelPlaying'
# echo "Adding label while recording"
# LABEL=$(( ${LABEL} + 1 ))
# CLIPS[$LABEL]=0
# send_to_geeqie 'next'
;;
*)
echo "add label: invalid state ${STATE} ... ignore"
@ -279,6 +291,9 @@ while true ; do
;;
'1')
echo "Deleting first clip after label."
# Assuming that Edit / Preferences / Interface /
# Retain labels if selection snaps to a label
# is disabled
send_to_audacity 'CursTrackEnd'
send_to_audacity 'SelPrevClipBoundaryToCursor'
send_to_audacity 'Delete'