audio-drain/audio/drain/Equalizer.hpp

56 lines
1.5 KiB
C++
Raw Permalink Normal View History

2015-04-10 23:00:13 +02:00
/** @file
* @author Edouard DUPIN
* @copyright 2011, Edouard DUPIN, all right reserved
* @license MPL v2.0 (see license file)
2015-04-10 23:00:13 +02:00
*/
#pragma once
2015-04-10 23:00:13 +02:00
2016-10-02 21:41:55 +02:00
#include <audio/drain/Algo.hpp>
#include <ememory/memory.hpp>
#include <ejson/Object.hpp>
#include <audio/algo/drain/Equalizer.hpp>
2015-04-10 23:00:13 +02:00
namespace audio {
namespace drain {
class Equalizer : public Algo {
protected:
/**
* @brief Constructor
*/
Equalizer();
void init();
public:
2016-07-19 21:43:58 +02:00
static ememory::SharedPtr<audio::drain::Equalizer> create();
2015-04-10 23:00:13 +02:00
/**
* @brief Destructor
*/
virtual ~Equalizer();
protected:
virtual void configurationChange();
public:
2015-04-13 21:49:48 +02:00
virtual bool process(audio::Time& _time,
2015-04-10 23:00:13 +02:00
void* _input,
size_t _inputNbChunk,
void*& _output,
size_t& _outputNbChunk);
protected:
ejson::Object m_config; // configuration of the equalizer.
2015-04-10 23:00:13 +02:00
public:
2017-08-28 00:08:17 +02:00
virtual bool setParameter(const etk::String& _parameter, const etk::String& _value);
virtual etk::String getParameter(const etk::String& _parameter) const;
virtual etk::String getParameterProperty(const etk::String& _parameter) const;
2015-04-10 23:00:13 +02:00
protected:
void addBiquad(int32_t _idBiquad, const ejson::Object& _object);
2015-05-04 22:25:32 +02:00
audio::algo::drain::Equalizer m_algo;
2015-04-10 23:00:13 +02:00
/**
* @brief Configure biquad with the user spec.
*/
void configureBiQuad();
public:
// for debug & tools only
2017-08-28 00:08:17 +02:00
etk::Vector<etk::Pair<float,float> > calculateTheory();
2015-04-10 23:00:13 +02:00
};
}
}