home *** CD-ROM | disk | FTP | other *** search
- /* FilterDemo ©1997 by Felix Schwarz
- This small script does previews of ALL filters,
- that are available in UConv. You can use parts
- of this Rexx-script in your own scripts..
- This script would be MUCH shorter without comments,
- so please go trough it.. it isn`t that long as it
- seems to be..
- */
-
- options results
- address 'UConv'
- /* Let`s get the number of filters and Anim-F/X currently available */
- FILTNUM
- fn=result
- ANIMFXNUM
- afxn=result
- summ=fn+afxn
-
- /* .. and show them */
- REQUESTER "Filter-Demo" "Wow!!" "You have "||fn||" Filters and "||afxn||" Anim-F/X available!|That are "||summ||" operators/effects in total!"
-
- /* Get a user-input */
- REQUESTER "Filter-Demo" "Yeah!|No.." "Wanna do a complete overview over all your filters ?"
- res=result
-
- IF res=1 THEN DO
- /* Let`s ask the user for the location of the preview-files */
- GETASLPATH "Set_the_location:" "T:"
- dir=result
-
- /* Ok, we`ll use the UConv-Logo as the basis for our previews */
- FIRSTINFILE "Ultraconvlogo.brsh"
-
- /* We wanna save it in JPEG */
- OUTFORMAT 10
- suffix=".jpg"
-
- /* Switch on the Filters and switch off the rest - but without poping up the GUI */
- SCALEREQ OFF NOGUI
- ROTATEREQ OFF NOGUI
- DITHERREQ OFF NOGUI
- ANIMFXREQ OFF NOGUI
- ANIMPUBREQ OFF NOGUI
- FILTERREQ ON NOGUI
-
- /* Open a progress bar with a statusline */
- OPENPROGRESSBAR 1 "Doing filters.."
-
- /* Let`s set it */
- SETPROGRESSBAR 1 0 "Writing AmigaGuide®-Header.."
- OPEN('filtprev',dir||'Filterpreviews.guide','W')
- WRITELN('filtprev','@database Filterpreviews.guide')
- WRITELN('filtprev','@master Filterpreviews.guide')
-
- /* Which version of UConv are we talking with ? :-) */
- UCVERSION
- vers=result
- WRITELN('filtprev','@$VER: '||vers)
- WRITELN('filtprev','@author Filter-Demo-Rexx-Script 1.0')
- WRITELN('filtprev','@(c) Felix Schwarz')
- WRITELN('filtprev','@remark Created with FilterDemo V1.0 (C)1997 by Felix Schwarz')
- WRITELN('filtprev',' ')
- WRITELN('filtprev','@node "Main" "Filter-Demo-Rexx-Guide 1.0"')
- WRITELN('filtprev','This cool guide was created by an even more cool ARexx-script')
- WRITELN('filtprev','using the UConv-ARexx-port. Click on one of the filter-names,')
- WRITELN('filtprev','to get a preview of the filters of '||vers)
-
- /* Let`s change the status */
- SETPROGRESSBAR 1 0 "Writing HTML-Header.."
- OPEN('html',dir||'Filterpreviews.html','W')
- WRITELN('html','<HTML><HEAD><TITLE>Filterpreviews created by FilterDemo 1.0</TITLE></HEAD>')
- WRITELN('html','<BODY BGCOLOR=#CFCFF0>')
- WRITELN('html','<CENTER><TABLE BORDER=1>')
- WRITELN('html','<TR><TD COLSPAN=2 ALIGN=CENTER><FONT SIZE=+2>Overview of all filters of UConv</FONT></TD></TR>')
-
- /* Now we`ll begin with the previews */
- DO i=0 to fn-1
- /* At first let`s begin with setting a filter */
- FILTCSTAT 0 i 20
-
- /* What`s the filters name ? */
- FILTNAME i
- fname=result
-
- /* Set the progress-bar */
- SETPROGRESSBAR 1 (i/fn)*100 'Doing: '||fname||'..'
-
- /* Let`s set the output-file and let`s convert */
- file=dir||fname||suffix
- FIRSTOUTFILE file
- CONVERT
-
- /* How long did we need for this operation ? */
- NEEDEDTIME
- ntime=result
-
- /* Let`s create a cool column for the AmigaGuide®-Document and write the line */
- MAKECOLUMN 30 fname
- WRITELN('filtprev','@{"'||result||'" link "'||dir||fname||suffix||'/main"} '||ntime)
-
- /* What was the last size before saving ? */
- GETLASTWIDTH
- width=result
- GETLASTHEIGHT
- height=result
-
- /* Width>400 ? Doesn`t fit in a normal browser-window and looks stupid -> "scale" */
- IF width>400 THEN DO
- widthscale=width/400
- width=400
- height=height/widthscale
- END
-
- /* Let`s save another line to the HTML-document */
- WRITELN('html','<TR><TD>'||fname||'('||ntime||')</TD><TD><IMG SRC="'||fname||suffix||'" WIDTH='||width||' HEIGHT='||height||'></TR>')
- END
-
- /* Let`s deselect the filter */
- FILTSTAT 0 -1 1
-
- /* Let`s switch off filters */
- FILTERREQ OFF NOGUI
-
- /* Close down the Hypertext-documents */
- WRITELN('filtprev','@endnode');
- WRITELN('html','<TR><TD COLSPAN=2>This HTML-overview was done by Filterdemo using '||vers||'</TD></TR></TABLE></CENTER></BODY></HTML>')
- CLOSE('filtprev')
- CLOSE('html')
-
- /* Close the progress-bar */
- CLOSEPROGRESSBAR 1
-
- /* Let`s copy some icons and show the AmigaGuide */
- Address command 'copy UConv:Doc_E.guide.info '||dir||'Filterpreviews.guide.info'
- Address command 'copy UConv:Doc_E.guide.info '||dir||'Filterpreviews.html.info'
- Address command 'sys:Utilities/Multiview '||dir||'Filterpreviews.guide'
-
- /* Nerv the user again ;-) .. and add a linefeed after look */
- REQUESTER "Ready!" "Coool!" "The Rexx-Script finished its work.. also watch|the created HTML-document with your browser."
-
- END
- ELSE REQUESTER "Filter-Demo" "Ok!" "Well, perhaps you`ll do an overview next time :-)"
-
- /* End of the script */
- EXIT
-