kdialog progressbar ffmpeg ultimate how to


 
a=$(kdialog --title $"FFmpeg Dolphin Service Menu"  --progressbar $"Starting Conversion..." 100)
b=$(kdialog --title $"FFmpeg Dolphin Service Menu"  --progressbar $"Global work..." 100)
 
qdbus $b  showCancelButton true
 
qdbus $b org.kde.kdialog.ProgressDialog.autoClose true

ls -d -1 /home/shared/Musica/*.mp3 > /tmp/listoffile.txt 
numberoffile=$(wc -l <"/tmp/listoffile.txt")
echo $numberoffile
count=1

while  read <&3 line ; do 

	while read linetwo ; do
qdbus $a org.kde.kdialog.ProgressDialog.setLabelText $"Processing file..... $line"
		qdbus $a  showCancelButton true
		while [[  $(qdbus  $a wasCancelled) != "false" || $(qdbus  $b wasCancelled) != "false"  ]] ; do
			echo -e "$COL_RED ECHO KILLING AXEL AND KDIALOG $COL_RESET"
			qdbus $a  org.kde.kdialog.ProgressDialog.close 
			qdbus $b  org.kde.kdialog.ProgressDialog.close 
			exit
		done
 
		qdbus  $a Set org.kde.kdialog.ProgressDialog value  "$linetwo"
	
	done < <((pv -W -n "$line" | ffmpeg -y ciao.flac -i pipe:0 2>/tmp/logffm.lst) 2>&1 )
	v=$(( $(($count*100))/$numberoffile ))
	echo $(($count*100)) and 
	count=$(($count+1))
	echo "qdbus  $b Set org.kde.kdialog.ProgressDialog value $v"
	qdbus  $b Set org.kde.kdialog.ProgressDialog value $v

done 3<"/tmp/listoffile.txt"   

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: