/*** 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 . ***/ #include "effectloaders.h" #include #include #include #include "effects/effect.h" #include "effects/transition.h" #include "global/path.h" #include "panels/panels.h" #include "panels/effectcontrols.h" #include "global/config.h" QMutex olive::effects_loaded; void load_internal_effects() { if (!olive::CurrentRuntimeConfig.shaders_are_enabled) { qWarning() << "Shaders are disabled, some effects may be nonfunctional"; } EffectMeta em; // load internal effects em.path = ":/internalshaders"; em.type = EFFECT_TYPE_EFFECT; em.subtype = EFFECT_TYPE_AUDIO; em.name = "Volume"; em.internal = EFFECT_INTERNAL_VOLUME; olive::effects.append(em); em.name = "Pan"; em.internal = EFFECT_INTERNAL_PAN; olive::effects.append(em); em.name = "VST Plugin 2.x"; em.internal = EFFECT_INTERNAL_VST; olive::effects.append(em); em.name = "Tone"; em.internal = EFFECT_INTERNAL_TONE; olive::effects.append(em); em.name = "Noise"; em.internal = EFFECT_INTERNAL_NOISE; olive::effects.append(em); em.name = "Fill Left/Right"; em.internal = EFFECT_INTERNAL_FILLLEFTRIGHT; olive::effects.append(em); em.subtype = EFFECT_TYPE_VIDEO; em.name = "Transform"; em.category = "Distort"; em.internal = EFFECT_INTERNAL_TRANSFORM; olive::effects.append(em); em.name = "Corner Pin"; em.internal = EFFECT_INTERNAL_CORNERPIN; olive::effects.append(em); /*em.name = "Mask"; em.internal = EFFECT_INTERNAL_MASK; olive::effects.append(em);*/ em.name = "Shake"; em.internal = EFFECT_INTERNAL_SHAKE; olive::effects.append(em); em.name = "Text"; em.category = "Render"; em.internal = EFFECT_INTERNAL_TEXT; olive::effects.append(em); em.name = "Rich Text"; em.category = "Render"; em.internal = EFFECT_INTERNAL_RICHTEXT; olive::effects.append(em); em.name = "Timecode"; em.internal = EFFECT_INTERNAL_TIMECODE; olive::effects.append(em); em.name = "Solid"; em.internal = EFFECT_INTERNAL_SOLID; olive::effects.append(em); // internal transitions em.type = EFFECT_TYPE_TRANSITION; em.category = ""; em.name = "Cross Dissolve"; em.internal = TRANSITION_INTERNAL_CROSSDISSOLVE; olive::effects.append(em); em.subtype = EFFECT_TYPE_AUDIO; em.name = "Linear Fade"; em.internal = TRANSITION_INTERNAL_LINEARFADE; olive::effects.append(em); em.name = "Exponential Fade"; em.internal = TRANSITION_INTERNAL_EXPONENTIALFADE; olive::effects.append(em); em.name = "Logarithmic Fade"; em.internal = TRANSITION_INTERNAL_LOGARITHMICFADE; olive::effects.append(em); } void load_shader_effects_worker(const QString& effects_path) { QDir effects_dir(effects_path); if (effects_dir.exists()) { QList entries = effects_dir.entryList({"*.xml", "*.blend"}, QDir::AllDirs | QDir::Files | QDir::NoDotAndDotDot); for (int i=0;i blend_mode_entries = effects_dir.entryList(QStringList("*.blend"), QDir::Files); for (int i=0;i effects_paths = get_effects_paths(); for (int h=0;hstart(); } EffectInit::EffectInit() { olive::effects_loaded.lock(); } void EffectInit::run() { qInfo() << "Initializing effects..."; load_internal_effects(); load_shader_effects(); olive::effects_loaded.unlock(); qInfo() << "Finished initializing effects"; }