19 #ifndef TEMPORAL_BEATS_HPP
20 #define TEMPORAL_BEATS_HPP
78 const double frac = modf (
beats, &whole);
79 return Beats ((int64_t) whole, (int64_t) rint (frac *
PPQN));
161 return other - *
this;
163 return *
this - other;
237 explicit operator bool ()
const {
return _ticks != 0; }
241 std::string
str ()
const {
242 std::ostringstream os;
283 return Temporal::Beats(std::numeric_limits<int32_t>::min(), std::numeric_limits<int32_t>::min());
312 std::ostringstream ostr;
321 std::istringstream istr (str);
int64_t to_ticks(uint32_t ppqn) const
Beats round_to_multiple(Beats const &multiple) const
Beats operator%=(Beats const &b)
Beats operator*(ratio_t const &factor) const
Beats operator*(int32_t factor) const
bool operator!=(const Beats &b) const
Beats operator%(Beats const &b) const
Beats(int64_t b, int64_t t)
Beats & operator=(const Beats &other)
int32_t get_ticks() const
static Beats ticks(int64_t ticks)
static const int32_t PPQN
Beats & operator=(double time)
Beats operator/(ratio_t const &factor) const
bool operator<=(const Beats &b) const
Beats & operator+=(const Beats &b)
Beats & operator-=(const Beats &b)
Beats(const Beats &other)
bool operator>(const Beats &b) const
Beats operator/(int32_t factor) const
static Beats beats(int64_t beats)
Beats round_to_subdivision(int subdivision, RoundMode dir) const
Beats round_up_to_beat() const
int64_t get_beats() const
Beats operator-(const Beats &b) const
static Beats ticks_at_rate(int64_t ticks, uint32_t ppqn)
static Beats from_double(double beats)
Beats round_up_to_multiple(Beats const &multiple) const
bool operator>=(const Beats &b) const
Beats round_to_beat() const
Beats round_down_to_multiple(Beats const &multiple) const
bool operator==(int beats) const
Beats diff(Beats const &other) const
bool operator==(const Beats &b) const
bool operator<(const Beats &b) const
Beats operator+(const Beats &b) const
Beats round_down_to_beat() const
DoubleableBeats(Beats const &b)
T int_div_round(T x, T y)
bool to_string(ARDOUR::AnyTime const &at, std::string &str)
int64_t muldiv_round(int64_t v, int64_t n, int64_t d)
bool string_to(std::string const &str, ARDOUR::AnyTime &at)
static const int32_t ticks_per_beat
std::istream & operator>>(std::istream &istream, Temporal::Beats &b)
std::ostream & operator<<(std::ostream &ostream, const Temporal::Beats &t)
static Temporal::Beats lowest()
static Temporal::Beats max()