Trouble updating parameters between two classes
hey guys, great forum - very useful.
When using more than one class, i'm having troubles passing variables between them (ie updating paramets when they change). In a simple example (with only 1 variable) there are two classes - Fader and FaderEffect (in seperate files). the faderEffect class has a constructor in it which creates a new faderEffect
public FaderEffect(float volume){
volumeLevel = volume;
}
In the fader class, i have code which creates a new object:
FaderEffect fader = null; // setting it up
if (fader==null){
fader = new FaderEffect(volume);
}
Which is fine. In the fader class i also have code which automatically updates the volume parameter:
public void parameterUpdate(String paramname, Object value) {
if (paramname.equals("volume"))
volume = new Float((String) value).floatValue();
}
But the problem is that the volumeLevel variable in the faderEffect class doesn't get updated because it only gets updated when you create the new object... so how can i get the varaibles to update automatically? At the moment i have to re-create a new 'Fader' each time...
I hope someone can help, as this is the last piece of the puzzle! :(
Thanks guys