1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

AudioDeviceManager: Fixed backwards compatibility when passing an empty string to removeMidiInputCallback()

This commit is contained in:
ed 2021-02-17 18:21:00 +00:00
parent d5b55a8474
commit 240089bcbc

View file

@ -1146,12 +1146,19 @@ void AudioDeviceManager::addMidiInputCallback (const String& name, MidiInputCall
void AudioDeviceManager::removeMidiInputCallback (const String& name, MidiInputCallback* callbackToRemove)
{
for (auto& device : MidiInput::getAvailableDevices())
if (name.isEmpty())
{
if (device.name == name)
removeMidiInputDeviceCallback ({}, callbackToRemove);
}
else
{
for (auto& device : MidiInput::getAvailableDevices())
{
removeMidiInputDeviceCallback (device.identifier, callbackToRemove);
return;
if (device.name == name)
{
removeMidiInputDeviceCallback (device.identifier, callbackToRemove);
return;
}
}
}
}