projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Updated nl_NL translation from Rob van Nieuwkerk.
[dcpomatic.git]
/
src
/
lib
/
dcpomatic_time.cc
diff --git
a/src/lib/dcpomatic_time.cc
b/src/lib/dcpomatic_time.cc
index 812c756ec27891224495b1a57b3e374ee793321d..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)
{
@@
-50,14
+89,9
@@
operator<< (ostream& s, DCPTime t)
return s;
}
return s;
}
-bool
-ContentTimePeriod::overlaps (ContentTimePeriod const & other) const
-{
- return (from < other.to && to >= other.from);
-}
-
-bool
-ContentTimePeriod::contains (ContentTime const & other) const
+ostream &
+operator<< (ostream& s, DCPTimePeriod p)
{
{
- return (from <= other && other < to);
+ s << "[DCP " << p.from.get() << " " << p.from.seconds() << "s -> " << p.to.get() << " " << p.to.seconds() << "s]";
+ return s;
}
}