From d342a1befa88cb3f23c7e3fccfd1edaeea968fed Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 22 May 2014 14:57:56 +0100 Subject: Add ContentTimePeriod class. --- src/lib/content_subtitle.cc | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'src/lib/content_subtitle.cc') diff --git a/src/lib/content_subtitle.cc b/src/lib/content_subtitle.cc index 11873afee..93e0677bb 100644 --- a/src/lib/content_subtitle.cc +++ b/src/lib/content_subtitle.cc @@ -19,18 +19,13 @@ #include "content_subtitle.h" -ContentTime -ContentTextSubtitle::from () const +ContentTimePeriod +ContentTextSubtitle::period () const { /* XXX: assuming we have some subs and they are all at the same time */ assert (!subs.empty ()); - return ContentTime::from_seconds (double (subs.front().in().to_ticks()) / 250); -} - -ContentTime -ContentTextSubtitle::to () const -{ - /* XXX: assuming we have some subs and they are all at the same time */ - assert (!subs.empty ()); - return ContentTime::from_seconds (double (subs.front().out().to_ticks()) / 250); + return ContentTimePeriod ( + ContentTime::from_seconds (double (subs.front().in().to_ticks()) / 250), + ContentTime::from_seconds (double (subs.front().out().to_ticks()) / 250) + ); } -- cgit v1.2.3