i managed to get all track names and tracktypes. but when i try to get through all devices in a track and try to display the name i get this error: "TypeError: undefined has no such function "name"
here is part of the code:
Code: Select all
function init() {
trackBank = host.createTrackBank (100, 0, 0);
numTracks = trackBank.getSizeOfBank();
//var track = null;
for (var i = 0; i < numTracks; i++)
{
var track = trackBank.getItemAt(i);
var devices = track.createDeviceBank(50);
var numDevices = devices.getSizeOfBank();
tracks.push(tracks);
track.name().addValueObserver(nameCallbackFunction(i, function(index, name)
{
if(name != "")
{
println("Track: " + name);
tracknames.push(name);
}
}));
track.trackType().addValueObserver(trackTypeCallbackFunction(i, function(index, tracktype)
{
if(tracktype =="Instrument" || tracktype =="Audio" || tracktype =="Group")
{
println("|| " + tracktype);
tracktypes.push(tracktype);
//getDevices(devices, index);
}
}));
for (var j = 0; j < numDevices; j++)
{
//var device = devices.getDevice(j);
if(devices[j] != undefined)
{
devices[j].name().addValueObserver(nameCallbackFunction(j, function(index, name)
{
println("Device: " + name);
}));
}
}
}
println("LockStates initialized! " + new Date().toLocaleTimeString());
}
any help is very appreciated. cheers, steve
the goal here is to save all parameter values of all devices in a project into arrays
maybe thats not possible at all and i am just wasting my time. please let me know