From bd99ad32accb3c2fa40c6cfaf3feccfd373f1ba6 Mon Sep 17 00:00:00 2001 From: Sebastian Kiesel Date: Sun, 13 Aug 2023 19:13:13 +0200 Subject: [PATCH] muxsa-vr: small cleanups --- bin/muxsa-vr | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/bin/muxsa-vr b/bin/muxsa-vr index 9db24b9..17351e3 100755 --- a/bin/muxsa-vr +++ b/bin/muxsa-vr @@ -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'