LCOV - code coverage report
Current view: top level - Dynamic - GainCompressorFilter.h (source / functions) Hit Total Coverage
Test: coverage.info.cleaned Lines: 1 1 100.0 %
Date: 2021-02-18 20:07:22 Functions: 1 2 50.0 %

          Line data    Source code
       1             : /**
       2             :  * \file GainCompressorFilter.h
       3             :  */
       4             : 
       5             : #ifndef ATK_DYNAMIC_GAINCOMPRESSORFILTER_H
       6             : #define ATK_DYNAMIC_GAINCOMPRESSORFILTER_H
       7             : 
       8             : #include <ATK/Dynamic/GainFilter.h>
       9             : #include <ATK/Dynamic/config.h>
      10             : 
      11             : namespace ATK
      12             : {
      13             :   /// Gain "compressor". Computes a new amplitude/volume gain based on threshold, slope and the power of the input signal
      14             :   template<typename DataType_>
      15             :   class ATK_DYNAMIC_EXPORT GainCompressorFilter : public ParentGainFilter<DataType_>
      16             :   {
      17             :   public:
      18             :     using Parent = ParentGainFilter<DataType_>;
      19             :     using Parent::ratio;
      20             :     using Parent::start_recomputeLUT;
      21             :     using typename Parent::DataType;
      22             :     /*!
      23             :      * @brief Constructor
      24             :      * @param nb_channels is the number of input and output channels
      25             :      * @param LUTsize is the total LUT size used by the filter
      26             :      * @param LUTprecision is the number of elements used to compute values < 1
      27             :      */
      28             :     GainCompressorFilter(gsl::index nb_channels = 1, size_t LUTsize = 128*1024, size_t LUTprecision = 64);
      29             :     /// Destructor
      30          13 :     ~GainCompressorFilter() override = default;
      31             : 
      32             :     /// Sets the softness of the knee of the filter (positive value)
      33             :     void set_softness(DataType_ softness);
      34             :     /// Retrieves the softness afctor
      35             :     DataType_ get_softness() const;
      36             : 
      37             :   protected:
      38             :     DataType_ computeGain(DataType_ value) const;
      39             :   private:
      40             :     DataType_ softness{0.0001};
      41             :   };
      42             : }
      43             : 
      44             : #endif

Generated by: LCOV version TK-3.3.0-4-gdba42eea