Number of LiveAPI control_surfaces
Does anyone know a simple way to get the number of LiveAPI control_surfaces? To use the getcount message we need some parent, but it appears control_surfaces is the root itself, so this doesn't work.
There can only be six, so I use an iteration and check type usually (in js). But yeah, it would be much better if control_surfaces didn't just return the __class__ builtins.
Interestingly there can be a lot more than six control_surfaces, but only six can be seen in the Preferences window. When setting a control_surface to none and then to some other surface not all previous surfaces are deleted, due to bad disconnect functions and Ableton Live not always calling the disconnect function.
I found iterating until I get an 'id 0' is a good solution. I have to iterate all surfaces anyway.
LOL yeah, now that I think about it I can confirm that. You're work around seems like a good idea, I think I'll implement the same.
a