From 50421d7b24d8019266d4f7a46f7ef53b8978a3be Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 20 Jan 2015 11:08:02 +0000 Subject: Missing include. --- src/wscript | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/wscript b/src/wscript index a3f69dd..149b9ff 100644 --- a/src/wscript +++ b/src/wscript @@ -52,6 +52,7 @@ def build(bld): stl_binary_tables.h stl_binary_writer.h stl_text_reader.h + sub_time.h subrip_reader.h subtitle.h vertical_position.h -- cgit v1.2.3 From 92f849621c9756fa60e89fc937d27444e72f64c8 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 20 Jan 2015 11:14:49 +0000 Subject: Add Time::all_as_seconds. --- src/sub_time.cc | 6 ++++++ src/sub_time.h | 2 ++ 2 files changed, 8 insertions(+) (limited to 'src') diff --git a/src/sub_time.cc b/src/sub_time.cc index e304310..ed61cb4 100644 --- a/src/sub_time.cc +++ b/src/sub_time.cc @@ -152,3 +152,9 @@ Time::from_hms (int h, int m, int s, int ms) { return Time (h * 3600 + m * 60 + s, ms, Rational (1000, 1)); } + +double +Time::all_as_seconds () const +{ + return seconds() + double(milliseconds ()) / 1000; +} diff --git a/src/sub_time.h b/src/sub_time.h index 7e1d193..22178e9 100644 --- a/src/sub_time.h +++ b/src/sub_time.h @@ -55,6 +55,8 @@ public: int frames_at (Rational rate) const; int milliseconds () const; + double all_as_seconds () const; + static Time from_hmsf (int h, int m, int s, int f, boost::optional rate = boost::optional ()); static Time from_hms (int h, int m, int s, int ms); -- cgit v1.2.3