[DEV] remove STL
This commit is contained in:
parent
567bdd6a86
commit
57adfb43c8
@ -27,7 +27,7 @@ namespace audio {
|
|||||||
* @brief audio-algo library namespace
|
* @brief audio-algo library namespace
|
||||||
*/
|
*/
|
||||||
namespace drain{
|
namespace drain{
|
||||||
typedef std::function<void (const etk::String& _origin, const etk::String& _status)> algoStatusFunction;
|
typedef etk::Function<void (const etk::String& _origin, const etk::String& _status)> algoStatusFunction;
|
||||||
class Algo : public ememory::EnableSharedFromThis<Algo> {
|
class Algo : public ememory::EnableSharedFromThis<Algo> {
|
||||||
private:
|
private:
|
||||||
etk::String m_name;
|
etk::String m_name;
|
||||||
|
@ -10,13 +10,13 @@
|
|||||||
|
|
||||||
namespace audio {
|
namespace audio {
|
||||||
namespace drain {
|
namespace drain {
|
||||||
typedef std::function<void (void* _data,
|
typedef etk::Function<void (void* _data,
|
||||||
const audio::Time& _playTime,
|
const audio::Time& _playTime,
|
||||||
size_t _nbChunk,
|
size_t _nbChunk,
|
||||||
enum audio::format _format,
|
enum audio::format _format,
|
||||||
uint32_t _frequency,
|
uint32_t _frequency,
|
||||||
const etk::Vector<audio::channel>& _map)> playbackFunction;
|
const etk::Vector<audio::channel>& _map)> playbackFunction;
|
||||||
typedef std::function<void (const void* _data,
|
typedef etk::Function<void (const void* _data,
|
||||||
const audio::Time& _readTime,
|
const audio::Time& _readTime,
|
||||||
size_t _nbChunk,
|
size_t _nbChunk,
|
||||||
enum audio::format _format,
|
enum audio::format _format,
|
||||||
|
@ -70,7 +70,7 @@ bool audio::drain::EndPointWrite::process(audio::Time& _time,
|
|||||||
// set output pointer:
|
// set output pointer:
|
||||||
_outputNbChunk = m_outputData.size()/(m_formatSize*m_output.getMap().size());
|
_outputNbChunk = m_outputData.size()/(m_formatSize*m_output.getMap().size());
|
||||||
_output = &m_outputData[0];
|
_output = &m_outputData[0];
|
||||||
std::unique_lock<std::mutex> lock(m_mutex);
|
std::unique_lock<ethread::Mutex> lock(m_mutex);
|
||||||
// check if data in the tmpBuffer
|
// check if data in the tmpBuffer
|
||||||
if (m_buffer.getSize() == 0) {
|
if (m_buffer.getSize() == 0) {
|
||||||
if (m_bufferUnderFlowSize == 0) {
|
if (m_bufferUnderFlowSize == 0) {
|
||||||
@ -110,7 +110,7 @@ bool audio::drain::EndPointWrite::process(audio::Time& _time,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void audio::drain::EndPointWrite::write(const void* _value, size_t _nbChunk) {
|
void audio::drain::EndPointWrite::write(const void* _value, size_t _nbChunk) {
|
||||||
std::unique_lock<std::mutex> lock(m_mutex);
|
std::unique_lock<ethread::Mutex> lock(m_mutex);
|
||||||
DRAIN_VERBOSE("[ASYNC] Write data : " << _nbChunk << " chunks" << " ==> " << m_output);
|
DRAIN_VERBOSE("[ASYNC] Write data : " << _nbChunk << " chunks" << " ==> " << m_output);
|
||||||
int32_t nbOverflow = m_buffer.write(_value, _nbChunk);
|
int32_t nbOverflow = m_buffer.write(_value, _nbChunk);
|
||||||
if (nbOverflow > 0) {
|
if (nbOverflow > 0) {
|
||||||
|
@ -7,12 +7,12 @@
|
|||||||
|
|
||||||
#include <audio/drain/EndPoint.hpp>
|
#include <audio/drain/EndPoint.hpp>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <mutex>
|
#include <ethread/Mutex.hpp>
|
||||||
#include <audio/drain/CircularBuffer.hpp>
|
#include <audio/drain/CircularBuffer.hpp>
|
||||||
|
|
||||||
namespace audio {
|
namespace audio {
|
||||||
namespace drain{
|
namespace drain{
|
||||||
typedef std::function<void (const audio::Time& _time,
|
typedef etk::Function<void (const audio::Time& _time,
|
||||||
size_t _nbChunk,
|
size_t _nbChunk,
|
||||||
enum audio::format _format,
|
enum audio::format _format,
|
||||||
uint32_t _frequency,
|
uint32_t _frequency,
|
||||||
@ -21,7 +21,7 @@ namespace audio {
|
|||||||
private:
|
private:
|
||||||
audio::drain::CircularBuffer m_buffer;
|
audio::drain::CircularBuffer m_buffer;
|
||||||
playbackFunctionWrite m_function;
|
playbackFunctionWrite m_function;
|
||||||
std::mutex m_mutex;
|
ethread::Mutex m_mutex;
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
* @brief Constructor
|
* @brief Constructor
|
||||||
|
@ -109,7 +109,7 @@ void audio::drain::IOFormatInterface::configurationChange() {
|
|||||||
m_ioChangeFunctor();
|
m_ioChangeFunctor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void audio::drain::IOFormatInterface::setCallback(const std::function<void()>& _functor) {
|
void audio::drain::IOFormatInterface::setCallback(const etk::Function<void()>& _functor) {
|
||||||
m_ioChangeFunctor = _functor;
|
m_ioChangeFunctor = _functor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,14 +74,14 @@ namespace audio {
|
|||||||
*/
|
*/
|
||||||
int32_t getChunkSize() const;
|
int32_t getChunkSize() const;
|
||||||
protected:
|
protected:
|
||||||
std::function<void()> m_ioChangeFunctor; //!< function pointer on the upper class
|
etk::Function<void()> m_ioChangeFunctor; //!< function pointer on the upper class
|
||||||
void configurationChange();
|
void configurationChange();
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* @brief Set the callback function to be notify when the arameter change.
|
* @brief Set the callback function to be notify when the arameter change.
|
||||||
* @param[in] _functor Function to call.
|
* @param[in] _functor Function to call.
|
||||||
*/
|
*/
|
||||||
void setCallback(const std::function<void()>& _functor);
|
void setCallback(const etk::Function<void()>& _functor);
|
||||||
};
|
};
|
||||||
etk::Stream& operator <<(etk::Stream& _os, const audio::drain::IOFormatInterface& _obj);
|
etk::Stream& operator <<(etk::Stream& _os, const audio::drain::IOFormatInterface& _obj);
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
namespace audio {
|
namespace audio {
|
||||||
namespace drain{
|
namespace drain{
|
||||||
typedef std::function<void (const etk::String& _origin, const etk::String& _status)> statusFunction;
|
typedef etk::Function<void (const etk::String& _origin, const etk::String& _status)> statusFunction;
|
||||||
class Process {
|
class Process {
|
||||||
protected:
|
protected:
|
||||||
etk::Vector<int8_t> m_data; //!< temporary overlap output buffer (change size of the output data)
|
etk::Vector<int8_t> m_data; //!< temporary overlap output buffer (change size of the output data)
|
||||||
|
@ -31,7 +31,7 @@ namespace audio {
|
|||||||
* @param[in] _name Name of the Algorithm.
|
* @param[in] _name Name of the Algorithm.
|
||||||
* @param[in] _functor Function of the factory
|
* @param[in] _functor Function of the factory
|
||||||
*/
|
*/
|
||||||
void addAlgoFactory(const etk::String& _name, std::function<drain::Algo*(void)> _functor);
|
void addAlgoFactory(const etk::String& _name, etk::Function<drain::Algo*(void)> _functor);
|
||||||
/**
|
/**
|
||||||
* @brief Remove a Factory Algorithm in the internal List (static for all instance)
|
* @brief Remove a Factory Algorithm in the internal List (static for all instance)
|
||||||
* @param[in] _name Name of the Algorithm.
|
* @param[in] _name Name of the Algorithm.
|
||||||
|
@ -35,7 +35,7 @@ def configure(target, my_module):
|
|||||||
])
|
])
|
||||||
my_module.add_depend([
|
my_module.add_depend([
|
||||||
'audio-drain',
|
'audio-drain',
|
||||||
'gtest',
|
'etest',
|
||||||
'etk',
|
'etk',
|
||||||
'test-debug'
|
'test-debug'
|
||||||
])
|
])
|
||||||
|
@ -5,6 +5,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <test-debug/debug.hpp>
|
#include <test-debug/debug.hpp>
|
||||||
#include <gtest/gtest.h>
|
#include <etest/etest.hpp>
|
||||||
#include <audio/drain/Process.hpp>
|
#include <audio/drain/Process.hpp>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <test-debug/debug.hpp>
|
#include <test-debug/debug.hpp>
|
||||||
#include <gtest/gtest.h>
|
#include <etest/etest.hpp>
|
||||||
#include <audio/drain/Process.hpp>
|
#include <audio/drain/Process.hpp>
|
||||||
|
|
||||||
|
|
||||||
|
@ -5,6 +5,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <test-debug/debug.hpp>
|
#include <test-debug/debug.hpp>
|
||||||
#include <gtest/gtest.h>
|
#include <etest/etest.hpp>
|
||||||
#include <audio/drain/Process.hpp>
|
#include <audio/drain/Process.hpp>
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
#include <etk/etk.hpp>
|
#include <etk/etk.hpp>
|
||||||
#include <test-debug/debug.hpp>
|
#include <test-debug/debug.hpp>
|
||||||
#include <gtest/gtest.h>
|
#include <etest/etest.hpp>
|
||||||
|
|
||||||
int main(int _argc, const char** _argv) {
|
int main(int _argc, const char** _argv) {
|
||||||
// init Google test :
|
// init Google test :
|
||||||
|
@ -5,6 +5,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <test-debug/debug.hpp>
|
#include <test-debug/debug.hpp>
|
||||||
#include <gtest/gtest.h>
|
#include <etest/etest.hpp>
|
||||||
#include <audio/drain/Process.hpp>
|
#include <audio/drain/Process.hpp>
|
||||||
|
|
||||||
|
@ -5,6 +5,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <test-debug/debug.hpp>
|
#include <test-debug/debug.hpp>
|
||||||
#include <gtest/gtest.h>
|
#include <etest/etest.hpp>
|
||||||
#include <audio/drain/Process.hpp>
|
#include <audio/drain/Process.hpp>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user