Browse Source

linux midi and audio fixes

tags/2021-05-28
jules 18 years ago
parent
commit
dbb3b223bf
4 changed files with 8 additions and 7 deletions
  1. +1
    -1
      build/linux/platform_specific_code/juce_linux_Audio.cpp
  2. +4
    -2
      build/linux/platform_specific_code/juce_linux_Midi.cpp
  3. +0
    -3
      src/juce_appframework/audio/devices/juce_AudioDeviceManager.cpp
  4. +3
    -1
      src/juce_core/text/juce_StringArray.cpp

+ 1
- 1
build/linux/platform_specific_code/juce_linux_Audio.cpp View File

@@ -863,7 +863,7 @@ public:
if (cardNum < 0) if (cardNum < 0)
break; 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) if (snd_ctl_card_info (handle, info) >= 0)
{ {


+ 4
- 2
build/linux/platform_specific_code/juce_linux_Midi.cpp View File

@@ -131,6 +131,8 @@ static snd_seq_t* iterateDevices (const bool forInput,
snd_seq_close (seqHandle); snd_seq_close (seqHandle);
} }
deviceNamesFound.appendNumbersToDuplicates (true, true);
return returnedHandle; return returnedHandle;
} }
@@ -325,7 +327,7 @@ public:
while (! threadShouldExit()) while (! threadShouldExit())
{ {
if (poll (pfd, numPfds, 100000) > 0)
if (poll (pfd, numPfds, 500) > 0)
{ {
snd_seq_event_t* inputEvent = 0; snd_seq_event_t* inputEvent = 0;
@@ -393,7 +395,7 @@ void MidiInput::start()
void MidiInput::stop() void MidiInput::stop()
{ {
((MidiInputThread*) internal)->stopThread (2000);
((MidiInputThread*) internal)->stopThread (3000);
} }
int MidiInput::getDefaultDeviceIndex() int MidiInput::getDefaultDeviceIndex()


+ 0
- 3
src/juce_appframework/audio/devices/juce_AudioDeviceManager.cpp View File

@@ -129,10 +129,7 @@ const StringArray AudioDeviceManager::getAvailableAudioDeviceNames() const
StringArray names; StringArray names;
for (int i = 0; i < availableDeviceTypes.size(); ++i) for (int i = 0; i < availableDeviceTypes.size(); ++i)
{
availableDeviceTypes[i]->scanForDevices();
names.addArray (availableDeviceTypes[i]->getDeviceNames (useInputNames)); names.addArray (availableDeviceTypes[i]->getDeviceNames (useInputNames));
}
return names; return names;
} }


+ 3
- 1
src/juce_core/text/juce_StringArray.cpp View File

@@ -528,9 +528,11 @@ void StringArray::removeDuplicates (const bool ignoreCase) throw()
{ {
const String& s = *(String*) strings.getUnchecked(i); const String& s = *(String*) strings.getUnchecked(i);
int nextIndex = i + 1;
for (;;) for (;;)
{ {
const int nextIndex = indexOf (s, ignoreCase, i + 1);
nextIndex = indexOf (s, ignoreCase, nextIndex);
if (nextIndex < 0) if (nextIndex < 0)
break; break;


Loading…
Cancel
Save