Cabbage Logo
Back to Cabbage Site

Increasing the size of the Settings dialogue box & I/O channel lists

Hi Rory,

I am contemplating some changes to the GUI which are probably not suitable for most users. Can you point me to where in the source code I could tweak these things?:

Increase the overall height and perhaps width of the Settings dialogue box.

Increase the height and perhaps width of the two scrolling tick-box list things Audo and MIDI > “Active output channels” and “Active input channels”.

My sound card (RME RayDat) has 36 channels, so these two lists (JACK > System) start off with 18 pairs of outputs, or inputs, with ticks, and I generally need to remove all but one of these ticks. So this is 17 + 17 tick clicks and it is quite difficult in the current sized list boxes, which only show four tick boxes at once. The same thing happens when I select the inputs or outputs of another instance of Cabbage: 18 ticks in both lists, most of which I need to untick.

I know nothing about GUI programming but if you can point me to the right place, I should be able to do it.

It may not be that straightforward, but you might as well have a go. I use a standard JUCE widget for this which is created on the fly each time a users need to change the settings. It’s call in this function:
https://github.com/rorywalsh/cabbage/blob/master/Source/Audio/Graph/AudioGraph.cpp#L288
This function is in turn called from herre:


You can set the size of the settings dialogue here, but it might not affect the size of that child component. For that you may need to hack the JUCE source :confounded: Best of luck with this. I did create my own custom device selector for the last version of Cabbage, but it was a pain to maintain with all the changes constantly being made to the JUCE audio system.

As they say in the classics: “Use the Source, Luke.” . . .

I altered line 863 above (I am using JUCE 5.2.0 so my line number is different) to make the Settings box bigger (600, 854) and this produced a taller dialog box which suits the second change.

The whole section named “Audio and MIDI” is called “viewport” and is produced by JUCE. The AudioDeviceSelectorComponent constructor has no argument for height. In the constructor itself (JUCE-5.2.0/modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.cpp/h), a private data member itemHeight is initialised to 24. This can’t be altered by the constructor, but there is a member function setItemHeight(int) to change it. However, this only sets the height of some of the items in the whole block and the spaces between them, not the height of the audio channel list boxes or number of audio channels which can be viewed in them.

The height of the two list boxes for Active output/input channels is set by lines 266 and 273 of JUCE-5.2.0/modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.cpp by calling of a member function of the two list objects whose only parameter is a local variable of the constructor: maxListBoxHeight, which is set to 100. As you wrote, I need to hack the JUCE code to change this value to 200 or more. By changing it to 250 I got list boxes which show 10 pairs of channels, and this suits the 854 high Settings window.

The Source is strong in this one :grin: