mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibWeb/WebAudio: Implement automation rate constraints
Some nodes have parameters whose automation rate is not allowed to be changed. This change enforces that constraint for all parameters it applies to.
This commit is contained in:
parent
575edf8a90
commit
c87f80454b
Notes:
github-actions[bot]
2025-01-19 16:25:50 +00:00
Author: https://github.com/tcl3
Commit: c87f80454b
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3301
6 changed files with 316 additions and 13 deletions
|
@ -18,7 +18,11 @@ class AudioParam final : public Bindings::PlatformObject {
|
|||
GC_DECLARE_ALLOCATOR(AudioParam);
|
||||
|
||||
public:
|
||||
static GC::Ref<AudioParam> create(JS::Realm&, GC::Ref<BaseAudioContext>, float default_value, float min_value, float max_value, Bindings::AutomationRate);
|
||||
enum class FixedAutomationRate {
|
||||
No,
|
||||
Yes,
|
||||
};
|
||||
static GC::Ref<AudioParam> create(JS::Realm&, GC::Ref<BaseAudioContext>, float default_value, float min_value, float max_value, Bindings::AutomationRate, FixedAutomationRate = FixedAutomationRate::No);
|
||||
|
||||
virtual ~AudioParam() override;
|
||||
|
||||
|
@ -43,7 +47,7 @@ public:
|
|||
WebIDL::ExceptionOr<GC::Ref<AudioParam>> cancel_and_hold_at_time(double cancel_time);
|
||||
|
||||
private:
|
||||
AudioParam(JS::Realm&, GC::Ref<BaseAudioContext>, float default_value, float min_value, float max_value, Bindings::AutomationRate);
|
||||
AudioParam(JS::Realm&, GC::Ref<BaseAudioContext>, float default_value, float min_value, float max_value, Bindings::AutomationRate, FixedAutomationRate = FixedAutomationRate::No);
|
||||
|
||||
GC::Ref<BaseAudioContext> m_context;
|
||||
|
||||
|
@ -57,6 +61,8 @@ private:
|
|||
|
||||
Bindings::AutomationRate m_automation_rate {};
|
||||
|
||||
FixedAutomationRate m_fixed_automation_rate { FixedAutomationRate::No };
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue