home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Misc / EDG-CT1.DMS / in.adf / CT.run / Macros / Expand_In&Out_To_Max.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1995-10-09  |  2.9 KB  |  138 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. GetText:
  33.     parse Arg Title, Text
  34.     Address FLY_1 SetString Text
  35.     Address FLY_1 GetStringNT 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 = "This Macro will adjust each clip in the current\
  103. project to their maximum In & Out Points."
  104. Answer = YesOrNo(Text," Continue "," Exit ")
  105. if Answer = 0 then call CloseStuff()
  106.  
  107. return
  108.  
  109.  
  110. Routine:
  111.     start_loc=croutonspot()
  112.     call croutonpick(LAST)
  113.     project_end=croutonspot()
  114.     call croutonpick(FIRST)
  115.     current_spot=0
  116.     do while (current_spot<project_end+1)
  117.            call croutonpick(current_spot)
  118.            current_spot=current_spot+1
  119.            if croutontype()="CLIP" then do
  120.                   call croutonsettag(Duration,CroutonGetTag(RecFields))
  121.                   call croutonsettag(AudioDuration,CroutonGetTag(RecFields))
  122.                   call croutonsettag(ClipStartField,0)
  123.                   call croutonsettag(AudioStart,0)
  124.                   end
  125.            end
  126.     call croutonpick(start_loc)
  127.     Address FLY_1 FYINT "All In & Out Points Have Been Adjusted!"
  128. return
  129.  
  130.  
  131. syntax:
  132. error:
  133.     Address FLY_1 OK_TEXT " OK "
  134.     Title = "An Error Was Found With This Macro On Line #"SIGL"!"
  135.     Address FLY_1 FYINT Title
  136.     Address FLY_1 Quit
  137. exit
  138.