The first is what the documentation seemed to encourage as far as I could tell.
However, even though I'm using the commands to lock the list, I still get Uncaught (in promise) Error: Read lock not acquired!. (I also get it if I don't lock the list).
Code: Select all
let list = uitools.getSelectedTracklist();
await list.whenLoaded();
list.beginUpdate();
for(let i=0; i<list.count; i++) {
console.log('track', track);
}
list.endUpdate();
Code: Select all
let list = uitools.getSelectedTracklist();
await list.whenLoaded();
list.forEach(track => {
console.log('track', track);
});
This confuses me. What's different about the two approaches? Aren't I still getting a track object either way?
Also, when does one need to lock the list if not in this case?
Thanks,
Dale.