Skip to content

Commit

Permalink
refactored some classes
Browse files Browse the repository at this point in the history
  • Loading branch information
itsmattkc committed May 7, 2019
1 parent 127a773 commit 9a13776
Show file tree
Hide file tree
Showing 133 changed files with 1,698 additions and 1,627 deletions.
2 changes: 1 addition & 1 deletion dialogs/speeddialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "panels/timeline.h"
#include "undo/undo.h"
#include "undo/undostack.h"
#include "nodes/node.h"
#include "nodes/oldeffectnode.h"
#include "project/media.h"

SpeedDialog::SpeedDialog(QWidget *parent, QVector<Clip*> clips) : QDialog(parent) {
Expand Down
10 changes: 5 additions & 5 deletions effects/effectfield.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
#include "rendering/renderfunctions.h"
#include "global/config.h"
#include "global/timing.h"
#include "effects/effectrow.h"
#include "nodes/node.h"
#include "nodes/nodeio.h"
#include "nodes/oldeffectnode.h"
#include "undo/undo.h"
#include "timeline/clip.h"
#include "timeline/sequence.h"
#include "global/math.h"
#include "global/debug.h"

EffectField::EffectField(EffectRow* parent, EffectFieldType t) :
EffectField::EffectField(NodeIO* parent, EffectFieldType t) :
QObject(parent),
type_(t),
enabled_(true)
Expand All @@ -49,9 +49,9 @@ EffectField::EffectField(EffectRow* parent, EffectFieldType t) :
connect(this, SIGNAL(Changed()), parent->GetParentEffect(), SLOT(FieldChanged()));
}

EffectRow *EffectField::GetParentRow()
NodeIO *EffectField::GetParentRow()
{
return static_cast<EffectRow*>(parent());
return static_cast<NodeIO*>(parent());
}

QVariant EffectField::ConvertStringToValue(const QString &s)
Expand Down
6 changes: 3 additions & 3 deletions effects/effectfield.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "undo/undostack.h"
#include "nodes/nodedatatypes.h"

class EffectRow;
class NodeIO;
class ComboAction;

/**
Expand Down Expand Up @@ -106,7 +106,7 @@ class EffectField : public QObject {
*
* The type of data contained within this field. This is expected to be filled by a derived class.
*/
EffectField(EffectRow* parent, EffectFieldType t);
EffectField(NodeIO* parent, EffectFieldType t);

/**
* @brief Get the EffectRow that this field is a member of.
Expand All @@ -117,7 +117,7 @@ class EffectField : public QObject {
*
* The EffectRow that this field is a member of.
*/
EffectRow* GetParentRow();
NodeIO* GetParentRow();

/**
* @brief Get the type of data to expect from this field
Expand Down
4 changes: 2 additions & 2 deletions effects/effectgizmo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

#include "ui/labelslider.h"
#include "effects/fields/doublefield.h"
#include "nodes/node.h"
#include "nodes/oldeffectnode.h"

EffectGizmo::EffectGizmo(Node *parent, int type) :
EffectGizmo::EffectGizmo(OldEffectNode *parent, int type) :
QObject(parent),
x_field1(nullptr),
x_field_multi1(1.0),
Expand Down
4 changes: 2 additions & 2 deletions effects/effectgizmo.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ enum GizmoType {
#include <QColor>

class DoubleField;
class Node;
class OldEffectNode;

class EffectGizmo : public QObject {
Q_OBJECT
public:
EffectGizmo(Node* parent, int type);
EffectGizmo(OldEffectNode* parent, int type);

QVector<QVector3D> world_pos;
QVector<QPoint> screen_pos;
Expand Down
2 changes: 1 addition & 1 deletion effects/effectloaders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <QXmlStreamReader>
#include <QDebug>

#include "nodes/node.h"
#include "nodes/oldeffectnode.h"
#include "effects/transition.h"
#include "global/path.h"
#include "panels/panels.h"
Expand Down
4 changes: 2 additions & 2 deletions effects/fields/boolfield.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@

#include <QCheckBox>

#include "nodes/node.h"
#include "nodes/oldeffectnode.h"
#include "undo/undo.h"

BoolField::BoolField(EffectRow *parent) :
BoolField::BoolField(NodeIO *parent) :
EffectField(parent, EffectField::EFFECT_FIELD_BOOL)
{}

Expand Down
2 changes: 1 addition & 1 deletion effects/fields/boolfield.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class BoolField : public EffectField
/**
* @brief Reimplementation of EffectField::EffectField().
*/
BoolField(EffectRow* parent);
BoolField(NodeIO* parent);

/**
* @brief Get the boolean value at a given timecode
Expand Down
2 changes: 1 addition & 1 deletion effects/fields/buttonfield.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include <QPushButton>

ButtonField::ButtonField(EffectRow *parent, const QString &string) :
ButtonField::ButtonField(NodeIO *parent, const QString &string) :
EffectField(parent, EffectField::EFFECT_FIELD_UI),
button_text_(string)
{}
Expand Down
2 changes: 1 addition & 1 deletion effects/fields/buttonfield.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class ButtonField : public EffectField
/**
* @brief Reimplementation of EffectField::EffectField().
*/
ButtonField(EffectRow* parent, const QString& string);
ButtonField(NodeIO* parent, const QString& string);

/**
* @brief Set whether this pushbutton is checkable
Expand Down
4 changes: 2 additions & 2 deletions effects/fields/colorfield.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
#include <QColor>

#include "ui/colorbutton.h"
#include "nodes/node.h"
#include "nodes/oldeffectnode.h"
#include "undo/undo.h"

ColorField::ColorField(EffectRow* parent) :
ColorField::ColorField(NodeIO* parent) :
EffectField(parent, EffectField::EFFECT_FIELD_COLOR)
{}

Expand Down
2 changes: 1 addition & 1 deletion effects/fields/colorfield.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class ColorField : public EffectField
/**
* @brief Reimplementation of EffectField::EffectField().
*/
ColorField(EffectRow* parent);
ColorField(NodeIO* parent);

/**
* @brief Get the color value at a given timecode
Expand Down
4 changes: 2 additions & 2 deletions effects/fields/combofield.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@

#include <QDebug>

#include "nodes/node.h"
#include "nodes/oldeffectnode.h"
#include "ui/comboboxex.h"
#include "undo/undo.h"

ComboField::ComboField(EffectRow* parent) :
ComboField::ComboField(NodeIO* parent) :
EffectField(parent, EffectField::EFFECT_FIELD_COMBO)
{}

Expand Down
2 changes: 1 addition & 1 deletion effects/fields/combofield.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class ComboField : public EffectField
/**
* @brief Reimplementation of EffectField::EffectField().
*/
ComboField(EffectRow* parent);
ComboField(NodeIO* parent);

/**
* @brief Add an item to this ComboField
Expand Down
4 changes: 2 additions & 2 deletions effects/fields/doublefield.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@

#include "doublefield.h"

#include "nodes/node.h"
#include "nodes/oldeffectnode.h"
#include "undo/undo.h"

DoubleField::DoubleField(EffectRow* parent) :
DoubleField::DoubleField(NodeIO* parent) :
EffectField(parent, EffectField::EFFECT_FIELD_DOUBLE),
min_(qSNaN()),
max_(qSNaN()),
Expand Down
2 changes: 1 addition & 1 deletion effects/fields/doublefield.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class DoubleField : public EffectField
/**
* @brief Reimplementation of EffectField::EffectField().
*/
DoubleField(EffectRow* parent);
DoubleField(NodeIO* parent);

/**
* @brief Get double value at timecode
Expand Down
4 changes: 2 additions & 2 deletions effects/fields/filefield.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
#include <QDebug>

#include "ui/embeddedfilechooser.h"
#include "nodes/node.h"
#include "nodes/oldeffectnode.h"
#include "undo/undo.h"

FileField::FileField(EffectRow* parent) :
FileField::FileField(NodeIO* parent) :
EffectField(parent, EffectField::EFFECT_FIELD_FILE)
{
// Set default value to an empty string
Expand Down
2 changes: 1 addition & 1 deletion effects/fields/filefield.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class FileField : public EffectField
/**
* @brief Reimplementation of EffectField::EffectField().
*/
FileField(EffectRow* parent);
FileField(NodeIO* parent);

/**
* @brief Get the filename at the given timecode
Expand Down
4 changes: 2 additions & 2 deletions effects/fields/fontfield.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
#include <QDebug>

#include "ui/comboboxex.h"
#include "nodes/node.h"
#include "nodes/oldeffectnode.h"
#include "undo/undo.h"

// NOTE/TODO: This shares a lot of similarity with ComboInput, and could probably be a derived class of it

FontField::FontField(EffectRow* parent) :
FontField::FontField(NodeIO* parent) :
EffectField(parent, EffectField::EFFECT_FIELD_FONT)
{
font_list = QFontDatabase().families();
Expand Down
2 changes: 1 addition & 1 deletion effects/fields/fontfield.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class FontField : public EffectField {
/**
* @brief Reimplementation of EffectField::EffectField().
*/
FontField(EffectRow* parent);
FontField(NodeIO* parent);

/**
* @brief Get the font family name at the given timecode
Expand Down
2 changes: 1 addition & 1 deletion effects/fields/labelfield.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include <QLabel>

LabelField::LabelField(EffectRow *parent, const QString &string) :
LabelField::LabelField(NodeIO *parent, const QString &string) :
EffectField(parent, EffectField::EFFECT_FIELD_UI),
label_text_(string)
{}
Expand Down
2 changes: 1 addition & 1 deletion effects/fields/labelfield.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class LabelField : public EffectField
/**
* @brief Reimplementation of EffectField::EffectField().
*/
LabelField(EffectRow* parent, const QString& string);
LabelField(NodeIO* parent, const QString& string);

/**
* @brief Reimplementation of EffectField::CreateWidget()
Expand Down
4 changes: 2 additions & 2 deletions effects/fields/stringfield.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
#include <QtMath>
#include <QDebug>

#include "nodes/node.h"
#include "nodes/oldeffectnode.h"
#include "ui/texteditex.h"
#include "global/config.h"
#include "undo/undo.h"

StringField::StringField(EffectRow* parent, bool rich_text) :
StringField::StringField(NodeIO* parent, bool rich_text) :
EffectField(parent, EffectField::EFFECT_FIELD_STRING),
rich_text_(rich_text)
{
Expand Down
2 changes: 1 addition & 1 deletion effects/fields/stringfield.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class StringField : public EffectField
* Provides a setting for whether this StringField - and its attached TextEditEx objects - should operate in rich
* text or plain text mode, defaulting to rich text mode.
*/
StringField(EffectRow* parent, bool rich_text = true);
StringField(NodeIO* parent, bool rich_text = true);

/**
* @brief Get the string at the given timecode
Expand Down
4 changes: 2 additions & 2 deletions effects/internal/audionoiseeffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <QDateTime>
#include <QtMath>

AudioNoiseEffect::AudioNoiseEffect(Clip* c) : Node(c) {
AudioNoiseEffect::AudioNoiseEffect(Clip* c) : OldEffectNode(c) {
amount_val = new DoubleInput(this, "amount", tr("Amount"));
amount_val->SetMinimum(0);
amount_val->SetDefault(20);
Expand Down Expand Up @@ -58,7 +58,7 @@ olive::TrackType AudioNoiseEffect::subtype()
return olive::kTypeAudio;
}

NodePtr AudioNoiseEffect::Create(Clip *c)
OldEffectNodePtr AudioNoiseEffect::Create(Clip *c)
{
return std::make_shared<AudioNoiseEffect>(c);
}
Expand Down
6 changes: 3 additions & 3 deletions effects/internal/audionoiseeffect.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
#ifndef AUDIONOISEEFFECT_H
#define AUDIONOISEEFFECT_H

#include "nodes/node.h"
#include "nodes/oldeffectnode.h"

class AudioNoiseEffect : public Node {
class AudioNoiseEffect : public OldEffectNode {
Q_OBJECT
public:
AudioNoiseEffect(Clip* c);
Expand All @@ -33,7 +33,7 @@ class AudioNoiseEffect : public Node {
virtual QString description() override;
virtual EffectType type() override;
virtual olive::TrackType subtype() override;
virtual NodePtr Create(Clip *c) override;
virtual OldEffectNodePtr Create(Clip *c) override;

virtual void process_audio(double timecode_start,
double timecode_end,
Expand Down
6 changes: 3 additions & 3 deletions effects/internal/cornerpineffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
#include "timeline/clip.h"
#include "global/debug.h"

CornerPinEffect::CornerPinEffect(Clip* c) : Node(c) {
SetFlags(Node::CoordsFlag | Node::ShaderFlag);
CornerPinEffect::CornerPinEffect(Clip* c) : OldEffectNode(c) {
SetFlags(OldEffectNode::CoordsFlag | OldEffectNode::ShaderFlag);

top_left = new Vec2Input(this, "topleft", tr("Top Left"));

Expand Down Expand Up @@ -88,7 +88,7 @@ olive::TrackType CornerPinEffect::subtype()
return olive::kTypeVideo;
}

NodePtr CornerPinEffect::Create(Clip *c)
OldEffectNodePtr CornerPinEffect::Create(Clip *c)
{
return std::make_shared<CornerPinEffect>(c);
}
Expand Down
6 changes: 3 additions & 3 deletions effects/internal/cornerpineffect.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
#ifndef CORNERPINEFFECT_H
#define CORNERPINEFFECT_H

#include "nodes/node.h"
#include "nodes/oldeffectnode.h"

class CornerPinEffect : public Node {
class CornerPinEffect : public OldEffectNode {
Q_OBJECT
public:
CornerPinEffect(Clip* c);
Expand All @@ -34,7 +34,7 @@ class CornerPinEffect : public Node {
virtual QString description() override;
virtual EffectType type() override;
virtual olive::TrackType subtype() override;
virtual NodePtr Create(Clip *c) override;
virtual OldEffectNodePtr Create(Clip *c) override;

void process_coords(double timecode, GLTextureCoords& coords, int data);
void process_shader(double timecode, GLTextureCoords& coords, int iterations);
Expand Down
4 changes: 2 additions & 2 deletions effects/internal/crossdissolvetransition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <QOpenGLFunctions>

CrossDissolveTransition::CrossDissolveTransition(Clip* c) : Transition(c) {
SetFlags(Node::CoordsFlag);
SetFlags(OldEffectNode::CoordsFlag);
}

QString CrossDissolveTransition::name()
Expand Down Expand Up @@ -56,7 +56,7 @@ olive::TrackType CrossDissolveTransition::subtype()
return olive::kTypeVideo;
}

NodePtr CrossDissolveTransition::Create(Clip *c)
OldEffectNodePtr CrossDissolveTransition::Create(Clip *c)
{
return std::make_shared<CrossDissolveTransition>(c);
}
Expand Down
Loading

0 comments on commit 9a13776

Please sign in to comment.