Try to be more clever about what sink to use for volume control

Authored by drosca on Jul 22 2016, 7:49 PM.

Description

Try to be more clever about what sink to use for volume control

This changes the applet to display volume icon and control volume
through scroll / global shortcuts of "preferred" sink.

Preferred sink is currently chosen according to these rules:

  • if there is only one sink, that sink is preferred
  • if there is some sink that is currently playing some sound, that sink is preferred (if default sink is playing sound, default sink is used instead)
  • if there is some sink that is currently idle (there are streams on the device, but not currently playing), that one sink is preferred (same exception for default sink is used here as in case above)

This should help with changing the volume of correct audio device in
most cases.

BUG: 365771

Differential Revision: https://phabricator.kde.org/D2270