Javscript - detecting when a M4L device has moved from one track to another
I'm pulling my hair out trying to do something so simple.
All I want to do is do what DISCOPATRICK did here with Javascript.
Basically, I can't seem to get Live to instantiate an object based on the path of the device.
Neither of the following ways works
I.e.
1. device_callback is never called when I move the device from one track to another
2. this_device_api.path updates every time the device moves, i.e. mode = 1 not working >> the LiveAPI object is following the id, not the path.
this_device_api = new LiveAPI(device_callback,'this_device');
this_device_api.mode = 1;
this_device = new LiveAPI('this_device');
// Copying the path to a new object
this_path = this_device.unquotedpath.split(' ').join(' ');
//Initializing the API
this_device_api = new LiveAPI(device_callback,this_path);
this_device_api.mode = 1;
It only works if I explicitly type this_device_api = new LiveAPI(device_callback, 'live_set tracks N devices n'); this_device_api.mode = 1;
PLEASE HELP!