diff options
author | Luciano Iam <lucianito@gmail.com> | 2019-09-29 03:00:04 +0200 |
---|---|---|
committer | Filipe Coelho <falktx@falktx.com> | 2019-10-05 21:27:37 +0100 |
commit | 0f015fc53b6e16f0479329ecb3d50ed18d8c2417 (patch) | |
tree | ac4ff0bf1c0f822b413ced880bcf544fb24103e6 /linux | |
parent | a11fa07e5e5769222d4fe5d8bc328cb03cd594f1 (diff) | |
download | jack2-0f015fc53b6e16f0479329ecb3d50ed18d8c2417.tar.gz |
Set pretty-name for ALSA seq MIDI ports
Diffstat (limited to 'linux')
-rw-r--r-- | linux/alsa/alsa_seqmidi.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/linux/alsa/alsa_seqmidi.c b/linux/alsa/alsa_seqmidi.c index a59e3e82..109e68c6 100644 --- a/linux/alsa/alsa_seqmidi.c +++ b/linux/alsa/alsa_seqmidi.c @@ -493,8 +493,9 @@ port_t* port_create(alsa_seqmidi_t *self, int type, snd_seq_addr_t addr, const s snd_seq_client_info_alloca (&client_info); snd_seq_get_any_client_info (self->seq, addr.client, client_info); + const char *device_name = snd_seq_client_info_get_name(client_info); snprintf(port->name, sizeof(port->name), "alsa_pcm:%s/midi_%s_%d", - snd_seq_client_info_get_name(client_info), port_type[type].name, addr.port+1); + device_name, port_type[type].name, addr.port+1); // replace all offending characters by - for (c = port->name; *c; ++c) @@ -510,9 +511,9 @@ port_t* port_create(alsa_seqmidi_t *self, int type, snd_seq_addr_t addr, const s } if (jack_caps & JackPortIsOutput) - snprintf(name, sizeof(name), "system:midi_capture_%d", ++self->midi_in_cnt); + snprintf(name, sizeof(name), "system_midi:capture_%d", ++self->midi_in_cnt); else - snprintf(name, sizeof(name), "system:midi_playback_%d", ++self->midi_out_cnt); + snprintf(name, sizeof(name), "system_midi:playback_%d", ++self->midi_out_cnt); port->jack_port = jack_port_register(self->jack, name, JACK_DEFAULT_MIDI_TYPE, jack_caps, 0); @@ -520,6 +521,7 @@ port_t* port_create(alsa_seqmidi_t *self, int type, snd_seq_addr_t addr, const s goto failed; jack_port_set_alias (port->jack_port, port->name); + jack_port_set_device_metadata (port->jack_port, device_name); /* generate an alias */ @@ -532,6 +534,7 @@ port_t* port_create(alsa_seqmidi_t *self, int type, snd_seq_addr_t addr, const s *c = '-'; jack_port_set_alias (port->jack_port, port->name); + jack_port_set_device_metadata (port->jack_port, device_name); if (type == PORT_INPUT) err = alsa_connect_from(self, port->remote.client, port->remote.port); |