projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Throw errors from CPLSummary constructor if the DCP::read reported any problems.
[dcpomatic.git]
/
src
/
lib
/
dcpomatic_time.h
diff --git
a/src/lib/dcpomatic_time.h
b/src/lib/dcpomatic_time.h
index 3d792467b465d4a433b5425942018b0e7b06d78b..897b725bd3e63587ba9390f194234847e01aedd1 100644
(file)
--- a/
src/lib/dcpomatic_time.h
+++ b/
src/lib/dcpomatic_time.h
@@
-35,8
+35,13
@@
#include <iomanip>
#include <cstdio>
#include <iomanip>
#include <cstdio>
+struct dcpomatic_time_ceil_test;
+struct dcpomatic_time_floor_test;
+
+namespace dcpomatic {
+
/** A time in seconds, expressed as a number scaled up by Time::HZ. We want two different
/** A time in seconds, expressed as a number scaled up by Time::HZ. We want two different
- * versions of this class,
ContentTime and
DCPTime, and we want it to be impossible to
+ * versions of this class,
dcpomatic::ContentTime and dcpomatic::
DCPTime, and we want it to be impossible to
* convert implicitly between the two. Hence there's this template hack. I'm not
* sure if it's the best way to do it.
*
* convert implicitly between the two. Hence there's this template hack. I'm not
* sure if it's the best way to do it.
*
@@
-113,6
+118,10
@@
public:
return *this;
}
return *this;
}
+ Time<S, O> operator/ (int o) const {
+ return Time<S, O> (_t / o);
+ }
+
/** Round up to the nearest sampling interval
* at some sampling rate.
* @param r Sampling rate.
/** Round up to the nearest sampling interval
* at some sampling rate.
* @param r Sampling rate.
@@
-221,12
+230,13
@@
public:
return Time<S, O> (INT64_MAX);
}
return Time<S, O> (INT64_MAX);
}
+ static const int HZ = 96000;
+
private:
private:
- friend struct dcpomatic_time_ceil_test;
- friend struct dcpomatic_time_floor_test;
+ friend struct
::
dcpomatic_time_ceil_test;
+ friend struct
::
dcpomatic_time_floor_test;
Type _t;
Type _t;
- static const int HZ = 96000;
};
class ContentTimeDifferentiator {};
};
class ContentTimeDifferentiator {};
@@
-352,4
+362,6
@@
std::string to_string (ContentTime t);
std::string to_string (DCPTime t);
std::string to_string (DCPTimePeriod p);
std::string to_string (DCPTime t);
std::string to_string (DCPTimePeriod p);
+}
+
#endif
#endif