mirror of
https://github.com/onyx-and-iris/vban-cli.git
synced 2026-04-18 11:23:31 +00:00
set up the skeletal structure for comp, gate, denoiser
add them as subcommand to the strip command group. for each one implement one or two subcommands.
This commit is contained in:
46
src/vban_cli/denoiser.py
Normal file
46
src/vban_cli/denoiser.py
Normal file
@@ -0,0 +1,46 @@
|
||||
from typing import Annotated
|
||||
|
||||
from cyclopts import App, Argument, Parameter
|
||||
|
||||
from .context import Context
|
||||
from .help import CustomHelpFormatter
|
||||
|
||||
app = App(name='denoiser', help_formatter=CustomHelpFormatter())
|
||||
|
||||
|
||||
@app.meta.default
|
||||
def launcher(
|
||||
*tokens: Annotated[str, Parameter(show=False, allow_leading_hyphen=True)],
|
||||
index: Annotated[int, Argument()] = None,
|
||||
ctx: Annotated[Context, Parameter(show=False)] = None,
|
||||
):
|
||||
"""Control the denoiser parameters."""
|
||||
additional_kwargs = {}
|
||||
command, bound, _ = app.parse_args(tokens)
|
||||
if index is not None:
|
||||
additional_kwargs['index'] = index
|
||||
if ctx is not None:
|
||||
additional_kwargs['ctx'] = ctx
|
||||
|
||||
return command(*bound.args, **bound.kwargs, **additional_kwargs)
|
||||
|
||||
|
||||
@app.command(name='knob')
|
||||
def knob(
|
||||
new_knob: Annotated[float, Argument()] = None,
|
||||
*,
|
||||
index: Annotated[int, Parameter(show=False)] = None,
|
||||
ctx: Annotated[Context, Parameter(show=False)] = None,
|
||||
):
|
||||
"""Get or set the knob of the specified denoiser.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
new_knob : int, 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.
|
||||
# console.out.print(ctx.client.strip[index].denoiser.knob)
|
||||
return
|
||||
ctx.client.strip[index].denoiser.knob = new_knob
|
||||
Reference in New Issue
Block a user