create custom effects
are there some kind of register class to register custom effects? The class EffectInfo would need to implement a call to a class like this: #include "EffectRegistry.h"
#include
namespace openshot {
EffectRegistry& EffectRegistry::GetInstance() { static EffectRegistry instance; return instance; }
void EffectRegistry::RegisterEffect(const std::string& name, EffectCreator creator) { creators[name] = creator; std::cout << "Efeito '" << name << "' registrado com sucesso!" << std::endl; }
EffectBase* EffectRegistry::CreateEffect(const std::string& name) { if (creators.count(name)) { return creators.at(name)(); } return nullptr; // Retorna nulo se o efeito não for encontrado } so EffectInfo work in this way: #include "EffectInfo.h" #include "EffectRegistry.h" // Inclua o novo arquivo
// Remova toda a lista de if/else if // Substitua o método CreateEffect pelo seguinte: EffectBase* EffectInfo::CreateEffect(const std::string& effect_type) const { // Crie o efeito usando o EffectRegistry return EffectRegistry::GetInstance().CreateEffect(effect_type); }
// Para o método GetEffects(), você precisará adaptar para o novo sistema. // Uma maneira é ter uma função estática que retorna a lista de nomes.
@jonoomph This needs your attention
Why did you lose focus? You have the only promising C++ initiative for consistently manipulating audio and video. Do you have other developers working with you? If not, you need to start with a team so it doesn't become overwhelming. You can make money with libOpenShot; you've done a good job. And now, with the help of AI, the work can progress much faster and gain more levels of skill and complexity. Thanks for your work.
Currently effects could easily be added by extending the EffectBase class. Currently our desire is creating a CustomEffect and CustomEffectRegistry, allow users to create their own effect by using a scripting language like Python or Lua instead of digging into C++ and rebuilding the whole library. I think there are a few people who tried to create something like that, but it's not quite finished and @jonoomph does not have time to create his own implementation, because it would requires a lot of testing and reorganizing the code base. I myself also tried to integrate PythonFX into libopenshot, but for some reason it conflicts badly with Qt - the soul of this project - and I don't have enough skill to fix this.