diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-05-22 14:57:56 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-05-22 14:57:56 +0100 |
| commit | d342a1befa88cb3f23c7e3fccfd1edaeea968fed (patch) | |
| tree | f566fa87d0de35f3f0c4d7e20752c83b8a5b9bce /src/lib/content_subtitle.cc | |
| parent | 85d343a420c4df1a08663c8afd3bdb73c8dfa985 (diff) | |
Add ContentTimePeriod class.
Diffstat (limited to 'src/lib/content_subtitle.cc')
| -rw-r--r-- | src/lib/content_subtitle.cc | 17 |
1 files changed, 6 insertions, 11 deletions
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) + ); } |
