Files
oak-editor/app/common/timerange.h
T
itsmattkc 16f80386e8 added qhash functions for timerange and rational
So these keys can be used in QHash containers, they need functions for how to
create those hashes.
2019-11-15 13:55:05 +09:00

32 lines
597 B
C++

#ifndef TIMERANGE_H
#define TIMERANGE_H
#include "rational.h"
class TimeRange {
public:
TimeRange() = default;
TimeRange(const rational& in, const rational& out);
const rational& in() const;
const rational& out() const;
const rational& length() const;
void set_in(const rational& in);
void set_out(const rational& out);
void set_range(const rational& in, const rational& out);
bool operator==(const TimeRange& r) const;
private:
void normalize();
rational in_;
rational out_;
rational length_;
};
uint qHash(const TimeRange& r, uint seed);
#endif // TIMERANGE_H