changed create_effect to a static member of Effect

This commit is contained in:
itsmattkc
2019-02-28 03:09:42 -08:00
parent 8b648ebcef
commit 86b7124238
6 changed files with 21 additions and 21 deletions
+3 -3
View File
@@ -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
View File
@@ -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
View File
@@ -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);