add bus label/gain commands

patch bump
This commit is contained in:
onyx-and-iris 2026-03-05 20:05:00 +00:00
parent 36a8ec124a
commit 6cd92a2975
3 changed files with 42 additions and 2 deletions

View File

@ -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" }

View File

@ -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

2
uv.lock generated
View File

@ -124,7 +124,7 @@ wheels = [
[[package]]
name = "vban-cli"
version = "0.12.3"
version = "0.12.4"
source = { editable = "." }
dependencies = [
{ name = "cyclopts" },