mirror of
https://github.com/onyx-and-iris/vmrcli.git
synced 2025-04-20 04:53:48 +01:00
Compare commits
4 Commits
61d81b0abf
...
477267e278
Author | SHA1 | Date | |
---|---|---|---|
477267e278 | |||
bc7568a191 | |||
c5c9360d32 | |||
9ee3f42334 |
16
README.md
16
README.md
@ -13,7 +13,7 @@
|
|||||||
## `Use`
|
## `Use`
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
./vmrcli.exe [-h] [-i] [-k] [-D] [-v] [-c] [-m] [-s] <api commands>
|
.\vmrcli.exe [-h] [-i] [-k] [-D] [-v] [-c] [-m] [-s] <api commands>
|
||||||
```
|
```
|
||||||
|
|
||||||
Where:
|
Where:
|
||||||
@ -38,13 +38,13 @@ Examples:
|
|||||||
Launch basic GUI, set log level to INFO, Toggle Strip 0 Mute, print its new value, then decrease Bus 0 Gain by 3.8
|
Launch basic GUI, set log level to INFO, Toggle Strip 0 Mute, print its new value, then decrease Bus 0 Gain by 3.8
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
./vmrcli.exe -kbasic -D2 !strip[0].mute strip[0].mute bus[0].gain-=3.8
|
.\vmrcli.exe -kbasic -D2 !strip[0].mute strip[0].mute bus[0].gain-=3.8
|
||||||
```
|
```
|
||||||
|
|
||||||
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
|
```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`
|
||||||
@ -52,7 +52,7 @@ Launch banana GUI, set log level to DEBUG, set Strip 0 label to podmic then prin
|
|||||||
Running the following command in Powershell:
|
Running the following command in Powershell:
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
./vmrcli.exe -i
|
.\vmrcli.exe -i
|
||||||
```
|
```
|
||||||
|
|
||||||
Will open an interactive prompt:
|
Will open an interactive prompt:
|
||||||
@ -69,7 +69,13 @@ API commands follow the same rules as listed above. Entering `Q` or `q` will exi
|
|||||||
Scripts can be loaded from text files, for example in Powershell:
|
Scripts can be loaded from text files, for example in Powershell:
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
./vmrcli.exe -D1 $(Get-Content .\example_commands.txt)
|
.\vmrcli.exe -D1 $(Get-Content .\example_commands.txt)
|
||||||
|
```
|
||||||
|
|
||||||
|
You may also pipe a scripts contents to the CLI:
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
$(Get-Content .\example_commands.txt) | .\vmrcli.exe -D1 -i
|
||||||
```
|
```
|
||||||
|
|
||||||
Multiple API commands can be in a single line but they should be space separated.
|
Multiple API commands can be in a single line but they should be space separated.
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#include <windows.h>
|
||||||
#include "ivmr.h"
|
#include "ivmr.h"
|
||||||
#include "wrapper.h"
|
#include "wrapper.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
@ -146,6 +147,8 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
log_info("Profile %s loaded", cvalue);
|
log_info("Profile %s loaded", cvalue);
|
||||||
set_parameter_string(vmr, "command.load", cvalue);
|
set_parameter_string(vmr, "command.load", cvalue);
|
||||||
|
Sleep(300);
|
||||||
|
clear_dirty(vmr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (iflag)
|
if (iflag)
|
||||||
@ -243,13 +246,12 @@ void interactive(PT_VMR vmr)
|
|||||||
while (fgets(input, MAX_LINE, stdin) != NULL)
|
while (fgets(input, MAX_LINE, stdin) != NULL)
|
||||||
{
|
{
|
||||||
input[strcspn(input, "\n")] = 0;
|
input[strcspn(input, "\n")] = 0;
|
||||||
len = strlen(input);
|
if ((len = strlen(input)) == 1 && toupper(input[0]) == 'Q')
|
||||||
if (len == 1 && toupper(input[0]) == 'Q')
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
parse_input(vmr, input, len);
|
parse_input(vmr, input, len);
|
||||||
|
|
||||||
memset(input, '\0', MAX_LINE); /* reset input buffer */
|
memset(input, 0, MAX_LINE); /* reset input buffer */
|
||||||
printf(">> ");
|
printf(">> ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -328,6 +330,7 @@ void parse_command(PT_VMR vmr, char *command)
|
|||||||
printf("%s: %.1f\n", command, res.val.f);
|
printf("%s: %.1f\n", command, res.val.f);
|
||||||
break;
|
break;
|
||||||
case STRING_T:
|
case STRING_T:
|
||||||
|
if (res.val.s[0] != '\0')
|
||||||
printf("%s: %ls\n", command, res.val.s);
|
printf("%s: %ls\n", command, res.val.s);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user