"
proc div {type left right} {
set width $($right - $left)
puts "
$type
"
}
set keeping 0
set last 0
set start -1
foreach b [$ts bookmarks] {
if {$start < 0} {
set start $b
continue
}
set end $b
incr keeping $($end - $start)
set left $($start * 500 / $len)
set right $($end * 500 / $len)
div cut $last $($left - 1)
div keep $left $($right - 1)
set last $right
set start -1
}
if {$start > 0} {
incr keeping $($len - $start)
set left $($start * 500 / $len)
div cut $last $($left - 1)
div keep $left 500
} else {
div cut $last 500
}
set keepperc $($keeping * 100.0 / $len)
set esttime $(int($keeping * 0.025))
if {[$ts get definition] eq "HD"} { set esttime $($esttime * 4) }
puts "