add 'Browse next' functionality

main
Christos Angelopoulos 2022-03-24 02:59:27 +02:00
parent 79b845a3b5
commit d51ee84534
2 changed files with 20 additions and 0 deletions

10
Sapo.sh
View File

@ -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++))

View File

@ -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++))