1 #ifndef AUDIOGRAPHER_NORMALIZER_H
2 #define AUDIOGRAPHER_NORMALIZER_H
4 #include "audiographer/visibility.h"
5 #include "audiographer/sink.h"
6 #include "audiographer/routines.h"
7 #include "audiographer/utils/listed_source.h"
12 /// A class for normalizing to a specified target in dB
13 class LIBAUDIOGRAPHER_API Normalizer
14 : public ListedSource<float>
19 /// Constructs a normalizer with a specific target in dB \n RT safe
20 Normalizer (float target_dB);
23 /// Sets the peak found in the material to be normalized \see PeakReader \n RT safe
24 void set_peak (float peak);
26 /** Allocates a buffer for using with const ProcessContexts
27 * This function does not need to be called if
28 * non-const ProcessContexts are given to \a process() .
31 void alloc_buffer(framecnt_t frames);
33 /// Process a const ProcessContext \see alloc_buffer() \n RT safe
34 void process (ProcessContext<float> const & c);
36 /// Process a non-const ProcsesContext in-place \n RT safe
37 void process (ProcessContext<float> & c);
45 framecnt_t buffer_size;
51 #endif // AUDIOGRAPHER_NORMALIZER_H