diff --git a/src/Bar.cpp b/src/Bar.cpp index 3c06d9d..3283d6c 100644 --- a/src/Bar.cpp +++ b/src/Bar.cpp @@ -286,8 +286,8 @@ namespace Bar Widget* audioSlider; Widget* micSlider; - Text* audioIcon; - Text* micIcon; + Button* audioIcon; + Button* micIcon; void OnChangeVolumeSink(Slider&, double value) { System::SetVolumeSink(value); @@ -315,6 +315,18 @@ namespace Bar System::SetVolumeSource(micVolume); } + void OnToggleSink(Button& button) + { + System::AudioInfo info = System::GetAudioInfo(); + System::SetMutedSink(!info.sinkMuted); + } + + void OnToggleSource(Button& button) + { + System::AudioInfo info = System::GetAudioInfo(); + System::SetMutedSource(!info.sourceMuted); + } + TimerResult UpdateAudio(Widget&) { System::AudioInfo info = System::GetAudioInfo(); @@ -344,7 +356,7 @@ namespace Bar } else { - ((Slider*)micSlider)->SetValue(info.sinkVolume); + ((Slider*)micSlider)->SetValue(info.sourceVolume); } if (info.sourceMuted) { @@ -605,18 +617,20 @@ namespace Bar Utils::SetTransform(*box, {-1, false, SideToAlignment(side)}); box->SetOrientation(Utils::GetOrientation()); { - auto icon = Widget::Create(); + auto icon = Widget::Create