1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-22 01:34:21 +00:00

linux midi and audio fixes

This commit is contained in:
jules 2007-07-24 14:07:57 +00:00
parent ff4812cd09
commit dbb3b223bf
4 changed files with 8 additions and 7 deletions

View file

@ -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)
{

View file

@ -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()

View file

@ -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;
}

View file

@ -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;