Skip to content

Commit

Permalink
Remove --add option
Browse files Browse the repository at this point in the history
  • Loading branch information
WyattBlue committed Dec 11, 2023
1 parent cb42932 commit c7e5a19
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 102 deletions.
48 changes: 2 additions & 46 deletions auto_editor/make_layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,8 @@
from auto_editor.lang.palet import Lexer, Parser, env, interpret, is_boolarr
from auto_editor.lib.data_structs import print_str
from auto_editor.lib.err import MyError
from auto_editor.timeline import (
ALayer,
ASpace,
TlAudio,
TlVideo,
VLayer,
VSpace,
audio_objects,
v1,
v3,
visual_objects,
)
from auto_editor.timeline import ASpace, TlAudio, TlVideo, VSpace, v1, v3
from auto_editor.utils.chunks import Chunks, chunkify, chunks_len, merge_chunks
from auto_editor.utils.cmdkw import ParserError, parse_with_palet
from auto_editor.utils.func import mut_margin
from auto_editor.utils.types import Args, CoerceError, time

Expand Down Expand Up @@ -159,39 +147,7 @@ def make_timeline(
)

v1_compatiable = None if inp is None else v1(inp, chunks)
tl = v3(inp, tb, sr, res, args.background, vclips, aclips, v1_compatiable)

w, h = res
pool: VLayer = []
apool: ALayer = []

env["start"] = 0
env["end"] = tl.end

for obj_attrs_str in args.add:
exploded = obj_attrs_str.split(":", 1)
obj_s = exploded[0]
attrs = "" if len(exploded) == 1 else exploded[1]

try:
if obj_s in visual_objects:
dic_obj = parse_with_palet(attrs, visual_objects[obj_s][1], env)
pool.append(visual_objects[obj_s][0](**dic_obj))
elif obj_s in audio_objects:
dic_obj = parse_with_palet(attrs, audio_objects[obj_s][1], env)
apool.append(audio_objects[obj_s][0](**dic_obj))
else:
log.error(f"Unknown timeline object: '{obj_s}'")
except (ParserError, CoerceError) as e:
log.error(e)

for vobj in pool:
tl.v.append([vobj])

for aobj in apool:
tl.a.append([aobj])

return tl
return v3(inp, tb, sr, res, args.background, vclips, aclips, v1_compatiable)


def make_layers(
Expand Down
55 changes: 0 additions & 55 deletions auto_editor/subcommands/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,27 +242,6 @@ def example():

return out

def add_audio():
pass
# run.main(
# ["example.mp4"],
# [
# "--source",
# "snd:resources/wav/pcm-f32le.wav",
# "--add",
# 'audio:0.3sec,end,"snd",volume=0.3',
# ],
# )
# return run.main(
# ["example.mp4"],
# [
# "--source",
# "snd:resources/wav/pcm-f32le.wav",
# "--add",
# 'audio:2,40,"snd",3sec',
# ],
# )

# PR #260
def high_speed_test():
return run.check(["example.mp4", "--video-speed", "99998"], "empty")
Expand Down Expand Up @@ -393,36 +372,6 @@ def resolution_and_scale():

return out

def obj_makes_video():
out = run.main(
["resources/new-commentary.mp3"],
["--add", 'rect:0,30,0,0,300,300,fill="blue"'],
"out.mp4",
)
cn = checker.check(out)
assert len(cn.videos) == 1
assert len(cn.audios) == 1
assert cn.videos[0].width == 1920
assert cn.videos[0].height == 1080
assert cn.videos[0].fps == 30

return out

def various_errors():
run.check(["example.mp4", "--add", "rect:0,60", "--cut-out", "60,end"])

def render_video_objs():
out = run.main(
["resources/testsrc.mp4"],
[
"--mark_as_loud",
"start,end",
"--add",
'rect:0,30,0,200,100,300,fill="#43FA56"',
],
)
return out

def premiere():
results = set()
for test_name in all_files:
Expand Down Expand Up @@ -767,13 +716,9 @@ def palet_scripts():
json_tests,
high_speed_test,
video_speed,
obj_makes_video,
multi_track_edit,
concat_mux_tracks,
concat_multiple_tracks,
render_video_objs,
various_errors,
add_audio,
frame_rate,
help_tests,
version_test,
Expand Down
1 change: 0 additions & 1 deletion auto_editor/utils/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ def resolution(val: str | None) -> tuple[int, int] | None:

@dataclass
class Args:
add: list[str] = field(default_factory=list)
yt_dlp_location: str = "yt-dlp"
download_format: str | None = None
output_format: str | None = None
Expand Down

0 comments on commit c7e5a19

Please sign in to comment.