projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
More debugging of batch converter startup.
[dcpomatic.git]
/
src
/
lib
/
dcpomatic_time.cc
diff --git
a/src/lib/dcpomatic_time.cc
b/src/lib/dcpomatic_time.cc
index 98888646d0a841e26bcb077a426be8ac66e1e8e4..1d965993598c20d6b573ca653d92692b374ff472 100644
(file)
--- a/
src/lib/dcpomatic_time.cc
+++ b/
src/lib/dcpomatic_time.cc
@@
-21,13
+21,22
@@
using std::ostream;
using std::ostream;
-ContentTime::ContentTime (DCPTime d, FrameRateChange f)
- : Time (rint (d.get() * f.speed_up))
+template <>
+Time<ContentTimeDifferentiator, DCPTimeDifferentiator>::Time (DCPTime d, FrameRateChange f)
+ : _t (llrint (d.get() * f.speed_up))
{
}
{
}
-DCPTime min (DCPTime a, DCPTime b)
+template <>
+Time<DCPTimeDifferentiator, ContentTimeDifferentiator>::Time (ContentTime d, FrameRateChange f)
+ : _t (llrint (d.get() / f.speed_up))
+{
+
+}
+
+DCPTime
+min (DCPTime a, DCPTime b)
{
if (a < b) {
return a;
{
if (a < b) {
return a;
@@
-36,6
+45,36
@@
DCPTime min (DCPTime a, DCPTime b)
return b;
}
return b;
}
+DCPTime
+max (DCPTime a, DCPTime b)
+{
+ if (a > b) {
+ return a;
+ }
+
+ return b;
+}
+
+ContentTime
+min (ContentTime a, ContentTime b)
+{
+ if (a < b) {
+ return a;
+ }
+
+ return b;
+}
+
+ContentTime
+max (ContentTime a, ContentTime b)
+{
+ if (a > b) {
+ return a;
+ }
+
+ return b;
+}
+
ostream &
operator<< (ostream& s, ContentTime t)
{
ostream &
operator<< (ostream& s, ContentTime t)
{
@@
-49,3
+88,10
@@
operator<< (ostream& s, DCPTime t)
s << "[DCP " << t.get() << " " << t.seconds() << "s]";
return s;
}
s << "[DCP " << t.get() << " " << t.seconds() << "s]";
return s;
}
+
+ostream &
+operator<< (ostream& s, DCPTimePeriod p)
+{
+ s << "[DCP " << p.from.get() << " " << p.from.seconds() << "s -> " << p.to.get() << " " << p.to.seconds() << "s]";
+ return s;
+}