#pragma once #include "Globals.h" #include "Helpers.h" #include #include #include namespace sfz { template class LinearEnvelope { public: LinearEnvelope(); LinearEnvelope(int maxCapacity, std::function function); void setMaxCapacity(int maxCapacity); void setFunction(std::function function); void registerEvent(int timestamp, Type inputValue); void clear(); void reset(Type value = 0.0); void getBlock(absl::Span output); private: std::function function { [](Type input) { return input; } }; static_assert(std::is_arithmetic::value); std::vector> events; int maxCapacity { config::defaultSamplesPerBlock }; Type currentValue { 0.0 }; LEAK_DETECTOR(LinearEnvelope); }; }