[DEV] update new ETK

This commit is contained in:
Edouard DUPIN 2017-09-26 15:57:44 +02:00
parent 00fc6bec02
commit b74ff1455f
7 changed files with 32 additions and 32 deletions

View File

@ -128,7 +128,7 @@ namespace audio {
return out; return out;
} }
void setFilterTime(std::chrono::microseconds _time) { void setFilterTime(echrono::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(std::chrono::microseconds _time) { void audio::algo::river::Lms::setFilterTime(echrono::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

@ -7,7 +7,7 @@
#pragma once #pragma once
#include <etk/types.hpp> #include <etk/types.hpp>
#include <chrono> #include <echrono/Steady.hpp>
#include <audio/format.hpp> #include <audio/format.hpp>
#include <ememory/memory.hpp> #include <ememory/memory.hpp>
@ -115,7 +115,7 @@ namespace audio {
* @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(std::chrono::microseconds _time); virtual void setFilterTime(echrono::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

@ -139,7 +139,7 @@ namespace audio {
return out; return out;
} }
void setFilterTime(std::chrono::microseconds _time) { void setFilterTime(echrono::microseconds _time) {
setFilterSize((m_sampleRate*_time.count())/1000000LL); setFilterSize((m_sampleRate*_time.count())/1000000LL);
} }
@ -204,7 +204,7 @@ void audio::algo::river::Nlms::process(void* _output, const void* _input, const
} }
void audio::algo::river::Nlms::setFilterTime(std::chrono::microseconds _time) { void audio::algo::river::Nlms::setFilterTime(echrono::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

@ -7,7 +7,7 @@
#pragma once #pragma once
#include <etk/types.hpp> #include <etk/types.hpp>
#include <chrono> #include <echrono/Steady.hpp>
#include <audio/format.hpp> #include <audio/format.hpp>
#include <ememory/memory.hpp> #include <ememory/memory.hpp>
@ -115,7 +115,7 @@ namespace audio {
* @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(std::chrono::microseconds _time); virtual void setFilterTime(echrono::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(std::chrono::microseconds _time) { virtual void setAttaqueTime(echrono::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(std::chrono::microseconds _time) { virtual void setReleaseTime(echrono::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());
} }
/** /**
@ -103,20 +103,20 @@ namespace audio {
* @param[in] _gain dB gain to apply for minimum. * @param[in] _gain dB gain to apply for minimum.
*/ */
virtual void setMinimumGain(float _gain) { virtual void setMinimumGain(float _gain) {
m_minGain = std::pow(10.0f, _gain/20.0f); m_minGain = etk::pow(10.0f, _gain/20.0f);
} }
/** /**
* @brief Set the threashold Gain. * @brief Set the threashold Gain.
* @param[in] _gain dB gain to start removing data. * @param[in] _gain dB gain to start removing data.
*/ */
virtual void setThreshold(float _gain) { virtual void setThreshold(float _gain) {
m_threashold = std::pow(10.0f, _gain/20.0f); m_threashold = etk::pow(10.0f, _gain/20.0f);
} }
/** /**
* @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(std::chrono::microseconds _time) { virtual void setReleaseDelay(echrono::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(std::chrono::microseconds _time) { void audio::algo::river::Supressor::setAttaqueTime(echrono::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(std::chrono::microseconds _time) { void audio::algo::river::Supressor::setReleaseTime(echrono::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(std::chrono::microseconds _time) { void audio::algo::river::Supressor::setReleaseDelay(echrono::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

@ -7,7 +7,7 @@
#pragma once #pragma once
#include <etk/types.hpp> #include <etk/types.hpp>
#include <chrono> #include <echrono/Steady.hpp>
#include <audio/format.hpp> #include <audio/format.hpp>
#include <ememory/memory.hpp> #include <ememory/memory.hpp>
@ -66,12 +66,12 @@ 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(std::chrono::microseconds _time); virtual void setAttaqueTime(echrono::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(std::chrono::microseconds _time); virtual void setReleaseTime(echrono::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(std::chrono::microseconds _time); virtual void setReleaseDelay(echrono::microseconds _time);
}; };
} }
} }

View File

@ -9,7 +9,7 @@
#include <audio/algo/river/Lms.hpp> #include <audio/algo/river/Lms.hpp>
#include <audio/algo/river/Nlms.hpp> #include <audio/algo/river/Nlms.hpp>
#include <etk/os/FSNode.hpp> #include <etk/os/FSNode.hpp>
#include <chrono> #include <echrono/Steady.hpp>
#include <ethread/tools.hpp> #include <ethread/tools.hpp>
@ -17,11 +17,11 @@
class Performance { class Performance {
private: private:
std::chrono::steady_clock::time_point m_timeStart; echrono::Steady m_timeStart;
std::chrono::steady_clock::time_point m_timeStop; echrono::Steady m_timeStop;
std::chrono::nanoseconds m_totalTimeProcessing; echrono::nanoseconds m_totalTimeProcessing;
std::chrono::nanoseconds m_minProcessing; echrono::nanoseconds m_minProcessing;
std::chrono::nanoseconds m_maxProcessing; echrono::nanoseconds m_maxProcessing;
int32_t m_totalIteration; int32_t m_totalIteration;
public: public:
Performance() : Performance() :
@ -32,11 +32,11 @@ class Performance {
} }
void tic() { void tic() {
m_timeStart = std::chrono::steady_clock::now(); m_timeStart = echrono::Steady::now();
} }
void toc() { void toc() {
m_timeStop = std::chrono::steady_clock::now(); m_timeStop = echrono::Steady::now();
std::chrono::nanoseconds time = m_timeStop - m_timeStart; echrono::nanoseconds time = m_timeStop - m_timeStart;
m_minProcessing = etk::min(m_minProcessing, time); m_minProcessing = etk::min(m_minProcessing, time);
m_maxProcessing = etk::max(m_maxProcessing, time); m_maxProcessing = etk::max(m_maxProcessing, time);
m_totalTimeProcessing += time; m_totalTimeProcessing += time;
@ -44,13 +44,13 @@ class Performance {
} }
std::chrono::nanoseconds getTotalTimeProcessing() { echrono::nanoseconds getTotalTimeProcessing() {
return m_totalTimeProcessing; return m_totalTimeProcessing;
} }
std::chrono::nanoseconds getMinProcessing() { echrono::nanoseconds getMinProcessing() {
return m_minProcessing; return m_minProcessing;
} }
std::chrono::nanoseconds getMaxProcessing() { echrono::nanoseconds getMaxProcessing() {
return m_maxProcessing; return m_maxProcessing;
} }
int32_t getTotalIteration() { int32_t getTotalIteration() {