Skip to content

Commit

Permalink
add -m flag for launching macrobuttons app.
Browse files Browse the repository at this point in the history
add -s flag for launching streamerview app

add -m, -s flags to Use section in README.
  • Loading branch information
onyx-and-iris committed Jul 2, 2024
1 parent f8d2f80 commit 4b64ae9
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 10 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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`

Expand Down
2 changes: 2 additions & 0 deletions include/vmr.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ enum kind
BASICX64,
BANANAX64,
POTATOX64,
MACROBUTTONS = 11,
STREAMERVIEW
};

long login(T_VBVMR_INTERFACE *vmr, int kind);
Expand Down
40 changes: 31 additions & 9 deletions src/vmrcli.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
Expand Down Expand Up @@ -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.");
Expand Down Expand Up @@ -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");
}

/**
Expand Down

0 comments on commit 4b64ae9

Please sign in to comment.