From 01dddc300e84a1124ad3aff0d19b893f647056af Mon Sep 17 00:00:00 2001 From: Albert Graef Date: Sat, 22 Jul 2023 20:14:16 +0200 Subject: [PATCH] Old port names are now the 1st alias with both rawmidi and seqmidi. 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 #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.) --- linux/alsa/alsa_rawmidi.c | 2 +- linux/alsa/alsa_seqmidi.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/linux/alsa/alsa_rawmidi.c b/linux/alsa/alsa_rawmidi.c index 5d0053518..bf9aa8e83 100644 --- a/linux/alsa/alsa_rawmidi.c +++ b/linux/alsa/alsa_rawmidi.c @@ -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); } diff --git a/linux/alsa/alsa_seqmidi.c b/linux/alsa/alsa_seqmidi.c index 3f40b3718..391d61f02 100644 --- a/linux/alsa/alsa_seqmidi.c +++ b/linux/alsa/alsa_seqmidi.c @@ -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)