Advertisement
Guest User

Untitled

a guest
May 20th, 2013
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # http://avisynth.org/mediawiki/HDColorBars
  2. Function StrReplace(string base, string sought, string rep)
  3.     {
  4.         pos = FindStr(base, sought)
  5.         return (sought == "") || (pos == 0) \
  6.             ? base \
  7.             : StrReplace( \
  8.                 LeftStr(base, pos - 1) + rep + \
  9.                 MidStr(base, pos + StrLen(sought)), \
  10.                 sought, rep)
  11.     }
  12.  
  13. # http://forum.doom9.org/showthread.php?t=102929
  14. function ForNext(var_string, from_indx, to_indx, by_value, loop_string, format_string)
  15. {
  16.     result = ""
  17.     LineBreak = """
  18. """
  19.     from_indx <= to_indx ? Eval( "result = result + LineBreak + StrReplace(loop_string, var_string, String(from_indx, format_string))") : NOP
  20.     (from_indx+by_value) <= to_indx ? Eval( "result = result + ForNext(var_string, (from_indx+by_value), to_indx, by_value, loop_string, format_string)") : NOP
  21.     return result
  22. }
  23.  
  24.  
  25. # this example splices the following clips:
  26. # cv3.avi
  27. # cv3_part002.avi
  28. # cv3_part003.avi
  29. # cv3_part004.avi
  30.  
  31. a = AviSource ("cv3.avi")
  32.  
  33. Eval(ForNext ("${i}", 2, 4, 1, """a = a + AviSource ("cv3_part${i}.avi")""", "%03.0f"))
  34.  
  35. a
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement