controlp5 updating controller
in
Contributed Library Questions
•
1 year ago
Hi there.
I am wondering if there is another way to update the value of the certain cp5 controller instead of calling each one, checking if value has changed and then controller.setValue();
actually the code works just fine but after a while the fps drop first to 30 then until 8 fps... i know that it's caused by this function.... has anyone suggestions?
this is the funciton i use...
public void updateController() {
for (Controller controller : deck_controllers) {
if (controller.getClass().getSimpleName().equalsIgnoreCase("Slider")) {
if (parameters.containsKey(controller.getLabel())) {
Parameter p = (Parameter) parameters.get(controller.getLabel());
if (controller.getValue() != p.getFloat()) {
controller.setValue(p.getInt());
} else {
PApplet.println("not changed");
}
}
}
}
1