Line data Source code
1 : /** 2 : * \file DryWetFilter.h 3 : */ 4 : 5 : #ifndef ATK_TOOLS_DRYWETFILTER_H 6 : #define ATK_TOOLS_DRYWETFILTER_H 7 : 8 : #include <ATK/Core/TypedBaseFilter.h> 9 : #include <ATK/Tools/config.h> 10 : #include <ATK/Tools/ToolsInterface.h> 11 : 12 : namespace ATK 13 : { 14 : /// Mixes two signals together 15 : template<typename DataType_> 16 : class ATK_TOOLS_EXPORT DryWetFilter final : public TypedBaseFilter<DataType_>, public DryWetInterface 17 : { 18 : protected: 19 : /// Simplify parent calls 20 : using Parent = TypedBaseFilter<DataType_>; 21 : using typename Parent::DataType; 22 : using Parent::converted_inputs; 23 : using Parent::outputs; 24 : using Parent::nb_input_ports; 25 : using Parent::nb_output_ports; 26 : 27 : public: 28 : /*! 29 : * @brief Constructor 30 : * @param nb_channels is the number of channels, equal to the number of output channels, half the number of input ones 31 : */ 32 : explicit DryWetFilter(gsl::index nb_channels = 1); 33 : /// Destructor 34 6 : ~DryWetFilter() override = default; 35 : 36 : /// Sets the amount of input signal in the output signal 37 : void set_dry(double dry) final; 38 : /// Returns the amount of dry signal in the output 39 : double get_dry() const final; 40 : 41 : protected: 42 : void process_impl(gsl::index size) const final; 43 : 44 : private: 45 : /// Amount of dry signal, between 0 and 1 46 : double dry{1}; 47 : }; 48 : } 49 : 50 : #endif