Update of /cvsroot/subproc/subproc
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv23196
Modified Files:
subproc
Log Message:
Added suuport for inserting space at some point.
Index: subproc
===================================================================
RCS file: /cvsroot/subproc/subproc/subproc,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- subproc 12 Jan 2007 21:13:27 -0000 1.19
+++ subproc 9 Feb 2007 21:50:26 -0000 1.20
@@ -441,6 +441,7 @@
if (p[1] == "m" || p[1] == "move") proc_move(p[2])
else if (p[1] == "s" || p[1] == "scale") proc_scale(p[2])
else if (p[1] == "d" || p[1] == "delete") proc_delete(p[2])
+ else if (p[1] == "i" || p[1] == "insert") proc_insert(p[2])
else error(11, _"Unknown process.")
}
delete p
@@ -504,4 +505,24 @@
}
}
+function proc_insert(x, j, s, l)
+{
+ # TODO x should be specified in frames, secs, mins, hours, etc
+ if (match(x, /:/))
+ {
+ s = strtonum(substr(x, 1, RSTART-1))
+ l = strtonum(substr(x, RSTART+RLENGTH))
+ }
+
+ debug(sprintf(_"Process: insert %s starting from %s", l, s))
+ for (j = 1; j <= isub["total"]; j++)
+ {
+ if (strtonum(subtitles["begin", j]) > s)
+ {
+ subtitles["begin", j] = subtitles["begin", j] + l
+ subtitles["end", j] = subtitles["end", j] + l
+ }
+ }
+}
+
# vim: set ft=awk syn=awk nowrap nu :
|