I’m building an audio settings section in the standalone version of a plugin using juce::AudioDeviceSelectorComponent. This plugin also has a resize function which allows switching between 75% and 100% of full size. The first screenshot shows what the setting section looks like when size is 100%. You have the settings and a background rectangle. The second screenshot shows what it looks like when size is at 75%. And this looks problematic as the background rectangle is resized proportionally, but the audio settings section is not resized proportionally: the height and size of “Show advanced settings” button aren’t being changed . Here’s the relevant code
std::unique_ptr<juce::AudioDeviceSelectorComponent> audioSettings;
void MyAudioProcessorEditor::resized()
{
...
if (isStandalone) {
audioSettingsBackground.setBoundsRelative(0.3, 0.3, 0.4, 0.4);
settingsLabel.setBoundsRelative(0.4, 0.25, 0.2, 0.05);
if (audioSettings && audioSettings->isVisible())
{
audioSettings->setBounds(audioSettingsBackground.getBounds().reduced(10));
}
}
}
MyAudioProcessorEditor::EqAudioProcessorEditor (MyAudioProcessor& p, juce::AudioProcessorValueTreeState& vts)
: ...
{
sizePortion = p.sizePortion;
if (juce::JUCEApplicationBase::isStandaloneApp()) {
otherDeviceManager.initialise(2, 2, nullptr, true);
audioSettings.reset(new juce::AudioDeviceSelectorComponent(
otherDeviceManager,
0, 2, 0, 2,
true, true, true, true));
juce::Colour bgColour((uint8)0x1e, (uint8)0x34, (uint8)0x52, (float)1.0f);
addAndMakeVisible(audioSettingsBackground);
audioSettingsBackground.setVisible(false);
addAndMakeVisible(audioSettings.get());
audioSettings->setVisible(false);
addAndMakeVisible(settingsButton);
settingsButton.addListener(this);
}
}


