/*
- Copyright (C) 2014-2017 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2014-2018 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
* at some sampling rate.
* @param r Sampling rate.
*/
- Time<S, O> ceil (float r) const {
- return Time<S, O> (llrint (HZ * frames_ceil(r) / double(r)));
+ Time<S, O> ceil (double r) const {
+ return Time<S, O> (llrint (HZ * frames_ceil(r) / r));
}
- Time<S, O> floor (float r) const {
- return Time<S, O> (llrint (HZ * frames_floor(r) / double(r)));
+ Time<S, O> floor (double r) const {
+ return Time<S, O> (llrint (HZ * frames_floor(r) / r));
+ }
+
+ Time<S, O> round (double r) const {
+ return Time<S, O> (llrint (HZ * frames_round(r) / r));
}
double seconds () const {
}
private:
- friend struct dcptime_ceil_test;
- friend struct dcptime_floor_test;
+ friend struct dcpomatic_time_ceil_test;
+ friend struct dcpomatic_time_floor_test;
Type _t;
static const int HZ = 96000;