Currently, effects.py contains all the video effects and a dictionary controlling how each effect should be run (batch_apply or multi_input_batch_apply for example). This isn't very good, this way of doing things was okay on a small scale but with an increasing number of effects it is getting annoying to maintain and should be refactored.
We should probably create an Effect abstract base class that implements the batch_apply method (renamed to apply). Each effect would inherit from this new class. The effects needing multi_input_batch_apply can be turned into a different effect class, inheriting from Effect, whose apply method is overriden and contains the functionality in multi_input_batch_apply.
These new effect classes can also have a schema function which defines what options they need so that the options needed for an effect are stored with the effect itself, meaning that the option schemas for each effect in config_schema.py can be replaced with a function that loads each of the schemas in an automatic loop.
Currently,
effects.py
contains all the video effects and a dictionary controlling how each effect should be run (batch_apply
ormulti_input_batch_apply
for example). This isn't very good, this way of doing things was okay on a small scale but with an increasing number of effects it is getting annoying to maintain and should be refactored.We should probably create an
Effect
abstract base class that implements thebatch_apply
method (renamed toapply
). Each effect would inherit from this new class. The effects needingmulti_input_batch_apply
can be turned into a different effect class, inheriting fromEffect
, whoseapply
method is overriden and contains the functionality inmulti_input_batch_apply
.These new effect classes can also have a
schema
function which defines what options they need so that the options needed for an effect are stored with the effect itself, meaning that the option schemas for each effect inconfig_schema.py
can be replaced with a function that loads each of the schemas in an automatic loop.