Files
vban-cli/src/vban_cli/denoiser.py
2026-03-05 19:59:32 +00:00

34 lines
965 B
Python

from typing import Annotated, Optional
from cyclopts import App, Argument, Parameter
from .context import Context
from .help import StripHelpFormatter
app = App(
name='denoiser',
help='Control the denoiser settings',
help_formatter=StripHelpFormatter(),
)
@app.command(name='knob')
def knob(
new_knob: Annotated[Optional[float], Argument()] = None,
*,
index: Annotated[int, Parameter(parse=False)],
ctx: Annotated[Context, Parameter(parse=False)],
):
"""Get or set the knob of the specified denoiser.
Parameters
----------
new_knob : float, optional
If provided, sets the knob to this value. If not provided, the current knob is printed.
"""
if new_knob 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].denoiser.knob)
return
ctx.client.strip[index].denoiser.knob = new_knob