diff --git a/lib/Subtitle/TimePoint.pm b/lib/Subtitle/TimePoint.pm new file mode 100644 index 0000000..45a57da --- /dev/null +++ b/lib/Subtitle/TimePoint.pm @@ -0,0 +1,37 @@ +package Subtitle::TimePoint; + +use strict; +use warnings; + +use Subtitle::Utils ':timing'; + +sub new { + my ($class, %args) = @_; + my $self = { + shift => $args{shift} || 0.0, + time => $args{time} || 0.0, + }; + return bless($self, $class); +} + +sub parse { + my ($self, $timespec) = @_; + + return 'empty timespec, nothing to do' + unless $timespec; + return 'wrong timespec, expected