Page 1 of 1

question - Detect changes (but not caused by user's direct input)

Posted: Fri Oct 23, 2020 1:02 am
by Atg
In win 10 when user press media keys to change volume OSD will appear. I want to write similar program for Voicemeeter. Is it possible to detect (by using API or any other way) when volume or mono/solo/mute button state are changed by MacroButtons or by hooked volume keys, but ignore changes made by user in GUI (dragging slider, pressing buttons in Voicemeeter)? Simplest way will be to check last state and compare to current state in a loop, but it will not distinguish what changes made by user and what by MacroButton; as far as I know same problem with "IsParametersDirty" function.

Re: question - Detect changes (but not caused by user's direct input)

Posted: Sun Oct 25, 2020 8:47 am
by Vincent Burel
yes, this OSD app should be done already ... because very simple to do with Voicemeeter Remote API

general principle is very simple:

Code: Select all

//if there is a change in Voicemeeter parameters
fParamChange=iVMR.VBVMR_IsParametersDirty();
{
   //we check our parameters specifically:
    iVMR.VBVMR_GetParameterFloat("Bus[0].Gain", &fcurrentValue);
   //we compare it to the one we previously displayed
   if (fcurrentValue != fDisplayedValue)
   {
       fDisplayedValue = fCurrentValue;
       ShowWindows
       DisplayCurrentValue(fDisplayedValue);
   }
}
then you could Hide the window after 2 second automatically for example... and that's it... you can do that with all parameters you want to possibily display in an OSD... This principle is also shown in sample0 source code of the SDK (for values given in edit box, see DrawCurrentValues() function).

Re: question - Detect changes (but not caused by user's direct input)

Posted: Sun Oct 25, 2020 2:23 pm
by Atg
Ok. But if I open Voicemeeter manually and press some buttons/drag faders will OSD still appear (will VBVMR_IsParametersDirty() return true)? If it does it will be a little inconvenient but I can work it out, maybe checking if Voicemeeter windows in focus.

Re: question - Detect changes (but not caused by user's direct input)

Posted: Sun Oct 25, 2020 9:27 pm
by Vincent Burel
of course! VBVMR_IsParametersDirty() returns 1 if there is a change on Voicemeeter (by mouse or anything else).

you may detect if Voicemeeter is hidden or not, for example with EnumWindows() functions...

Re: question - Detect changes (but not caused by user's direct input)

Posted: Mon Oct 26, 2020 1:35 pm
by Atg
My main question was is it possible to detect changes, except changes made by user in GUI (dragging faders, pressing buttons). You said yes so I wanted to clarify what if I didnt know something about VBVMR_IsParametersDirty.
Anyway after some research I understand why nobody made OSD already - window apps cant be on top of fullscreen apps (games for example). Only ways to make a proper OSD is to hook into 3d graphics API or use win10 UWP CompactOverlay (and there is lack of info how to make proper OSD "window" in UWP without control bar and close button, etc).

Re: question - Detect changes (but not caused by user's direct input)

Posted: Thu Nov 26, 2020 12:11 pm
by Vincent Burel
you may detect if the Voicemeeter GUI (main windows) is hidden or not for example. But i note your request...
last pack 10 includes an example of code to make an OSD (MAR 2021)