Avoid allocations when reading VST3 process data

On the plugin side. We still need to do a lot of optimizations
elsewhere.
This commit is contained in:
Robbert van der Helm
2021-05-06 17:50:41 +02:00
parent 0b173ecba8
commit 9f5066a293
9 changed files with 168 additions and 85 deletions
@@ -32,20 +32,22 @@
class YaParamValueQueue : public Steinberg::Vst::IParamValueQueue {
public:
/**
* Default constructor with an empty queue.
* We only provide a default constructor here, because we need to fill the
* existing object with new data every processing cycle to avoid
* reallocating a new object every time.
*/
YaParamValueQueue();
/**
* Create an empty queue for a specific parameter. Used in
* `YaParameterChanges::addParameterData`.
* Clear this queue in place so that it can be used to write parameter data
* to. Used in `YaParameterChanges::addParameterData`.
*/
YaParamValueQueue(Steinberg::Vst::ParamID parameter_id);
void clear_for_parameter(Steinberg::Vst::ParamID parameter_id);
/**
* Read data from an existing `IParamValueQueue` object.
* Read data from an `IParamValueQueue` object into this existing object.
*/
YaParamValueQueue(Steinberg::Vst::IParamValueQueue& original_queue);
void repopulate(Steinberg::Vst::IParamValueQueue& original_queue);
~YaParamValueQueue();