From e6a17d5772b6d2bd95ac9a176c8536e52446dcc5 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Mon, 2 Mar 2026 22:02:25 +0000 Subject: [PATCH] add more gate commands --- src/vban_cli/gate.py | 105 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) diff --git a/src/vban_cli/gate.py b/src/vban_cli/gate.py index 8a674e2..399e1de 100644 --- a/src/vban_cli/gate.py +++ b/src/vban_cli/gate.py @@ -63,3 +63,108 @@ def threshold( # app.console.print(ctx.client.strip[index].gate.threshold) return ctx.client.strip[index].gate.threshold = new_threshold + + +@app.command(name='damping-max') +def damping_max( + new_damping_max: Annotated[float, Argument()] = None, + *, + index: Annotated[int, Parameter(parse=False)], + ctx: Annotated[Context, Parameter(parse=False)], +): + """Get or set the damping max of the specified gate. + + Parameters + ---------- + new_damping_max : float, optional + If provided, sets the damping max to this value. If not provided, the current damping max is printed. + """ + if new_damping_max is None: + # See https://github.com/onyx-and-iris/vban-cli?tab=readme-ov-file#implementation-notes - 2. + # app.console.print(ctx.client.strip[index].gate.damping) + return + ctx.client.strip[index].gate.damping = new_damping_max + + +@app.command(name='bp-sidechain') +def bp_sidechain( + new_bp_sidechain: Annotated[bool, Argument()] = None, + *, + index: Annotated[int, Parameter(parse=False)], + ctx: Annotated[Context, Parameter(parse=False)], +): + """Get or set the BP sidechain of the specified gate. + + Parameters + ---------- + new_bp_sidechain : bool, optional + If provided, sets the BP sidechain to this value. If not provided, the current BP sidechain is printed. + """ + if new_bp_sidechain is None: + # See https://github.com/onyx-and-iris/vban-cli?tab=readme-ov-file#implementation-notes - 2. + # app.console.print(ctx.client.strip[index].gate.bpsidechain) + return + ctx.client.strip[index].gate.bpsidechain = new_bp_sidechain + + +@app.command(name='attack') +def attack( + new_attack: Annotated[float, Argument()] = None, + *, + index: Annotated[int, Parameter(parse=False)], + ctx: Annotated[Context, Parameter(parse=False)], +): + """Get or set the attack of the specified gate. + + Parameters + ---------- + new_attack : float, optional + If provided, sets the attack to this value. If not provided, the current attack is printed. + """ + if new_attack is None: + # See https://github.com/onyx-and-iris/vban-cli?tab=readme-ov-file#implementation-notes - 2. + # app.console.print(ctx.client.strip[index].gate.attack) + return + ctx.client.strip[index].gate.attack = new_attack + + +@app.command(name='hold') +def hold( + new_hold: Annotated[float, Argument()] = None, + *, + index: Annotated[int, Parameter(parse=False)], + ctx: Annotated[Context, Parameter(parse=False)], +): + """Get or set the hold of the specified gate. + + Parameters + ---------- + new_hold : float, optional + If provided, sets the hold to this value. If not provided, the current hold is printed. + """ + if new_hold is None: + # See https://github.com/onyx-and-iris/vban-cli?tab=readme-ov-file#implementation-notes - 2. + # app.console.print(ctx.client.strip[index].gate.hold) + return + ctx.client.strip[index].gate.hold = new_hold + + +@app.command(name='release') +def release( + new_release: Annotated[float, Argument()] = None, + *, + index: Annotated[int, Parameter(parse=False)], + ctx: Annotated[Context, Parameter(parse=False)], +): + """Get or set the release of the specified gate. + + Parameters + ---------- + new_release : float, optional + If provided, sets the release to this value. If not provided, the current release is printed. + """ + if new_release is None: + # See https://github.com/onyx-and-iris/vban-cli?tab=readme-ov-file#implementation-notes - 2. + # app.console.print(ctx.client.strip[index].gate.release) + return + ctx.client.strip[index].gate.release = new_release