ladybird/Libraries/LibWeb/WebAudio/ControlMessage.h
Ben Eidson d942b98549 LibWeb/WebAudio: Add stable IDs to AudioNodes
Modeled after UniqueNodeID and uses incremental counter on
BaseAudioContext to assign IDs.
2026-01-23 15:03:43 +01:00

29 lines
521 B
C++

/*
* Copyright (c) 2025-2026, Ben Eidson <b.e.eidson@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Variant.h>
#include <LibWeb/WebAudio/Types.h>
namespace Web::WebAudio {
struct StartSource {
NodeID node_id { 0 };
double when { 0.0 };
};
struct StopSource {
NodeID node_id { 0 };
double when { 0.0 };
};
// FIXME: add more message types
// https://webaudio.github.io/web-audio-api/#control-message
using ControlMessage = Variant<StartSource, StopSource>;
}