ladybird/Userland/Libraries/LibWeb/HTML/AudioPlayState.h
Timothy Flynn f61f55d397 LibWeb+LibWebView+WebContent: Support muting an entire page
This adds an IPC for chromes to mute a tab. When muted, we trigger an
internal volume change notification and indicate that the user agent has
overriden the media volume.
2024-03-30 19:28:20 +01:00

36 lines
535 B
C++

/*
* Copyright (c) 2024, Tim Flynn <trflynn89@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Assertions.h>
namespace Web::HTML {
enum class AudioPlayState {
Paused,
Playing,
};
enum class MuteState {
Muted,
Unmuted,
};
constexpr MuteState invert_mute_state(MuteState mute_state)
{
switch (mute_state) {
case MuteState::Muted:
return MuteState::Unmuted;
case MuteState::Unmuted:
return MuteState::Muted;
}
VERIFY_NOT_REACHED();
}
}