From 6cd92a2975ef9ab51fe909d7b1896ba37e94efa8 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Thu, 5 Mar 2026 20:05:00 +0000 Subject: [PATCH] add bus label/gain commands patch bump --- pyproject.toml | 2 +- src/vban_cli/bus.py | 40 ++++++++++++++++++++++++++++++++++++++++ uv.lock | 2 +- 3 files changed, 42 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e5ba115..b05a4b9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "vban-cli" -version = "0.12.3" +version = "0.12.4" description = "A command-line interface for Voicemeeter leveraging VBAN." readme = "README.md" license = { text = "LICENSE" } diff --git a/src/vban_cli/bus.py b/src/vban_cli/bus.py index 09a24ee..5e3914f 100644 --- a/src/vban_cli/bus.py +++ b/src/vban_cli/bus.py @@ -106,3 +106,43 @@ def mode( app.console.print(ctx.client.bus[index].mode.get()) return setattr(ctx.client.bus[index].mode, type_, True) + + +@app.command(name='gain') +def gain( + new_value: Annotated[Optional[float], Argument()] = None, + *, + index: Annotated[int, Parameter(parse=False)], + ctx: Annotated[Context, Parameter(parse=False)], +): + """Get or set the gain of the specified bus. + + Parameters + ---------- + new_value : float, optional + If provided, sets the gain to this value. If not provided, the current gain is printed. + """ + if new_value is None: + app.console.print(ctx.client.bus[index].gain) + return + ctx.client.bus[index].gain = new_value + + +@app.command(name='label') +def label( + new_value: Annotated[Optional[str], Argument()] = None, + *, + index: Annotated[int, Parameter(parse=False)], + ctx: Annotated[Context, Parameter(parse=False)], +): + """Get or set the label of the specified bus. + + Parameters + ---------- + new_value : str, optional + If provided, sets the label to this value. If not provided, the current label is printed. + """ + if new_value is None: + app.console.print(ctx.client.bus[index].label) + return + ctx.client.bus[index].label = new_value diff --git a/uv.lock b/uv.lock index 9077b5e..d897f07 100644 --- a/uv.lock +++ b/uv.lock @@ -124,7 +124,7 @@ wheels = [ [[package]] name = "vban-cli" -version = "0.12.3" +version = "0.12.4" source = { editable = "." } dependencies = [ { name = "cyclopts" },