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;
+ }
+
+ 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)
{
return s;
}
-bool
-ContentTimePeriod::overlaps (ContentTimePeriod const & other) const
+ostream &
+operator<< (ostream& s, DCPTimePeriod p)
{
- return (from < other.to && to >= other.from);
+ s << "[DCP " << p.from.get() << " " << p.from.seconds() << "s -> " << p.to.get() << " " << p.to.seconds() << "s]";
+ return s;
}