#!/bin/sh
##
## takes three arguments - the .srt filename and a
## ms shift value with possibly negative sign.
##
## if a third argument is given of the form
## 2/1000
## then it will be taken as a PROGRESSIVE time
## adjustment applied at the rate of, for the
## example, 2 milliseconds later per second,
## effectively speeding up or slowing down the
## subtitle track.
## A progressive option of 0/1000 is considered
## a no-op and can be used as a placeholder if a
## RANGE of lines is specified as a 4th option.
##
## A subrange of entries can be operated on by
## specifying a line range as the fourth option.
## For example:
##
## srtshifter my-subs.srt -5000 0/1000 312-400
##
## Would cause ONLY lines 312-400 (inclusive) to
## be displayed 5 seconds earlier.
##
## all arguments must use integer values!
##
## I am told that there are people who edit the
## headers of container files to change the frame
## rate, and they are the folks who need to apply
## a speedup or slowdown to account for the slightly
## faster/slower video produced by that heinous
## act.
##
## Note that there is something called "extended srt"
## that looks like this:
##
## 00:00:14,948 --> 00:00:18,247 X1:201 X2:516 Y1:397 Y2:423
## <font color="#fbff1c">Whose side is time on?</font>
##
## Phil Ehrens <phil@slug.org>

## The next line tells sh to execute the script using tclsh \
exec tclsh "$0" ${1+"$@"}