From a28db25bcca7265b24cc1917feba0662fb8cbc50 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Thu, 4 Jul 2024 12:19:04 +0100 Subject: [PATCH] define mb function pointers in the iVMR interface. add trace logs for login, logout and mb functions --- src/cdll.c | 11 +++++++++++ src/vmr.c | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/src/cdll.c b/src/cdll.c index b9d6aa8..c667c11 100644 --- a/src/cdll.c +++ b/src/cdll.c @@ -109,6 +109,10 @@ long initialize_dll_interfaces(PT_VMR vmr) vmr->VBVMR_Input_GetDeviceDescA = (T_VBVMR_Input_GetDeviceDescA)GetProcAddress(G_H_Module, "VBVMR_Input_GetDeviceDescA"); vmr->VBVMR_Input_GetDeviceDescW = (T_VBVMR_Input_GetDeviceDescW)GetProcAddress(G_H_Module, "VBVMR_Input_GetDeviceDescW"); + vmr->VBVMR_MacroButton_IsDirty = (T_VBVMR_MacroButton_IsDirty)GetProcAddress(G_H_Module, "VBVMR_MacroButton_IsDirty"); + 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"); + // check pointers are valid if (vmr->VBVMR_Login == NULL) return -1; @@ -156,5 +160,12 @@ long initialize_dll_interfaces(PT_VMR vmr) if (vmr->VBVMR_Input_GetDeviceDescW == NULL) return -35; + if (vmr->VBVMR_MacroButton_IsDirty == NULL) + return -36; + if (vmr->VBVMR_MacroButton_GetStatus == NULL) + return -37; + if (vmr->VBVMR_MacroButton_SetStatus == NULL) + return -38; + return 0; } \ No newline at end of file diff --git a/src/vmr.c b/src/vmr.c index c021ee1..3bd1fea 100644 --- a/src/vmr.c +++ b/src/vmr.c @@ -22,6 +22,7 @@ long login(PT_VMR vmr, int kind) int rep; long v; + log_trace("VBVMR_Login()"); rep = vmr->VBVMR_Login(); if (rep == 1) { @@ -66,6 +67,7 @@ long logout(PT_VMR vmr) int rep; Sleep(20); /* give time for last command */ + log_trace("VBVMR_Logout()"); rep = vmr->VBVMR_Logout(); if (rep == 0) log_info("Successfully logged out of the Voicemeeter API"); @@ -128,16 +130,19 @@ long set_parameters(PT_VMR vmr, char *command) bool is_mdirty(PT_VMR vmr) { + log_trace("VBVMR_MacroButton_IsDirty()"); return vmr->VBVMR_MacroButton_IsDirty() == 1; } long macrobutton_getstatus(PT_VMR vmr, long n, float *val, long mode) { + log_trace("VBVMR_MacroButton_GetStatus(%ld, *v, %ld)", n, mode); return vmr->VBVMR_MacroButton_GetStatus(n, val, mode); } long macrobutton_setstatus(PT_VMR vmr, long n, float val, long mode) { + log_trace("VBVMR_MacroButton_SetStatus(%ld, %d, %ld)", n, (int)val, mode); return vmr->VBVMR_MacroButton_SetStatus(n, val, mode); }