summaryrefslogtreecommitdiff
path: root/src/lib/dcpomatic_time.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-03-04 20:22:47 +0000
committerCarl Hetherington <cth@carlh.net>2014-03-04 20:22:47 +0000
commit1b1bc528ee5ca1fee1bd33f9fb6f79cd551e3b33 (patch)
treed60b9fb573dd8d6ab89036fb8788cd1b1c69aada /src/lib/dcpomatic_time.cc
parent6d8bcba724be622739a749064466901486304cee (diff)
New DCPTime/ContentTime types.
Diffstat (limited to 'src/lib/dcpomatic_time.cc')
-rw-r--r--src/lib/dcpomatic_time.cc35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/lib/dcpomatic_time.cc b/src/lib/dcpomatic_time.cc
new file mode 100644
index 000000000..5344915c0
--- /dev/null
+++ b/src/lib/dcpomatic_time.cc
@@ -0,0 +1,35 @@
+/*
+ Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#include "dcpomatic_time.h"
+
+ContentTime::ContentTime (DCPTime d, FrameRateChange f)
+ : Time (rint (d.get() * f.speed_up))
+{
+
+}
+
+DCPTime min (DCPTime a, DCPTime b)
+{
+ if (a < b) {
+ return a;
+ }
+
+ return b;
+}