{"version":3,"file":"Filter.mjs","sources":["../../src/filters/Filter.ts"],"sourcesContent":["/**\n * Represents a single sound element. Can be used to play, pause, etc. sound instances.\n *\n * @memberof filters\n */\nclass Filter\n{\n    /** The node to connect for the filter to the previous filter. */\n    public destination: AudioNode;\n\n    /** The node to connect for the filter to the previous filter. */\n    public source: AudioNode;\n\n    /**\n     * @param {AudioNode} destination - The audio node to use as the destination for the input AudioNode\n     * @param {AudioNode} [source] - Optional output node, defaults to destination node. This is useful\n     *        when creating filters which contains multiple AudioNode elements chained together.\n     */\n    constructor(destination: AudioNode, source?: AudioNode)\n    {\n        this.init(destination, source);\n    }\n\n    /** Reinitialize */\n    protected init(destination: AudioNode, source?: AudioNode): void\n    {\n        this.destination = destination;\n        this.source = source || destination;\n    }\n\n    /**\n     * Connect to the destination.\n     * @param {AudioNode} destination - The destination node to connect the output to\n     */\n    public connect(destination: AudioNode): void\n    {\n        this.source?.connect(destination);\n    }\n\n    /** Completely disconnect filter from destination and source nodes. */\n    public disconnect(): void\n    {\n        this.source?.disconnect();\n    }\n\n    /** Destroy the filter and don't use after this. */\n    public destroy(): void\n    {\n        this.disconnect();\n        this.destination = null;\n        this.source = null;\n    }\n}\n\nexport { Filter };\n"],"names":[],"mappings":"AAKA,MAAM,MACN,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYI,WAAA,CAAY,aAAwB,MACpC,EAAA;AACI,IAAK,IAAA,CAAA,IAAA,CAAK,aAAa,MAAM,CAAA,CAAA;AAAA,GACjC;AAAA;AAAA,EAGU,IAAA,CAAK,aAAwB,MACvC,EAAA;AACI,IAAA,IAAA,CAAK,WAAc,GAAA,WAAA,CAAA;AACnB,IAAA,IAAA,CAAK,SAAS,MAAU,IAAA,WAAA,CAAA;AAAA,GAC5B;AAAA;AAAA;AAAA;AAAA;AAAA,EAMO,QAAQ,WACf,EAAA;AACI,IAAK,IAAA,CAAA,MAAA,EAAQ,QAAQ,WAAW,CAAA,CAAA;AAAA,GACpC;AAAA;AAAA,EAGO,UACP,GAAA;AACI,IAAA,IAAA,CAAK,QAAQ,UAAW,EAAA,CAAA;AAAA,GAC5B;AAAA;AAAA,EAGO,OACP,GAAA;AACI,IAAA,IAAA,CAAK,UAAW,EAAA,CAAA;AAChB,IAAA,IAAA,CAAK,WAAc,GAAA,IAAA,CAAA;AACnB,IAAA,IAAA,CAAK,MAAS,GAAA,IAAA,CAAA;AAAA,GAClB;AACJ;;;;"}