ladybird/Userland/Libraries/LibWeb/WebAudio/OscillatorNode.idl
Shannon Booth 099c9e4a7e LibWeb: Implement OscillatorNode.type
This is a simple getter and setter of the OscillatorType enum, with
error checking to not allow 'custom', as that should only be changed
through 'setPeriodicWave()'.
2024-05-04 14:01:38 +02:00

29 lines
909 B
Text

#import <WebAudio/AudioScheduledSourceNode.idl>
#import <WebAudio/PeriodicWave.idl>
// https://webaudio.github.io/web-audio-api/#enumdef-oscillatortype
enum OscillatorType {
"sine",
"square",
"sawtooth",
"triangle",
"custom"
};
// https://webaudio.github.io/web-audio-api/#OscillatorOptions
dictionary OscillatorOptions : AudioNodeOptions {
OscillatorType type = "sine";
float frequency = 440;
float detune = 0;
PeriodicWave periodicWave;
};
// https://webaudio.github.io/web-audio-api/#OscillatorNode
[Exposed=Window]
interface OscillatorNode : AudioScheduledSourceNode {
constructor(BaseAudioContext context, optional OscillatorOptions options = {});
attribute OscillatorType type;
// FIXME: readonly attribute AudioParam frequency;
// FIXME: readonly attribute AudioParam detune;
// FIXME: undefined setPeriodicWave(PeriodicWave periodicWave);
};