Home | History | Annotate | Download | only in aconnect

Lines Matching refs:seq

99 static void list_each_subs(snd_seq_t *seq, snd_seq_query_subscribe_t *subs, int type, const char *msg)
104 while (snd_seq_query_port_subscribers(seq, subs) >= 0) {
127 static void list_subscribers(snd_seq_t *seq, const snd_seq_addr_t *addr)
132 list_each_subs(seq, subs, SND_SEQ_QUERY_SUBS_READ, _("Connecting To"));
133 list_each_subs(seq, subs, SND_SEQ_QUERY_SUBS_WRITE, _("Connected From"));
139 typedef void (*action_func_t)(snd_seq_t *seq, snd_seq_client_info_t *cinfo, snd_seq_port_info_t *pinfo, int count);
141 static void do_search_port(snd_seq_t *seq, int perm, action_func_t do_action)
150 while (snd_seq_query_next_client(seq, cinfo) >= 0) {
155 while (snd_seq_query_next_port(seq, pinfo) >= 0) {
157 do_action(seq, cinfo, pinfo, count);
165 static void print_port(snd_seq_t *seq, snd_seq_client_info_t *cinfo,
180 static void print_port_and_subs(snd_seq_t *seq, snd_seq_client_info_t *cinfo,
183 print_port(seq, cinfo, pinfo, count);
184 list_subscribers(seq, snd_seq_port_info_get_addr(pinfo));
191 static void remove_connection(snd_seq_t *seq, snd_seq_client_info_t *cinfo,
201 for (; snd_seq_query_port_subscribers(seq, query) >= 0;
208 if (snd_seq_get_any_port_info(seq, dest->client, dest->port, port) < 0)
218 snd_seq_unsubscribe_port(seq, subs);
223 for (; snd_seq_query_port_subscribers(seq, query) >= 0;
230 if (snd_seq_get_any_port_info(seq, sender->client, sender->port, port) < 0)
240 snd_seq_unsubscribe_port(seq, subs);
244 static void remove_all_connections(snd_seq_t *seq)
246 do_search_port(seq, 0, remove_connection);
273 snd_seq_t *seq;
325 if (snd_seq_open(&seq, "default", SND_SEQ_OPEN_DUPLEX, 0) < 0) {
334 do_search_port(seq, list_perm,
336 snd_seq_close(seq);
339 remove_all_connections(seq);
340 snd_seq_close(seq);
347 snd_seq_close(seq);
352 if ((client = snd_seq_client_id(seq)) < 0) {
353 snd_seq_close(seq);
359 if (snd_seq_set_client_name(seq, "ALSA Connector") < 0) {
360 snd_seq_close(seq);
366 if (snd_seq_parse_address(seq, &sender, argv[optind]) < 0) {
367 snd_seq_close(seq);
371 if (snd_seq_parse_address(seq, &dest, argv[optind + 1]) < 0) {
372 snd_seq_close(seq);
385 if (snd_seq_get_port_subscription(seq, subs) < 0) {
386 snd_seq_close(seq);
390 if (snd_seq_unsubscribe_port(seq, subs) < 0) {
391 snd_seq_close(seq);
396 if (snd_seq_get_port_subscription(seq, subs) == 0) {
397 snd_seq_close(seq);
401 if (snd_seq_subscribe_port(seq, subs) < 0) {
402 snd_seq_close(seq);
408 snd_seq_close(seq);