little mp3 calculator

YOU NEED THE DIALOG DIRECTOR v 0.7 TO WORK WITH MY PROGRAM.

this is a little mp3 calculator wich help you to calculate the size of an encoded audio cd. FOR THIS PROGRAM YOU NEED THE Dialog Director v0.7.

OS version: Any

-- copyright by nicki schäfer
-- all rights reserved, june 2004
-- thx audion, shorty
-- if there is something to improve, write to nicki.schaefer@epost.de

property msgDialog : {size:[400, 80], style:standard window, closeable:true, name:"Shortys", contents:[¬
	{class:static text, contents:"Little MP3 Calculator", bounds:[0, 20, 400, 90], font:1, justification:center}]}

dd install with fonts [{size:25, color:[0, 0, 65535]}] with grayscale
set d to dd make dialog msgDialog
try
	repeat
		if (dd interact with user for max ticks 15) = -1 then exit repeat
		dd set font of item 1 of d to 2
		if (dd interact with user for max ticks 15) = -1 then exit repeat
		dd set font of item 1 of d to 1
	end repeat
end try
dd uninstall

property rate : 0.015122987
set dlog128 to {size:[275, 210], name:"MP3 CALCULATOR", style:standard window, contents:[¬
	{class:push button, bounds:[94, 160, 175, 180], name:"Calculate", action:"calculate"}, ¬
	{class:text field, bounds:[94, 88, 124, 106], value:""}, ¬
	{class:text field, bounds:[145, 88, 175, 106], value:""}, ¬
	{class:static text, bounds:[55, 30, 297, 46], contents:"Enter here the length of"}, ¬
	{class:static text, bounds:[86, 50, 326, 50], contents:"your music CD:"}, ¬
	{class:static text, bounds:[131, 88, 141, 106], contents:":"}, ¬
	{class:static text, bounds:[95, 114, 125, 130], contents:"min"}, ¬
	{class:static text, bounds:[131, 114, 141, 130], contents:":"}, ¬
	{class:static text, bounds:[147, 114, 177, 130], contents:"sec"} ¬
		], closeable:true ¬
	}

dd auto dialog dlog128 with grayscale given script:me

on calculate()
	set [a, b] to dd get value of items 2 thru 3 of dialog 1
	set ergebnis to (((a * 60) + b) * rate)
	set mb to ((round (ergebnis * 10)) / 10)
	display dialog "If you encode your music CD with Audion 3.0.2 in \"Normal Qualtiy\", your encoded CD has a size about " & mb & " MB." buttons {"Close"} default button {"Close"} with icon 1
end calculate