Line data Source code
1 : /** 2 : * \file EQInterface.h 3 : */ 4 : 5 : #ifndef ATK_EQ_EQINTERFACE_H 6 : #define ATK_EQ_EQINTERFACE_H 7 : 8 : #include <ATK/config.h> 9 : #include <ATK/EQ/config.h> 10 : 11 : #include <map> 12 : 13 : namespace ATK 14 : { 15 : /// Interface for a variable order filter 16 : class ATK_EQ_EXPORT OrderInterface 17 : { 18 : public: 19 158 : virtual ~OrderInterface() = default; 20 : /// Sets the cut or central frequency of the filter 21 : virtual void set_order(unsigned int cut_frequency) = 0; 22 : /// Returns the cut or central frequency 23 : virtual unsigned int get_order() const = 0; 24 : }; 25 : 26 : /// Interface for a single cut frequency filter 27 : template<typename DataType> 28 : class ATK_EQ_EXPORT SingleCutFrequencyInterface 29 : { 30 : public: 31 187 : virtual ~SingleCutFrequencyInterface() = default; 32 : /// Sets the cut or central frequency of the filter 33 : virtual void set_cut_frequency(DataType cut_frequency) = 0; 34 : /// Returns the cut or central frequency 35 : virtual DataType get_cut_frequency() const = 0; 36 : }; 37 : 38 : /// Interface for a dual cut frequency filter 39 : template<typename DataType> 40 : class ATK_EQ_EXPORT DualCutFrequencyInterface 41 : { 42 : public: 43 76 : virtual ~DualCutFrequencyInterface() = default; 44 : /// Sets the bandwidth as a bandwidth 45 : virtual void set_cut_frequencies(std::pair<DataType, DataType> cut_frequencies) = 0; 46 : /// Sets the bandwidth as two separate values 47 : virtual void set_cut_frequencies(DataType f0, DataType f1) = 0; 48 : /// Gets the bandwidth 49 : virtual std::pair<DataType, DataType> get_cut_frequencies() const = 0; 50 : }; 51 : 52 : /// Interface for filter with a Q parameter 53 : template<typename DataType> 54 : class ATK_EQ_EXPORT QInterface 55 : { 56 : public: 57 48 : virtual ~QInterface() = default; 58 : /// Sets the Q factor, must be strictly positive 59 : /*! 60 : * A smaller Q will lead to a bigger bandwidth, a bigger Q will lead to a smaller bandwidth 61 : */ 62 : virtual void set_Q(DataType Q) = 0; 63 : /// Returns the Q factor 64 : virtual DataType get_Q() const = 0; 65 : }; 66 : 67 : /// Interface for filter with a gain parameter 68 : template<typename DataType> 69 : class ATK_EQ_EXPORT GainInterface 70 : { 71 : public: 72 14 : virtual ~GainInterface() = default; 73 : /// Sets the gain of the filter 74 : virtual void set_gain(DataType gain) = 0; 75 : /// Returns the gain for the filter 76 : virtual DataType get_gain() const = 0; 77 : }; 78 : 79 : /// Interface for filter with a ripple parameter 80 : template<typename DataType> 81 : class ATK_EQ_EXPORT RippleInterface 82 : { 83 : public: 84 76 : virtual ~RippleInterface() = default; 85 : /// Sets the ripple 86 : virtual void set_ripple(DataType ripple) = 0; 87 : /// Returns the ripple 88 : virtual DataType get_ripple() const = 0; 89 : }; 90 : } 91 : 92 : #endif