began some rewrites to timeline drawing

This commit is contained in:
itsmattkc
2021-01-14 10:30:20 +11:00
parent fbdda3d6d4
commit f7883bd02c
60 changed files with 3134 additions and 951 deletions
-2
View File
@@ -25,7 +25,5 @@ set(OLIVE_SOURCES
timeline/timelinepoints.cpp
timeline/timelineworkarea.h
timeline/timelineworkarea.cpp
timeline/trackreference.h
timeline/trackreference.cpp
PARENT_SCOPE
)
+3 -3
View File
@@ -27,7 +27,7 @@ TimelineCoordinate::TimelineCoordinate() :
{
}
TimelineCoordinate::TimelineCoordinate(const rational &frame, const TrackReference &track) :
TimelineCoordinate::TimelineCoordinate(const rational &frame, const Track::Reference &track) :
frame_(frame),
track_(track)
{
@@ -44,7 +44,7 @@ const rational &TimelineCoordinate::GetFrame() const
return frame_;
}
const TrackReference &TimelineCoordinate::GetTrack() const
const Track::Reference &TimelineCoordinate::GetTrack() const
{
return track_;
}
@@ -54,7 +54,7 @@ void TimelineCoordinate::SetFrame(const rational &frame)
frame_ = frame;
}
void TimelineCoordinate::SetTrack(const TrackReference &track)
void TimelineCoordinate::SetTrack(const Track::Reference &track)
{
track_ = track;
}
+5 -5
View File
@@ -22,7 +22,7 @@
#define TIMELINECOORDINATE_H
#include "common/rational.h"
#include "trackreference.h"
#include "node/output/track/track.h"
namespace olive {
@@ -30,19 +30,19 @@ class TimelineCoordinate
{
public:
TimelineCoordinate();
TimelineCoordinate(const rational& frame, const TrackReference& track);
TimelineCoordinate(const rational& frame, const Track::Reference& track);
TimelineCoordinate(const rational& frame, const Track::Type& track_type, const int& track_index);
const rational& GetFrame() const;
const TrackReference& GetTrack() const;
const Track::Reference& GetTrack() const;
void SetFrame(const rational& frame);
void SetTrack(const TrackReference& track);
void SetTrack(const Track::Reference& track);
private:
rational frame_;
TrackReference track_;
Track::Reference track_;
};
-65
View File
@@ -1,65 +0,0 @@
/***
Olive - Non-Linear Video Editor
Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
***/
#include "trackreference.h"
namespace olive {
TrackReference::TrackReference() :
type_(Track::kNone),
index_(0)
{
}
TrackReference::TrackReference(const Track::Type &type, const int &index) :
type_(type),
index_(index)
{
}
const Track::Type &TrackReference::type() const
{
return type_;
}
const int &TrackReference::index() const
{
return index_;
}
bool TrackReference::operator==(const TrackReference &ref) const
{
return type_ == ref.type_ && index_ == ref.index_;
}
bool TrackReference::operator!=(const TrackReference &ref) const
{
return !(*this == ref);
}
uint qHash(const TrackReference &r, uint seed)
{
// Not super efficient, but couldn't think of any better way to ensure a different hash each time
return ::qHash(QStringLiteral("%1:%2").arg(QString::number(r.type()),
QString::number(r.index())),
seed);
}
}
-57
View File
@@ -1,57 +0,0 @@
/***
Olive - Non-Linear Video Editor
Copyright (C) 2020 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
***/
#ifndef TRACKREFERENCE_H
#define TRACKREFERENCE_H
#include "node/output/track/track.h"
#include "timeline/timelinecommon.h"
namespace olive {
class TrackReference
{
public:
TrackReference();
TrackReference(const Track::Type& type, const int& index);
const Track::Type& type() const;
const int& index() const;
bool operator<(const TrackReference& ref) const;
bool operator==(const TrackReference& ref) const;
bool operator!=(const TrackReference& ref) const;
private:
Track::Type type_;
int index_;
};
uint qHash(const TrackReference& r, uint seed = 0);
}
#endif // TRACKREFERENCE_H