aplaymidi: list only MIDI-capable ports

When listing ports with aplaymidi/arecordmidi, show only
ports that understand MIDI messages, i.e., that have the
SND_SEQ_PORT_TYPE_MIDI_GENERIC flag set.
This commit is contained in:
Clemens Ladisch 2006-05-02 15:43:07 +02:00
parent f92e100b56
commit 3a7f46c00f
2 changed files with 8 additions and 0 deletions

View file

@ -786,6 +786,10 @@ static void list_ports(void)
snd_seq_port_info_set_client(pinfo, client);
snd_seq_port_info_set_port(pinfo, -1);
while (snd_seq_query_next_port(seq, pinfo) >= 0) {
/* port must understand MIDI messages */
if (!(snd_seq_port_info_get_type(pinfo)
& SND_SEQ_PORT_TYPE_MIDI_GENERIC))
continue;
/* we need both WRITE and SUBS_WRITE */
if ((snd_seq_port_info_get_capability(pinfo)
& (SND_SEQ_PORT_CAP_WRITE | SND_SEQ_PORT_CAP_SUBS_WRITE))

View file

@ -659,6 +659,10 @@ static void list_ports(void)
snd_seq_port_info_set_client(pinfo, client);
snd_seq_port_info_set_port(pinfo, -1);
while (snd_seq_query_next_port(seq, pinfo) >= 0) {
/* port must understand MIDI messages */
if (!(snd_seq_port_info_get_type(pinfo)
& SND_SEQ_PORT_TYPE_MIDI_GENERIC))
continue;
/* we need both READ and SUBS_READ */
if ((snd_seq_port_info_get_capability(pinfo)
& (SND_SEQ_PORT_CAP_READ | SND_SEQ_PORT_CAP_SUBS_READ))