refactored some classes

This commit is contained in:
itsmattkc
2019-05-08 00:41:44 +10:00
parent 127a773c54
commit 9a13776b2c
133 changed files with 1698 additions and 1627 deletions
+5 -5
View File
@@ -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)
@@ -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)
+3 -3
View File
@@ -29,7 +29,7 @@
#include "undo/undostack.h"
#include "nodes/nodedatatypes.h"
class EffectRow;
class NodeIO;
class ComboAction;
/**
@@ -106,7 +106,7 @@ public:
*
* 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.
@@ -117,7 +117,7 @@ public:
*
* The EffectRow that this field is a member of.
*/
EffectRow* GetParentRow();
NodeIO* GetParentRow();
/**
* @brief Get the type of data to expect from this field
+2 -2
View File
@@ -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),
+2 -2
View File
@@ -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;
+1 -1
View File
@@ -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"
-388
View File
@@ -1,388 +0,0 @@
/***
Olive - Non-Linear Video Editor
Copyright (C) 2019 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 "effectrow.h"
#include <QHBoxLayout>
#include <QPushButton>
#include <QMessageBox>
#include "undo/undo.h"
#include "undo/undostack.h"
#include "timeline/clip.h"
#include "timeline/sequence.h"
#include "panels/panels.h"
#include "panels/effectcontrols.h"
#include "panels/viewer.h"
#include "panels/grapheditor.h"
#include "nodes/node.h"
#include "ui/viewerwidget.h"
#include "ui/keyframenavigator.h"
#include "ui/clickablelabel.h"
EffectRow::EffectRow(Node *parent,
const QString &id,
const QString &name,
bool savable,
bool keyframable) :
QObject(parent),
id_(id),
name_(name),
keyframable_(keyframable),
keyframing_(false),
savable_(savable),
output_type_(olive::nodes::kInvalid)
{
Q_ASSERT(parent != nullptr);
parent->AddRow(this);
}
void EffectRow::AddField(EffectField *field)
{
field->setParent(this);
connect(field, SIGNAL(Clicked()), this, SIGNAL(Clicked()));
connect(field, SIGNAL(Changed()), this, SIGNAL(Changed()));
fields_.append(field);
}
void EffectRow::AddAcceptedNodeInput(olive::nodes::DataType type)
{
Q_ASSERT(output_type_ == olive::nodes::kInvalid);
accepted_inputs_.append(type);
}
void EffectRow::ConnectEdge(EffectRow *output, EffectRow *input)
{
// Make sure one is an output and one is an input
Q_ASSERT(output->IsNodeInput() != input->IsNodeInput());
// Swap them if necessary
if (input->IsNodeOutput()) {
EffectRow* temp = output;
output = input;
input = temp;
}
// Inputs can only have one edge, so we disconnect it here if there is one
if (!input->node_edges_.isEmpty()) {
DisconnectEdge(input->node_edges_.first());
}
NodeEdgePtr edge = std::make_shared<NodeEdge>(output, input);
output->node_edges_.append(edge);
input->node_edges_.append(edge);
emit output->EdgesChanged();
}
void EffectRow::DisconnectEdge(NodeEdgePtr edge)
{
EffectRow* output = edge->output();
EffectRow* input = edge->input();
output->node_edges_.removeAll(edge);
input->node_edges_.removeAll(edge);
emit output->EdgesChanged();
}
QVector<NodeEdgePtr> EffectRow::edges()
{
return node_edges_;
}
bool EffectRow::IsKeyframing() {
return keyframing_;
}
void EffectRow::SetKeyframingInternal(bool b) {
if (GetParentEffect()->type() != EFFECT_TYPE_TRANSITION) {
keyframing_ = b;
emit KeyframingSetChanged(keyframing_);
}
}
bool EffectRow::IsSavable()
{
return savable_;
}
bool EffectRow::IsKeyframable()
{
return keyframable_;
}
QVariant EffectRow::GetValueAt(double timecode)
{
Q_ASSERT(FieldCount() == 1);
return Field(0)->GetValueAt(timecode);
}
void EffectRow::SetValueAt(double timecode, const QVariant &value)
{
Q_ASSERT(FieldCount() == 1);
Field(0)->SetValueAt(timecode, value);
}
void EffectRow::SetEnabled(bool enabled)
{
for (int i=0;i<FieldCount();i++) {
Field(i)->SetEnabled(enabled);
}
}
void EffectRow::SetOutputDataType(olive::nodes::DataType type)
{
Q_ASSERT(accepted_inputs_.isEmpty());
output_type_ = type;
}
bool EffectRow::CanAcceptDataType(olive::nodes::DataType type)
{
if (!IsNodeInput()) {
return false;
}
return accepted_inputs_.contains(type);
}
olive::nodes::DataType EffectRow::OutputDataType()
{
return output_type_;
}
bool EffectRow::IsNodeInput()
{
return !accepted_inputs_.isEmpty();
}
bool EffectRow::IsNodeOutput()
{
return output_type_ != olive::nodes::kInvalid;
}
void EffectRow::SetKeyframingEnabled(bool enabled) {
if (enabled == keyframing_) {
return;
}
if (enabled) {
ComboAction* ca = new ComboAction();
// Enable keyframing setting on this row
ca->append(new SetIsKeyframing(this, true));
// Prepare each field's data to start keyframing
for (int i=0;i<FieldCount();i++) {
Field(i)->PrepareDataForKeyframing(true, ca);
}
olive::undo_stack.push(ca);
update_ui(false);
} else {
// Confirm with the user whether they really want to disable keyframing
if (QMessageBox::question(panel_effect_controls,
tr("Disable Keyframes"),
tr("Disabling keyframes will delete all current keyframes. "
"Are you sure you want to do this?"),
QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes) {
ComboAction* ca = new ComboAction();
// Prepare each field's data to stop keyframing
for (int i=0;i<FieldCount();i++) {
Field(i)->PrepareDataForKeyframing(false, ca);
}
// Disable keyframing setting on this row
ca->append(new SetIsKeyframing(this, false));
olive::undo_stack.push(ca);
update_ui(false);
} else {
SetKeyframingInternal(true);
}
}
}
void EffectRow::GoToPreviousKeyframe() {
long key = LONG_MIN;
Clip* c = GetParentEffect()->parent_clip;
long sequence_playhead = c->track()->sequence()->playhead;
// Used to convert clip frame number to sequence frame number
long time_adjustment = c->timeline_in() - c->clip_in();
// Loop through all of this row's fields
for (int i=0;i<FieldCount();i++) {
EffectField* f = Field(i);
// Loop through all of this field's keyframes for a keyframe EARLIER than the playhead
for (int j=0;j<f->keyframes.size();j++) {
long comp = f->keyframes.at(j).time + time_adjustment;
// Get the closest keyframe
if (comp < sequence_playhead) {
key = qMax(comp, key);
}
}
}
// If we found a keyframe less than the playhead, jump to it
if (key != LONG_MIN) panel_sequence_viewer->seek(key);
}
void EffectRow::ToggleKeyframe() {
Clip* c = GetParentEffect()->parent_clip;
long sequence_playhead = c->track()->sequence()->playhead;
// Used to convert clip frame number to sequence frame number
long time_adjustment = c->timeline_in() - c->clip_in();
QVector<EffectField*> key_fields;
QVector<int> key_field_index;
// See if any keyframes on any fields are at the current time
for (int j=0;j<FieldCount();j++) {
EffectField* f = Field(j);
for (int i=0;i<f->keyframes.size();i++) {
long comp = f->keyframes.at(i).time + time_adjustment;
if (comp == sequence_playhead) {
// Cache the keyframes if they are at the current time
key_fields.append(f);
key_field_index.append(i);
}
}
}
ComboAction* ca = new ComboAction();
if (key_fields.isEmpty()) {
// If we didn't find any current keyframes, create one for each field
SetKeyframeOnAllFields(ca);
} else {
// If we DID find keyframes at this time, delete them
QVector<EffectField*> sorted_key_fields;
QVector<int> sorted_key_field_index;
// Since QVectors shift themselves when removing items, we need to sort these in reverse order
for (int i=0;i<key_field_index.size();i++) {
bool found = false;
for (int j=0;j<sorted_key_field_index.size();j++) {
if (sorted_key_field_index.at(j) < key_field_index.at(i)) {
sorted_key_fields.insert(j, key_fields.at(i));
sorted_key_field_index.insert(j, key_field_index.at(i));
found = true;
break;
}
}
if (!found) {
sorted_key_fields.append(key_fields.at(i));
sorted_key_field_index.append(key_field_index.at(i));
}
}
for (int i=0;i<sorted_key_fields.size();i++) {
ca->append(new KeyframeDelete(sorted_key_fields.at(i), sorted_key_field_index.at(i)));
}
}
olive::undo_stack.push(ca);
update_ui(false);
}
void EffectRow::GoToNextKeyframe() {
long key = LONG_MAX;
Clip* c = GetParentEffect()->parent_clip;
for (int i=0;i<FieldCount();i++) {
EffectField* f = Field(i);
for (int j=0;j<f->keyframes.size();j++) {
long comp = f->keyframes.at(j).time - c->clip_in() + c->timeline_in();
if (comp > c->track()->sequence()->playhead) {
key = qMin(comp, key);
}
}
}
if (key != LONG_MAX) panel_sequence_viewer->seek(key);
}
void EffectRow::FocusRow() {
panel_graph_editor->set_row(this);
}
void EffectRow::SetKeyframeOnAllFields(ComboAction* ca) {
for (int i=0;i<FieldCount();i++) {
EffectField* field = Field(i);
KeyframeDataChange* kdc = new KeyframeDataChange(field);
field->SetValueAt(GetParentEffect()->Now(), field->GetValueAt(GetParentEffect()->Now()));
kdc->SetNewKeyframes();
ca->append(kdc);
}
panel_effect_controls->update_keyframes();
}
Node *EffectRow::GetParentEffect()
{
return static_cast<Node*>(parent());
}
const QString &EffectRow::name() {
return name_;
}
EffectField* EffectRow::Field(int i) {
return fields_.at(i);
}
int EffectRow::FieldCount() {
return fields_.size();
}
-466
View File
@@ -1,466 +0,0 @@
/***
Olive - Non-Linear Video Editor
Copyright (C) 2019 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 EFFECTROW_H
#define EFFECTROW_H
#include <QObject>
#include <QVector>
class Node;
class QGridLayout;
class EffectField;
class QLabel;
class QPushButton;
class ComboAction;
class QHBoxLayout;
class KeyframeNavigator;
class ClickableLabel;
#include "effectfields.h"
#include "nodes/nodeedge.h"
/**
* @brief The EffectRow class
*
* Primarily a way of grouping EffectField objects together. As UI objects, Effects are largely formatted as a table
* and you can think of EffectRows as the rows of the table and EffectFields as the columns.
*
* Within Olive, keyframing is enabled on the EffectRow (rather than individual EffectFields) so all attached fields
* will be keyframed together.
*
* Unlike EffectField, there's no reason to derive from EffectRow as it's simply a container of fields and a few
* keyframe functions.
*/
class EffectRow : public QObject {
Q_OBJECT
public:
/**
* @brief EffectRow Constructor
*
* @param parent
*
* Every EffectRow object must be attached to a valid Effect object. The Effect object takes ownership of the
* EffectRow and automatically frees it through the QObject parent/child system. EffectRows are never intended to
* change parents throughout their lifetimes.
*
* @param id
*
* Field ID. Must be non-empty. Must also be unique within this Effect. Used for saving/loading values into project
* files so that if ordering of fields are changed, or fields are added/removed from Effects later in development,
* saved values in project files will still link with the correct field. Also used as the uniform variable name
* in GLSL shaders.
*
* @param name
*
* Row name. This is not used as an internal identifier, it's just for the user interface, so it can be translated
* with no issue.
*
* @param savable
*
* Whether the fields in this row should be saved to the project file. This is true by default. If the row contains
* non-value UI widgets, setting this to false is recommended.
*
* @param keyframable
*
* Whether keyframing can be enabled on this row or not. This is true by default. Some values you may want to prevent
* the user from keyframing (e.g. the filename of a VST plugin), which can be done by setting this to false.
*/
EffectRow(Node* parent,
const QString& id,
const QString& name,
bool savable = true,
bool keyframable = true);
/**
* @brief Retrieve the EffectField at this index. Must be less than FieldCount().
*
* @param i
*
* Index to retrieve the EffectField at.
*
* @return
*
* EffectField at the provided index.
*/
EffectField* Field(int i);
/**
* @brief Number of fields currently contained in this row.
*
* @return The number of fields currently contained in this row as an integer. Any field index (retrieved with
* Field()) is guaranteed to be valid >= 0 and < FieldCount().
*/
int FieldCount();
/**
* @brief Set a keyframe at the current playhead on all fields contained within this row
*
* @param ca
*
* The ComboAction to add this action to. This may not be nullptr.
*/
void SetKeyframeOnAllFields(ComboAction *ca);
/**
* @brief Get parent Effect
*
* Equivalent to `static_cast<Effect*>(parent())`.
*
* @return The parent Effect object that this row is attached to.
*/
Node* GetParentEffect();
/**
* @brief Return the row's name
*
* @return The name specified in the constructor as a QString
*/
const QString& name();
/**
* @brief Get the unique identifier of this field set in the constructor
*
* Mostly used for saving/loading or interacting with GLSL-based shader effects (see EffectField() for more details).
*
* @return
*/
const QString& id();
/**
* @brief Get whether this row is keyframing or not
*
* @return True if this row is keyframing.
*/
bool IsKeyframing();
/**
* @brief Set whether this row is keyframing or not.
*
* It's not recommended to use this function for any user-initiated keyframe setting change as it doesn't create any
* undoable actions. Use SetKeyframingEnabled() instead for a user-friendly variant.
*/
void SetKeyframingInternal(bool);
/**
* @brief Get whether this row should be saved into a project file or not
*
* @return True if this row should be saved. This value is set in the constructor.
*/
bool IsSavable();
/**
* @brief Get whether this row can be keyframed or not.
*
* @return True if this row can be keyframed. This value is set in the constructor.
*/
bool IsKeyframable();
/**
* @brief Get value at a given timecode
*
* Functions as a wrapper for EffectField::GetValueAt().
*
* The default function is to return the result of the first EffectField on this EffectRow which should be sufficient
* for most input types. If this EffectRow has more or less than one EffectField, you must override this function in a
* derived class to provide the correct field <-> row coordination or else it will trigger an abort.
*
* @param timecode
*
* Timecode to get the value at
*
* @return
*
* The value of the first EffectField at the given timecode
*/
virtual QVariant GetValueAt(double timecode);
/**
* @brief SetValueAt
*
* Functions as a wrapper for EffectField::SetValueAt().
*
* The default function is to call the function of the first EffectField on this EffectRow which should be sufficient
* for most input types. If this EffectRow has more or less than one EffectField, you must override this function in a
* derived class to provide the correct field <-> row coordination or else it will trigger an abort.
*
* @param timecode
*
* Timecode to set the value at
*
* @param value
*
* Value to set at this timecode
*/
virtual void SetValueAt(double timecode, const QVariant& value);
/**
* @brief Sets the enabled state on all EffectField objects on this row to enabled
*/
void SetEnabled(bool enabled);
/**
* @brief Check if nodes can be connected to this as an input.
*
* Connecting is enabled by adding an accepted node input using AddNodeInput().
*
* @return
*
* TRUE if nodes can be connected as an input.
*/
bool IsNodeInput();
/**
* @brief Check if nodes can be connected to this as an output
*
* Connecting is enabled by setting an output data type in SetOutputDataType().
*
* @return
*
* TRUE if nodes can be connected as an output
*/
bool IsNodeOutput();
/**
* @brief Set output data type
*
* Set the type of data this row outputs to type
*/
void SetOutputDataType(olive::nodes::DataType type);
/**
* @brief Check if this row can accept the data type specified in type
*
* @return
*
* TRUE if this row can accept this data type. If this row is not an input, this function will always return FALSE.
*/
bool CanAcceptDataType(olive::nodes::DataType type);
/**
* @brief Get this row's output data type
*
* @return
*
* If this is not an output, this will always return olive::nodes::kInvalid
*/
olive::nodes::DataType OutputDataType();
/**
* @brief Adds a node data type that can be accepted by this input
*
* Allows this input to take a node connection from a data type specified by type. An input can take several data
* types.
*
* @param type
*
* The data type to add
*/
void AddAcceptedNodeInput(olive::nodes::DataType type);
/**
* @brief Connect two node sockets together
*
* For outputs, the maximum amount of edges is unlimited and this will continually add to a list of edges. For inputs,
* there can only be one edge and adding a second will destroy the first.
*
* @param edge
*
* The edge to add (output) or replace the current edge (input).
*/
static void ConnectEdge(EffectRow* output, EffectRow* input);
/**
* @brief Disconnect an edge
*
* Disconnects two nodes and destroys the edge object connecting them together
*
* @param edge
*
* Edge to be removed
*/
static void DisconnectEdge(NodeEdgePtr edge);
/**
* @brief Get a list of references to all edges currently connected to this row
*/
QVector<NodeEdgePtr> edges();
protected:
/**
* @brief Add a field to this row
*
* Ownership of the EffectField is transferred to this row and the row will free its memory. In the Effect's UI, this
* will add the field to an additional column.
*
* @param Field
*
* The field to add to this row.
*/
void AddField(EffectField* Field);
public slots:
/**
* @brief Go to previous keyframe
*
* Gets the closest keyframe prior to the current playhead and seeks to it.
*
* Attach to KeyframeNavigator::goto_previous_key() signal.
*/
void GoToPreviousKeyframe();
/**
* @brief Toggle a keyframe at this point in time
*
* Either deletes (if any child EffectFields have any keyframes here) or creates (if none do) a keyframe on all
* EffectField children at the current time.
*
* Attach to KeyframeNavigator::toggle_key() signal.
*/
void ToggleKeyframe();
/**
* @brief Go to next keyframe
*
* Gets the closest keyframe after the current playhead and seeks to it.
*
* Attach to KeyframeNavigator::goto_next_key() signal.
*/
void GoToNextKeyframe();
/**
* @brief Slot for whenever this EffectRow is focused.
*
* Connect UI objects gaining focus to this slot. Automatically updates the Graph Editor to attach to this row.
*/
void FocusRow();
signals:
/**
* @brief Keyframing setting changed signal
*
* Emitted whenever keyframing is enabled or disabled.
*
* @param
*
* True if keyframing was enabled, false if keyframing was disabled.
*/
void KeyframingSetChanged(bool);
/**
* @brief Changed signal
*
* Wrapper for EffectField::Changed().
*/
void Changed();
/**
* @brief Clicked signal
*
* Wrapper for EffectField::Clicked().
*/
void Clicked();
/**
* @brief Edges changed signal
*
* Signal emitted any time an edge is connected or disconnected from this row
*/
void EdgesChanged();
private slots:
/**
* @brief Set keyframing enabled state
*
* A user-friendly function for enabling or disabling keyframes on this row. Preferred to SetKeyframingInternal()
* for any user-initiated change. Automatically creates an undoable action so users can undo the enabling/disabling.
* Also confirms with the user when disabling keyframing whether they wish to continue and remove all the current
* keyframes.
*
* Attach to KeyframeNavigator::keyframe_enabled_changed() signal.
*/
void SetKeyframingEnabled(bool);
private:
/**
* @brief Internal unique identifier for this field set in the constructor. Access with id().
*/
QString id_;
/**
* @brief Internal variable for the row's name
*
* Set in the constructor, retrieved with name().
*/
QString name_;
/**
* @brief Internal variable for whether this row can be keyframed.
*
* Set in the constructor, retrieved with IsKeyframable().
*/
bool keyframable_;
/**
* @brief Internal variable for whether this row is currently keyframing.
*
* Set by SetKeyframingInternal() and retrieved with IsKeyframing().
*/
bool keyframing_;
/**
* @brief Internal variable for whether this row should be saved.
*
* Set in the constructor, retrieved with IsSavable().
*/
bool savable_;
/**
* @brief Internal array of EffectField objects.
*
* It is not necessary to delete the elements in this array as they're already children of this QObject, so they'll
* get freed automatically.
*/
QVector<EffectField*> fields_;
/**
* @brief Internal array of accepted node data types.
*
* Is mutally-exclusive with accepted_outputs_, i.e. you cannot have values added to this and also a value set in
* accepted_outputs_.
*/
QVector<olive::nodes::DataType> accepted_inputs_;
/**
* @brief Internal value for what kind of data this row outputs
*
* Is mutally-exclusive with accepted_inputs_, i.e. you cannot have values added to it and also a value set in
* this.
*/
olive::nodes::DataType output_type_;
/**
* @brief Internal array of node edges. Access with AddEdge() and RemoveEdge().
*/
QVector<NodeEdgePtr> node_edges_;
};
#endif // EFFECTROW_H
+2 -2
View File
@@ -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)
{}
+1 -1
View File
@@ -35,7 +35,7 @@ public:
/**
* @brief Reimplementation of EffectField::EffectField().
*/
BoolField(EffectRow* parent);
BoolField(NodeIO* parent);
/**
* @brief Get the boolean value at a given timecode
+1 -1
View File
@@ -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)
{}
+1 -1
View File
@@ -42,7 +42,7 @@ public:
/**
* @brief Reimplementation of EffectField::EffectField().
*/
ButtonField(EffectRow* parent, const QString& string);
ButtonField(NodeIO* parent, const QString& string);
/**
* @brief Set whether this pushbutton is checkable
+2 -2
View File
@@ -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)
{}
+1 -1
View File
@@ -35,7 +35,7 @@ public:
/**
* @brief Reimplementation of EffectField::EffectField().
*/
ColorField(EffectRow* parent);
ColorField(NodeIO* parent);
/**
* @brief Get the color value at a given timecode
+2 -2
View File
@@ -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)
{}
+1 -1
View File
@@ -48,7 +48,7 @@ public:
/**
* @brief Reimplementation of EffectField::EffectField().
*/
ComboField(EffectRow* parent);
ComboField(NodeIO* parent);
/**
* @brief Add an item to this ComboField
+2 -2
View File
@@ -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()),
+1 -1
View File
@@ -39,7 +39,7 @@ public:
/**
* @brief Reimplementation of EffectField::EffectField().
*/
DoubleField(EffectRow* parent);
DoubleField(NodeIO* parent);
/**
* @brief Get double value at timecode
+2 -2
View File
@@ -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
+1 -1
View File
@@ -36,7 +36,7 @@ public:
/**
* @brief Reimplementation of EffectField::EffectField().
*/
FileField(EffectRow* parent);
FileField(NodeIO* parent);
/**
* @brief Get the filename at the given timecode
+2 -2
View File
@@ -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();
+1 -1
View File
@@ -37,7 +37,7 @@ public:
/**
* @brief Reimplementation of EffectField::EffectField().
*/
FontField(EffectRow* parent);
FontField(NodeIO* parent);
/**
* @brief Get the font family name at the given timecode
+1 -1
View File
@@ -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)
{}
+1 -1
View File
@@ -37,7 +37,7 @@ public:
/**
* @brief Reimplementation of EffectField::EffectField().
*/
LabelField(EffectRow* parent, const QString& string);
LabelField(NodeIO* parent, const QString& string);
/**
* @brief Reimplementation of EffectField::CreateWidget()
+2 -2
View File
@@ -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)
{
+1 -1
View File
@@ -39,7 +39,7 @@ public:
* 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
+2 -2
View File
@@ -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);
@@ -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);
}
+3 -3
View File
@@ -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);
@@ -33,7 +33,7 @@ public:
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,
+3 -3
View File
@@ -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"));
@@ -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);
}
+3 -3
View File
@@ -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);
@@ -34,7 +34,7 @@ public:
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);
+2 -2
View File
@@ -23,7 +23,7 @@
#include <QOpenGLFunctions>
CrossDissolveTransition::CrossDissolveTransition(Clip* c) : Transition(c) {
SetFlags(Node::CoordsFlag);
SetFlags(OldEffectNode::CoordsFlag);
}
QString CrossDissolveTransition::name()
@@ -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);
}
+1 -1
View File
@@ -33,7 +33,7 @@ public:
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_coords(double timecode, GLTextureCoords &, int data) override;
};
@@ -52,7 +52,7 @@ olive::TrackType ExponentialFadeTransition::subtype()
return olive::kTypeAudio;
}
NodePtr ExponentialFadeTransition::Create(Clip *c)
OldEffectNodePtr ExponentialFadeTransition::Create(Clip *c)
{
return std::make_shared<ExponentialFadeTransition>(c);
}
+1 -1
View File
@@ -32,7 +32,7 @@ public:
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,
+2 -2
View File
@@ -25,7 +25,7 @@ enum FillType {
FILL_TYPE_RIGHT
};
FillLeftRightEffect::FillLeftRightEffect(Clip* c) : Node(c) {
FillLeftRightEffect::FillLeftRightEffect(Clip* c) : OldEffectNode(c) {
fill_type = new ComboInput(this, "type", tr("Type"));
fill_type->AddItem(tr("Fill Left with Right"), FILL_TYPE_LEFT);
fill_type->AddItem(tr("Fill Right with Left"), FILL_TYPE_RIGHT);
@@ -56,7 +56,7 @@ olive::TrackType FillLeftRightEffect::subtype()
return olive::kTypeAudio;
}
NodePtr FillLeftRightEffect::Create(Clip *c)
OldEffectNodePtr FillLeftRightEffect::Create(Clip *c)
{
return std::make_shared<FillLeftRightEffect>(c);
}
+3 -3
View File
@@ -21,9 +21,9 @@
#ifndef FILLLEFTRIGHTEFFECT_H
#define FILLLEFTRIGHTEFFECT_H
#include "nodes/node.h"
#include "nodes/oldeffectnode.h"
class FillLeftRightEffect : public Node {
class FillLeftRightEffect : public OldEffectNode {
Q_OBJECT
public:
FillLeftRightEffect(Clip* c);
@@ -33,7 +33,7 @@ public:
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,
+1 -1
View File
@@ -47,7 +47,7 @@ olive::TrackType LinearFadeTransition::subtype()
return olive::kTypeAudio;
}
NodePtr LinearFadeTransition::Create(Clip *c)
OldEffectNodePtr LinearFadeTransition::Create(Clip *c)
{
return std::make_shared<LinearFadeTransition>(c);
}
+1 -1
View File
@@ -32,7 +32,7 @@ public:
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,
@@ -52,7 +52,7 @@ olive::TrackType LogarithmicFadeTransition::subtype()
return olive::kTypeAudio;
}
NodePtr LogarithmicFadeTransition::Create(Clip *c)
OldEffectNodePtr LogarithmicFadeTransition::Create(Clip *c)
{
return std::make_shared<LogarithmicFadeTransition>(c);
}
+1 -1
View File
@@ -32,7 +32,7 @@ public:
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,
+2 -2
View File
@@ -28,7 +28,7 @@
#include "ui/labelslider.h"
#include "ui/collapsiblewidget.h"
PanEffect::PanEffect(Clip* c) : Node(c) {
PanEffect::PanEffect(Clip* c) : OldEffectNode(c) {
pan_val = new DoubleInput(this, "pan", tr("Pan"));
pan_val->SetMinimum(-100);
pan_val->SetDefault(0);
@@ -60,7 +60,7 @@ olive::TrackType PanEffect::subtype()
return olive::kTypeAudio;
}
NodePtr PanEffect::Create(Clip *c)
OldEffectNodePtr PanEffect::Create(Clip *c)
{
return std::make_shared<PanEffect>(c);
}
+3 -3
View File
@@ -21,9 +21,9 @@
#ifndef PANEFFECT_H
#define PANEFFECT_H
#include "nodes/node.h"
#include "nodes/oldeffectnode.h"
class PanEffect : public Node {
class PanEffect : public OldEffectNode {
Q_OBJECT
public:
PanEffect(Clip* c);
@@ -33,7 +33,7 @@ public:
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,
+3 -3
View File
@@ -35,9 +35,9 @@ enum AutoscrollDirection {
};
RichTextEffect::RichTextEffect(Clip *c) :
Node(c)
OldEffectNode(c)
{
SetFlags(Node::SuperimposeFlag);
SetFlags(OldEffectNode::SuperimposeFlag);
text_val = new StringInput(this, "text", tr("Text"));
@@ -112,7 +112,7 @@ olive::TrackType RichTextEffect::subtype()
return olive::kTypeVideo;
}
NodePtr RichTextEffect::Create(Clip *c)
OldEffectNodePtr RichTextEffect::Create(Clip *c)
{
return std::make_shared<RichTextEffect>(c);
}
+3 -3
View File
@@ -21,9 +21,9 @@
#ifndef RICHTEXTEFFECT_H
#define RICHTEXTEFFECT_H
#include "nodes/node.h"
#include "nodes/oldeffectnode.h"
class RichTextEffect : public Node {
class RichTextEffect : public OldEffectNode {
Q_OBJECT
public:
RichTextEffect(Clip* c);
@@ -34,7 +34,7 @@ public:
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 redraw(double timecode) override;
+3 -3
View File
@@ -32,8 +32,8 @@
#include "panels/timeline.h"
#include "global/debug.h"
ShakeEffect::ShakeEffect(Clip* c) : Node(c) {
SetFlags(Node::CoordsFlag);
ShakeEffect::ShakeEffect(Clip* c) : OldEffectNode(c) {
SetFlags(OldEffectNode::CoordsFlag);
intensity_val = new DoubleInput(this, "intensity", tr("Intensity"));
intensity_val->SetMinimum(0);
@@ -110,7 +110,7 @@ olive::TrackType ShakeEffect::subtype()
return olive::kTypeVideo;
}
NodePtr ShakeEffect::Create(Clip *c)
OldEffectNodePtr ShakeEffect::Create(Clip *c)
{
return std::make_shared<ShakeEffect>(c);
}
+3 -3
View File
@@ -21,11 +21,11 @@
#ifndef SHAKEEFFECT_H
#define SHAKEEFFECT_H
#include "nodes/node.h"
#include "nodes/oldeffectnode.h"
#define RANDOM_VAL_SIZE 30
class ShakeEffect : public Node {
class ShakeEffect : public OldEffectNode {
Q_OBJECT
public:
ShakeEffect(Clip* c);
@@ -37,7 +37,7 @@ public:
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;
DoubleInput* intensity_val;
DoubleInput* rotation_val;
+3 -3
View File
@@ -35,9 +35,9 @@ const int SMPTE_STRIP_COUNT = 3;
const int SMPTE_LOWER_BARS = 4;
SolidEffect::SolidEffect(Clip* c) :
Node(c)
OldEffectNode(c)
{
SetFlags(Node::SuperimposeFlag);
SetFlags(OldEffectNode::SuperimposeFlag);
// Field for solid type
solid_type = new ComboInput(this, "type", tr("Type"));
@@ -99,7 +99,7 @@ olive::TrackType SolidEffect::subtype()
return olive::kTypeVideo;
}
NodePtr SolidEffect::Create(Clip *c)
OldEffectNodePtr SolidEffect::Create(Clip *c)
{
return std::make_shared<SolidEffect>(c);
}
+3 -3
View File
@@ -21,11 +21,11 @@
#ifndef SOLIDEFFECT_H
#define SOLIDEFFECT_H
#include "nodes/node.h"
#include "nodes/oldeffectnode.h"
#include <QImage>
class SolidEffect : public Node {
class SolidEffect : public OldEffectNode {
Q_OBJECT
public:
enum SolidType {
@@ -42,7 +42,7 @@ public:
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 redraw(double timecode) override;
+3 -3
View File
@@ -43,9 +43,9 @@
#include "global/config.h"
TextEffect::TextEffect(Clip* c) :
Node(c)
OldEffectNode(c)
{
SetFlags(Node::SuperimposeFlag);
SetFlags(OldEffectNode::SuperimposeFlag);
text_val = new StringInput(this, "text", tr("Text"), false);
@@ -151,7 +151,7 @@ olive::TrackType TextEffect::subtype()
return olive::kTypeVideo;
}
NodePtr TextEffect::Create(Clip *c)
OldEffectNodePtr TextEffect::Create(Clip *c)
{
return std::make_shared<TextEffect>(c);
}
+3 -3
View File
@@ -21,12 +21,12 @@
#ifndef TEXTEFFECT_H
#define TEXTEFFECT_H
#include "nodes/node.h"
#include "nodes/oldeffectnode.h"
#include <QFont>
#include <QImage>
class TextEffect : public Node {
class TextEffect : public OldEffectNode {
Q_OBJECT
public:
TextEffect(Clip* c);
@@ -37,7 +37,7 @@ public:
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 redraw(double timecode) override;
private slots:
+3 -3
View File
@@ -43,9 +43,9 @@
#include "global/config.h"
TimecodeEffect::TimecodeEffect(Clip* c) :
Node(c)
OldEffectNode(c)
{
SetFlags(Node::SuperimposeFlag);
SetFlags(OldEffectNode::SuperimposeFlag);
tc_select = new ComboInput(this, "tc_selector", tr("Timecode"));
tc_select->AddItem(tr("Sequence"), true);
@@ -104,7 +104,7 @@ olive::TrackType TimecodeEffect::subtype()
return olive::kTypeVideo;
}
NodePtr TimecodeEffect::Create(Clip *c)
OldEffectNodePtr TimecodeEffect::Create(Clip *c)
{
return std::make_shared<TimecodeEffect>(c);
}
+3 -3
View File
@@ -21,12 +21,12 @@
#ifndef TIMECODEEFFECT_H
#define TIMECODEEFFECT_H
#include "nodes/node.h"
#include "nodes/oldeffectnode.h"
#include <QFont>
#include <QImage>
class TimecodeEffect : public Node {
class TimecodeEffect : public OldEffectNode {
Q_OBJECT
public:
TimecodeEffect(Clip* c);
@@ -37,7 +37,7 @@ public:
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 redraw(double timecode) override;
DoubleInput* scale_val;
+2 -2
View File
@@ -27,7 +27,7 @@
#include "timeline/clip.h"
#include "timeline/sequence.h"
ToneEffect::ToneEffect(Clip* c) : Node(c), sinX(INT_MIN) {
ToneEffect::ToneEffect(Clip* c) : OldEffectNode(c), sinX(INT_MIN) {
type_val = new ComboInput(this, "type", tr("Type"));
type_val->AddItem(tr("Sine"), TONE_TYPE_SINE);
@@ -70,7 +70,7 @@ olive::TrackType ToneEffect::subtype()
return olive::kTypeAudio;
}
NodePtr ToneEffect::Create(Clip *c)
OldEffectNodePtr ToneEffect::Create(Clip *c)
{
return std::make_shared<ToneEffect>(c);
}
+3 -3
View File
@@ -21,9 +21,9 @@
#ifndef TONEEFFECT_H
#define TONEEFFECT_H
#include "nodes/node.h"
#include "nodes/oldeffectnode.h"
class ToneEffect : public Node {
class ToneEffect : public OldEffectNode {
Q_OBJECT
public:
ToneEffect(Clip* c);
@@ -33,7 +33,7 @@ public:
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,
+4 -4
View File
@@ -43,8 +43,8 @@
#include "panels/viewer.h"
#include "ui/viewerwidget.h"
TransformEffect::TransformEffect(Clip* c) : Node(c) {
SetFlags(Node::CoordsFlag);
TransformEffect::TransformEffect(Clip* c) : OldEffectNode(c) {
SetFlags(OldEffectNode::CoordsFlag);
position = new Vec2Input(this, "pos", tr("Position"));
@@ -68,7 +68,7 @@ TransformEffect::TransformEffect(Clip* c) : Node(c) {
opacity->SetDefault(100);
// TEMP - Create matrix output
EffectRow* matrix_output = new EffectRow(this, "matrix", "Matrix", false, false);
NodeIO* matrix_output = new NodeIO(this, "matrix", "Matrix", false, false);
matrix_output->SetOutputDataType(olive::nodes::kMatrix);
// set up gizmos
@@ -155,7 +155,7 @@ olive::TrackType TransformEffect::subtype()
return olive::kTypeVideo;
}
NodePtr TransformEffect::Create(Clip *c)
OldEffectNodePtr TransformEffect::Create(Clip *c)
{
return std::make_shared<TransformEffect>(c);
}
+3 -3
View File
@@ -21,9 +21,9 @@
#ifndef TRANSFORMEFFECT_H
#define TRANSFORMEFFECT_H
#include "nodes/node.h"
#include "nodes/oldeffectnode.h"
class TransformEffect : public Node {
class TransformEffect : public OldEffectNode {
Q_OBJECT
public:
TransformEffect(Clip* c);
@@ -34,7 +34,7 @@ public:
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 refresh() override;
virtual void process_coords(double timecode, GLTextureCoords& coords, int data) override;
+4 -4
View File
@@ -28,7 +28,7 @@
#include "global/debug.h"
VoidEffect::VoidEffect(Clip* c, const QString& n, const QString& id) :
Node(c),
OldEffectNode(c),
display_name_(n),
id_(id)
{
@@ -69,13 +69,13 @@ bool VoidEffect::IsCreatable()
return false;
}
NodePtr VoidEffect::Create(Clip *)
OldEffectNodePtr VoidEffect::Create(Clip *)
{
return nullptr;
}
NodePtr VoidEffect::copy(Clip* c) {
NodePtr copy = std::make_shared<VoidEffect>(c, display_name_, id_);
OldEffectNodePtr VoidEffect::copy(Clip* c) {
OldEffectNodePtr copy = std::make_shared<VoidEffect>(c, display_name_, id_);
copy->SetEnabled(IsEnabled());
copy_field_keyframes(copy);
return copy;
+4 -4
View File
@@ -27,9 +27,9 @@
* isn't lost if the user saves over the project.
*/
#include "nodes/node.h"
#include "nodes/oldeffectnode.h"
class VoidEffect : public Node {
class VoidEffect : public OldEffectNode {
Q_OBJECT
public:
VoidEffect(Clip* c, const QString& n, const QString &id);
@@ -40,8 +40,8 @@ public:
virtual EffectType type() override;
virtual olive::TrackType subtype() override;
virtual bool IsCreatable() override;
virtual NodePtr Create(Clip *c) override;
virtual NodePtr copy(Clip* c) override;
virtual OldEffectNodePtr Create(Clip *c) override;
virtual OldEffectNodePtr copy(Clip* c) override;
virtual void load(QXmlStreamReader &stream) override;
virtual void save(QXmlStreamWriter &stream) override;
+2 -2
View File
@@ -28,7 +28,7 @@
#include "ui/labelslider.h"
#include "ui/collapsiblewidget.h"
VolumeEffect::VolumeEffect(Clip* c) : Node(c) {
VolumeEffect::VolumeEffect(Clip* c) : OldEffectNode(c) {
volume_val = new DoubleInput(this, "volume", tr("Volume"));
// set defaults
@@ -61,7 +61,7 @@ olive::TrackType VolumeEffect::subtype()
return olive::kTypeAudio;
}
NodePtr VolumeEffect::Create(Clip *c)
OldEffectNodePtr VolumeEffect::Create(Clip *c)
{
return std::make_shared<VolumeEffect>(c);
}
+3 -3
View File
@@ -21,9 +21,9 @@
#ifndef VOLUMEEFFECT_H
#define VOLUMEEFFECT_H
#include "nodes/node.h"
#include "nodes/oldeffectnode.h"
class VolumeEffect : public Node {
class VolumeEffect : public OldEffectNode {
Q_OBJECT
public:
VolumeEffect(Clip* c);
@@ -33,7 +33,7 @@ public:
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,
+3 -3
View File
@@ -228,7 +228,7 @@ void VSTHost::send_data_cache_to_plugin()
}
VSTHost::VSTHost(Clip* c) :
Node(c),
OldEffectNode(c),
plugin(nullptr),
dialog(nullptr),
input_cache(BLOCK_SIZE),
@@ -274,7 +274,7 @@ olive::TrackType VSTHost::subtype()
return olive::kTypeAudio;
}
NodePtr VSTHost::Create(Clip *c)
OldEffectNodePtr VSTHost::Create(Clip *c)
{
return std::make_shared<VSTHost>(c);
}
@@ -321,7 +321,7 @@ void VSTHost::custom_load(QXmlStreamReader &stream) {
}
void VSTHost::save(QXmlStreamWriter &stream) {
Node::save(stream);
OldEffectNode::save(stream);
if (plugin != nullptr) {
char* p = nullptr;
int32_t length = int32_t(dispatcher(plugin, effGetChunk, 0, 0, &p, 0));
+3 -3
View File
@@ -24,7 +24,7 @@
#include <QDialog>
#include <QLibrary>
#include "nodes/node.h"
#include "nodes/oldeffectnode.h"
#include "include/vestige.h"
// Plugin's dispatcher function
@@ -46,7 +46,7 @@ private:
void destroy();
};
class VSTHost : public Node {
class VSTHost : public OldEffectNode {
Q_OBJECT
public:
VSTHost(Clip* c);
@@ -57,7 +57,7 @@ public:
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,
+4 -4
View File
@@ -41,7 +41,7 @@
#include <QCoreApplication>
Transition::Transition(Clip *c) :
Node(c),
OldEffectNode(c),
secondary_clip(nullptr)
{
length_field = new DoubleInput(this, "length", tr("Length"), false, false);
@@ -57,8 +57,8 @@ Transition::Transition(Clip *c) :
connect(length_field, SIGNAL(Changed()), this, SLOT(UpdateMaximumLength()));
}
NodePtr Transition::copy(Clip *c) {
NodePtr node = Node::copy(c);
OldEffectNodePtr Transition::copy(Clip *c) {
OldEffectNodePtr node = OldEffectNode::copy(c);
static_cast<Transition*>(node.get())->set_length(get_true_length());
@@ -67,7 +67,7 @@ NodePtr Transition::copy(Clip *c) {
void Transition::save(QXmlStreamWriter &stream) {
stream.writeAttribute("length", QString::number(get_true_length()));
Node::save(stream);
OldEffectNode::save(stream);
}
void Transition::set_length(int l) {
+3 -3
View File
@@ -21,7 +21,7 @@
#ifndef TRANSITION_H
#define TRANSITION_H
#include "nodes/node.h"
#include "nodes/oldeffectnode.h"
#include "nodes/inputs.h"
enum TransitionType {
@@ -33,12 +33,12 @@ enum TransitionType {
class Transition;
using TransitionPtr = std::shared_ptr<Transition>;
class Transition : public Node {
class Transition : public OldEffectNode {
Q_OBJECT
public:
Transition(Clip* c);
virtual NodePtr copy(Clip* c) override;
virtual OldEffectNodePtr copy(Clip* c) override;
Clip* secondary_clip;