From d51ee8453415b03b4a9c51870e91aa10da22089a Mon Sep 17 00:00:00 2001 From: Christos Angelopoulos Date: Thu, 24 Mar 2022 02:59:27 +0200 Subject: [PATCH] add 'Browse next' functionality --- Sapo.sh | 10 ++++++++++ sapo-fix.sh | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/Sapo.sh b/Sapo.sh index 44001fa..1da25fc 100755 --- a/Sapo.sh +++ b/Sapo.sh @@ -204,6 +204,7 @@ else TOTAL_ERRORS=$(cat "$DIRECTORY""Sapo_""$NAME"/errors.tsv|wc -l) fi ERROR_LINE=1 +BROWSE_NEXT=false while [ $ERROR_LINE -le $TOTAL_ERRORS ] do if [[ $LINES_TO_EDIT == "ALL" ]] @@ -223,6 +224,11 @@ do while [[ $GO == false ]] do + if [[ $BROWSE_NEXT == true ]] + then + celluloid "$DIRECTORY""Sapo_""$NAME"/$ERROR_WAV & + fi + BROWSE_NEXT=false yad --image "$HOME/git/sapo/sapo.png" \ --height=40 --width=400 \ --title="Line $ERROR_TEXT_LINE ( of $TOTAL_ERRORS )- $NAME" \ @@ -233,6 +239,7 @@ do --button='🗡 Split-Render':5 \ --button='🎵 Edit audio':7 \ --button='❌ Remove audio':6 \ + --button='⏩ Browse Next':9 \ --button='⬅️ Previous Line':8 \ --button='➡️ Next Line':0 \ --text="Text of line $ERROR_TEXT_LINE ( of $TOTAL_ERRORS ): @@ -260,6 +267,9 @@ do 7)audacity "$DIRECTORY""Sapo_""$NAME"/$ERROR_WAV ;; 8) GO=true; ERROR_LINE=$(($ERROR_LINE - 2)) + ;; + 9) BROWSE_NEXT=true; GO=true + ;; esac done ((ERROR_LINE++)) diff --git a/sapo-fix.sh b/sapo-fix.sh index e38a470..fdbbf76 100755 --- a/sapo-fix.sh +++ b/sapo-fix.sh @@ -45,6 +45,7 @@ else TOTAL_ERRORS=$(cat "$DIRECTORY""Sapo_""$NAME"/errors.tsv|wc -l) fi ERROR_LINE=1 +BROWSE_NEXT=false while [ $ERROR_LINE -le $TOTAL_ERRORS ] do if [[ $LINES_TO_EDIT == "ALL" ]] @@ -64,6 +65,11 @@ do while [[ $GO == false ]] do + if [[ $BROWSE_NEXT == true ]] + then + celluloid "$DIRECTORY""Sapo_""$NAME"/$ERROR_WAV & + fi + BROWSE_NEXT=false yad --image "$HOME/git/sapo/sapo.png" \ --height=40 --width=400 \ --title="Line $ERROR_TEXT_LINE ( of $TOTAL_ERRORS )- $NAME" \ @@ -74,6 +80,7 @@ do --button='🗡 Split-Render':5 \ --button='🎵 Edit audio':7 \ --button='❌ Remove audio':6 \ + --button='⏩ Browse Next':9 \ --button='⬅️ Previous Line':8 \ --button='➡️ Next Line':0 \ --text="Text of line $ERROR_TEXT_LINE ( of $TOTAL_ERRORS ): @@ -101,6 +108,9 @@ do 7)audacity "$DIRECTORY""Sapo_""$NAME"/$ERROR_WAV ;; 8) GO=true; ERROR_LINE=$(($ERROR_LINE - 2)) + ;; + 9) BROWSE_NEXT=true; GO=true + ;; esac done ((ERROR_LINE++))