home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format 61 / af061a.adf / Macros / MakePlayerFile.clssa < prev    next >
Text File  |  1993-10-11  |  5KB  |  169 lines

  1. /***********************************************************************
  2.   GADGET: "'Make Player'" "7" AUTO TYP: "?"
  3.  
  4.   $DAT >>MakePlayerFile.clssa<< 04.10.1993 (C) ProDAD Holger Burkarth
  5. ************************************************************************/
  6.  
  7. Options Results
  8. Address clariSSA
  9.  
  10.   SSAPlay="c:SSAPlay"
  11.  
  12.   FailAt 10
  13.   AltFail=RESULT
  14.  
  15.   DO FOREVER
  16.     Anims=""
  17.     AnimDatei=""
  18.     IF GetVersion()="P" THEN DO
  19.       GetAnimInfo MASTER MULTI
  20.       IF RESULT~="" THEN DO
  21.         PARSE VAR RESULT . "NAME" '"' AnimDatei '"' .
  22.  
  23.         PARSE VAR RESULT "NAME" '"'AnimDatei'"' "FRAMES" frames MultiMode
  24.         IF MultiMode~="MULTI" THEN AnimDatei=""
  25.       END
  26.     END
  27.     IF AnimDatei="" THEN DO
  28.       GetAnimInfo MASTER
  29.       PARSE VAR RESULT "'" AnimDatei "'" .
  30.     END
  31.  
  32.  
  33.     IF RESULT~="" THEN DO
  34.       MSRequester "TITLE '*** Make Player ***'''",
  35.                         "'Create a batch-file for the SSAPlayer.'",
  36.                   "PTEXT '** Info **'",
  37.                         "'Save current data as PlayeFile.'"
  38.       IF RC~=0 THEN LEAVE
  39.       Art=RESULT
  40.  
  41.       IF Art=1 THEN DO
  42.         MSRequester "TITLE '*** Make Player ***''Info'",
  43.              "'Create a batch-file for the Player.'",
  44.              "'First choose a file name to save the data'",
  45.              "'as. The current settings will be retrained'",
  46.              "'when it is played back unless changes have'",
  47.              "'been made.'",
  48.              "'Start the batch-file with the Shell (CLI)'",
  49.              "'as follows:'",
  50.              "'-------------------------'",
  51.              "'  execute [Filename]  (hit Return key)'",
  52.              "'-------------------------'",
  53.              "'Filename => Name of the batch file'",
  54.        "PTEXT 'Ok'"
  55.       END
  56.       ELSE IF Art=2 THEN DO
  57.         FileSelect 'TITLE "Choose batch-file" PTEXT "Save"'
  58.         IF RC~=0 THEN LEAVE
  59.         Datei=RESULT
  60.  
  61.         GetPlayMode
  62.         PARSE VAR RESULT . "MOUSESTART" Maus . "SLOWPLAY" slow "DFPMode" dfp .
  63.         Line=" -SRN "
  64.         IF Maus="ON" THEN Line=Line "-M"
  65.         ELSE              Line=Line "-m"
  66.         IF slow="ON" THEN Line=Line "-SP"
  67.         ELSE              Line=Line "-sp"
  68.         IF dfp="ON" THEN  Line=Line "-DFP"
  69.         ELSE              Line=Line "-dfp"
  70.  
  71.         GetPref
  72.         PARSE VAR RESULT . "USE24BB" BB24 .
  73.         IF BB24="ON" THEN Line=Line "-24BB"
  74.         ELSE              Line=Line "-24bb"
  75.  
  76.         Append=0
  77.         DateiArt=0;
  78.         IF Exists(Datei) THEN DO
  79.           MSRequester "TITLE 'File already exists.''Append new data to existing file?'",
  80.                       "PTEXT 'Append data to existing file'",
  81.                             "'Create new file'",
  82.                             "'Create new file (with Workbench icon)'"
  83.           IF RC~=0 THEN LEAVE
  84.           if RESULT=1 THEN Append=1
  85.           DateiArt=RESULT
  86.         END
  87.         ELSE DO
  88.           MSRequester "TITLE 'Create player-batch-file'",
  89.                       "PTEXT 'Create file'",
  90.                             "'Create file (with Workbench icon)'"
  91.           IF RC~=0 THEN LEAVE
  92.           DateiArt=RESULT+1
  93.         END
  94.  
  95.         INTRequest "'Enter number of playback repeats.''1 => playback once'" 1
  96.         IF RC~=0 THEN LEAVE
  97.         IF RESULT>1 THEN Line=Line "-l"RESULT
  98.  
  99.         INTRequest "'Enter wait time between loading''and playback. (1/50)sec.''0 == immediately''50 == 1 second'" 0
  100.         IF RC~=0 THEN LEAVE
  101.         IF RESULT>0 THEN Line=Line "-d"RESULT
  102.  
  103.  
  104.  
  105.         Line=Line '"'AnimDatei'"'
  106.  
  107.         IF Append=1 THEN DO
  108.           flag='Append'
  109.           ADDRESS COMMAND "Copy "  '"'Datei'" t:MPF'
  110.           IF Open(rr,"T:MPF","Read") THEN DO
  111.             IF Open(ww,Datei,"Write") THEN DO
  112.               DO FOREVER
  113.                 Zeile=ReadLn(rr)
  114.                 IF Zeile="" THEN LEAVE
  115.                 IF Index(Zeile,"-srn")>0 THEN DO
  116.                   Zeile=Left(Zeile,Index(Zeile,"-srn")-1)
  117.                 END
  118.                 call WriteLn(ww,Zeile)
  119.               END
  120.               call Close(ww)
  121.             END
  122.             call Close(rr)
  123.           END
  124.           ADDRESS COMMAND "Delete t:MPF"
  125.  
  126.         END
  127.         ELSE             flag='Write'
  128.         IF Open(bd,Datei,flag) THEN DO
  129.           IF DateiArt=3 THEN DO
  130.             ADDRESS COMMAND "Copy Batch-Icon "'"'Datei".info"'"'
  131.           END
  132.           IF DateiArt~=1 THEN DO
  133.             call Writeln(bd,"; clariSSA / SSA /Batch-File")
  134.             call Writeln(bd,"; SSA => Super Smooth Animation")
  135.             call Writeln(bd,"; Copyright 1991-1993 by proDAD")
  136.             call Writeln(bd,"; Start the batch-file with    execute <Filename>")
  137.             IF DateiArt=3 THEN DO
  138.               call Writeln(bd,";  Doubleklick on the Icon start the script.")
  139.               call Writeln(bd,";  (Required: OS2.x and IconX)")
  140.             END
  141.             call Writeln(bd,";")
  142.             call Writeln(bd,";")
  143.             call Writeln(bd,"stack 6000")
  144.           END
  145.           call Writech(bd,SSAPlay)
  146.           call Writeln(bd,Line" -srn")
  147.           call Close(bd)
  148.         END
  149.         ELSE Message "'Error: Cannot open the file.'"
  150.  
  151.       END
  152.  
  153.     END; ELSE Message '"There is no MASTER-Anim"'
  154.     LEAVE
  155.   END
  156.   FailAt AltFail
  157. exit
  158.  
  159.  
  160.  
  161.  
  162. GetVersion: procedure
  163. DO
  164.   Information
  165.   PARSE VAR RESULT . "VERSION:" cl .
  166.   RETURN (cl)
  167. END
  168.  
  169.