nodes: merged gizmotraverser and nodetabletraverser into nodetraverser

No real reason for these other derivatives that did virtually
the same thing.
This commit is contained in:
itsmattkc
2021-04-22 12:52:10 +10:00
parent 65a1922ed4
commit 97b9bcc79f
15 changed files with 65 additions and 336 deletions
+7 -9
View File
@@ -16,23 +16,21 @@
set(OLIVE_SOURCES
${OLIVE_SOURCES}
widget/viewer/audiowaveformview.h
widget/viewer/audiowaveformview.cpp
widget/viewer/footageviewer.h
widget/viewer/audiowaveformview.h
widget/viewer/footageviewer.cpp
widget/viewer/gizmotraverser.h
widget/viewer/gizmotraverser.cpp
widget/viewer/viewer.h
widget/viewer/footageviewer.h
widget/viewer/viewer.cpp
widget/viewer/viewerdisplay.h
widget/viewer/viewer.h
widget/viewer/viewerdisplay.cpp
widget/viewer/viewerplaybacktimer.h
widget/viewer/viewerdisplay.h
widget/viewer/viewerplaybacktimer.cpp
widget/viewer/viewerplaybacktimer.h
widget/viewer/viewerqueue.h
widget/viewer/viewersafemargininfo.h
widget/viewer/viewersizer.h
widget/viewer/viewersizer.cpp
widget/viewer/viewerwindow.h
widget/viewer/viewersizer.h
widget/viewer/viewerwindow.cpp
widget/viewer/viewerwindow.h
PARENT_SCOPE
)
-51
View File
@@ -1,51 +0,0 @@
/***
Olive - Non-Linear Video Editor
Copyright (C) 2021 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 "gizmotraverser.h"
namespace olive {
QVariant GizmoTraverser::ProcessVideoFootage(const FootageJob &ref, const rational &input_time)
{
Q_UNUSED(input_time)
VideoParams stream = ref.video_params();
return QVector2D(stream.width() * stream.pixel_aspect_ratio().toDouble(),
stream.height());
}
QVariant GizmoTraverser::ProcessShader(const Node *node, const TimeRange &range, const ShaderJob &job)
{
Q_UNUSED(node)
Q_UNUSED(range)
Q_UNUSED(job)
return GenerateResolution();
}
QVariant GizmoTraverser::ProcessFrameGeneration(const Node *node, const GenerateJob &job)
{
Q_UNUSED(node)
Q_UNUSED(job)
return GenerateResolution();
}
}
-57
View File
@@ -1,57 +0,0 @@
/***
Olive - Non-Linear Video Editor
Copyright (C) 2021 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 GIZMOTRAVERSER_H
#define GIZMOTRAVERSER_H
#include "node/traverser.h"
namespace olive {
class GizmoTraverser : public NodeTraverser
{
public:
GizmoTraverser(const QVector2D& sequence_resolution) :
size_(sequence_resolution)
{
}
protected:
virtual QVariant ProcessVideoFootage(const FootageJob& stream, const rational &input_time) override;
virtual QVariant ProcessShader(const Node *node, const TimeRange &range, const ShaderJob& job) override;
virtual QVector2D GenerateResolution() const override
{
return size_;
}
virtual QVariant ProcessFrameGeneration(const Node *node, const GenerateJob& job) override;
// FIXME: Do something about audio?
private:
QVector2D size_;
};
}
#endif // GIZMOTRAVERSER_H
+3 -3
View File
@@ -33,7 +33,7 @@
#include "common/functiontimer.h"
#include "config/config.h"
#include "core.h"
#include "gizmotraverser.h"
#include "node/traverser.h"
namespace olive {
@@ -339,8 +339,8 @@ void ViewerDisplayWidget::OnPaint()
// Draw gizmos if we have any
if (gizmos_) {
GizmoTraverser gt(QVector2D(gizmo_params_.width() * gizmo_params_.pixel_aspect_ratio().toDouble(),
gizmo_params_.height()));
NodeTraverser gt;
gt.SetCacheVideoParams(gizmo_params_);
rational node_time = GetGizmoTime();