"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Functional_1 = require("../../../../../../Class/Functional");
const _ids_1 = require("../../../../../_ids");
class AudioDestinationNode_ extends Functional_1.Functional {
    constructor(system) {
        super({
            i: ['node'],
            o: [],
        }, {
            input: {
                node: {
                    ref: true,
                },
            },
            output: {
                node: {
                    ref: true,
                },
            },
        }, system, _ids_1.ID_AUDIO_DESTINATION_NODE);
    }
    f({ node: sourceNode }, done) {
        this._source = sourceNode;
        const ctx = sourceNode.getContext();
        const _node = ctx.destination;
        this._node = _node;
        sourceNode.connect(_node);
    }
    d() {
        if (this._node) {
            this._source.disconnect(this._node);
            this._source = undefined;
            this._node = undefined;
        }
    }
}
exports.default = AudioDestinationNode_;
//# sourceMappingURL=index.js.map