mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-16 00:27:58 +00:00
abstract classes must take the options object
no passing in individual parameters. This simplifies the code a little
This commit is contained in:
parent
2f7d4111ee
commit
923940576c
2 changed files with 5 additions and 13 deletions
|
@ -69,12 +69,8 @@ extends ToneWithContext<Options> {
|
|||
});
|
||||
}
|
||||
|
||||
constructor(options: Partial<ToneAudioNodeOptions>);
|
||||
constructor() {
|
||||
super(optionsFromArguments(ToneAudioNode.getDefaults(), arguments, ["context"]));
|
||||
|
||||
const options = optionsFromArguments(ToneAudioNode.getDefaults(), arguments, ["context"]);
|
||||
|
||||
constructor(options: ToneAudioNodeOptions) {
|
||||
super(options);
|
||||
this.numberOfInputs = options.numberOfInputs;
|
||||
this.numberOfOutputs = options.numberOfOutputs;
|
||||
}
|
||||
|
|
|
@ -94,15 +94,11 @@ export abstract class Source<Options extends SourceOptions> extends ToneAudioNod
|
|||
private _syncedStart: (time: Seconds, offset: Seconds) => void = noOp;
|
||||
private _syncedStop: (time: Seconds) => void = noOp;
|
||||
|
||||
constructor(options: Partial<SourceOptions>);
|
||||
constructor() {
|
||||
|
||||
super(optionsFromArguments(Volume.getDefaults(), arguments, ["volume"]));
|
||||
const options = optionsFromArguments(Volume.getDefaults(), arguments, ["volume"]);
|
||||
|
||||
constructor(options: SourceOptions) {
|
||||
super(options);
|
||||
readOnly(this, "volume");
|
||||
this._state.memory = 100;
|
||||
this.volume.value = options.volume;
|
||||
this.volume.setValueAtTime(options.volume, 0);
|
||||
// set mute initially
|
||||
this.mute = options.mute;
|
||||
|
||||
|
|
Loading…
Reference in a new issue