add help dialogue

add guard for toggleCmd to prevent unsafe gain changes.

use logrus for control of log levels.

add an input prompt for interactive mode
This commit is contained in:
2024-07-02 06:50:28 +01:00
parent 359c2d61b5
commit 1b9d633217
2 changed files with 121 additions and 83 deletions

View File

@@ -1,6 +1,6 @@
## About
A simple voicemeeter-cli program. Offers ability to toggle, get and set parameters.
A Voicemeeter CLI, offers ability to toggle, get and set parameters.
## Install
@@ -8,28 +8,31 @@ First build and install it with `go install` (skip this step if using binary fro
## Use
Toggle with `!` prefix, get by excluding `=` and set by including `=`. Mix and match arguments.
Commands that begin with `!` will toggle a parameter, commands that contain `=` will set a parameter, all other commands will get a value.
You may pass the following optional flags:
- -v: (-verbose) to toggle console output.
- -i: (-interactive) to toggle interactive mode.
- -k: (-kind) to set the kind of Voicemeeter. Defaults to banana.
- -d: (-delay) to set a delay on the getters. Defaults to 20ms.
- -h: Print the help dialogue
- -i: Enable interactive mode
- -k: The kind of Voicemeeter GUI to launch, defaults to Banana
- -l: Log level (0 up to 6), defaults to 3, Warn Level
- -d: Set the delay between commands, defaults to 20ms
- -v: Enable extra console output (toggle and set messages).
for example:
`vm-cli.exe -v -k=potato -d=25 strip[0].mute=0 strip[0].mute !strip[0].mute strip[0].mute bus[0].gain=-8.8 command.lock=1`
`vm-cli.exe -v -l=4 -k=potato strip[0].mute=0 strip[0].mute !strip[0].mute strip[0].mute bus[0].gain=-8.8 command.lock=1`
Expected output:
```
Running command strip[0].mute=0
Value of strip[0].mute is: 0
time="<timestamp>" level=info msg="Logged into Voicemeeter Banana v2.1.1.1"
strip[0].mute: 1.00
Toggling strip[0].mute
Value of strip[0].mute is: 1
Running command bus[0].gain=-8.8
Running command command.lock=1
strip[0].mute: 0.00
Setting strip[0].label=podmic
strip[0].label: podmic
time="<timestamp>" level=info msg="Logged out of Voicemeeter Banana"
```
If running in interactive mode enter `q`, `quit` or `<Enter>` to exit.
If running in interactive mode enter `Q`, to exit.