mirror of
https://github.com/onyx-and-iris/vmrcli.git
synced 2025-04-20 13:03:49 +01:00
Compare commits
No commits in common. "2740c6c82dd58cf1725cb0285bf70ad807eb3c52" and "49604b874bc181a6b1ecb6295487343504ff5778" have entirely different histories.
2740c6c82d
...
49604b874b
17
README.md
17
README.md
@ -12,13 +12,10 @@
|
|||||||
|
|
||||||
## `Use`
|
## `Use`
|
||||||
|
|
||||||
```powershell
|
`./vmrcli.exe [-i] [-k] [-D] <api commands>`
|
||||||
./vmrcli.exe [-h] [-i] [-k] [-D] <api commands>
|
|
||||||
```
|
|
||||||
|
|
||||||
Where:
|
Where:
|
||||||
|
|
||||||
- `h`: Prints the help dialogue.
|
|
||||||
- `i`: Enable interactive mode. If set, any api commands passed on the command line will be ignored.
|
- `i`: Enable interactive mode. If set, any api commands passed on the command line will be ignored.
|
||||||
- `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
|
||||||
@ -33,23 +30,17 @@ Examples:
|
|||||||
|
|
||||||
Launch basic GUI, set log 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
|
||||||
|
|
||||||
```powershell
|
`./vmrcli.exe -kbasic -D2 !strip[0].mute strip[0].mute`
|
||||||
./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
|
Launch banana GUI, set log level to DEBUG, set Strip 0 label to podmic then print Strip 2 label
|
||||||
|
|
||||||
```powershell
|
`./vmrcli.exe -kbanana -D1 strip[0].label=podmic strip[2].label`
|
||||||
./vmrcli.exe -kbanana -D1 strip[0].label=podmic strip[2].label
|
|
||||||
```
|
|
||||||
|
|
||||||
## `Interactive Mode`
|
## `Interactive Mode`
|
||||||
|
|
||||||
Running the following command in Powershell:
|
Running the following command in Powershell:
|
||||||
|
|
||||||
```powershell
|
`./vmrcli.exe -i`
|
||||||
./vmrcli.exe -i
|
|
||||||
```
|
|
||||||
|
|
||||||
Will open an interactive prompt:
|
Will open an interactive prompt:
|
||||||
|
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
#ifndef __UTIL_H__
|
#ifndef __UTIL_H__
|
||||||
#define __UTIL_H__
|
#define __UTIL_H__
|
||||||
|
|
||||||
void remove_name_in_path(char *szPath);
|
|
||||||
void replace_multiple_space_with_one(char *s, size_t len);
|
void replace_multiple_space_with_one(char *s, size_t len);
|
||||||
char *version_as_string(char *, long v, int n);
|
|
||||||
|
|
||||||
#endif /* __UTIL_H__ */
|
#endif /* __UTIL_H__ */
|
13
src/cdll.c
13
src/cdll.c
@ -1,7 +1,6 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "cdll.h"
|
#include "cdll.h"
|
||||||
#include "util.h"
|
|
||||||
|
|
||||||
/*******************************************************************************/
|
/*******************************************************************************/
|
||||||
/** GET VOICEMEETER DIRECTORY **/
|
/** GET VOICEMEETER DIRECTORY **/
|
||||||
@ -13,6 +12,18 @@
|
|||||||
#define KEY_WOW64_32KEY 0x0200
|
#define KEY_WOW64_32KEY 0x0200
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void remove_name_in_path(char *szPath)
|
||||||
|
{
|
||||||
|
char *p = szPath;
|
||||||
|
|
||||||
|
while (*p++)
|
||||||
|
;
|
||||||
|
while (p > szPath && *p != '\\')
|
||||||
|
p--;
|
||||||
|
if (*p == '\\')
|
||||||
|
*p = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
bool __cdecl registry_get_voicemeeter_folder(char *szDir)
|
bool __cdecl registry_get_voicemeeter_folder(char *szDir)
|
||||||
{
|
{
|
||||||
char szKey[256];
|
char szKey[256];
|
||||||
|
24
src/util.c
24
src/util.c
@ -1,18 +1,4 @@
|
|||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdio.h>
|
|
||||||
#include "util.h"
|
|
||||||
|
|
||||||
void remove_name_in_path(char *szPath)
|
|
||||||
{
|
|
||||||
char *p = szPath;
|
|
||||||
|
|
||||||
while (*p++)
|
|
||||||
;
|
|
||||||
while (p > szPath && *p != '\\')
|
|
||||||
p--;
|
|
||||||
if (*p == '\\')
|
|
||||||
*p = '\0';
|
|
||||||
}
|
|
||||||
|
|
||||||
void replace_multiple_space_with_one(char *s, size_t len)
|
void replace_multiple_space_with_one(char *s, size_t len)
|
||||||
{
|
{
|
||||||
@ -47,13 +33,3 @@ void replace_multiple_space_with_one(char *s, size_t len)
|
|||||||
}
|
}
|
||||||
s[j] = '\0';
|
s[j] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
char *version_as_string(char *s, long v, int n)
|
|
||||||
{
|
|
||||||
long v1 = (v & 0xFF000000) >> 24,
|
|
||||||
v2 = (v & 0x00FF0000) >> 16,
|
|
||||||
v3 = (v & 0x0000FF00) >> 8,
|
|
||||||
v4 = (v & 0x000000FF);
|
|
||||||
snprintf(s, n, "%i.%i.%i.%i", (int)v1, (int)v2, (int)v3, (int)v4);
|
|
||||||
return s;
|
|
||||||
}
|
|
14
src/vmr.c
14
src/vmr.c
@ -3,9 +3,6 @@
|
|||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include "vmr.h"
|
#include "vmr.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "util.h"
|
|
||||||
|
|
||||||
#define VERSION_STR_LEN 128
|
|
||||||
|
|
||||||
long login(T_VBVMR_INTERFACE *vmr, int kind)
|
long login(T_VBVMR_INTERFACE *vmr, int kind)
|
||||||
{
|
{
|
||||||
@ -46,10 +43,13 @@ long login(T_VBVMR_INTERFACE *vmr, int kind)
|
|||||||
if (rep == 0)
|
if (rep == 0)
|
||||||
{
|
{
|
||||||
version(vmr, &v);
|
version(vmr, &v);
|
||||||
char version_s[VERSION_STR_LEN];
|
long v1 = (v & 0xFF000000) >> 24,
|
||||||
log_info(
|
v2 = (v & 0x00FF0000) >> 16,
|
||||||
"Successfully logged into the Voicemeeter API v%s",
|
v3 = (v & 0x0000FF00) >> 8,
|
||||||
version_as_string(version_s, v, VERSION_STR_LEN));
|
v4 = (v & 0x000000FF);
|
||||||
|
char version_s[128];
|
||||||
|
sprintf(version_s, "%i.%i.%i.%i", (int)v1, (int)v2, (int)v3, (int)v4);
|
||||||
|
log_info("Successfully logged into the Voicemeeter API v%s", version_s);
|
||||||
clear_dirty(vmr);
|
clear_dirty(vmr);
|
||||||
}
|
}
|
||||||
return rep;
|
return rep;
|
||||||
|
@ -112,9 +112,8 @@ int main(int argc, char *argv[])
|
|||||||
void help()
|
void help()
|
||||||
{
|
{
|
||||||
puts(
|
puts(
|
||||||
"Usage: ./vmrcli.exe [-h] [-i] [-k] [-D] <api commands>\n"
|
"Usage: ./vmrcli.exe [-i] [-k] [-D] <api commands>\n"
|
||||||
"Where: \n"
|
"Where: \n"
|
||||||
"\th: Prints the help dialogue\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");
|
"\tD: Set log level 0=TRACE, 1=DEBUG, 2=INFO, 3=WARN, 4=ERROR, 5=FATAL");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user