Not too experienced with JUCE, I’ve run into a probably very trivial issue.
I have made auv3 plugins for iOS. I want to show the default juce device manager in the standalone, so that users also can use it standalone.
I looked at the tutorial, but the real AudioDeviceManager that is used there, is not available in AudioProcessorEditor.
I added a fake AudioDeviceManager audioDevice, and the manager component is visible and working on screen, but it doesnt seem to work for the audio.
So I most likely need to connect to the real AudioDeviceManager, which I can not find…
AudioDeviceManager audioDevice;
AudioDeviceSelectorComponent audioSetup;
JuceDemoPluginAudioProcessorEditor (JuceDemoPluginAudioProcessor& owner)
: AudioProcessorEditor (owner),
audioSetup(audioDevice,
0, // minimum input channels
256, // maximum input channels
0, // minimum output channels
256, // maximum output channels
false, // ability to select midi inputs
false, // ability to select midi output device
false, // treat channels as stereo pairs
false), // hide advanced options
tnx in advance!
Why are you accessing the ADM from a plugin? Plugins operate on audio to/from the hosting application, not the underlying audio subsystem.
when you choose auv3 as a target in xcode, the standalone is also created.
In that standalone I want to access teh ADM
Solved it this way, I just leave it here for other peeps with same problem to find
this.
if someone with more expertise knows how to do it more elegantly: please tell! I just hacked it this way 
You need one extra include
#include “juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h”
Then in AudioProcessorEditor the following code:
//First a pointer to circumvent requirements
AudioDeviceSelectorComponent* audioSetupP;
if(processor.wrapperType == wrapperType_Standalone)
{
auto pluginHolder = StandalonePluginHolder::getInstance();
AudioDeviceSelectorComponent* mySetup = new AudioDeviceSelectorComponent
(pluginHolder->deviceManager,
1, // minimum input channels
2, // maximum input channels
2, // minimum output channels
2, // maximum output channels
false, // ability to select midi inputs
false, // ability to select midi output device
false, // treat channels as stereo pairs
false);
audioSetupP = mySetup;
addAndMakeVisible(audioSetupP);
}
In resized():
auto r = getLocalBounds().reduced (12);
if(processor.wrapperType == wrapperType_Standalone)
{
audioSetupP->setBounds(r.removeFromTop(100));
}
3 Likes