falconindy / ponymix

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

Support checking for headphones #24

Closed nogweii closed 10 years ago

nogweii commented 10 years ago

Codifying #23. This checks the active port's jack, to see if it's 'available'. Not all devices support that, which will return PA_PORT_AVAILABLE_UNKNOWN. Those are presented as not having headphones plugged in.

Not sure if this really matches your own style, it's been a long time since I programmed C++.

falconindy commented 10 years ago

I'm already playing with this locally. FYI your patch will cause segfaults on my desktop and laptop, where info->active_port is NULL.

nogweii commented 10 years ago

I'm already playing with this locally Oh, cool!

FYI your patch will cause segfaults on my desktop and laptop, where info->active_port is NULL. Yeah, I just found that as well.

Should I close this then and leave the issue open?

falconindy commented 10 years ago

I suppose. I can push what I have to a remote branch if you want to play with it and see how it works. I'm also making zero commitments to anything for the next week while I'm on vacation.

falconindy commented 10 years ago

See the 'available' branch.

falconindy commented 10 years ago

Added in ec1ce20be1dc307