falconindy / ponymix

CLI volume control for PulseAudio
MIT License
177 stars 27 forks source link

Provide a flag to set a custom cap for increase. #19

Closed kevincox closed 11 years ago

kevincox commented 11 years ago

Clamping the volume at 100% is a great feature but it would be nice to allow overriding this. It would be nice to have a flag that changed the cap value.

$ ponymix --max-vol 150 increase 10 # Can go over the max.
95
$ ponymix --max-vol 150 increase 10 # Same, and does.
105
$ ponymix increase 10 # Uses the default of 100, so doesn't change it.
105
falconindy commented 11 years ago

increase and decrease are bound by the caps -- however, set-volume is not (it has a higher cap).

kevincox commented 11 years ago

Yeah, but I want to use increase/decrease with a different cap. If I had to get the volume, add to it and set it using set-volume to get around the cap I may as well just use pacmd.

falconindy commented 11 years ago

I suppose it makes sense to have this configurable.

vodik commented 11 years ago

I've been poking at implementing this and its rather straightforward but interacts with set-volume:

Note that:

Maybe set-volume shouldn't clamp at all.

kevincox commented 11 years ago

Those are some really interesting points. Here are some of my thoughts

That being said I think that clamping increment and decrement by default make perfect sense, especially because a common use case is binding them to a key for volume control (I would imagine).

Putting a default maximum on set-volume makes sense so simple scripts don't make the sound garbage quality, but it also makes sense that set-volume simply sets the volume to what was passed in.

For set-volume I don't think there is a "correct" default but I would leave it how it is now, and if --max-volume is set use that as the limit both when higher and lower than the default. There should also be a way to unlimit it (-1 maybe, is there a use for 0 that it shouldn't be used?) if that isn't made the default.

Sorry for the long response, but I blabbered because I'm not really decided either way.

falconindy commented 11 years ago

I don't think it's that interesting. If you ignore --max-volume, then you get the sane defaults that I hardcode. If you pass --max-volume, then you can do whatever you want. It won't be my eardrums.

falconindy commented 11 years ago

Implemented in 92e4b9772a46f4b40b47df44fd3964c868e3c12f

kevincox commented 11 years ago

Thanks, it works great.