diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2006-05-02 15:43:07 +0200 |
---|---|---|
committer | Clemens Ladisch <clemens@ladisch.de> | 2006-05-02 15:43:07 +0200 |
commit | 3a7f46c00f94bee3f236ca61c2906d7e9d1717c3 (patch) | |
tree | 406af37534c34ce02a11b4be21d22936bda338d1 /seq/aplaymidi | |
parent | f92e100b56bd2fff683315ff4d319ce379665069 (diff) | |
download | alsa-utils-3a7f46c00f94bee3f236ca61c2906d7e9d1717c3.tar.gz |
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.
Diffstat (limited to 'seq/aplaymidi')
-rw-r--r-- | seq/aplaymidi/aplaymidi.c | 4 | ||||
-rw-r--r-- | seq/aplaymidi/arecordmidi.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/seq/aplaymidi/aplaymidi.c b/seq/aplaymidi/aplaymidi.c index 625e9e9..c2819d0 100644 --- a/seq/aplaymidi/aplaymidi.c +++ b/seq/aplaymidi/aplaymidi.c @@ -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)) diff --git a/seq/aplaymidi/arecordmidi.c b/seq/aplaymidi/arecordmidi.c index c8e2865..243ec56 100644 --- a/seq/aplaymidi/arecordmidi.c +++ b/seq/aplaymidi/arecordmidi.c @@ -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)) |