// SPDX-FileCopyrightText: 2026 Reactorcoremeltdown // SPDX-License-Identifier: GPL-3.0-or-later #pragma once #include #include "sizzle/Params.hpp" namespace sizzle { /** * An insert effect: the C++ twin of AudioEffect in Effects.kt. `update` refreshes * cached settings (call it when the params change, and once before processing); * `process` runs per mono sample and must never allocate or lock. Construct on a * normal thread: constructors allocate delay lines for [sampleRate]. */ class Effect { public: virtual ~Effect() = default; virtual void update(const Params &p, float tempoBpm) = 0; virtual float process(float x) = 0; /** The effect for ToolboxType name [type] ("DELAY", "FILTER", …), or nullptr * for types without an audio processor (the MIDI effects) or not ported yet. */ static std::unique_ptr create(const char *type, int sampleRate); }; } // namespace sizzle