home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Misc / EDG-CT1.DMS / in.adf / CT.run / Macros / Set_Transition_Speed.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1995-10-16  |  3.3 KB  |  156 lines

  1. /*
  2.                         Control Tower Arexx Script
  3.                            Written By J.L. White
  4.                          (C)1995 Merlin's Software
  5. */
  6.  
  7. signal on error
  8. signal on syntax
  9. Options Results
  10.  
  11. Main:
  12. call OpenStuff()
  13. call Docs()
  14. call Routine()
  15. call CloseStuff()
  16. exit
  17. return
  18.  
  19. GetFile:
  20.     parse Arg Title, Path
  21.     Address FLY_1 SetString Path
  22.     Address FLY_1 GetFileNameNT Title
  23. return result
  24.  
  25.  
  26. GetPath:
  27.     parse Arg Title, Path
  28.     Address FLY_1 SetString Path
  29.     Address FLY_1 GetPathNameNT Title
  30. return result
  31.  
  32. GetTextTC:
  33.     parse Arg Title, Text
  34.     Address FLY_1 SetString Text
  35.     Address FLY_1 GetStringNTTC Title
  36. return result
  37.  
  38.  
  39. OpenStuff:
  40.     address command "run CT:FLY"
  41.     do while (POS('FLY_1',SHOW('Ports')) = 0)
  42.         address command "wait 1"
  43.         end
  44.     TOASTERLIB="ToasterARexx.port"
  45.     call remlib('ToasterARexx.port')
  46.     call remlib('PROJECT_REXX_PORT')
  47.     call addlib('PROJECT_REXX_PORT' , 0)
  48.     call addlib(TOASTERLIB,0)
  49. return
  50.  
  51. CloseStuff:
  52.     Address FLY_1 Quit
  53.     call remlib('ToasterARexx.port')
  54.     call remlib('PROJECT_REXX_PORT')
  55.     exit
  56. return
  57.  
  58. YesOrNo: procedure
  59.     parse Arg Title,Yes,No
  60.     Address FLY_1 OK_TEXT Yes
  61.     Address FLY_1 CANCEL_TEXT No
  62.     Address FLY_1 AskYesNoNT Title
  63.     if result = "OK" then YesNo = 1
  64.     else YesNo = 0
  65. return YesNo
  66.  
  67. Info: 
  68.     parse Arg Title,Yes
  69.     Address FLY_1 OK_TEXT Yes
  70.     Address FLY_1 FYINT Title
  71. return
  72.  
  73. FindDrive:
  74.     address command "C:Info >RAM:FLY-List"
  75.     call open TempFile,"RAM:FLY-List",R
  76.     do until eof(TempFile)
  77.         line = readln(TempFile)
  78.         parse var line Drive" "Rest
  79.         if Drive = "FA0:" then 
  80.             Volume = word(Rest,7)":"
  81.     end
  82.     call close TempFile
  83.     address command "Delete >NIL: RAM:FLY-List"
  84. return Volume
  85.  
  86. GetFileName: procedure  
  87.    ARG CompleteName
  88.    c = lastpos("/",CompleteName)
  89.    if c = 0 then c = lastpos(":",CompleteName)
  90.    return substr(CompleteName, c + 1)
  91.  
  92.  
  93. GetPathName: procedure  
  94.    ARG CompleteName
  95.    c = lastpos(":",CompleteName)
  96.    if c = 0 then c = lastpos(":",CompleteName)
  97.    return left(CompleteName,c)
  98.  
  99. Docs:
  100. Answer = YesOrNo(" Do You Need Instructions?"," YES "," NO ")
  101. if Answer = 0 then return 
  102. Text = "
  103. This Macro will adjust the speed of ALL Transitions\
  104. in the current Project to a new user selected Speed!"
  105. Answer = YesOrNo(Text," Continue "," Exit ")
  106. if Answer = 0 then call CloseStuff()
  107.  
  108. return
  109.  
  110.  
  111. Routine:
  112.     Address FLY_1 OK_TEXT " OK "
  113.     Address FLY_1 GetSpeedNT
  114.     Mode = result
  115.     if Mode = 1 then Type = 3
  116.     if Mode = 2 then Type = 0
  117.     if Mode = 3 then Type = 1
  118.     if Mode = 4 then do
  119.         Type = 2
  120.         TimeCode = GetTextTC("Enter New Speed","00:00:00:00")
  121.         Address FLY_1 ConvertTC TimeCode
  122.         Num = result
  123.         end
  124.     start_loc=croutonspot()
  125.     call croutonpick(LAST)
  126.     project_end=croutonspot()
  127.     call croutonpick(FIRST)
  128.     current_spot=0
  129.     do while (current_spot<project_end+1)
  130.            call croutonpick(current_spot)
  131.            current_spot=current_spot+1
  132.            if croutontype()="ALGO" | croutontype()="ANIM" | croutontype()="ILBM" then do
  133.             if Type = 2 then do
  134.                 if croutongettag(VariableFcount) > 0 then do
  135.                           call croutonsettag(FCountMode,Type)
  136.                           call croutonsettag(NumFramesVariable,Num)
  137.                     end
  138.                 end
  139.             else
  140.                       call croutonsettag(FCountMode,Type)
  141.                   end
  142.            end
  143.     call croutonpick(start_loc)
  144.  
  145.     Address FLY_1 FYINT "Transition Speeds Have ALL Been Changed!"
  146. return
  147.  
  148.  
  149. syntax:
  150. error:
  151.     Address FLY_1 OK_TEXT " OK "
  152.     Title = "An Error Was Found With This Macro On Line #"SIGL"!"
  153.     Address FLY_1 FYINT Title
  154.     Address FLY_1 Quit
  155. exit
  156.