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:
parent
d5b55a8474
commit
240089bcbc
1 changed files with 11 additions and 4 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue