Index | Thread | Search

From:
Alexandre Ratchov <alex@caoua.org>
Subject:
Re: sndiod: per-program (instead of per-client) level control
To:
Omar Polo <op@omarpolo.com>
Cc:
tech@openbsd.org
Date:
Tue, 17 Jun 2025 17:59:17 +0200

Download raw body.

Thread
On Tue, Jun 17, 2025 at 02:13:07PM +0200, Omar Polo wrote:
> > [...]
> > +	i = 0;
> > +	s = slot_array;
> > +	while (1) {
> > +		if (i == DEV_NSLOT) {
> > +			logx(1, "%s: too many connections", a->name);
> > +			return NULL;
> >  		}
> > +		if (s->ops == NULL)
> > +			break;
> > +		i++;
> > +		s++;
> >  	}
> 
> I feel like a for loop would be slightly more readable here
> 
> 	s = slot_array;
> 	for (i = 0; i < DEV_NSLOT; i++, s++)
> 		if (s->ops == NULL)
> 			break;
> 	if (i == DEV_NSLOT) {
> 		logx(...)
> 		return NULL;
> 	}
> 

Yes, this is the pattern already used in many places, indeed no need
to make an exception here. Fixed (locally), thanks.

> > [...]
> > Index: sndiod.8
> > ===================================================================
> > RCS file: /cvs/src/usr.bin/sndiod/sndiod.8,v
> > diff -u -p -r1.17 sndiod.8
> > --- sndiod.8	3 May 2024 16:47:15 -0000	1.17
> > +++ sndiod.8	16 Jun 2025 18:17:58 -0000
> > @@ -440,12 +440,13 @@ exposes the audio device clock
> >  and allows audio device properties to be controlled
> >  through MIDI.
> >  .Pp
> > -A MIDI channel is assigned to each stream, and the volume
> > +A MIDI channel is assigned to each program, and the volume
> >  is changed using the standard volume controller (number 7).
> >  Similarly, when the audio client changes its volume,
> >  the same MIDI controller message is sent out; it can be used
> >  for instance for monitoring or as feedback for motorized
> >  faders.
> > +If there are multiple instances of the same program they will share the same setting.
> 
> This line should be folded, (my xterm and) man -Tlint complain it's
> longer than 80 column :p

Fixed using sthen's wording, thanks