add -m flag for launching macrobuttons app.

add -s flag for launching streamerview app

add -m, -s flags to Use section in README.
This commit is contained in:
onyx-and-iris 2024-07-02 17:49:51 +01:00
parent f8d2f80cbf
commit 4b64ae95fd
3 changed files with 36 additions and 10 deletions

View File

@ -13,7 +13,7 @@
## `Use`
```powershell
./vmrcli.exe [-h] [-i] [-k] [-D] [-v] <api commands>
./vmrcli.exe [-h] [-i] [-k] [-D] [-v] [-m] [-s] <api commands>
```
Where:
@ -23,6 +23,8 @@ 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`

View File

@ -12,6 +12,8 @@ enum kind
BASICX64,
BANANAX64,
POTATOX64,
MACROBUTTONS = 11,
STREAMERVIEW
};
long login(T_VBVMR_INTERFACE *vmr, int kind);

View File

@ -47,6 +47,8 @@ bool vflag = false;
int main(int argc, char *argv[])
{
bool iflag = false;
bool mflag = false;
bool sflag = false;
int opt;
char *kvalue = "";
int dvalue;
@ -60,20 +62,26 @@ int main(int argc, char *argv[])
log_set_level(LOG_WARN);
while ((opt = getopt(argc, argv, "k:ihD:v")) != -1)
while ((opt = getopt(argc, argv, "hk:msiD:v")) != -1)
{
switch (opt)
{
case 'i':
iflag = true;
break;
case 'h':
help();
exit(EXIT_SUCCESS);
case 'k':
kvalue = optarg;
kind = set_kind(kvalue);
break;
case 'h':
help();
exit(EXIT_SUCCESS);
case 'm':
mflag = true;
break;
case 's':
sflag = true;
break;
case 'i':
iflag = true;
break;
case 'D':
dvalue = atoi(optarg);
if (dvalue >= LOG_TRACE && dvalue <= LOG_FATAL)
@ -104,6 +112,18 @@ 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.");
@ -131,13 +151,15 @@ int main(int argc, char *argv[])
void help()
{
puts(
"Usage: ./vmrcli.exe [-h] [-i] [-k] [-D] [-v] <api commands>\n"
"Usage: ./vmrcli.exe [-h] [-i] [-k] [-D] [-v] [-m] [-s] <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)");
"\tv: Enable extra console output (toggle, set messages)\n"
"\tm: Launch the MacroButtons application\n"
"\tm: Launch the StreamerView application");
}
/**