mirror of
https://github.com/onyx-and-iris/vmrcli.git
synced 2025-04-20 04:53:48 +01:00
Compare commits
No commits in common. "b95c40265cb4a6ee7a07d60388de5c98d271c5c7" and "faad5bc2c8e7891eff009efeb0f03e917380f62e" have entirely different histories.
b95c40265c
...
faad5bc2c8
10
README.md
10
README.md
@ -13,7 +13,7 @@
|
||||
## `Use`
|
||||
|
||||
```powershell
|
||||
./vmrcli.exe [-h] [-i] [-k] [-D] [-v] [-m] [-s] <api commands>
|
||||
./vmrcli.exe [-h] [-i] [-k] [-D] [-v] <api commands>
|
||||
```
|
||||
|
||||
Where:
|
||||
@ -23,21 +23,19 @@ Where:
|
||||
- `k`: The kind of Voicemeeter (basic, banana or potato). Use this to launch the GUI.
|
||||
- `D`: Set log level 0=TRACE, 1=DEBUG, 2=INFO, 3=WARN, 4=ERROR, 5=FATAL
|
||||
- `v`: Enable extra console output (toggle, set messages)
|
||||
- `m`: Launch the MacroButtons application
|
||||
- `s`: Launch the StreamerView application
|
||||
|
||||
## `API Commands`
|
||||
|
||||
- Commands starting with `!` will be toggled, use it with boolean parameters.
|
||||
- Commands containing `=` will set a value. (use `+=` and `-=` to increment/decrement)
|
||||
- Commands containing `=` will set a value.
|
||||
- All other commands with get a value.
|
||||
|
||||
Examples:
|
||||
|
||||
Launch basic GUI, set log level to INFO, Toggle Strip 0 Mute, print its new value, then decrease Bus 0 Gain by 3.8
|
||||
Launch basic GUI, set log level to INFO, Toggle Strip 0 Mute, then print its new value
|
||||
|
||||
```powershell
|
||||
./vmrcli.exe -kbasic -D2 !strip[0].mute strip[0].mute bus[0].gain-=3.8
|
||||
./vmrcli.exe -kbasic -D2 !strip[0].mute strip[0].mute
|
||||
```
|
||||
|
||||
Launch banana GUI, set log level to DEBUG, set Strip 0 label to podmic then print Strip 2 label
|
||||
|
@ -1,5 +1,3 @@
|
||||
strip[0].mute !strip[0].mute strip[0].mute strip[0].gain strip[0].label=podmic strip[0].label
|
||||
strip[1].mute=1 strip[1].mute strip[1].limit-=8
|
||||
strip[2].gain-=5 strip[2].comp+=4.8
|
||||
bus[0].label
|
||||
bus[1].gain-=5.8
|
||||
strip[1].mute=1 strip[1].mute
|
||||
bus[0].label bus[0].gain=-8.3
|
@ -12,8 +12,6 @@ enum kind
|
||||
BASICX64,
|
||||
BANANAX64,
|
||||
POTATOX64,
|
||||
MACROBUTTONS = 11,
|
||||
STREAMERVIEW
|
||||
};
|
||||
|
||||
long login(T_VBVMR_INTERFACE *vmr, int kind);
|
||||
|
18
src/vmr.c
18
src/vmr.c
@ -30,25 +30,25 @@ long login(T_VBVMR_INTERFACE *vmr, int kind)
|
||||
log_info(
|
||||
"Launching Voicemeeter %s GUI",
|
||||
kind_as_string(kind_s, kind, KIND_STR_LEN));
|
||||
}
|
||||
|
||||
time_t endwait;
|
||||
int timeout = 2;
|
||||
time_t start = time(NULL);
|
||||
|
||||
endwait = time(NULL) + timeout;
|
||||
do
|
||||
{
|
||||
if ((rep = version(vmr, &v)) == 0)
|
||||
break;
|
||||
Sleep(50);
|
||||
} while (time(NULL) < endwait);
|
||||
}
|
||||
if (rep == 0)
|
||||
{
|
||||
version(vmr, &v);
|
||||
char version_s[VERSION_STR_LEN];
|
||||
log_info(
|
||||
"Successfully logged into the Voicemeeter API v%s",
|
||||
version_as_string(version_s, v, VERSION_STR_LEN));
|
||||
break;
|
||||
}
|
||||
Sleep(50);
|
||||
} while (time(NULL) < start + timeout);
|
||||
|
||||
if (rep == 0)
|
||||
{
|
||||
clear_dirty(vmr);
|
||||
}
|
||||
return rep;
|
||||
|
40
src/vmrcli.c
40
src/vmrcli.c
@ -47,8 +47,6 @@ bool vflag = false;
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
bool iflag = false;
|
||||
bool mflag = false;
|
||||
bool sflag = false;
|
||||
int opt;
|
||||
char *kvalue = "";
|
||||
int dvalue;
|
||||
@ -62,26 +60,20 @@ int main(int argc, char *argv[])
|
||||
|
||||
log_set_level(LOG_WARN);
|
||||
|
||||
while ((opt = getopt(argc, argv, "hk:msiD:v")) != -1)
|
||||
while ((opt = getopt(argc, argv, "k:ihD:v")) != -1)
|
||||
{
|
||||
switch (opt)
|
||||
{
|
||||
case 'h':
|
||||
help();
|
||||
exit(EXIT_SUCCESS);
|
||||
case 'i':
|
||||
iflag = true;
|
||||
break;
|
||||
case 'k':
|
||||
kvalue = optarg;
|
||||
kind = set_kind(kvalue);
|
||||
break;
|
||||
case 'm':
|
||||
mflag = true;
|
||||
break;
|
||||
case 's':
|
||||
sflag = true;
|
||||
break;
|
||||
case 'i':
|
||||
iflag = true;
|
||||
break;
|
||||
case 'h':
|
||||
help();
|
||||
exit(EXIT_SUCCESS);
|
||||
case 'D':
|
||||
dvalue = atoi(optarg);
|
||||
if (dvalue >= LOG_TRACE && dvalue <= LOG_FATAL)
|
||||
@ -112,18 +104,6 @@ int main(int argc, char *argv[])
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (mflag)
|
||||
{
|
||||
log_info("MacroButtons app launched");
|
||||
run_voicemeeter(vmr, MACROBUTTONS);
|
||||
}
|
||||
|
||||
if (sflag)
|
||||
{
|
||||
log_info("StreamerView app launched");
|
||||
run_voicemeeter(vmr, STREAMERVIEW);
|
||||
}
|
||||
|
||||
if (iflag)
|
||||
{
|
||||
puts("Interactive mode enabled. Enter 'Q' to exit.");
|
||||
@ -151,15 +131,13 @@ int main(int argc, char *argv[])
|
||||
void help()
|
||||
{
|
||||
puts(
|
||||
"Usage: ./vmrcli.exe [-h] [-i] [-k] [-D] [-v] [-m] [-s] <api commands>\n"
|
||||
"Usage: ./vmrcli.exe [-h] [-i] [-k] [-D] [-v] <api commands>\n"
|
||||
"Where: \n"
|
||||
"\th: Prints the help message\n"
|
||||
"\ti: Enable interactive mode\n"
|
||||
"\tk: The kind of Voicemeeter (basic, banana, potato)\n"
|
||||
"\tD: Set log level 0=TRACE, 1=DEBUG, 2=INFO, 3=WARN, 4=ERROR, 5=FATAL\n"
|
||||
"\tv: Enable extra console output (toggle, set messages)\n"
|
||||
"\tm: Launch the MacroButtons application\n"
|
||||
"\ts: Launch the StreamerView application");
|
||||
"\tv: Enable extra console output (toggle, set messages)");
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user