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) TOTAL_ERRORS=$(cat "$DIRECTORY""Sapo_""$NAME"/errors.tsv|wc -l)
fi fi
ERROR_LINE=1 ERROR_LINE=1
BROWSE_NEXT=false
while [ $ERROR_LINE -le $TOTAL_ERRORS ] while [ $ERROR_LINE -le $TOTAL_ERRORS ]
do do
if [[ $LINES_TO_EDIT == "ALL" ]] if [[ $LINES_TO_EDIT == "ALL" ]]
@ -223,6 +224,11 @@ do
while [[ $GO == false ]] while [[ $GO == false ]]
do do
if [[ $BROWSE_NEXT == true ]]
then
celluloid "$DIRECTORY""Sapo_""$NAME"/$ERROR_WAV &
fi
BROWSE_NEXT=false
yad --image "$HOME/git/sapo/sapo.png" \ yad --image "$HOME/git/sapo/sapo.png" \
--height=40 --width=400 \ --height=40 --width=400 \
--title="Line $ERROR_TEXT_LINE ( of $TOTAL_ERRORS )- $NAME" \ --title="Line $ERROR_TEXT_LINE ( of $TOTAL_ERRORS )- $NAME" \
@ -233,6 +239,7 @@ do
--button='🗡 Split-Render':5 \ --button='🗡 Split-Render':5 \
--button='🎵 Edit audio':7 \ --button='🎵 Edit audio':7 \
--button='❌ Remove audio':6 \ --button='❌ Remove audio':6 \
--button='⏩ Browse Next':9 \
--button='⬅️ Previous Line':8 \ --button='⬅️ Previous Line':8 \
--button='➡️ Next Line':0 \ --button='➡️ Next Line':0 \
--text="Text of line $ERROR_TEXT_LINE ( of $TOTAL_ERRORS ): --text="Text of line $ERROR_TEXT_LINE ( of $TOTAL_ERRORS ):
@ -260,6 +267,9 @@ do
7)audacity "$DIRECTORY""Sapo_""$NAME"/$ERROR_WAV 7)audacity "$DIRECTORY""Sapo_""$NAME"/$ERROR_WAV
;; ;;
8) GO=true; ERROR_LINE=$(($ERROR_LINE - 2)) 8) GO=true; ERROR_LINE=$(($ERROR_LINE - 2))
;;
9) BROWSE_NEXT=true; GO=true
;;
esac esac
done done
((ERROR_LINE++)) ((ERROR_LINE++))

View File

@ -45,6 +45,7 @@ else
TOTAL_ERRORS=$(cat "$DIRECTORY""Sapo_""$NAME"/errors.tsv|wc -l) TOTAL_ERRORS=$(cat "$DIRECTORY""Sapo_""$NAME"/errors.tsv|wc -l)
fi fi
ERROR_LINE=1 ERROR_LINE=1
BROWSE_NEXT=false
while [ $ERROR_LINE -le $TOTAL_ERRORS ] while [ $ERROR_LINE -le $TOTAL_ERRORS ]
do do
if [[ $LINES_TO_EDIT == "ALL" ]] if [[ $LINES_TO_EDIT == "ALL" ]]
@ -64,6 +65,11 @@ do
while [[ $GO == false ]] while [[ $GO == false ]]
do do
if [[ $BROWSE_NEXT == true ]]
then
celluloid "$DIRECTORY""Sapo_""$NAME"/$ERROR_WAV &
fi
BROWSE_NEXT=false
yad --image "$HOME/git/sapo/sapo.png" \ yad --image "$HOME/git/sapo/sapo.png" \
--height=40 --width=400 \ --height=40 --width=400 \
--title="Line $ERROR_TEXT_LINE ( of $TOTAL_ERRORS )- $NAME" \ --title="Line $ERROR_TEXT_LINE ( of $TOTAL_ERRORS )- $NAME" \
@ -74,6 +80,7 @@ do
--button='🗡 Split-Render':5 \ --button='🗡 Split-Render':5 \
--button='🎵 Edit audio':7 \ --button='🎵 Edit audio':7 \
--button='❌ Remove audio':6 \ --button='❌ Remove audio':6 \
--button='⏩ Browse Next':9 \
--button='⬅️ Previous Line':8 \ --button='⬅️ Previous Line':8 \
--button='➡️ Next Line':0 \ --button='➡️ Next Line':0 \
--text="Text of line $ERROR_TEXT_LINE ( of $TOTAL_ERRORS ): --text="Text of line $ERROR_TEXT_LINE ( of $TOTAL_ERRORS ):
@ -101,6 +108,9 @@ do
7)audacity "$DIRECTORY""Sapo_""$NAME"/$ERROR_WAV 7)audacity "$DIRECTORY""Sapo_""$NAME"/$ERROR_WAV
;; ;;
8) GO=true; ERROR_LINE=$(($ERROR_LINE - 2)) 8) GO=true; ERROR_LINE=$(($ERROR_LINE - 2))
;;
9) BROWSE_NEXT=true; GO=true
;;
esac esac
done done
((ERROR_LINE++)) ((ERROR_LINE++))