changed create_effect to a static member of Effect
This commit is contained in:
+3
-3
@@ -69,7 +69,7 @@
|
||||
|
||||
QVector<EffectMeta> effects;
|
||||
|
||||
EffectPtr create_effect(Clip* c, const EffectMeta* em) {
|
||||
EffectPtr Effect::Create(Clip* c, const EffectMeta* em) {
|
||||
if (em->internal >= 0 && em->internal < EFFECT_INTERNAL_COUNT) {
|
||||
// must be an internal effect
|
||||
switch (em->internal) {
|
||||
@@ -103,7 +103,7 @@ EffectPtr create_effect(Clip* c, const EffectMeta* em) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const EffectMeta* get_internal_meta(int internal_id, int type) {
|
||||
const EffectMeta* Effect::GetInternalMeta(int internal_id, int type) {
|
||||
for (int i=0;i<effects.size();i++) {
|
||||
if (effects.at(i).internal == internal_id && effects.at(i).type == type) {
|
||||
return &effects.at(i);
|
||||
@@ -855,7 +855,7 @@ void Effect::setIterations(int i) {
|
||||
void Effect::process_image(double, uint8_t *, uint8_t *, int){}
|
||||
|
||||
EffectPtr Effect::copy(Clip *c) {
|
||||
EffectPtr copy = create_effect(c, meta);
|
||||
EffectPtr copy = Effect::Create(c, meta);
|
||||
copy->set_enabled(is_enabled());
|
||||
copy_field_keyframes(copy);
|
||||
return copy;
|
||||
|
||||
+3
-3
@@ -43,7 +43,6 @@
|
||||
#include "ui/checkboxex.h"
|
||||
|
||||
class Clip;
|
||||
using ClipPtr = std::shared_ptr<Clip>;
|
||||
|
||||
class Effect;
|
||||
using EffectPtr = std::shared_ptr<Effect>;
|
||||
@@ -61,8 +60,6 @@ struct EffectMeta {
|
||||
extern QVector<EffectMeta> effects;
|
||||
|
||||
double log_volume(double linear);
|
||||
EffectPtr create_effect(Clip *c, const EffectMeta *em);
|
||||
const EffectMeta* get_internal_meta(int internal_id, int type);
|
||||
|
||||
enum EffectType {
|
||||
EFFECT_TYPE_INVALID,
|
||||
@@ -229,6 +226,9 @@ public:
|
||||
void gizmo_move(EffectGizmo* sender, int x_movement, int y_movement, double timecode, bool done);
|
||||
void gizmo_world_to_screen();
|
||||
bool are_gizmos_enabled();
|
||||
|
||||
static EffectPtr Create(Clip *c, const EffectMeta *em);
|
||||
static const EffectMeta* GetInternalMeta(int internal_id, int type);
|
||||
public slots:
|
||||
void field_changed();
|
||||
private slots:
|
||||
|
||||
+1
-1
@@ -212,7 +212,7 @@ void AddEffectCommand::doUndo() {
|
||||
|
||||
void AddEffectCommand::doRedo() {
|
||||
if (ref == nullptr) {
|
||||
ref = create_effect(clip, meta);
|
||||
ref = Effect::Create(clip, meta);
|
||||
}
|
||||
if (pos < 0) {
|
||||
clip->effects.append(ref);
|
||||
|
||||
Reference in New Issue
Block a user