Ok, try this (totally untested, not even compiled) idea…
Add this method to juce_mac_CoreAudio.cpp
[code]const String AudioIODevice::getDefaultDevice (const bool forOutput)
{
StringArray names;
Array ids;
getAudioDeviceList (names, ids);
String result (names[0]);
AudioDeviceID deviceID;
UInt32 size = sizeof (deviceID);
if (AudioHardwareGetProperty (forOutput ? kAudioHardwarePropertyDefaultOutputDevice
: kAudioHardwarePropertyDefaultInputDevice,
&size, &deviceID) == noErr)
{
for (int i = ids.size(); --i >= 0;)
if (ids[i] == deviceID)
result = names[i];
}
return result;
}
[/code]
In the juce_AudioIODevice.h file, add the declaration:
static const String getDefaultDevice (const bool forOutput);
And tweak this method in juce_AudioDeviceManager.h:
[code]
const String AudioDeviceManager::initialise (const int numInputChannelsNeeded,
const int numOutputChannelsNeeded,
const XmlElement* const e)
{
numInputChansNeeded = numInputChannelsNeeded;
numOutputChansNeeded = numOutputChannelsNeeded;
if (e != 0 && e->hasTagName (T("DEVICESETUP")))
{
BitArray ins, outs;
ins.parseString (e->getStringAttribute (T("audioDeviceInChans"), T("11")), 2);
outs.parseString (e->getStringAttribute (T("audioDeviceOutChans"), T("11")), 2);
String error (setAudioDevice (e->getStringAttribute (T("audioDeviceName")),
e->getIntAttribute (T("audioDeviceBufferSize")),
e->getDoubleAttribute (T("audioDeviceRate"))));
XmlElement* c = e->getFirstChildElement();
while (c != 0)
{
if (c->hasTagName (T("MIDIINPUT")))
setMidiInputEnabled (c->getStringAttribute (T("name")), true);
c = c->getNextElement();
}
return error;
}
else
{
const String defaultDevice (AudioIODevice::getDefaultDevice (numOutputChannelsNeeded > 0));
return setAudioDevice (defaultDevice, 0, 0);
}
}[/code]