UNPKG

2.08 kBTypeScriptView Raw
1import { Gain } from "../../core/context/Gain.js";
2import { ToneAudioNode, ToneAudioNodeOptions } from "../../core/context/ToneAudioNode.js";
3export interface SoloOptions extends ToneAudioNodeOptions {
4 solo: boolean;
5}
6/**
7 * Solo lets you isolate a specific audio stream. When an instance is set to `solo=true`,
8 * it will mute all other instances of Solo.
9 * @example
10 * const soloA = new Tone.Solo().toDestination();
11 * const oscA = new Tone.Oscillator("C4", "sawtooth").connect(soloA);
12 * const soloB = new Tone.Solo().toDestination();
13 * const oscB = new Tone.Oscillator("E4", "square").connect(soloB);
14 * soloA.solo = true;
15 * // no audio will pass through soloB
16 * @category Component
17 */
18export declare class Solo extends ToneAudioNode<SoloOptions> {
19 readonly name: string;
20 readonly input: Gain;
21 readonly output: Gain;
22 /**
23 * @param solo If the connection should be initially solo'ed.
24 */
25 constructor(solo?: boolean);
26 constructor(options?: Partial<SoloOptions>);
27 static getDefaults(): SoloOptions;
28 /**
29 * Hold all of the solo'ed tracks belonging to a specific context
30 */
31 private static _allSolos;
32 /**
33 * Hold the currently solo'ed instance(s)
34 */
35 private static _soloed;
36 /**
37 * Isolates this instance and mutes all other instances of Solo.
38 * Only one instance can be soloed at a time. A soloed
39 * instance will report `solo=false` when another instance is soloed.
40 */
41 get solo(): boolean;
42 set solo(solo: boolean);
43 /**
44 * If the current instance is muted, i.e. another instance is soloed
45 */
46 get muted(): boolean;
47 /**
48 * Add this to the soloed array
49 */
50 private _addSolo;
51 /**
52 * Remove this from the soloed array
53 */
54 private _removeSolo;
55 /**
56 * Is this on the soloed array
57 */
58 private _isSoloed;
59 /**
60 * Returns true if no one is soloed
61 */
62 private _noSolos;
63 /**
64 * Solo the current instance and unsolo all other instances.
65 */
66 private _updateSolo;
67 dispose(): this;
68}