mirror of
https://github.com/holub/mame
synced 2025-05-20 20:58:51 +03:00
(MESS) osdcore: Allow "default" for -midiin and -midiout. [R. Belmont]
This commit is contained in:
parent
931ae57120
commit
90c4bfb799
@ -232,16 +232,23 @@ osd_midi_device *osd_open_midi_input(const char *devname)
|
||||
PortMidiStream *stm;
|
||||
osd_midi_device *ret;
|
||||
|
||||
for (int i = 0; i < num_devs; i++)
|
||||
if (!strcmp("default", devname))
|
||||
{
|
||||
pmInfo = Pm_GetDeviceInfo(i);
|
||||
|
||||
if (pmInfo->input)
|
||||
found_dev = Pm_GetDefaultInputDeviceID();
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < num_devs; i++)
|
||||
{
|
||||
if (!strcmp(devname, pmInfo->name))
|
||||
pmInfo = Pm_GetDeviceInfo(i);
|
||||
|
||||
if (pmInfo->input)
|
||||
{
|
||||
found_dev = i;
|
||||
break;
|
||||
if (!strcmp(devname, pmInfo->name))
|
||||
{
|
||||
found_dev = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -279,16 +286,23 @@ osd_midi_device *osd_open_midi_output(const char *devname)
|
||||
PortMidiStream *stm;
|
||||
osd_midi_device *ret;
|
||||
|
||||
for (int i = 0; i < num_devs; i++)
|
||||
if (!strcmp("default", devname))
|
||||
{
|
||||
pmInfo = Pm_GetDeviceInfo(i);
|
||||
|
||||
if (pmInfo->output)
|
||||
found_dev = Pm_GetDefaultOutputDeviceID();
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < num_devs; i++)
|
||||
{
|
||||
if (!strcmp(devname, pmInfo->name))
|
||||
pmInfo = Pm_GetDeviceInfo(i);
|
||||
|
||||
if (pmInfo->output)
|
||||
{
|
||||
found_dev = i;
|
||||
break;
|
||||
if (!strcmp(devname, pmInfo->name))
|
||||
{
|
||||
found_dev = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user