[subproc-cvs] subproc subproc,1.16,1.17
Status: Beta
Brought to you by:
cstroie
From: Costin S. <cs...@us...> - 2006-07-30 20:49:16
|
Update of /cvsroot/subproc/subproc In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv10328 Modified Files: subproc Log Message: Added support for bidirectional conversion frames - time. Index: subproc =================================================================== RCS file: /cvsroot/subproc/subproc/subproc,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- subproc 22 Jul 2006 09:17:17 -0000 1.16 +++ subproc 30 Jul 2006 20:49:10 -0000 1.17 @@ -45,7 +45,7 @@ meta["email"] = "cs...@us..." meta["version"] = "0.1-pre" - # Define some globals + # Define some global paramters # Some commonly used fps fps["film"] = "23.976" fps["pal"] = "25" @@ -133,7 +133,19 @@ process() # Now convert from fps to time or vice-versa, if needed - # TODO to be done + if (osub["units"] != isub["units"]) + if (osub["units"] ~ /^t/) + for (j = 1; j <= isub["total"]; j++) + { + subtitles["begin", j] = subtitles["begin", j] * 1000 / isub["fps"] + subtitles["end", j] = subtitles["end", j] * 1000 / isub["fps"] + } + else + for (j = 1; j <= isub["total"]; j++) + { + subtitles["begin", j] = subtitles["begin", j] / 1000 * isub["fps"] + subtitles["end", j] = subtitles["end", j] / 1000 * isub["fps"] + } # The output if (osub["format"] == "microdvd") @@ -163,9 +175,13 @@ { for (i = 1; i < ARGC; i++) { + # Error if the input filename has already been set + # TODO Use multiple input files and concatenate them in one big output file if (isub["file"]) error(1, _"Unexpected option after the input file name: " ARGV[i]) + # Start parsing the ARGV array + # TODO Enable long format options (GNU format) if (ARGV[i] == "-o") { # The output file name @@ -251,17 +267,17 @@ # Register the supported subtitle formats # MicroDVD - sub_units["microdvd"] = 0 + sub_units["microdvd"] = "f" sub_description["microdvd"] = "MicroDVD" sub_extension["microdvd"] = "sub" # SubViewer - sub_units["subviewer"] = 1 + sub_units["subviewer"] = "t" sub_description["subviewer"] = "SubViewer" sub_extension["subviewer"] = "srt" # Subrip - sub_units["subrip"] = 1 + sub_units["subrip"] = "t" sub_description["subrip"] = "Subrip" sub_extension["subrip"] = "srt" } @@ -425,7 +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 print _"Unknown process." + else error(11, _"Unknown process.") } delete p } |