-
-
Notifications
You must be signed in to change notification settings - Fork 50
Description
Problem
I am trying to make several videos that share some logics.
I realize I have to completely finish 1 video before starting making another one since CURRENT_VIDEO contains only 1 video object.
This makes my code less neat since I want to create several similar objects that belong to different video in a loop.
My solution
If objects can be created by naming the video object where they should be explicitly, it will enable making several videos at the same time. For example:
videos = [Video(500, 500) for i in 1:10]
......
obs = []
for (i, video) in enumerate(videos)
ob = Object(video, frames, create_fun, Point(0,0))
push!(obs, ob)
end
......
for (i, video) in enumerate(videos)
render(video; "output/$i.mp4")
endNew Object api should work with existing api well because of multiple dispatch.
A new method of Object and other related functions like Background can be added.
For example:
function Object(video::Video, frames, func::Function, start_pos::Union{Object,Point}; kwargs...)
# Do not check if CURRENT_VIDEO is empty or not.
......
endConstruction of Video should also be altered to meet the new requirement. I haven't come up with a good idea about how.