merged effects into node structure
This commit is contained in:
+8
-7
@@ -189,7 +189,7 @@ void SetTimelineInOutCommand::doRedo() {
|
||||
}
|
||||
}
|
||||
|
||||
AddEffectCommand::AddEffectCommand(Clip* c, EffectPtr e, const EffectMeta *m, int insert_pos) {
|
||||
AddEffectCommand::AddEffectCommand(Clip* c, NodePtr e, NodeType m, int insert_pos) {
|
||||
clip = c;
|
||||
ref = e;
|
||||
meta = m;
|
||||
@@ -207,7 +207,7 @@ void AddEffectCommand::doUndo() {
|
||||
|
||||
void AddEffectCommand::doRedo() {
|
||||
if (ref == nullptr) {
|
||||
ref = Effect::Create(clip, meta);
|
||||
ref = olive::node_library[meta]->Create(clip);
|
||||
}
|
||||
if (pos < 0) {
|
||||
clip->effects.append(ref);
|
||||
@@ -219,7 +219,7 @@ void AddEffectCommand::doRedo() {
|
||||
AddTransitionCommand::AddTransitionCommand(Clip* iopen,
|
||||
Clip* iclose,
|
||||
TransitionPtr copy,
|
||||
const EffectMeta *itransition,
|
||||
NodeType itransition,
|
||||
int ilength) {
|
||||
open_ = iopen;
|
||||
close_ = iclose;
|
||||
@@ -251,9 +251,10 @@ void AddTransitionCommand::doRedo() {
|
||||
// create new transition object
|
||||
if (new_transition_ref_ == nullptr) {
|
||||
if (transition_to_copy_ == nullptr) {
|
||||
new_transition_ref_ = Transition::CreateFromMeta(primary, secondary, transition_meta_);
|
||||
new_transition_ref_ = std::static_pointer_cast<Transition>(olive::node_library[transition_meta_]->Create(primary));
|
||||
new_transition_ref_->secondary_clip = secondary;
|
||||
} else {
|
||||
new_transition_ref_ = transition_to_copy_->copy(primary, nullptr);
|
||||
new_transition_ref_ = std::static_pointer_cast<Transition>(transition_to_copy_->copy(primary));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -544,7 +545,7 @@ void ReplaceClipMediaCommand::doRedo() {
|
||||
update_ui(true);
|
||||
}
|
||||
|
||||
EffectDeleteCommand::EffectDeleteCommand(Effect *e) :
|
||||
EffectDeleteCommand::EffectDeleteCommand(Node *e) :
|
||||
effect_(e)
|
||||
{}
|
||||
|
||||
@@ -1132,7 +1133,7 @@ void UpdateViewer::doRedo() {
|
||||
panel_sequence_viewer->viewer_widget()->frame_update();
|
||||
}
|
||||
|
||||
SetEffectData::SetEffectData(Effect *e, const QByteArray &s) {
|
||||
SetEffectData::SetEffectData(Node *e, const QByteArray &s) {
|
||||
effect = e;
|
||||
data = s;
|
||||
}
|
||||
|
||||
+13
-13
@@ -30,6 +30,7 @@
|
||||
|
||||
#include "comboaction.h"
|
||||
|
||||
#include "nodes/node.h"
|
||||
#include "timeline/marker.h"
|
||||
#include "timeline/selection.h"
|
||||
#include "effects/keyframe.h"
|
||||
@@ -43,13 +44,12 @@ using SequencePtr = std::shared_ptr<Sequence>;
|
||||
class Media;
|
||||
using MediaPtr = std::shared_ptr<Media>;
|
||||
|
||||
class Effect;
|
||||
using EffectPtr = std::shared_ptr<Effect>;
|
||||
class Node;
|
||||
using NodePtr = std::shared_ptr<Node>;
|
||||
|
||||
class Transition;
|
||||
using TransitionPtr = std::shared_ptr<Transition>;
|
||||
|
||||
struct EffectMeta;
|
||||
class EffectRow;
|
||||
class EffectField;
|
||||
|
||||
@@ -124,27 +124,27 @@ private:
|
||||
|
||||
class AddEffectCommand : public OliveAction {
|
||||
public:
|
||||
AddEffectCommand(Clip* c, EffectPtr e, const EffectMeta* m, int insert_pos = -1);
|
||||
AddEffectCommand(Clip* c, NodePtr e, NodeType m, int insert_pos = -1);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
Clip* clip;
|
||||
const EffectMeta* meta;
|
||||
EffectPtr ref;
|
||||
NodeType meta;
|
||||
NodePtr ref;
|
||||
int pos;
|
||||
bool done;
|
||||
};
|
||||
|
||||
class AddTransitionCommand : public OliveAction {
|
||||
public:
|
||||
AddTransitionCommand(Clip* iopen, Clip* iclose, TransitionPtr copy, const EffectMeta* itransition, int ilength);
|
||||
AddTransitionCommand(Clip* iopen, Clip* iclose, TransitionPtr copy, NodeType itransition, int ilength);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
Clip* open_;
|
||||
Clip* close_;
|
||||
TransitionPtr transition_to_copy_;
|
||||
const EffectMeta* transition_meta_;
|
||||
NodeType transition_meta_;
|
||||
int length_;
|
||||
TransitionPtr old_open_transition_;
|
||||
TransitionPtr old_close_transition_;
|
||||
@@ -273,12 +273,12 @@ private:
|
||||
|
||||
class EffectDeleteCommand : public OliveAction {
|
||||
public:
|
||||
EffectDeleteCommand(Effect* e);
|
||||
EffectDeleteCommand(Node* e);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
Effect* effect_;
|
||||
EffectPtr deleted_obj_;
|
||||
Node* effect_;
|
||||
NodePtr deleted_obj_;
|
||||
Clip* parent_clip_;
|
||||
int index_;
|
||||
};
|
||||
@@ -593,11 +593,11 @@ public:
|
||||
|
||||
class SetEffectData : public OliveAction {
|
||||
public:
|
||||
SetEffectData(Effect* e, const QByteArray &s);
|
||||
SetEffectData(Node* e, const QByteArray &s);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
Effect* effect;
|
||||
Node* effect;
|
||||
QByteArray data;
|
||||
QByteArray old_data;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user