Lines Matching refs:seq

122 static void list_each_subs(snd_seq_t *seq, snd_seq_query_subscribe_t *subs, int type, const char *msg)
127 while (snd_seq_query_port_subscribers(seq, subs) >= 0) {
150 static void list_subscribers(snd_seq_t *seq, const snd_seq_addr_t *addr)
155 list_each_subs(seq, subs, SND_SEQ_QUERY_SUBS_READ, _("Connecting To"));
156 list_each_subs(seq, subs, SND_SEQ_QUERY_SUBS_WRITE, _("Connected From"));
162 typedef void (*action_func_t)(snd_seq_t *seq, snd_seq_client_info_t *cinfo, snd_seq_port_info_t *pinfo, int count);
164 static void do_search_port(snd_seq_t *seq, int perm, action_func_t do_action)
173 while (snd_seq_query_next_client(seq, cinfo) >= 0) {
182 while (snd_seq_query_next_port(seq, pinfo) >= 0) {
184 do_action(seq, cinfo, pinfo, count);
196 static void print_port(snd_seq_t *seq ATTRIBUTE_UNUSED,
240 static void print_port_and_subs(snd_seq_t *seq, snd_seq_client_info_t *cinfo,
243 print_port(seq, cinfo, pinfo, count);
244 list_subscribers(seq, snd_seq_port_info_get_addr(pinfo));
251 static void remove_connection(snd_seq_t *seq,
268 while (snd_seq_query_port_subscribers(seq, query) >= 0) {
272 if (snd_seq_get_any_port_info(seq, dest->client, dest->port, port) < 0 ||
281 if (snd_seq_unsubscribe_port(seq, subs) < 0) {
287 static void remove_all_connections(snd_seq_t *seq)
289 do_search_port(seq, 0, remove_connection);
325 snd_seq_t *seq;
384 if (snd_seq_open(&seq, "default", SND_SEQ_OPEN_DUPLEX, 0) < 0) {
393 do_search_port(seq, list_perm,
395 snd_seq_close(seq);
398 remove_all_connections(seq);
399 snd_seq_close(seq);
406 snd_seq_close(seq);
411 if ((client = snd_seq_client_id(seq)) < 0) {
412 snd_seq_close(seq);
418 if (snd_seq_set_client_name(seq, "ALSA Connector") < 0) {
419 snd_seq_close(seq);
425 if (snd_seq_parse_address(seq, &sender, argv[optind]) < 0) {
426 snd_seq_close(seq);
430 if (snd_seq_parse_address(seq, &dest, argv[optind + 1]) < 0) {
431 snd_seq_close(seq);
444 if (snd_seq_get_port_subscription(seq, subs) < 0) {
445 snd_seq_close(seq);
449 if (snd_seq_unsubscribe_port(seq, subs) < 0) {
450 snd_seq_close(seq);
455 if (snd_seq_get_port_subscription(seq, subs) == 0) {
456 snd_seq_close(seq);
460 if (snd_seq_subscribe_port(seq, subs) < 0) {
461 snd_seq_close(seq);
467 snd_seq_close(seq);