Merge remote-tracking branch 'jcorporation/idle'
This commit is contained in:
commit
5a7d2be77d
|
@ -231,6 +231,13 @@ Partition::OnMixerVolumeChanged(Mixer &, int) noexcept
|
|||
EmitIdle(IDLE_MIXER);
|
||||
}
|
||||
|
||||
void
|
||||
Partition::OnMixerChanged() noexcept
|
||||
{
|
||||
/* notify clients */
|
||||
EmitIdle(IDLE_MIXER);
|
||||
}
|
||||
|
||||
void
|
||||
Partition::OnIdleMonitor(unsigned mask) noexcept
|
||||
{
|
||||
|
|
|
@ -289,6 +289,7 @@ private:
|
|||
|
||||
/* virtual methods from class MixerListener */
|
||||
void OnMixerVolumeChanged(Mixer &mixer, int volume) noexcept override;
|
||||
void OnMixerChanged() noexcept override;
|
||||
|
||||
/* callback for #idle_monitor */
|
||||
void OnIdleMonitor(unsigned mask) noexcept;
|
||||
|
|
|
@ -30,6 +30,7 @@ class MixerListener {
|
|||
public:
|
||||
virtual void OnMixerVolumeChanged(Mixer &mixer,
|
||||
int volume) noexcept = 0;
|
||||
virtual void OnMixerChanged() noexcept = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include "Client.hxx"
|
||||
#include "mixer/Mixer.hxx"
|
||||
#include "mixer/Memento.hxx"
|
||||
#include "mixer/Listener.hxx"
|
||||
#include "Idle.hxx"
|
||||
|
||||
extern unsigned audio_output_state_version;
|
||||
|
@ -47,9 +48,10 @@ audio_output_enable_index(MultipleOutputs &outputs,
|
|||
|
||||
idle_add(IDLE_OUTPUT);
|
||||
|
||||
if (ao.GetMixer() != nullptr) {
|
||||
auto *mixer = ao.GetMixer();
|
||||
if (mixer != nullptr) {
|
||||
mixer_memento.InvalidateHardwareVolume();
|
||||
idle_add(IDLE_MIXER);
|
||||
mixer->listener.OnMixerChanged();
|
||||
}
|
||||
|
||||
ao.GetClient().ApplyEnabled();
|
||||
|
@ -77,7 +79,7 @@ audio_output_disable_index(MultipleOutputs &outputs,
|
|||
if (mixer != nullptr) {
|
||||
mixer->LockClose();
|
||||
mixer_memento.InvalidateHardwareVolume();
|
||||
idle_add(IDLE_MIXER);
|
||||
mixer->listener.OnMixerChanged();
|
||||
}
|
||||
|
||||
ao.GetClient().ApplyEnabled();
|
||||
|
@ -104,7 +106,7 @@ audio_output_toggle_index(MultipleOutputs &outputs,
|
|||
if (mixer != nullptr) {
|
||||
mixer->LockClose();
|
||||
mixer_memento.InvalidateHardwareVolume();
|
||||
idle_add(IDLE_MIXER);
|
||||
mixer->listener.OnMixerChanged();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
class NullMixerListener : public MixerListener {
|
||||
public:
|
||||
void OnMixerVolumeChanged(Mixer &, int) noexcept override {}
|
||||
virtual void OnMixerChanged() noexcept override {}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue