1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:07:34 +00:00

WindowServer: Add an audio icon to the menu bar

Clicking on this icon toggles the AudioServer muted state.

It currently does not react to muted state changes caused by other
programs, since it has no way of learning about those from AudioServer,
other than performing a synchronous IPC call (GetMuted), which we don't
want to be doing in the WindowServer :^)
This commit is contained in:
Andreas Kling 2019-11-22 22:15:39 +01:00
parent 6fbe0f17f2
commit 9009390f9c
5 changed files with 40 additions and 1 deletions

View file

@ -6,6 +6,8 @@
#include <WindowServer/WSCPUMonitor.h>
#include <WindowServer/WSWindow.h>
class AClientConnection;
class WSMenuManager final : public CObject {
C_OBJECT(WSMenuManager)
public:
@ -50,6 +52,14 @@ private:
WeakPtr<WSMenu> m_current_menu;
Vector<WeakPtr<WSMenu>> m_open_menu_stack;
RefPtr<GraphicsBitmap> m_muted_bitmap;
RefPtr<GraphicsBitmap> m_unmuted_bitmap;
OwnPtr<AClientConnection> m_audio_client;
Rect m_audio_rect;
bool m_needs_window_resize { false };
bool m_bar_open { false };
bool m_audio_muted { false };
};