mirror of
https://github.com/onyx-and-iris/vmrcli.git
synced 2026-04-19 17:53:30 +00:00
Compare commits
10 Commits
0.1.0
...
760924def8
| Author | SHA1 | Date | |
|---|---|---|---|
| 760924def8 | |||
| 7b7d4fc2c7 | |||
| 0b6e0800ce | |||
| 4488a386b8 | |||
| 9863ca6dca | |||
| cd11b26ad8 | |||
| 71e06ac646 | |||
| 050a4d9e60 | |||
| 694a4dbc65 | |||
| 3f8ed17176 |
14
README.md
14
README.md
@@ -28,22 +28,26 @@ Where:
|
||||
|
||||
Examples:
|
||||
|
||||
Launch basic GUI, set debug level to INFO, Toggle Strip 0 Mute, then print its new value
|
||||
Launch basic GUI, set log level to INFO, Toggle Strip 0 Mute, then print its new value
|
||||
|
||||
`./vmrcli.exe -kbasic -D2 !strip[0].mute strip[0].mute`
|
||||
|
||||
Launch banana GUI, set debug level to DEBUG, set Strip 0 label to podmic then print Strip 2 label
|
||||
Launch banana GUI, set log level to DEBUG, set Strip 0 label to podmic then print Strip 2 label
|
||||
|
||||
`vmrcli.exe -kbanana -D1 strip[0].label=podmic strip[2].label`
|
||||
`./vmrcli.exe -kbanana -D1 strip[0].label=podmic strip[2].label`
|
||||
|
||||
## `Script files`
|
||||
|
||||
Scripts can be loaded from text files, for example:
|
||||
Scripts can be loaded from text files, for example in Powershell:
|
||||
|
||||
```powershell
|
||||
./vbantxt-cli -D1 $(Get-Content .\example_commands.txt)
|
||||
./vmrcli.exe -D1 $(Get-Content .\example_commands.txt)
|
||||
```
|
||||
|
||||
## `Official Documentation`
|
||||
|
||||
- [Voicemeeter Remote C API](https://github.com/onyx-and-iris/Voicemeeter-SDK/blob/main/VoicemeeterRemoteAPI.pdf)
|
||||
|
||||
## `Special Thanks`
|
||||
|
||||
- [rxi](https://github.com/rxi) for writing the [log.c](https://github.com/rxi/log.c) package
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#include <windows.h>
|
||||
#include "VoicemeeterRemote.h"
|
||||
|
||||
#ifndef __CDLL_H__
|
||||
#define __CDLL_H__
|
||||
|
||||
#include <windows.h>
|
||||
#include "VoicemeeterRemote.h"
|
||||
|
||||
long initialize_dll_interfaces(T_VBVMR_INTERFACE *iVMR);
|
||||
|
||||
#endif /*__CDLL_H__*/
|
||||
@@ -1,9 +1,9 @@
|
||||
#include <stdbool.h>
|
||||
#include "voicemeeterRemote.h"
|
||||
|
||||
#ifndef __VMR_H__
|
||||
#define __VMR_H__
|
||||
|
||||
#include <stdbool.h>
|
||||
#include "voicemeeterRemote.h"
|
||||
|
||||
enum kind
|
||||
{
|
||||
BASIC = 1,
|
||||
|
||||
@@ -51,6 +51,7 @@ long logout(T_VBVMR_INTERFACE *iVMR)
|
||||
|
||||
long run_voicemeeter(T_VBVMR_INTERFACE *iVMR, int kind)
|
||||
{
|
||||
log_trace("VBVMR_RunVoicemeeter(%d)", kind);
|
||||
return iVMR->VBVMR_RunVoicemeeter((long)kind);
|
||||
}
|
||||
|
||||
@@ -71,26 +72,31 @@ bool is_pdirty(T_VBVMR_INTERFACE *iVMR)
|
||||
|
||||
long get_parameter_float(T_VBVMR_INTERFACE *iVMR, char *param, float *f)
|
||||
{
|
||||
log_trace("VBVMR_GetParameterFloat(%s, %f)", param, f);
|
||||
return iVMR->VBVMR_GetParameterFloat(param, f);
|
||||
}
|
||||
|
||||
long get_parameter_string(T_VBVMR_INTERFACE *iVMR, char *param, char *s)
|
||||
{
|
||||
log_trace("VBVMR_GetParameterStringA(%s, %s)", param, s);
|
||||
return iVMR->VBVMR_GetParameterStringA(param, s);
|
||||
}
|
||||
|
||||
long set_parameter_float(T_VBVMR_INTERFACE *iVMR, char *param, float val)
|
||||
{
|
||||
log_trace("VBVMR_SetParameterFloat(%s, %f)", param, val);
|
||||
return iVMR->VBVMR_SetParameterFloat(param, val);
|
||||
}
|
||||
|
||||
long set_parameter_string(T_VBVMR_INTERFACE *iVMR, char *param, char *s)
|
||||
{
|
||||
log_trace("VBVMR_SetParameterStringA(%s, %s)", param, s);
|
||||
return iVMR->VBVMR_SetParameterStringA(param, s);
|
||||
}
|
||||
|
||||
long set_parameters(T_VBVMR_INTERFACE *iVMR, char *command)
|
||||
{
|
||||
log_trace("VBVMR_SetParameters(%s)", command);
|
||||
return iVMR->VBVMR_SetParameters(command);
|
||||
}
|
||||
|
||||
|
||||
20
src/vmrcli.c
20
src/vmrcli.c
@@ -42,10 +42,10 @@ int main(int argc, char *argv[])
|
||||
if (argc == 1)
|
||||
{
|
||||
help();
|
||||
return EXIT_SUCCESS;
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
log_set_level(LOG_INFO);
|
||||
log_set_level(LOG_WARN);
|
||||
|
||||
while ((opt = getopt(argc, argv, "k:ihD:")) != -1)
|
||||
{
|
||||
@@ -62,10 +62,18 @@ int main(int argc, char *argv[])
|
||||
help();
|
||||
exit(EXIT_SUCCESS);
|
||||
case 'D':
|
||||
if ((dvalue = atoi(optarg)) && dvalue >= LOG_TRACE && dvalue <= LOG_FATAL)
|
||||
dvalue = atoi(optarg);
|
||||
if (dvalue >= LOG_TRACE && dvalue <= LOG_FATAL)
|
||||
{
|
||||
log_set_level(dvalue);
|
||||
}
|
||||
else
|
||||
{
|
||||
fputs(
|
||||
"-D arg out of range, expected value from 0 up to 5\n"
|
||||
"Log level will default to LOG_WARN (3).\n",
|
||||
stderr);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
abort();
|
||||
@@ -104,7 +112,7 @@ int main(int argc, char *argv[])
|
||||
void help()
|
||||
{
|
||||
puts(
|
||||
"Usage: ./vmrcli.exe [-i] [-k] <api commands>\n"
|
||||
"Usage: ./vmrcli.exe [-i] [-k] [-D] <api commands>\n"
|
||||
"Where: \n"
|
||||
"\ti: Enable interactive mode\n"
|
||||
"\tk: The kind of Voicemeeter (basic, banana, potato)\n"
|
||||
@@ -177,7 +185,7 @@ void interactive(T_VBVMR_INTERFACE *vmr)
|
||||
char command[MAX_LINE];
|
||||
int i = 0;
|
||||
|
||||
while (!isspace(*p) && *p != EOF)
|
||||
while (!isspace(*p))
|
||||
command[i++] = *p++;
|
||||
command[i] = '\0';
|
||||
p++; /* shift to next char */
|
||||
@@ -224,7 +232,7 @@ void parse_command(T_VBVMR_INTERFACE *vmr, char *command)
|
||||
puts(res.val.s);
|
||||
break;
|
||||
default:
|
||||
fputs("Unknown result...", stderr);
|
||||
fputs("Unexpected result type", stderr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user