I hope this is in the right place, then again this one might be a general programming mistake rather than asking how to use controlP5..
I have a box which is populated with data in the form of textlabels. The number of boxes needs to change as and when new devices come online or go offline.
I currently start by declaring in my setup that updateboxes=1;
Then this is in Draw:
if(updateboxes=1){
while(i<numberofboxes){
arrayofboxes[i]=new box(positioninginfo,i); //i gives each label inside each box an id relating to its box.
}
updateboxes=0;
}
When the number of boxes gets bigger all is well (except for the error that says "controller with name 'blaar' already exists" but that's because I'm re-drawing all of them everytime and because I can't work out how to delete them I get that warning).
Now, when I reduce the number of boxes the labels stay there. Because (I think) there's no way of deleting an instance in Java.
TL;DR - when I call a new class, labels are being overwritten because they have the same name. How can I give a label a name dependent on the class instance?
Hi,
I come from the world of microprocessors so the whole class thing is still something of a mystery to me!
I'm trying to create a program that will have a few windows displaying fairly similar data (received from a pic). At the moment I have this:
void setup(){
//set window dimensions
size(700,300);
controlP5=new ControlP5(this);
l1_data = new Data(50, 70);
l2_data = new Data(220, 70);
}
void draw(){
background(125);
l1_data.shapes();
l2_data.shapes();
}
Data is this:
class Data{
int X, Y = 0;
Textlabel name, l1, l2, l3, N;
Data(int tempX, int tempY){
X = tempX;
Y = tempY;
stroke(255);
fill(80);
rect(X,Y,100,Y+100);
name = controlP5.addTextlabel("name_label","Distro 1",X+2,Y+2);
N = controlP5.addTextlabel("N_label","N",X+2,Y+60);
}
void shapes (){
stroke(255);
fill(80);
rect(X,Y,100,Y+100);
}
}
My question is how to I get "N_label" to be "l1_data_N_label" and "l2_data_N_label"? This is required because each label is overwritten when the next new instance is called.
I'm very new to processing, I'm trying to work out how far to go with it, does anyone know if it is possible to access the IO from a program like ASIO4ALL? I have looked at "Beads" but they only support the default recording input on windows, and the latency is awful. I need a minimum of 4 channels of audio in and 8 channels out.
I suppose all I am trying to find out is if multiple channels of audio processing, at a low latency, is possible with Processing or do I need to use something else?