mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-09 16:55:42 +01:00
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:
parent
f92e100b56
commit
3a7f46c00f
2 changed files with 8 additions and 0 deletions
|
@ -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))
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Reference in a new issue