AudioDeviceSelectorComponent x AudioDeviceManager question


#1

Hello, people.

I’m trying to make an audio application with a little more knowledge about Juce architecture. So, I have the following code to start playing a sound device:

AudioDeviceManager *audioDeviceManager = new AudioDeviceManager;
audioDeviceManager->initialise(2,2,0,false);
audioDeviceManager->setAudioCallback(this);
audioDeviceSelector = new AudioDeviceSelectorComponent(*audioDeviceManager,2,2,2,2,true);

So, why do I need to pass the same information to audioDeviceManager and to audioDeviceSelectorComponent?

When I do a “audioDeviceManager->initialise(2,2,0,false);” I’m asking Juce engine to give me a sound device handler with 2 inputs and 2 outputs. When I do a “audioDeviceSelector = new AudioDeviceSelectorComponent(*audioDeviceManager,2,2,2,2,true);” I’m asking to Juce engine nearly the same thing. Is it a intentional redundancy?

Thanks![/code]


#2

It’s not quite the same - for the manager, you’re telling it the minimum number of channels you need from the device, but for the UI, you’re saying what the limits are for the min/max number of channels the user can enable at the same time. So they might have a device with 16 channels, but you only allow 2 to be enabled at once.

I guess this info could have been added to the device manager too, but it’s only actually needed by the UI comp.


#3