[DEV] update of external of elog and ethread

This commit is contained in:
Edouard DUPIN 2016-03-08 21:29:34 +01:00
parent 1231a997fd
commit 3a61ded583
9 changed files with 32 additions and 32 deletions

View File

@ -128,7 +128,7 @@ namespace audio {
return out; return out;
} }
void setFilterTime(std11::chrono::microseconds _time) { void setFilterTime(std::chrono::microseconds _time) {
setFilterSize((m_sampleRate*_time.count())/1000000LL); setFilterSize((m_sampleRate*_time.count())/1000000LL);
} }
@ -193,7 +193,7 @@ void audio::algo::river::Lms::process(void* _output, const void* _input, const v
} }
void audio::algo::river::Lms::setFilterTime(std11::chrono::microseconds _time) { void audio::algo::river::Lms::setFilterTime(std::chrono::microseconds _time) {
if (m_private == nullptr) { if (m_private == nullptr) {
AA_RIVER_ERROR("Algo is not initialized..."); AA_RIVER_ERROR("Algo is not initialized...");
} }

View File

@ -109,13 +109,13 @@ namespace audio {
*/ */
virtual void process(void* _output, const void* _input, const void* _inputFeedback, size_t _nbChunk); virtual void process(void* _output, const void* _input, const void* _inputFeedback, size_t _nbChunk);
protected: protected:
std11::shared_ptr<LmsPrivate> m_private; // private data. std::shared_ptr<LmsPrivate> m_private; // private data.
public: // parameter area: public: // parameter area:
/** /**
* @brief Set filter size with specifing the filter temporal size and his samplerate * @brief Set filter size with specifing the filter temporal size and his samplerate
* @param[in] _time Time of the filter size * @param[in] _time Time of the filter size
*/ */
virtual void setFilterTime(std11::chrono::microseconds _time); virtual void setFilterTime(std::chrono::microseconds _time);
/** /**
* @brief Set filter size in number of sample * @brief Set filter size in number of sample
* @param[in] _nbSample Sample size of the filter * @param[in] _nbSample Sample size of the filter

View File

@ -153,7 +153,7 @@ namespace audio {
return out; return out;
} }
void setFilterTime(std11::chrono::microseconds _time) { void setFilterTime(std::chrono::microseconds _time) {
setFilterSize((m_sampleRate*_time.count())/1000000LL); setFilterSize((m_sampleRate*_time.count())/1000000LL);
} }
@ -218,7 +218,7 @@ void audio::algo::river::Nlms::process(void* _output, const void* _input, const
} }
void audio::algo::river::Nlms::setFilterTime(std11::chrono::microseconds _time) { void audio::algo::river::Nlms::setFilterTime(std::chrono::microseconds _time) {
if (m_private == nullptr) { if (m_private == nullptr) {
AA_RIVER_ERROR("Algo is not initialized..."); AA_RIVER_ERROR("Algo is not initialized...");
} }

View File

@ -109,13 +109,13 @@ namespace audio {
*/ */
virtual void process(void* _output, const void* _input, const void* _inputFeedback, size_t _nbChunk); virtual void process(void* _output, const void* _input, const void* _inputFeedback, size_t _nbChunk);
protected: protected:
std11::shared_ptr<NlmsPrivate> m_private; // private data. std::shared_ptr<NlmsPrivate> m_private; // private data.
public: // parameter area: public: // parameter area:
/** /**
* @brief Set filter size with specifing the filter temporal size and his samplerate * @brief Set filter size with specifing the filter temporal size and his samplerate
* @param[in] _time Time of the filter size * @param[in] _time Time of the filter size
*/ */
virtual void setFilterTime(std11::chrono::microseconds _time); virtual void setFilterTime(std::chrono::microseconds _time);
/** /**
* @brief Set filter size in number of sample * @brief Set filter size in number of sample
* @param[in] _nbSample Sample size of the filter * @param[in] _nbSample Sample size of the filter

View File

@ -88,14 +88,14 @@ namespace audio {
* @brief Set the algo attaque time. * @brief Set the algo attaque time.
* @param[in] _time Time of the attaque gain. * @param[in] _time Time of the attaque gain.
*/ */
virtual void setAttaqueTime(std11::chrono::microseconds _time) { virtual void setAttaqueTime(std::chrono::microseconds _time) {
m_attaqueStep = 1.0 / float(int64_t(m_sampleRate) * 1000000LL / _time.count()); m_attaqueStep = 1.0 / float(int64_t(m_sampleRate) * 1000000LL / _time.count());
} }
/** /**
* @brief Set the algo release time. * @brief Set the algo release time.
* @param[in] _time Time of the release gain. * @param[in] _time Time of the release gain.
*/ */
virtual void setReleaseTime(std11::chrono::microseconds _time) { virtual void setReleaseTime(std::chrono::microseconds _time) {
m_releaseStep = 1.0 / float(int64_t(m_sampleRate) * 1000000LL / _time.count()); m_releaseStep = 1.0 / float(int64_t(m_sampleRate) * 1000000LL / _time.count());
} }
/** /**
@ -116,7 +116,7 @@ namespace audio {
* @brief Set the delay befor releasing time. * @brief Set the delay befor releasing time.
* @param[in] _time Time of the dalay release. * @param[in] _time Time of the dalay release.
*/ */
virtual void setReleaseDelay(std11::chrono::microseconds _time) { virtual void setReleaseDelay(std::chrono::microseconds _time) {
m_nbSampleDelay = int64_t(m_sampleRate) * 1000000LL / _time.count(); m_nbSampleDelay = int64_t(m_sampleRate) * 1000000LL / _time.count();
} }
}; };
@ -165,14 +165,14 @@ void audio::algo::river::Supressor::process(void* _output, const void* _input, c
} }
void audio::algo::river::Supressor::setAttaqueTime(std11::chrono::microseconds _time) { void audio::algo::river::Supressor::setAttaqueTime(std::chrono::microseconds _time) {
if (m_private == nullptr) { if (m_private == nullptr) {
AA_RIVER_ERROR("Algo is not initialized..."); AA_RIVER_ERROR("Algo is not initialized...");
} }
m_private->setAttaqueTime(_time); m_private->setAttaqueTime(_time);
} }
void audio::algo::river::Supressor::setReleaseTime(std11::chrono::microseconds _time) { void audio::algo::river::Supressor::setReleaseTime(std::chrono::microseconds _time) {
if (m_private == nullptr) { if (m_private == nullptr) {
AA_RIVER_ERROR("Algo is not initialized..."); AA_RIVER_ERROR("Algo is not initialized...");
} }
@ -193,7 +193,7 @@ void audio::algo::river::Supressor::setThreshold(float _gain) {
m_private->setThreshold(_gain); m_private->setThreshold(_gain);
} }
void audio::algo::river::Supressor::setReleaseDelay(std11::chrono::microseconds _time) { void audio::algo::river::Supressor::setReleaseDelay(std::chrono::microseconds _time) {
if (m_private == nullptr) { if (m_private == nullptr) {
AA_RIVER_ERROR("Algo is not initialized..."); AA_RIVER_ERROR("Algo is not initialized...");
} }

View File

@ -60,18 +60,18 @@ namespace audio {
*/ */
virtual void process(void* _output, const void* _input, const void* _inputFeedback, size_t _nbChunk); virtual void process(void* _output, const void* _input, const void* _inputFeedback, size_t _nbChunk);
protected: protected:
std11::shared_ptr<SupressorPrivate> m_private; // private data. std::shared_ptr<SupressorPrivate> m_private; // private data.
public: // parameter area: public: // parameter area:
/** /**
* @brief Set the algo attaque time. * @brief Set the algo attaque time.
* @param[in] _time Time of the attaque gain. * @param[in] _time Time of the attaque gain.
*/ */
virtual void setAttaqueTime(std11::chrono::microseconds _time); virtual void setAttaqueTime(std::chrono::microseconds _time);
/** /**
* @brief Set the algo release time. * @brief Set the algo release time.
* @param[in] _time Time of the release gain. * @param[in] _time Time of the release gain.
*/ */
virtual void setReleaseTime(std11::chrono::microseconds _time); virtual void setReleaseTime(std::chrono::microseconds _time);
/** /**
* @brief Set the minimum Gain. * @brief Set the minimum Gain.
* @param[in] _gain dB gain to apply for minimum. * @param[in] _gain dB gain to apply for minimum.
@ -86,7 +86,7 @@ namespace audio {
* @brief Set the delay befor releasing time. * @brief Set the delay befor releasing time.
* @param[in] _time Time of the dalay release. * @param[in] _time Time of the dalay release.
*/ */
virtual void setReleaseDelay(std11::chrono::microseconds _time); virtual void setReleaseDelay(std::chrono::microseconds _time);
}; };
} }
} }

View File

@ -8,7 +8,7 @@
int32_t audio::algo::river::getLogId() { int32_t audio::algo::river::getLogId() {
static int32_t g_val = etk::log::registerInstance("audio-algo-river"); static int32_t g_val = elog::registerInstance("audio-algo-river");
return g_val; return g_val;
} }

View File

@ -5,7 +5,7 @@
*/ */
#pragma once #pragma once
#include <etk/log.h> #include <elog/log.h>
namespace audio { namespace audio {
namespace algo { namespace algo {
@ -15,7 +15,7 @@ namespace audio {
} }
} }
#define AA_RIVER_BASE(info,data) TK_LOG_BASE(audio::algo::river::getLogId(),info,data) #define AA_RIVER_BASE(info,data) ELOG_BASE(audio::algo::river::getLogId(),info,data)
#define AA_RIVER_CRITICAL(data) AA_RIVER_BASE(1, data) #define AA_RIVER_CRITICAL(data) AA_RIVER_BASE(1, data)
#define AA_RIVER_ERROR(data) AA_RIVER_BASE(2, data) #define AA_RIVER_ERROR(data) AA_RIVER_BASE(2, data)

View File

@ -19,11 +19,11 @@
class Performance { class Performance {
private: private:
std11::chrono::steady_clock::time_point m_timeStart; std::chrono::steady_clock::time_point m_timeStart;
std11::chrono::steady_clock::time_point m_timeStop; std::chrono::steady_clock::time_point m_timeStop;
std11::chrono::nanoseconds m_totalTimeProcessing; std::chrono::nanoseconds m_totalTimeProcessing;
std11::chrono::nanoseconds m_minProcessing; std::chrono::nanoseconds m_minProcessing;
std11::chrono::nanoseconds m_maxProcessing; std::chrono::nanoseconds m_maxProcessing;
int32_t m_totalIteration; int32_t m_totalIteration;
public: public:
Performance() : Performance() :
@ -34,11 +34,11 @@ class Performance {
} }
void tic() { void tic() {
m_timeStart = std11::chrono::steady_clock::now(); m_timeStart = std::chrono::steady_clock::now();
} }
void toc() { void toc() {
m_timeStop = std11::chrono::steady_clock::now(); m_timeStop = std::chrono::steady_clock::now();
std11::chrono::nanoseconds time = m_timeStop - m_timeStart; std::chrono::nanoseconds time = m_timeStop - m_timeStart;
m_minProcessing = std::min(m_minProcessing, time); m_minProcessing = std::min(m_minProcessing, time);
m_maxProcessing = std::max(m_maxProcessing, time); m_maxProcessing = std::max(m_maxProcessing, time);
m_totalTimeProcessing += time; m_totalTimeProcessing += time;
@ -46,13 +46,13 @@ class Performance {
} }
std11::chrono::nanoseconds getTotalTimeProcessing() { std::chrono::nanoseconds getTotalTimeProcessing() {
return m_totalTimeProcessing; return m_totalTimeProcessing;
} }
std11::chrono::nanoseconds getMinProcessing() { std::chrono::nanoseconds getMinProcessing() {
return m_minProcessing; return m_minProcessing;
} }
std11::chrono::nanoseconds getMaxProcessing() { std::chrono::nanoseconds getMaxProcessing() {
return m_maxProcessing; return m_maxProcessing;
} }
int32_t getTotalIteration() { int32_t getTotalIteration() {