diff options
Diffstat (limited to 'usr.bin/sndiod/midi.c')
-rw-r--r-- | usr.bin/sndiod/midi.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/usr.bin/sndiod/midi.c b/usr.bin/sndiod/midi.c index d84bd3aa971..d3bd018de32 100644 --- a/usr.bin/sndiod/midi.c +++ b/usr.bin/sndiod/midi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: midi.c,v 1.23 2020/01/23 05:27:17 ratchov Exp $ */ +/* $OpenBSD: midi.c,v 1.24 2020/04/25 05:03:54 ratchov Exp $ */ /* * Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org> * @@ -190,6 +190,25 @@ midi_tag(struct midi *ep, unsigned int tag) } /* + * return the list of tags + */ +unsigned int +midi_tags(struct midi *ep) +{ + int i; + struct midithru *t; + unsigned int tags; + + tags = 0; + for (i = 0; i < MIDITHRU_NMAX; i++) { + t = midithru + i; + if ((t->txmask | t->rxmask) & ep->self) + tags |= 1 << i; + } + return tags; +} + +/* * broadcast the given message to other endpoints */ void |