mirror of
https://github.com/onyx-and-iris/vmrcli.git
synced 2026-04-20 02:03:31 +00:00
Compare commits
2 Commits
v0.7.1
...
39540e9c3e
| Author | SHA1 | Date | |
|---|---|---|---|
| 39540e9c3e | |||
| af98dead75 |
2
makefile
2
makefile
@@ -33,6 +33,6 @@ $(BIN_DIR) $(OBJ_DIR):
|
||||
pwsh -Command New-Item -Path $@ -ItemType Directory
|
||||
|
||||
clean:
|
||||
pwsh -Command Remove-Item -Recurse $(EXE), $(OBJ_DIR)
|
||||
pwsh -Command Remove-Item -Recurse $(EXE), $(OBJ_DIR) -force
|
||||
|
||||
-include $(OBJ:.o=.d)
|
||||
|
||||
11
src/ivmr.c
11
src/ivmr.c
@@ -20,6 +20,13 @@
|
||||
#include "util.h"
|
||||
#include "log.h"
|
||||
|
||||
#define PRAGMA_IgnoreWCastIncompatibleFuncTypes \
|
||||
_Pragma("GCC diagnostic push") \
|
||||
_Pragma("GCC diagnostic ignored \"-Wcast-function-type\"")
|
||||
|
||||
#define PRAGMA_Pop \
|
||||
_Pragma("GCC diagnostic pop")
|
||||
|
||||
static T_VBVMR_INTERFACE iVMR;
|
||||
|
||||
static long initialize_dll_interfaces(PT_VMR vmr);
|
||||
@@ -79,6 +86,8 @@ static long initialize_dll_interfaces(PT_VMR vmr)
|
||||
if (G_H_Module == NULL)
|
||||
return -101;
|
||||
|
||||
PRAGMA_IgnoreWCastIncompatibleFuncTypes;
|
||||
|
||||
// Get function pointers
|
||||
vmr->VBVMR_Login = (T_VBVMR_Login)GetProcAddress(G_H_Module, "VBVMR_Login");
|
||||
vmr->VBVMR_Logout = (T_VBVMR_Logout)GetProcAddress(G_H_Module, "VBVMR_Logout");
|
||||
@@ -110,6 +119,8 @@ static long initialize_dll_interfaces(PT_VMR vmr)
|
||||
vmr->VBVMR_MacroButton_GetStatus = (T_VBVMR_MacroButton_GetStatus)GetProcAddress(G_H_Module, "VBVMR_MacroButton_GetStatus");
|
||||
vmr->VBVMR_MacroButton_SetStatus = (T_VBVMR_MacroButton_SetStatus)GetProcAddress(G_H_Module, "VBVMR_MacroButton_SetStatus");
|
||||
|
||||
PRAGMA_Pop;
|
||||
|
||||
// check pointers are valid
|
||||
if (vmr->VBVMR_Login == NULL)
|
||||
return -1;
|
||||
|
||||
12
src/vmrcli.c
12
src/vmrcli.c
@@ -144,7 +144,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
PT_VMR vmr = create_interface();
|
||||
|
||||
int rep = login(vmr, kind);
|
||||
long rep = login(vmr, kind);
|
||||
if (rep != 0)
|
||||
{
|
||||
log_fatal("Error logging into the Voicemeeter API");
|
||||
@@ -185,15 +185,15 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
rep = logout(vmr);
|
||||
if (rep == 0)
|
||||
{
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
else
|
||||
if (rep != 0)
|
||||
{
|
||||
log_fatal("Error logging out of the Voicemeeter API");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
*/
|
||||
long login(PT_VMR vmr, int kind)
|
||||
{
|
||||
int rep;
|
||||
long rep;
|
||||
long v;
|
||||
|
||||
log_trace("VBVMR_Login()");
|
||||
@@ -75,7 +75,7 @@ long login(PT_VMR vmr, int kind)
|
||||
*/
|
||||
long logout(PT_VMR vmr)
|
||||
{
|
||||
int rep;
|
||||
long rep;
|
||||
|
||||
Sleep(20); /* give time for last command */
|
||||
log_trace("VBVMR_Logout()");
|
||||
|
||||
Reference in New Issue
Block a user