From 080e26f75f85c3f2f3c4104132767117ed3ebab8 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Mon, 2 Mar 2026 00:28:32 +0000 Subject: [PATCH] add more eq cell commands --- README.md | 4 +++ src/vban_cli/eq.py | 82 +++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 85 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cbb48cd..304ad8e 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,10 @@ examples: ```console vban-cli strip 0 eq cell 0 on false + +vban-cli strip 3 eq cell 2 freq 1500 + +vban-cli strip 4 eq cell 5 type 5 ``` see `vban-cli strip eq cell --help` for more info. diff --git a/src/vban_cli/eq.py b/src/vban_cli/eq.py index c95ecdc..eb99760 100644 --- a/src/vban_cli/eq.py +++ b/src/vban_cli/eq.py @@ -64,7 +64,7 @@ def cell_launcher( Only channel 0 is supported, see https://github.com/onyx-and-iris/vban-cli?tab=readme-ov-file#implementation-notes - 3. """ additional_kwargs = {} - command, bound, _ = app.parse_args(tokens) + command, bound, _ = cell_app.parse_args(tokens) additional_kwargs['target'] = target.channel[0].cell[band] return command(*bound.args, **bound.kwargs, **additional_kwargs) @@ -88,3 +88,83 @@ def cell_on( # console.out.print(target.on) return target.on = new_state + + +@cell_app.command(name='freq') +def cell_freq( + new_freq: Annotated[float, Argument()] = None, + *, + target: Annotated[object, Parameter(show=False)] = None, +): + """Get or set the frequency of the specified EQ cell. + + Parameters + ---------- + new_freq : float + If provided, sets the frequency to this value. If not provided, the current frequency is printed. + """ + if new_freq is None: + # See https://github.com/onyx-and-iris/vban-cli?tab=readme-ov-file#implementation-notes - 2. + # console.out.print(target.f) + return + target.f = new_freq + + +@cell_app.command(name='gain') +def cell_gain( + new_gain: Annotated[float, Argument()] = None, + *, + target: Annotated[object, Parameter(show=False)] = None, +): + """Get or set the gain of the specified EQ cell. + + Parameters + ---------- + new_gain : float + If provided, sets the gain to this value. If not provided, the current gain is printed. + """ + if new_gain is None: + # See https://github.com/onyx-and-iris/vban-cli?tab=readme-ov-file#implementation-notes - 2. + # console.out.print(target.gain) + return + target.gain = new_gain + + +@cell_app.command(name='quality') +def cell_q( + new_q: Annotated[float, Argument()] = None, + *, + target: Annotated[object, Parameter(show=False)] = None, +): + """Get or set the Q of the specified EQ cell. + + Parameters + ---------- + new_q : float + If provided, sets the Q to this value. If not provided, the current Q is printed. + """ + if new_q is None: + # See https://github.com/onyx-and-iris/vban-cli?tab=readme-ov-file#implementation-notes - 2. + # console.out.print(target.q) + return + target.q = new_q + + +@cell_app.command(name='type') +def cell_type( + new_type: Annotated[int, Argument()] = None, + *, + target: Annotated[object, Parameter(show=False)] = None, +): + """Get or set the type of the specified EQ cell. + + Parameters + ---------- + new_type : int + If provided, sets the type to this value. If not provided, the current type is printed. + """ + if new_type is None: + # See https://github.com/onyx-and-iris/vban-cli?tab=readme-ov-file#implementation-notes - 2. + # console.out.print(target.type) + return + target.type = new_type