#pragma once

#include "data/node.h"
#include "nodelib/param.h"

namespace Xybrid::Effects {
    class Distortion : public Data::Node {
        NodeLib::Param drive = {"Drive", 0.0, 24.0, 0.0};
        NodeLib::Param shape = {"Shape", -10.0, 10.0, 0.0};
        NodeLib::Param mix = {"Mix", 0.0, 1.0, 1.0};
        NodeLib::Param output = {"Output", -12.0, 12.0, 0.0};

    public:
        Distortion();
        ~Distortion() override = default;

        void init() override;
        void reset() override;
        //void release() override;
        void process() override;

        void saveData(QCborMap&) const override;
        void loadData(const QCborMap&) override;

        void onGadgetCreated() override;
    };
}
