mirror of
https://github.com/onyx-and-iris/vban-cli.git
synced 2026-04-19 11:53:31 +00:00
Compare commits
7 Commits
v0.8.0
...
a9c3168542
| Author | SHA1 | Date | |
|---|---|---|---|
| a9c3168542 | |||
| fba3eddea8 | |||
| 6c2c924a48 | |||
| 27290e1a0e | |||
| 6188da4f51 | |||
| 230e537414 | |||
| e6ebf86c86 |
7
.pre-commit-config.yaml
Normal file
7
.pre-commit-config.yaml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
repos:
|
||||||
|
- repo: https://github.com/astral-sh/uv-pre-commit
|
||||||
|
# uv version.
|
||||||
|
rev: 0.10.7
|
||||||
|
hooks:
|
||||||
|
# Update the uv lockfile
|
||||||
|
- id: uv-lock
|
||||||
18
README.md
18
README.md
@@ -93,6 +93,20 @@ vban-cli strip 4 eq cell 5 type 5
|
|||||||
|
|
||||||
see `vban-cli strip eq cell --help` for more info.
|
see `vban-cli strip eq cell --help` for more info.
|
||||||
|
|
||||||
|
#### Strip Gainlayer Command
|
||||||
|
|
||||||
|
Usage: vban-cli strip \<index> gainlayer \<gainlayer_index> COMMAND [OPTIONS] [ARGS]
|
||||||
|
|
||||||
|
examples:
|
||||||
|
|
||||||
|
```console
|
||||||
|
vban-cli strip 0 gainlayer 0 level
|
||||||
|
|
||||||
|
vban-cli strip 3 gainlayer 2 level -13.5
|
||||||
|
```
|
||||||
|
|
||||||
|
see `vban-cli strip gainlayer --help` for more info.
|
||||||
|
|
||||||
### Bus Command
|
### Bus Command
|
||||||
|
|
||||||
Usage: vban-cli bus \<index> COMMAND [ARGS]
|
Usage: vban-cli bus \<index> COMMAND [ARGS]
|
||||||
@@ -163,7 +177,7 @@ see `vban-cli sendtext --help` for more info.
|
|||||||
|
|
||||||
## Implementation Notes
|
## Implementation Notes
|
||||||
|
|
||||||
1. The VBAN TEXT subprotocol defines two packet structures [ident:0][ident-0] and [ident:1][ident-1]. Neither of them contain the data for Bus EQ parameters.
|
1. The VBAN RT SERVICE subprotocol defines two packet structures [ident:0][ident-0] and [ident:1][ident-1]. Neither of them contain the data for Bus EQ parameters.
|
||||||
2. Packet structure with [ident:1][ident-1] is emitted by the VBAN server only on pdirty events. This means we do not receive the current state of those parameters on initial subscription. Therefore any commands which are intended to fetch the value of parameters defined in packet [ident:1][ident-1] will not work in this CLI.
|
2. Packet structure with [ident:1][ident-1] is emitted by the VBAN server only on pdirty events. This means we do not receive the current state of those parameters on initial subscription. Therefore any commands which are intended to fetch the value of parameters defined in packet [ident:1][ident-1] will not work in this CLI.
|
||||||
3. Packet structure with [ident:1][ident-1] defines parameteric EQ data only for the [first channel][ident-1-peq].
|
3. Packet structure with [ident:1][ident-1] defines parameteric EQ data only for the [first channel][ident-1-peq].
|
||||||
|
|
||||||
@@ -186,5 +200,5 @@ If there's something missing that you would like to see added the best bet is to
|
|||||||
|
|
||||||
|
|
||||||
[ident-0]: https://github.com/onyx-and-iris/Voicemeeter-SDK/blob/3be2c1c36563afbd6df3da8436406c77d2cc1f10/VoicemeeterRemote.h#L896
|
[ident-0]: https://github.com/onyx-and-iris/Voicemeeter-SDK/blob/3be2c1c36563afbd6df3da8436406c77d2cc1f10/VoicemeeterRemote.h#L896
|
||||||
[ident-1]: https://github.com/onyx-and-iris/Voicemeeter-SDK/blob/3be2c1c36563afbd6df3da8436406c77d2cc1f10/VoicemeeterRemote.h#L982
|
[ident-1]: https://github.com/onyx-and-iris/Voicemeeter-SDK/blob/3be2c1c36563afbd6df3da8436406c77d2cc1f10/VoicemeeterRemote.h#L1053
|
||||||
[ident-1-peq]: https://github.com/onyx-and-iris/Voicemeeter-SDK/blob/3be2c1c36563afbd6df3da8436406c77d2cc1f10/VoicemeeterRemote.h#L995
|
[ident-1-peq]: https://github.com/onyx-and-iris/Voicemeeter-SDK/blob/3be2c1c36563afbd6df3da8436406c77d2cc1f10/VoicemeeterRemote.h#L995
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "vban-cli"
|
name = "vban-cli"
|
||||||
version = "0.8.0"
|
version = "0.9.0"
|
||||||
description = "A command-line interface for Voicemeeter leveraging VBAN."
|
description = "A command-line interface for Voicemeeter leveraging VBAN."
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
license = { text = "LICENSE" }
|
license = { text = "LICENSE" }
|
||||||
|
|||||||
51
src/vban_cli/gainlayer.py
Normal file
51
src/vban_cli/gainlayer.py
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
from typing import Annotated
|
||||||
|
|
||||||
|
from cyclopts import App, Argument, Parameter
|
||||||
|
|
||||||
|
from . import console
|
||||||
|
from .context import Context
|
||||||
|
from .help import GainlayerHelpFormatter
|
||||||
|
|
||||||
|
app = App(name='gainlayer', help_formatter=GainlayerHelpFormatter())
|
||||||
|
|
||||||
|
|
||||||
|
@app.meta.default
|
||||||
|
def launcher(
|
||||||
|
gainlayer_index: Annotated[int, Argument()] = None,
|
||||||
|
*tokens: Annotated[str, Parameter(show=False, allow_leading_hyphen=True)],
|
||||||
|
index: Annotated[int, Argument()] = None,
|
||||||
|
ctx: Annotated[Context, Parameter(show=False)] = None,
|
||||||
|
):
|
||||||
|
"""Control the gainlayers."""
|
||||||
|
additional_kwargs = {}
|
||||||
|
command, bound, _ = app.parse_args(tokens)
|
||||||
|
if index is not None and gainlayer_index is not None:
|
||||||
|
additional_kwargs['strip_index'] = index
|
||||||
|
additional_kwargs['gainlayer_index'] = gainlayer_index
|
||||||
|
else:
|
||||||
|
raise ValueError('Both gainlayer_index and index must be provided.')
|
||||||
|
if ctx is not None:
|
||||||
|
additional_kwargs['ctx'] = ctx
|
||||||
|
|
||||||
|
return command(*bound.args, **bound.kwargs, **additional_kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
@app.command(name='level')
|
||||||
|
def level(
|
||||||
|
new_level: Annotated[float, Argument()] = None,
|
||||||
|
*,
|
||||||
|
strip_index: Annotated[int, Parameter(show=False)] = None,
|
||||||
|
gainlayer_index: Annotated[int, Parameter(show=False)] = None,
|
||||||
|
ctx: Annotated[Context, Parameter(show=False)] = None,
|
||||||
|
):
|
||||||
|
"""Get or set the level of the specified gainlayer.
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
new_level : float
|
||||||
|
If provided, sets the level to this value. If not provided, the current level is printed.
|
||||||
|
"""
|
||||||
|
if new_level is None:
|
||||||
|
console.out.print(ctx.client.strip[strip_index].gainlayer[gainlayer_index].gain)
|
||||||
|
return
|
||||||
|
ctx.client.strip[strip_index].gainlayer[gainlayer_index].gain = new_level
|
||||||
@@ -95,6 +95,22 @@ class EqHelpFormatter(BaseHelpFormatter):
|
|||||||
console.print(f'[bold]Usage:[/bold] {modified_usage}')
|
console.print(f'[bold]Usage:[/bold] {modified_usage}')
|
||||||
|
|
||||||
|
|
||||||
|
class GainlayerHelpFormatter(BaseHelpFormatter):
|
||||||
|
"""Help formatter for gainlayer commands that works with strip commands.
|
||||||
|
|
||||||
|
Injects <index> after 'strip' and <gainlayer_index> after 'gainlayer'."""
|
||||||
|
|
||||||
|
def render_usage(self, console: Console, options: ConsoleOptions, usage) -> None:
|
||||||
|
"""Render the usage line with proper <index> placement for strip commands."""
|
||||||
|
if usage:
|
||||||
|
modified_usage = re.sub(
|
||||||
|
r'(\S+\s+strip)(\s+gainlayer\s+)(COMMAND)',
|
||||||
|
r'\1 <index>\2<[cyan]gainlayer_index[/cyan]> \3',
|
||||||
|
str(usage),
|
||||||
|
)
|
||||||
|
console.print(f'[bold]Usage:[/bold] {modified_usage}')
|
||||||
|
|
||||||
|
|
||||||
class CellHelpFormatter(BaseHelpFormatter):
|
class CellHelpFormatter(BaseHelpFormatter):
|
||||||
"""Help formatter for cell commands that works with both strip and bus commands.
|
"""Help formatter for cell commands that works with both strip and bus commands.
|
||||||
|
|
||||||
@@ -105,7 +121,7 @@ class CellHelpFormatter(BaseHelpFormatter):
|
|||||||
if usage:
|
if usage:
|
||||||
modified_usage = re.sub(
|
modified_usage = re.sub(
|
||||||
r'(\S+\s+)(\w+)(\s+eq\s+cell\s+)(COMMAND)',
|
r'(\S+\s+)(\w+)(\s+eq\s+cell\s+)(COMMAND)',
|
||||||
r'\1\2 <index>\3<band> \4',
|
r'\1\2 <index>\3<[cyan]band[/cyan]> \4',
|
||||||
str(usage),
|
str(usage),
|
||||||
)
|
)
|
||||||
console.print(f'[bold]Usage:[/bold] {modified_usage}')
|
console.print(f'[bold]Usage:[/bold] {modified_usage}')
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ from typing import Annotated, Optional
|
|||||||
|
|
||||||
from cyclopts import App, Argument, Parameter
|
from cyclopts import App, Argument, Parameter
|
||||||
|
|
||||||
from . import comp, console, denoiser, eq, gate
|
from . import comp, console, denoiser, eq, gainlayer, gate
|
||||||
from .context import Context
|
from .context import Context
|
||||||
from .help import StripHelpFormatter
|
from .help import StripHelpFormatter
|
||||||
|
|
||||||
@@ -11,6 +11,7 @@ app.command(eq.app.meta, name='eq')
|
|||||||
app.command(comp.app.meta, name='comp')
|
app.command(comp.app.meta, name='comp')
|
||||||
app.command(gate.app.meta, name='gate')
|
app.command(gate.app.meta, name='gate')
|
||||||
app.command(denoiser.app.meta, name='denoiser')
|
app.command(denoiser.app.meta, name='denoiser')
|
||||||
|
app.command(gainlayer.app.meta, name='gainlayer')
|
||||||
|
|
||||||
|
|
||||||
@app.meta.default
|
@app.meta.default
|
||||||
|
|||||||
4
uv.lock
generated
4
uv.lock
generated
@@ -124,7 +124,7 @@ wheels = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "vban-cli"
|
name = "vban-cli"
|
||||||
version = "0.8.0"
|
version = "0.9.0"
|
||||||
source = { editable = "." }
|
source = { editable = "." }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ name = "cyclopts" },
|
{ name = "cyclopts" },
|
||||||
@@ -141,7 +141,7 @@ requires-dist = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "vban-cmd"
|
name = "vban-cmd"
|
||||||
version = "2.8.0"
|
version = "2.8.1"
|
||||||
source = { editable = "../vban-cmd-python" }
|
source = { editable = "../vban-cmd-python" }
|
||||||
|
|
||||||
[package.metadata]
|
[package.metadata]
|
||||||
|
|||||||
Reference in New Issue
Block a user