/*** 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 "nodes/oldeffectnode.h" #include "effects/transition.h" #include "global/path.h" #include "panels/panels.h" #include "panels/effectcontrols.h" #include "global/config.h" #include "effects/internal/transformeffect.h" #include "effects/internal/texteffect.h" #include "effects/internal/timecodeeffect.h" #include "effects/internal/solideffect.h" #include "effects/internal/audionoiseeffect.h" #include "effects/internal/toneeffect.h" #include "effects/internal/volumeeffect.h" #include "effects/internal/paneffect.h" #include "effects/internal/shakeeffect.h" #include "effects/internal/cornerpineffect.h" #include "effects/internal/vsthost.h" #include "effects/internal/fillleftrighteffect.h" #include "effects/internal/richtexteffect.h" #include "effects/internal/crossdissolvetransition.h" #include "effects/internal/linearfadetransition.h" #include "effects/internal/logarithmicfadetransition.h" #include "effects/internal/exponentialfadetransition.h" #include "nodes/nodes/nodemedia.h" #include "nodes/nodes/nodeimageoutput.h" #include "nodes/nodes/nodeshader.h" QMutex olive::effects_loaded; void load_internal_effects() { if (!olive::runtime_config.shaders_are_enabled) { qWarning() << "Shaders are disabled, some effects may be nonfunctional"; } olive::node_library.resize(kInvalidNode); olive::node_library.fill(nullptr); olive::node_library[kTransformEffect] = std::make_shared(nullptr); olive::node_library[kTextInput] = std::make_shared(nullptr); olive::node_library[kSolidInput] = std::make_shared(nullptr); olive::node_library[kNoiseInput] = std::make_shared(nullptr); olive::node_library[kVolumeEffect] = std::make_shared(nullptr); olive::node_library[kPanEffect] = std::make_shared(nullptr); olive::node_library[kToneInput] = std::make_shared(nullptr); olive::node_library[kShakeEffect] = std::make_shared(nullptr); olive::node_library[kTimecodeEffect] = std::make_shared(nullptr); olive::node_library[kFillLeftRightEffect] = std::make_shared(nullptr); olive::node_library[kVstEffect] = std::make_shared(nullptr); olive::node_library[kCornerPinEffect] = std::make_shared(nullptr); olive::node_library[kRichTextInput] = std::make_shared(nullptr); olive::node_library[kMediaInput] = std::make_shared(nullptr); olive::node_library[kImageOutput] = std::make_shared(nullptr); olive::node_library[kCrossDissolveTransition] = std::make_shared(nullptr); olive::node_library[kLinearFadeTransition] = std::make_shared(nullptr); olive::node_library[kExponentialFadeTransition] = std::make_shared(nullptr); olive::node_library[kLogarithmicFadeTransition] = std::make_shared(nullptr); } void load_shader_effects_worker(const QString& effects_path) { QDir effects_dir(effects_path); if (effects_dir.exists()) { QList entries = effects_dir.entryList({"*.xml"}, QDir::AllDirs | QDir::Files | QDir::NoDotAndDotDot); for (int i=0;i(nullptr, effect_name, effect_id, effect_cat, file_url)); } else { qCritical() << "Invalid effect found in" << entries.at(i); } break; } reader.readNext(); } file.close(); } } } } void load_shader_effects() { QList 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"; }