From e89e87ba9434cfa052ee19c502f40dec31a6bc4d Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 4 Mar 2021 20:38:15 +0100 Subject: [PATCH] alsa-seq: generate the same name as a2jmidid It is more descriptive and more compatible. If we change Midi-Bridge to a2j, some apps will parse our port names in a special way, even (catia). --- spa/plugins/alsa/alsa-seq-bridge.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/spa/plugins/alsa/alsa-seq-bridge.c b/spa/plugins/alsa/alsa-seq-bridge.c index 29ec8b1cf..fe6fc8daf 100644 --- a/spa/plugins/alsa/alsa-seq-bridge.c +++ b/spa/plugins/alsa/alsa-seq-bridge.c @@ -226,7 +226,7 @@ static inline void clean_name(char *name) { char *c; for (c = name; *c; ++c) { - if (!isalnum(*c) && strchr(" /_:()", *c) == NULL) + if (!isalnum(*c) && strchr(" /_:()[]", *c) == NULL) *c = '-'; } } @@ -254,10 +254,12 @@ static void emit_port_info(struct seq_state *this, struct seq_port *port, bool f snd_seq_get_any_client_info(this->sys.hndl, port->addr.client, client_info); - snprintf(name, sizeof(name), "%s:%s_%d", + snprintf(name, sizeof(name), "%s [%d] (%s): [%d] %s", snd_seq_client_info_get_name(client_info), + port->addr.client, port->direction == SPA_DIRECTION_OUTPUT ? "capture" : "playback", - port->addr.port); + port->addr.port, + snd_seq_port_info_get_name(info)); clean_name(name); snprintf(path, sizeof(path), "alsa:seq:%s:client_%d:%s_%d",