1 | import { AbstractParam } from "../core/context/AbstractParam.js";
|
2 | import { Param } from "../core/context/Param.js";
|
3 | import { InputNode, OutputNode, ToneAudioNode, ToneAudioNodeOptions } from "../core/context/ToneAudioNode.js";
|
4 | import { Time, UnitMap, UnitName } from "../core/type/Units.js";
|
5 | import { ToneConstantSource } from "./ToneConstantSource.js";
|
6 | export interface SignalOptions<TypeName extends UnitName> extends ToneAudioNodeOptions {
|
7 | value: UnitMap[TypeName];
|
8 | units: TypeName;
|
9 | convert: boolean;
|
10 | minValue?: number;
|
11 | maxValue?: number;
|
12 | }
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 | export declare class Signal<TypeName extends UnitName = "number"> extends ToneAudioNode<SignalOptions<any>> implements AbstractParam<TypeName> {
|
33 | readonly name: string;
|
34 | |
35 |
|
36 |
|
37 | readonly override: boolean;
|
38 | |
39 |
|
40 |
|
41 | protected _constantSource: ToneConstantSource<TypeName>;
|
42 | readonly output: OutputNode;
|
43 | protected _param: Param<TypeName>;
|
44 | readonly input: InputNode;
|
45 | |
46 |
|
47 |
|
48 |
|
49 | constructor(value?: UnitMap[TypeName], units?: TypeName);
|
50 | constructor(options?: Partial<SignalOptions<TypeName>>);
|
51 | static getDefaults(): SignalOptions<any>;
|
52 | connect(destination: InputNode, outputNum?: number, inputNum?: number): this;
|
53 | dispose(): this;
|
54 | setValueAtTime(value: UnitMap[TypeName], time: Time): this;
|
55 | getValueAtTime(time: Time): UnitMap[TypeName];
|
56 | setRampPoint(time: Time): this;
|
57 | linearRampToValueAtTime(value: UnitMap[TypeName], time: Time): this;
|
58 | exponentialRampToValueAtTime(value: UnitMap[TypeName], time: Time): this;
|
59 | exponentialRampTo(value: UnitMap[TypeName], rampTime: Time, startTime?: Time): this;
|
60 | linearRampTo(value: UnitMap[TypeName], rampTime: Time, startTime?: Time): this;
|
61 | targetRampTo(value: UnitMap[TypeName], rampTime: Time, startTime?: Time): this;
|
62 | exponentialApproachValueAtTime(value: UnitMap[TypeName], time: Time, rampTime: Time): this;
|
63 | setTargetAtTime(value: UnitMap[TypeName], startTime: Time, timeConstant: number): this;
|
64 | setValueCurveAtTime(values: UnitMap[TypeName][], startTime: Time, duration: Time, scaling?: number): this;
|
65 | cancelScheduledValues(time: Time): this;
|
66 | cancelAndHoldAtTime(time: Time): this;
|
67 | rampTo(value: UnitMap[TypeName], rampTime: Time, startTime?: Time): this;
|
68 | get value(): UnitMap[TypeName];
|
69 | set value(value: UnitMap[TypeName]);
|
70 | get convert(): boolean;
|
71 | set convert(convert: boolean);
|
72 | get units(): UnitName;
|
73 | get overridden(): boolean;
|
74 | set overridden(overridden: boolean);
|
75 | get maxValue(): number;
|
76 | get minValue(): number;
|
77 | /**
|
78 | * @see {@link Param.apply}.
|
79 | */
|
80 | apply(param: Param | AudioParam): this;
|
81 | }
|
82 | /**
|
83 | * When connecting from a signal, it's necessary to zero out the node destination
|
84 | * node if that node is also a signal. If the destination is not 0, then the values
|
85 | * will be summed. This method insures that the output of the destination signal will
|
86 | * be the same as the source signal, making the destination signal a pass through node.
|
87 | * @param signal The output signal to connect from
|
88 | * @param destination the destination to connect to
|
89 | * @param outputNum the optional output number
|
90 | * @param inputNum the input number
|
91 | */
|
92 | export declare function connectSignal(signal: OutputNode, destination: InputNode, outputNum?: number, inputNum?: number): void;
|