chenlh
2026-03-26 36e42207da4c088b5bfd96f2cfc8944f890440d7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#pragma once
 
 
/**
 * Base Class for Audio Effect Processors
 * 
 */
template <typename SampleType>
class EffectProcessorBase
{
public:
 
    /**
     * @brief Prepares object for playback
     * 
     * @param sampleRate Current sampling rate
     */
    virtual void prepare(SampleType sampleRate) = 0; 
 
    /**
     * @brief Processes a single sample
     * 
     * @param input Input sample
     */
    virtual SampleType processSample(SampleType input) = 0;
 
    /**
     * @brief Processes a memory block that holds audio samples
     * 
     * @param data Memory block start pointer 
     * @param startSample Sample index to start processing from
     * @param endSample Number of samples to process
     */
    virtual void process(SampleType* channelData, int startSample, int endSample) = 0;
 
protected:
    SampleType sampleRate;
};