mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-15 08:17:07 +00:00
setting parameters as readonly
This commit is contained in:
parent
b217fc45ac
commit
989abb9697
2 changed files with 6 additions and 3 deletions
|
@ -51,7 +51,7 @@ export class PulseOscillator extends Source<PulseOscillatorOptions> implements T
|
|||
/**
|
||||
* The width of the pulse.
|
||||
*/
|
||||
width: Signal<"audioRange">;
|
||||
readonly width: Signal<"audioRange">;
|
||||
|
||||
/**
|
||||
* gate the width amount
|
||||
|
@ -69,12 +69,12 @@ export class PulseOscillator extends Source<PulseOscillatorOptions> implements T
|
|||
/**
|
||||
* The frequency control.
|
||||
*/
|
||||
frequency: Signal<"frequency">;
|
||||
readonly frequency: Signal<"frequency">;
|
||||
|
||||
/**
|
||||
* The detune in cents.
|
||||
*/
|
||||
detune: Signal<"cents">;
|
||||
readonly detune: Signal<"cents">;
|
||||
|
||||
/**
|
||||
* Threshold the signal to turn it into a square
|
||||
|
|
|
@ -3,6 +3,7 @@ import { Param } from "../../core/context/Param";
|
|||
import { Cents, Frequency, Seconds, Time } from "../../core/type/Units";
|
||||
import { optionsFromArguments } from "../../core/util/Defaults";
|
||||
import { OneShotSource, OneShotSourceOptions } from "../OneShotSource";
|
||||
import { readOnly } from "../../core/util/Interface";
|
||||
|
||||
export interface ToneOscillatorNodeOptions extends OneShotSourceOptions {
|
||||
frequency: Frequency;
|
||||
|
@ -67,6 +68,8 @@ export class ToneOscillatorNode extends OneShotSource<ToneOscillatorNodeOptions>
|
|||
units: "cents",
|
||||
value: options.detune,
|
||||
});
|
||||
|
||||
readOnly(this, ["frequency", "detune"]);
|
||||
}
|
||||
|
||||
static getDefaults(): ToneOscillatorNodeOptions {
|
||||
|
|
Loading…
Reference in a new issue