mirror of
https://github.com/onyx-and-iris/vmrcli.git
synced 2025-01-18 08:41:08 +00:00
allow clear to accept either dirty func as pointer
This commit is contained in:
parent
35335a60aa
commit
b225ba5cc3
@ -41,6 +41,6 @@ bool is_mdirty(PT_VMR vmr);
|
|||||||
long macrobutton_getstatus(PT_VMR vmr, long n, float *val, long mode);
|
long macrobutton_getstatus(PT_VMR vmr, long n, float *val, long mode);
|
||||||
long macrobutton_setstatus(PT_VMR vmr, long n, float val, long mode);
|
long macrobutton_setstatus(PT_VMR vmr, long n, float val, long mode);
|
||||||
|
|
||||||
void clear_dirty(PT_VMR vmr);
|
void clear(PT_VMR vmr, bool (*f)(PT_VMR));
|
||||||
|
|
||||||
#endif /* __WRAPPER_H__ */
|
#endif /* __WRAPPER_H__ */
|
@ -175,7 +175,7 @@ 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);
|
Sleep(300);
|
||||||
clear_dirty(vmr);
|
clear(vmr, is_pdirty);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (iflag)
|
if (iflag)
|
||||||
@ -373,7 +373,7 @@ void parse_command(PT_VMR vmr, char *command)
|
|||||||
*/
|
*/
|
||||||
void get(PT_VMR vmr, char *command, struct result *res)
|
void get(PT_VMR vmr, char *command, struct result *res)
|
||||||
{
|
{
|
||||||
clear_dirty(vmr);
|
clear(vmr, is_pdirty);
|
||||||
if (get_parameter_float(vmr, command, &res->val.f) != 0)
|
if (get_parameter_float(vmr, command, &res->val.f) != 0)
|
||||||
{
|
{
|
||||||
res->type = STRING_T;
|
res->type = STRING_T;
|
||||||
|
@ -61,7 +61,7 @@ long login(PT_VMR vmr, int kind)
|
|||||||
|
|
||||||
if (rep == 0)
|
if (rep == 0)
|
||||||
{
|
{
|
||||||
clear_dirty(vmr);
|
clear(vmr, is_pdirty);
|
||||||
}
|
}
|
||||||
return rep;
|
return rep;
|
||||||
}
|
}
|
||||||
@ -157,9 +157,9 @@ long macrobutton_setstatus(PT_VMR vmr, long n, float val, long mode)
|
|||||||
return vmr->VBVMR_MacroButton_SetStatus(n, val, mode);
|
return vmr->VBVMR_MacroButton_SetStatus(n, val, mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
void clear_dirty(PT_VMR vmr)
|
void clear(PT_VMR vmr, bool (*f)(PT_VMR))
|
||||||
{
|
{
|
||||||
Sleep(30);
|
Sleep(30);
|
||||||
while (is_pdirty(vmr))
|
while (f(vmr))
|
||||||
Sleep(1);
|
Sleep(1);
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user