diff --git a/build/linux/platform_specific_code/juce_linux_Audio.cpp b/build/linux/platform_specific_code/juce_linux_Audio.cpp index 64f3aa3799..40d44d616a 100644 --- a/build/linux/platform_specific_code/juce_linux_Audio.cpp +++ b/build/linux/platform_specific_code/juce_linux_Audio.cpp @@ -863,7 +863,7 @@ public: if (cardNum < 0) break; - if (snd_ctl_open (&handle, T("hw:") + String (cardNum), 0) >= 0) + if (snd_ctl_open (&handle, T("hw:") + String (cardNum), SND_CTL_NONBLOCK) >= 0) { if (snd_ctl_card_info (handle, info) >= 0) { diff --git a/build/linux/platform_specific_code/juce_linux_Midi.cpp b/build/linux/platform_specific_code/juce_linux_Midi.cpp index 02071afcde..717209f5a6 100644 --- a/build/linux/platform_specific_code/juce_linux_Midi.cpp +++ b/build/linux/platform_specific_code/juce_linux_Midi.cpp @@ -131,6 +131,8 @@ static snd_seq_t* iterateDevices (const bool forInput, snd_seq_close (seqHandle); } + deviceNamesFound.appendNumbersToDuplicates (true, true); + return returnedHandle; } @@ -325,7 +327,7 @@ public: while (! threadShouldExit()) { - if (poll (pfd, numPfds, 100000) > 0) + if (poll (pfd, numPfds, 500) > 0) { snd_seq_event_t* inputEvent = 0; @@ -393,7 +395,7 @@ void MidiInput::start() void MidiInput::stop() { - ((MidiInputThread*) internal)->stopThread (2000); + ((MidiInputThread*) internal)->stopThread (3000); } int MidiInput::getDefaultDeviceIndex() diff --git a/src/juce_appframework/audio/devices/juce_AudioDeviceManager.cpp b/src/juce_appframework/audio/devices/juce_AudioDeviceManager.cpp index 09b146625c..fa72a50b09 100644 --- a/src/juce_appframework/audio/devices/juce_AudioDeviceManager.cpp +++ b/src/juce_appframework/audio/devices/juce_AudioDeviceManager.cpp @@ -129,10 +129,7 @@ const StringArray AudioDeviceManager::getAvailableAudioDeviceNames() const StringArray names; for (int i = 0; i < availableDeviceTypes.size(); ++i) - { - availableDeviceTypes[i]->scanForDevices(); names.addArray (availableDeviceTypes[i]->getDeviceNames (useInputNames)); - } return names; } diff --git a/src/juce_core/text/juce_StringArray.cpp b/src/juce_core/text/juce_StringArray.cpp index d786af7762..d6cfcccbd3 100644 --- a/src/juce_core/text/juce_StringArray.cpp +++ b/src/juce_core/text/juce_StringArray.cpp @@ -528,9 +528,11 @@ void StringArray::removeDuplicates (const bool ignoreCase) throw() { const String& s = *(String*) strings.getUnchecked(i); + int nextIndex = i + 1; + for (;;) { - const int nextIndex = indexOf (s, ignoreCase, i + 1); + nextIndex = indexOf (s, ignoreCase, nextIndex); if (nextIndex < 0) break;