Casting Radio's in ControlP5 Library

edited May 2015 in Library Questions

I'm getting an error when running my program. This is what it shows: Cannot cast from Controller<capture#14-of?> to Radio Does anyone know how I fix this problem, so that it can cast correctly. Here is the snippet of code where the problem is coming from:

if(theEvent.controller().name()=="rad1") { Radio b=(Radio)controlP5.controller("rad2"); currScale=new Scale((int)theEvent.controller().value()+9,(int)b.value()); grid.update(currScale,BASE_DUR,(int)complen.value()); }

Tagged:
Sign In or Register to comment.