Commit 8de9ecbb authored by sletz's avatar sletz
Browse files

Fix alsa_seq port naming.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3028 0c269be4-1314-0410-8aa9-9f06e86f4224
parent c5cb9d89
......@@ -424,7 +424,7 @@ void midi_port_init(const alsa_rawmidi_t *midi, midi_port_t *port, snd_rawmidi_i
static
inline int midi_port_open_jack(alsa_rawmidi_t *midi, midi_port_t *port, int type, const char *alias)
{
char name[64];
char name[128];
if (type & JackPortIsOutput)
snprintf(name, sizeof(name) - 1, "system:midi_capture_%d", ++midi->midi_in_cnt);
......
......@@ -464,6 +464,7 @@ port_t* port_create(alsa_seqmidi_t *self, int type, snd_seq_addr_t addr, const s
char *c;
int err;
int jack_caps;
char name[128];
port = calloc(1, sizeof(port_t));
if (!port)
......@@ -474,7 +475,7 @@ 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);
snprintf(port->name, sizeof(port->name), "%s/midi_%s_%d",
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);
// replace all offending characters by -
......@@ -489,12 +490,19 @@ port_t* port_create(alsa_seqmidi_t *self, int type, snd_seq_addr_t addr, const s
if (snd_seq_port_info_get_type (info) & (SND_SEQ_PORT_TYPE_HARDWARE|SND_SEQ_PORT_TYPE_PORT|SND_SEQ_PORT_TYPE_SPECIFIC)) {
jack_caps |= (JackPortIsPhysical|JackPortIsTerminal);
}
if (jack_caps & JackPortIsOutput)
snprintf(name, sizeof(name) - 1, "system:midi_capture_%d", ++self->midi_in_cnt);
else
snprintf(name, sizeof(name) - 1, "system:midi_playback_%d", ++self->midi_out_cnt);
port->jack_port = jack_port_register(self->jack,
port->name, JACK_DEFAULT_MIDI_TYPE, jack_caps, 0);
name, JACK_DEFAULT_MIDI_TYPE, jack_caps, 0);
if (!port->jack_port)
goto failed;
jack_port_set_alias (port->jack_port, port->name);
/* generate an alias */
snprintf(port->name, sizeof(port->name), "%s:midi/%s_%d",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment