nicklan / pnmixer

Volume mixer for the system tray
GNU General Public License v3.0
152 stars 32 forks source link

Automatically reload audio when needed #171

Closed elboulangero closed 6 years ago

elboulangero commented 6 years ago

In case we're not working with the preferred card, we check if the preferred card is available when user does something (get/set the mute/volume).

We refrain from doing that too often though, since it involves querying alsa for the list of soundcard available, and then doing string comparison on every element of this list. It wouldn't be wise to do that for every user action: when the user is scrolling, that could be a bit heavy.

So we maintain a timestamp and force an minimum interval between two checks. At the moment I set it to 10 seconds.

nazar-pc commented 6 years ago

I'd really like to see this merged and released as new version. It works great from my testing so far.

elboulangero commented 6 years ago

I'm ok with merging that, @hasufell please click merge if you're ok as well, thx !

hasufell commented 6 years ago

Could you rebase the PR to see if the clang static analyzer passes?

elboulangero commented 6 years ago

Looks all good !