I have been using the AudioDeviceSelectorComponent
in a few projects and I really appreciate what it does. It’s tedious to write by hand, and get it right in all cases.
I would like to note two things that I’ve been missing when I worked with it, to discuss which of these could actually be sensible additions to the class, and which I can solve otherwise.
- A method
getBestHeight
would be nice, to let the parent component know how much space is needed to show everything. Because sometimes you want to place another component below this one, or adjust the parent window’s size to just as much height as is needed. The height varies depending on what the user selects. Sometimes the multi-out selection will be visible, sometimes not. So it’s hard to ensure from outside that enough space is available, without showing a large gap at the bottom. - It would be great to be able to customize how wide the columns are, because you may want to add more
PropertyComponent
s below it, and line up the columns. The layout proportions are currently hardcoded in theresized()
method. Right now I’m just copying the numbers over to my code, which isn’t too bad.