New audio device code

I’ve just checked in a bunch of changes to the way audio devices work, that allow you to mix + match pairs of devices in ways that you couldn’t before.

So with DSound or CoreAudio, you can choose separate devices to be the inputs and outputs. I’ve also beefed up the device selection component with a ‘test’ button and a little input level meter.

So if any guinea pigs out there want to test it, I’d love some feedback! It’s very new code, so no guarantees that it’s bug-free!

when compiling AudioPlugins in standalone:

juce_AudioFilterStreamer.obj : error LNK2001: unresolved external symbol "public: void __thiscall juce::AudioDeviceManager::removeMidiInputCallback(class juce::MidiInputCallback *)" (?removeMidiInputCallback@AudioDeviceManager@juce@@QAEXPAVMidiInput

i think you changed this method, it now takes two parameters, not one.

Yeah, you probably need to clean + rebuild all.

i did but:

    void removeMidiInputCallback (const String& midiInputDeviceName,
                                  MidiInputCallback* callback);

and the AudioFilterStreamer has (had cause now i noticed that the latest wrapper code has this fixed)

removeMidiInputCallback (streamer);

changed it to

removeMidiInputCallback (String::empty, streamer);

witch is what you did, so the issue is solved. sorry for the bug report that isn’t there :slight_smile:

Seems that the persistent settings in XML got broken in the new code …
Tell me if you need more details or if it is evident when you check it.

In my setup, channel selections do not get stored correctly in the settings file as they did before.

There are entries for the input selection but the bits stick to the same pattern regardless of my selection.

There is no entry for the output channels.

Observation: There is a memory leak with containing device setting strings.

Thanks. I’ve checked in a few changes now that should help there. Let me know if you still have any problems…

Thanks for the quick response. I tested and this helped a lot. The store/restore now works.

Playing around with the AudioDeviceSelectorComponent I made the following observations:

  1. A bug in AudioDeviceSettingsPanel::changeListenerCallback(…) probably introduced with copy and paste (I do make them myself from time to time)

if (setup.maxNumInputChannels > 0 && setup.minNumOutputChannels < setup.manager->getCurrentAudioDevice()->getInputChannelNames().size())
should have been

if (setup.maxNumInputChannels > 0 && setup.minNumInputChannels < setup.manager->getCurrentAudioDevice()->getInputChannelNames().size())

  1. It would be nice to be able to control whether to use stereo pairs or not in the device selector. As is this is controlled by the hardcoded state of the boolean flag useSteroPairs in AudioIODeviceType::DeviceSetupDetails. Control could be either through a checkbox in the device selector dialog or in its constructor or something else.

Whoops, yes, the cut-and-paste monster clearly struck there! Thanks.

Yes, I do need to add some way of setting that stereo pairs flag…