Previously, we refreshed the list by completely erasing it and building
a new one. While simple, it caused some obnoxious visual glitches, and
I could imagine some more serious problems it might have caused as well.
Now we remove only the devices that don't exist any more, and add only
those that we don't already know about. Much better for the user
interface, but O(n^2). Oh well, I doubt anyone will have enough PD
Buddies connected at once for that to matter much.
Previously, the device list only loaded once on startup. This was poor
behaviour, as devices can be attached and detached at any time.
Now the attached devices are polled once per second, and the list is
updated accordingly. The code behind it is a bit messy because the
list model interacts directly with parts of the GUI, but it works
pretty well nevertheless. There's no mechanism to kick us out of the
configuration screen if the device we're configuring is detached, but
this can be addressed later. For now, I'm reasonably happy with this
new feature.
It's by no means wonderful internally, but to a large extent it works.
The list functionality is still untested, since I won't be able to have
two PDB Sinks connected to my computer at once until tomorrow. But for
now, a neat little GUI.