Thanks for your response but I don't succeed to have something working :(
my code :
init:
if (snd_seq_open(&seq, "default", SND_SEQ_OPEN_DUPLEX, 0) >= 0) {
m_iClient = snd_seq_set_client_name(seq, "LiveMix");
m_iPort = snd_seq_create_simple_port(seq, "control", 0,
SND_SEQ_PORT_TYPE_MIDI_GENERIC | SND_SEQ_PORT_TYPE_SOFTWARE | SND_SEQ_PORT_TYPE_APPLICATION);
m_iMidi = snd_seq_create_simple_port(seq, "control",
SND_SEQ_PORT_CAP_READ | SND_SEQ_PORT_CAP_SUBS_READ | SND_SEQ_PORT_CAP_WRITE | SND_SEQ_PORT_CAP_SUBS_WRITE,
SND_SEQ_PORT_TYPE_APPLICATION);
} else {
qDebug() << "The ALSA MIDI system is not available. No ports based on it will be created";
}
get (to save) :
snd_seq_client_info_t *cinfo;
snd_seq_port_info_t *pinfo;
snd_seq_client_info_alloca(&cinfo);
snd_seq_port_info_alloca(&pinfo);
snd_seq_client_info_set_client(cinfo, -1);
snd_seq_port_info_set_client(pinfo, snd_seq_client_info_get_client(cinfo));
snd_seq_port_info_set_port(pinfo, m_iMidi);
snd_seq_query_subscribe_set_client(subs, m_iClient);
snd_seq_query_subscribe_set_port(subs, m_iMidi);
snd_seq_query_subscribe_set_type(subs, SND_SEQ_QUERY_SUBS_READ);
snd_seq_query_subscribe_set_index(subs, 0);
while (snd_seq_query_port_subscribers(seq, subs) >= 0) {
const snd_seq_addr_t *addr;
addr = snd_seq_query_subscribe_get_addr(subs);
qDebug()<<222<<addr->client<<addr->port;
snd_seq_query_subscribe_set_index(subs, snd_seq_query_subscribe_get_index(subs) + 1);
}
snd_seq_query_subscribe_alloca(&subs);
snd_seq_query_subscribe_set_client(subs, m_iClient);
snd_seq_query_subscribe_set_port(subs, m_iMidi);
snd_seq_query_subscribe_set_type(subs, SND_SEQ_QUERY_SUBS_WRITE);
snd_seq_query_subscribe_set_index(subs, 0);
while (snd_seq_query_port_subscribers(seq, subs) >= 0) {
const snd_seq_addr_t *addr;
addr = snd_seq_query_subscribe_get_addr(subs);
qDebug()<<333<<addr->client<<addr->port;
}
The first block seem to return all the client-port, the second return nothing. :(
Does anybody have an idea ?
Thanks in advance
Stéphane