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` ## `Use`
```powershell ```powershell
./vmrcli.exe [-h] [-i] [-k] [-D] [-v] <api commands> ./vmrcli.exe [-h] [-i] [-k] [-D] [-v] [-m] [-s] <api commands>
``` ```
Where: Where:
@ -23,6 +23,8 @@ Where:
- `k`: The kind of Voicemeeter (basic, banana or potato). Use this to launch the GUI. - `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 - `D`: Set log level 0=TRACE, 1=DEBUG, 2=INFO, 3=WARN, 4=ERROR, 5=FATAL
- `v`: Enable extra console output (toggle, set messages) - `v`: Enable extra console output (toggle, set messages)
- `m`: Launch the MacroButtons application
- `s`: Launch the StreamerView application
## `API Commands` ## `API Commands`

View File

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

View File

@ -47,6 +47,8 @@ bool vflag = false;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
bool iflag = false; bool iflag = false;
bool mflag = false;
bool sflag = false;
int opt; int opt;
char *kvalue = ""; char *kvalue = "";
int dvalue; int dvalue;
@ -60,20 +62,26 @@ int main(int argc, char *argv[])
log_set_level(LOG_WARN); 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) switch (opt)
{ {
case 'i': case 'h':
iflag = true; help();
break; exit(EXIT_SUCCESS);
case 'k': case 'k':
kvalue = optarg; kvalue = optarg;
kind = set_kind(kvalue); kind = set_kind(kvalue);
break; break;
case 'h': case 'm':
help(); mflag = true;
exit(EXIT_SUCCESS); break;
case 's':
sflag = true;
break;
case 'i':
iflag = true;
break;
case 'D': case 'D':
dvalue = atoi(optarg); dvalue = atoi(optarg);
if (dvalue >= LOG_TRACE && dvalue <= LOG_FATAL) if (dvalue >= LOG_TRACE && dvalue <= LOG_FATAL)
@ -104,6 +112,18 @@ int main(int argc, char *argv[])
exit(EXIT_FAILURE); 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) if (iflag)
{ {
puts("Interactive mode enabled. Enter 'Q' to exit."); puts("Interactive mode enabled. Enter 'Q' to exit.");
@ -131,13 +151,15 @@ int main(int argc, char *argv[])
void help() void help()
{ {
puts( 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" "Where: \n"
"\th: Prints the help message\n" "\th: Prints the help message\n"
"\ti: Enable interactive mode\n" "\ti: Enable interactive mode\n"
"\tk: The kind of Voicemeeter (basic, banana, potato)\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" "\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");
} }
/** /**