various changes to rendering flow and structure

This commit is contained in:
itsmattkc
2019-10-23 00:42:52 +11:00
parent 5f86b9b9c7
commit 7dec79ceaa
42 changed files with 663 additions and 888 deletions
+2
View File
@@ -35,5 +35,7 @@ set(OLIVE_SOURCES
common/threadedobject.cpp
common/timecodefunctions.h
common/timecodefunctions.cpp
common/timerange.h
common/timerange.cpp
PARENT_SCOPE
)
+51
View File
@@ -0,0 +1,51 @@
#include "timerange.h"
TimeRange::TimeRange()
{
}
TimeRange::TimeRange(const rational &in, const rational &out) :
in_(in),
out_(out)
{
normalize();
}
const rational &TimeRange::in() const
{
return in_;
}
const rational &TimeRange::out() const
{
return out_;
}
void TimeRange::set_in(const rational &in)
{
in_ = in;
normalize();
}
void TimeRange::set_out(const rational &out)
{
out_ = out;
normalize();
}
void TimeRange::set_range(const rational &in, const rational &out)
{
in_ = in;
out_ = out;
normalize();
}
void TimeRange::normalize()
{
// If `out` is earlier than `in`, swap them
if (out_ < in_) {
rational temp = in_;
in_ = out_;
out_ = temp;
}
}
+25
View File
@@ -0,0 +1,25 @@
#ifndef TIMERANGE_H
#define TIMERANGE_H
#include "rational.h"
class TimeRange {
public:
TimeRange();
TimeRange(const rational& in, const rational& out);
const rational& in() const;
const rational& out() const;
void set_in(const rational& in);
void set_out(const rational& out);
void set_range(const rational& in, const rational& out);
private:
void normalize();
rational in_;
rational out_;
};
#endif // TIMERANGE_H