|
|
@ -61,6 +61,20 @@ sub parse_timing { |
|
|
|
return $time; |
|
|
|
return $time; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sub build_timing { |
|
|
|
|
|
|
|
my ($self, $time, $prec) = @_; |
|
|
|
|
|
|
|
$prec //= 2; |
|
|
|
|
|
|
|
my ($hrs, $min, $sec, $msec, $rest); |
|
|
|
|
|
|
|
$hrs = int($time / 3600); |
|
|
|
|
|
|
|
$rest = $time - ($hrs * 3600); |
|
|
|
|
|
|
|
$min = int($rest / 60); |
|
|
|
|
|
|
|
$rest = $rest - ($min * 60); |
|
|
|
|
|
|
|
$sec = int($rest / 1); |
|
|
|
|
|
|
|
$msec = sprintf "%.${prec}f", ($rest - ($sec * 1)); |
|
|
|
|
|
|
|
$msec =~ s/^0\.//o; |
|
|
|
|
|
|
|
return sprintf("%d:%02d:%02d.%s", $hrs, $min, $sec, $msec); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
sub trim { |
|
|
|
sub trim { |
|
|
|
my ($self, $line) = @_; |
|
|
|
my ($self, $line) = @_; |
|
|
|
return unless defined $line; |
|
|
|
return unless defined $line; |
|
|
|