Skip to content

Commit

Permalink
Old port names are now the 1st alias with both rawmidi and seqmidi.
Browse files Browse the repository at this point in the history
To these ends, swap the 1st and 2nd alias of rawmidi and seqmidi, so
that the old generic port names become the 1st alias.

This was suggested by @nedko in jackaudio#945 and seems to be a prudent choice in
order to offer as much backward compatibility as possible. (We keep the
2nd aliases around, too. If a Jack2 client wants to change these, it
should be prepared to first empty the slot anyway.)
  • Loading branch information
agraef committed Jul 22, 2023
1 parent 00b091f commit 01dddc3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion linux/alsa/alsa_rawmidi.c
Original file line number Diff line number Diff line change
Expand Up @@ -470,8 +470,8 @@ inline int midi_port_open_jack(alsa_rawmidi_t *midi, midi_port_t *port, int type
type | JackPortIsPhysical | JackPortIsTerminal, 0);

if (port->jack) {
jack_port_set_alias(port->jack, alias);
jack_port_set_alias(port->jack, old_name);
jack_port_set_alias(port->jack, alias);
jack_port_set_default_metadata(port->jack, port->device_name);
}

Expand Down
2 changes: 1 addition & 1 deletion linux/alsa/alsa_seqmidi.c
Original file line number Diff line number Diff line change
Expand Up @@ -552,9 +552,9 @@ port_t* port_create(alsa_seqmidi_t *self, int type, snd_seq_addr_t addr, const s
if (!isalnum(*c) && *c != '/' && *c != '_' && *c != ':' && *c != '(' && *c != ')')
*c = '-';

jack_port_set_alias (port->jack_port, port->name);
// set the old port name as an alias -ag
jack_port_set_alias (port->jack_port, old_name);
jack_port_set_alias (port->jack_port, port->name);
jack_port_set_default_metadata (port->jack_port, device_name);

if (type == PORT_INPUT)
Expand Down

0 comments on commit 01dddc3

Please sign in to comment.