Estimated Time Copy (Callback)

Ejemplos y plantillas para Autoplay Media Studio.
Estimated Time Copy (Callback)

Imagen

Buenas amigos de AMSSpecialist, el otro dia se me ocurrio la idea de hacer que un callback calcule el tiempo que a pasado y el restante, espero que os guste la idea y os ayude a perfeccionar vuestros proyectos.

Callback:
function CopyCallback(sSrcFile, sDstFile, nCopBytes, nTotBytes, nCopBytesCurFile, nTotBytesCurFile)
	if ayt == nil then
		ayt = Math.Floor(nTotBytes/100)
		tm1 = os.clock();
	end
	if _1a == nil then
		if nCopBytes > (ayt) then
			stimatedTotal = Math.Floor((os.clock()-tm1)*100);
			_1a = true;
		end
	end	
	if _10a == nil then
		if nCopBytes > (ayt*10) then
			stimatedTotal = Math.Floor((os.clock()-tm1)*10);
			_10a = true;
		end
	end
	if _50a == nil then
		if nCopBytes > (ayt*50) then
			stimatedTotal = Math.Floor((os.clock()-tm1)*2);
			_50a = true;
		end
	end

	stimated = Math.Floor((os.clock()-tm1));
	if stimatedTotal == nil then
		stimatedTotal = "calculated";
	end
	Paragraph.SetText("Paragraph1", "Time: "..stimated.." seconds of "..stimatedTotal.." seconds.");
end
Llamada:
result = Dialog.FolderBrowse("Please select a folder to copy:", "");
if result ~= "" then
	Folder.Create(_TempFolder.."\\estimated_temp");
	File.Copy(result.."\\*.*", _TempFolder.."\\estimated_temp\\", true, true, false, true, CopyCallback);
	
	Paragraph.SetText("Paragraph1", "Total Time: "..os.clock()-tm1.." seconds.");
	Folder.DeleteTree(_TempFolder.."\\estimated_temp", nil);
end
Ejemplo:
HIDE: ON
Hidebb Message Hidden Description
thanks
way pablo
Thank you
good ..!! thanks ceone
thanks
Gracias
muchas gracias :yes: :yes: :yes:
molable tio molable!
abriras
gracias..

:pc: ...

gracias..

INteresante

manda pra mim

nice xx
thanksssss
thank u for best toipc
gracias
Muchas gracias