(MESS) osdcore: Allow "default" for -midiin and -midiout. [R. Belmont]

This commit is contained in:
R. Belmont 2014-06-28 01:39:55 +00:00
parent 931ae57120
commit 90c4bfb799

View File

@ -232,16 +232,23 @@ osd_midi_device *osd_open_midi_input(const char *devname)
PortMidiStream *stm; PortMidiStream *stm;
osd_midi_device *ret; osd_midi_device *ret;
for (int i = 0; i < num_devs; i++) if (!strcmp("default", devname))
{ {
pmInfo = Pm_GetDeviceInfo(i); found_dev = Pm_GetDefaultInputDeviceID();
}
if (pmInfo->input) else
{
for (int i = 0; i < num_devs; i++)
{ {
if (!strcmp(devname, pmInfo->name)) pmInfo = Pm_GetDeviceInfo(i);
if (pmInfo->input)
{ {
found_dev = i; if (!strcmp(devname, pmInfo->name))
break; {
found_dev = i;
break;
}
} }
} }
} }
@ -279,16 +286,23 @@ osd_midi_device *osd_open_midi_output(const char *devname)
PortMidiStream *stm; PortMidiStream *stm;
osd_midi_device *ret; osd_midi_device *ret;
for (int i = 0; i < num_devs; i++) if (!strcmp("default", devname))
{ {
pmInfo = Pm_GetDeviceInfo(i); found_dev = Pm_GetDefaultOutputDeviceID();
}
if (pmInfo->output) else
{
for (int i = 0; i < num_devs; i++)
{ {
if (!strcmp(devname, pmInfo->name)) pmInfo = Pm_GetDeviceInfo(i);
if (pmInfo->output)
{ {
found_dev = i; if (!strcmp(devname, pmInfo->name))
break; {
found_dev = i;
break;
}
} }
} }
} }