Is there a way to use the same callback function to observe the same parameter on different tracks?
For instance, I’d like to observe the ‘volume’ parameter in all tracks without having to define a different callback for each track. Is there a way to retrieve the track reference from the args in the callback function?
Thanks for your reply Andrew. I understand I need different LiveAPI objects to register each observer for each track but my question is whether I can use the same callback function for each observer or do I need to create a different callback for each observer too.
var api1 = new LiveAPI(volumeChanged);
var api2 = new LiveAPI(volumeChanged);
var api3 = new LiveAPI(volumeChanged);
api1.path = "live_set tracks 0 mixer_device volume"
api2.path = "live_set tracks 1 mixer_device volume"
api3.path = "live_set tracks 2 mixer_device volume"
api1.property = "value";
api2.property = "value";
api3.property = "value";
// Right now only one argument is received, the value, thus we don’t know in which track the volume has changed.
// Ideally here the source object (volume in this case) could be passed as an argument so we could go through the canonical_path to find its track…