mirror of https://gitlab.com/christosangel/sapo
add Duration indication
parent
11abf9307f
commit
6219c181df
13
Sapo.sh
13
Sapo.sh
|
@ -20,7 +20,8 @@ case $? in
|
|||
esac
|
||||
DIRECTORY=${FILE%/*}/
|
||||
NAME=${FILE##*/}
|
||||
echo "FILE : ""$FILE"
|
||||
TEXT_EDITOR="xed"
|
||||
AUDIO_EDITOR="audacity"
|
||||
|
||||
mkdir "$DIRECTORY""Sapo_""$NAME"/
|
||||
|
||||
|
@ -89,7 +90,7 @@ case $? in
|
|||
;;
|
||||
1) exit
|
||||
;;
|
||||
2) xed "$DIRECTORY""Sapo_""$NAME"/"$NAME"sentenced.txt & yad --image "$HOME/git/sapo/sapo.png" --height=40 --width=400 --title="${NAME} - Sapo" --button=gtk-cancel:1 --button=gtk-ok:0 --text="If you are done editing $NAME\sentenced.txt, <span foreground='yellow'><b>press OK</b></span> to continue!" --window-icon=$HOME/git/sapo/sapo.png
|
||||
2) $TEXT_EDITOR "$DIRECTORY""Sapo_""$NAME"/"$NAME"sentenced.txt & yad --image "$HOME/git/sapo/sapo.png" --height=40 --width=400 --title="${NAME} - Sapo" --button=gtk-cancel:1 --button=gtk-ok:0 --text="If you are done editing $NAME\sentenced.txt, <span foreground='yellow'><b>press OK</b></span> to continue!" --window-icon=$HOME/git/sapo/sapo.png
|
||||
case $? in
|
||||
0)
|
||||
;;
|
||||
|
@ -124,7 +125,7 @@ do
|
|||
TOTALCHARS=$(wc -m "$DIRECTORY""Sapo_""$NAME"/"$NAME"sentenced.txt |awk '{print $1}')
|
||||
CHARSDONE=$(head -$LINE "$DIRECTORY""Sapo_""$NAME"/"$NAME"sentenced.txt|wc -m)
|
||||
CHARSLEFT=$(($TOTALCHARS - $CHARSDONE))
|
||||
SECONDS=$(( $CHARSLEFT / 4 ))
|
||||
SECONDS=$(( $CHARSLEFT / 8 ))
|
||||
CHARSDONE100=$(($CHARSDONE * 100))
|
||||
PERCENTAGE=$(( $CHARSDONE100 / $TOTALCHARS))
|
||||
HOURS=$(( SECONDS / 3600 ))
|
||||
|
@ -240,6 +241,7 @@ do
|
|||
killall mplayer;mplayer "$DIRECTORY""Sapo_""$NAME"/$ERROR_WAV &
|
||||
fi
|
||||
BROWSE_NEXT=false
|
||||
DURATION=$(sox "$DIRECTORY""Sapo_""$NAME"/$ERROR_WAV -n stat 2>&1 |grep "Length"|sed 's/^.*\: *//')
|
||||
yad --image "$HOME/git/sapo/sapo.png" \
|
||||
--height=40 --width=400 \
|
||||
--title="Line $ERROR_TEXT_LINE ( of $TOTAL_ERRORS )- $NAME" \
|
||||
|
@ -256,8 +258,9 @@ do
|
|||
--button='⏩ Browse':9 \
|
||||
--text="Text of line $ERROR_TEXT_LINE ( of $TOTAL_ERRORS ):
|
||||
|
||||
<span foreground='yellow'><b>$TEXT_TO_CORRECT</b></span>
|
||||
<span foreground='yellow'><b>$TEXT_TO_CORRECT</b></span> sec
|
||||
|
||||
-Duration : <span foreground='orange'><b>$DURATION</b></span>
|
||||
-What would you like to do?" \
|
||||
--window-icon=$HOME/git/sapo/sapo.png
|
||||
case $? in
|
||||
|
@ -276,7 +279,7 @@ do
|
|||
;;
|
||||
6) if [[ -e "$DIRECTORY""Sapo_""$NAME"/$ERROR_WAV ]];then rm "$DIRECTORY""Sapo_""$NAME"/$ERROR_WAV;notify-send "$DIRECTORY""Sapo_""$NAME"/"$ERROR_WAV"" has been deleted."; else notify-send "There is no file ""$DIRECTORY""Sapo_""$NAME"/"$ERROR_WAV"". Already deleted?";fi;GO=true
|
||||
;;
|
||||
7)killall mplayer;audacity "$DIRECTORY""Sapo_""$NAME"/$ERROR_WAV
|
||||
7)killall mplayer;$AUDIO_EDITOR "$DIRECTORY""Sapo_""$NAME"/$ERROR_WAV
|
||||
;;
|
||||
8)killall mplayer; GO=true; ERROR_LINE=$(($ERROR_LINE - 2))
|
||||
;;
|
||||
|
|
11
sapo-fix.sh
11
sapo-fix.sh
|
@ -21,6 +21,7 @@ case $? in
|
|||
esac
|
||||
DIRECTORY=${FILE%/*}/
|
||||
NAME=${FILE##*/}
|
||||
AUDIO_EDITOR="audacity"
|
||||
####### FIXING ERRORS ONE BY ONE or EDIT THE FILE LINE BY LINE############
|
||||
yad --image "$HOME/git/sapo/sapo-fix.png" \
|
||||
--height=40 --width=200 --title="${NAME} - Sapo" \
|
||||
|
@ -70,7 +71,8 @@ do
|
|||
killall mplayer;mplayer "$DIRECTORY""Sapo_""$NAME"/$ERROR_WAV &
|
||||
fi
|
||||
BROWSE_NEXT=false
|
||||
yad --image "$HOME/git/sapo/sapo-fix.png" \
|
||||
DURATION=$(sox "$DIRECTORY""Sapo_""$NAME"/$ERROR_WAV -n stat 2>&1 |grep "Length"|sed 's/^.*\: *//')
|
||||
yad --image "$HOME/git/sapo/sapo.png" \
|
||||
--height=40 --width=400 \
|
||||
--title="Line $ERROR_TEXT_LINE ( of $TOTAL_ERRORS )- $NAME" \
|
||||
--button=gtk-cancel:1 \
|
||||
|
@ -84,12 +86,13 @@ do
|
|||
--button='➡️ Next':0 \
|
||||
--button='👉 Go To':10 \
|
||||
--button='⏩ Browse':9 \
|
||||
--text="Text of line $ERROR_TEXT_LINE ( of $TOTAL_ERRORS ):
|
||||
--text="-Text of line $ERROR_TEXT_LINE ( of $TOTAL_ERRORS ):
|
||||
|
||||
<span foreground='yellow'><b>$TEXT_TO_CORRECT</b></span>
|
||||
|
||||
-Duration : <span foreground='orange'><b>$DURATION</b></span> sec
|
||||
-What would you like to do?" \
|
||||
--window-icon=$HOME/git/sapo/sapo-fix.png
|
||||
--window-icon=$HOME/git/sapo/sapo.png
|
||||
case $? in
|
||||
0) killall mplayer;GO=true
|
||||
;;
|
||||
|
@ -106,7 +109,7 @@ do
|
|||
;;
|
||||
6)killall mplayer; if [[ -e "$DIRECTORY""Sapo_""$NAME"/$ERROR_WAV ]];then rm "$DIRECTORY""Sapo_""$NAME"/$ERROR_WAV;notify-send "$DIRECTORY""Sapo_""$NAME"/"$ERROR_WAV"" has been deleted."; else notify-send "There is no file ""$DIRECTORY""Sapo_""$NAME"/"$ERROR_WAV"". Already deleted?";fi;GO=true
|
||||
;;
|
||||
7)killall mplayer;audacity "$DIRECTORY""Sapo_""$NAME"/$ERROR_WAV
|
||||
7)killall mplayer;$AUDIO_EDITOR "$DIRECTORY""Sapo_""$NAME"/$ERROR_WAV
|
||||
;;
|
||||
8)killall mplayer; GO=true; ERROR_LINE=$(($ERROR_LINE - 2))
|
||||
;;
|
||||
|
|
Loading…
Reference in New Issue