"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Semifunctional_1 = require("../../../../../../Class/Semifunctional");
const Array_1 = require("../../../../../../wrap/Array");
const _ids_1 = require("../../../../../_ids");
class GetByteTimeDomainData extends Semifunctional_1.Semifunctional {
    constructor(system) {
        super({
            fi: ['node', 'opt'],
            fo: ['data'],
            i: ['done'],
        }, {
            input: {
                node: {
                    ref: true,
                },
            },
            output: {
                data: {
                    ref: true,
                },
            },
        }, system, _ids_1.ID_GET_BYTE_TIME_DOMAIN_DATA);
        this._reset = () => {
            this._data = undefined;
            this._backward_all();
        };
    }
    f({ node, opt }, done) {
        const fftSize = node.getFFTSize();
        this._data = new Uint8Array(fftSize);
        node.getByteTimeDomainData(this._data);
        const data = (0, Array_1.wrapUint8Array)(this._data, this.__system);
        done({
            data,
        });
    }
    d() {
        //
    }
    onIterDataInputData(name, data) {
        // if (name === 'done') {
        this._reset();
        // }
    }
}
exports.default = GetByteTimeDomainData;
//# sourceMappingURL=index.js.map