Line data Source code
1 : /** 2 : * \file ApplyGainFilter.h 3 : */ 4 : 5 : #ifndef ATK_TOOLS_APPLYGAINFILTER_H 6 : #define ATK_TOOLS_APPLYGAINFILTER_H 7 : 8 : #include <ATK/Core/TypedBaseFilter.h> 9 : #include <ATK/Tools/config.h> 10 : 11 : namespace ATK 12 : { 13 : /// Multiplies two channels together 14 : /** 15 : * Gain applyer. Has twice as many inputs channels as it has output channels 16 : * Even channels are signal, odd channels are gains, results is the product of both 17 : */ 18 : template<typename DataType_> 19 : class ATK_TOOLS_EXPORT ApplyGainFilter final : public TypedBaseFilter<DataType_> 20 : { 21 : protected: 22 : /// Simplify parent calls 23 : using Parent = TypedBaseFilter<DataType_>; 24 : using typename Parent::DataType; 25 : using Parent::converted_inputs; 26 : using Parent::outputs; 27 : using Parent::nb_input_ports; 28 : using Parent::nb_output_ports; 29 : 30 : public: 31 : /*! 32 : * @brief Constructor 33 : * @param nb_channels is the number of channels, equal to the number of output channels, half the number of input ones 34 : */ 35 : explicit ApplyGainFilter(gsl::index nb_channels = 1); 36 : /// Destructor 37 1 : ~ApplyGainFilter() override = default; 38 : 39 : protected: 40 : void process_impl(gsl::index size) const final; 41 : }; 42 : } 43 : 44 : #endif