[DEV] update new lutin 0.8.0
This commit is contained in:
parent
05237a7b29
commit
902c0ec7aa
@ -3,25 +3,39 @@ import lutin.module as module
|
||||
import lutin.tools as tools
|
||||
import lutin.debug as debug
|
||||
|
||||
|
||||
def get_type():
|
||||
return "BINARY"
|
||||
|
||||
def get_sub_type():
|
||||
return "TEST"
|
||||
|
||||
def get_desc():
|
||||
return "single audio flow test"
|
||||
|
||||
def get_licence():
|
||||
return "APACHE-2"
|
||||
|
||||
def create(target):
|
||||
my_module = module.Module(__file__, 'audio-drain-test', 'BINARY')
|
||||
|
||||
def get_compagny_type():
|
||||
return "com"
|
||||
|
||||
def get_compagny_name():
|
||||
return "atria-soft"
|
||||
|
||||
def get_maintainer():
|
||||
return ["Mr DUPIN Edouard <yui.heero@gmail.com>"]
|
||||
|
||||
def create(target, module_name):
|
||||
my_module = module.Module(__file__, module_name, get_type())
|
||||
my_module.add_src_file([
|
||||
'test/main.cpp',
|
||||
'test/debug.cpp',
|
||||
'test/updateFlow.cpp',
|
||||
'test/resampling.cpp',
|
||||
'test/format.cpp',
|
||||
'test/channelOrder.cpp',
|
||||
'test/equalizer.cpp'
|
||||
])
|
||||
|
||||
my_module.add_module_depend(['audio-drain', 'gtest', 'etk'])
|
||||
|
||||
my_module.add_module_depend(['audio-drain', 'gtest', 'etk', 'test-debug'])
|
||||
return my_module
|
||||
|
||||
|
||||
|
@ -3,12 +3,30 @@ import lutin.module as module
|
||||
import lutin.tools as tools
|
||||
import lutin.debug as debug
|
||||
|
||||
|
||||
def get_type():
|
||||
return "LIBRARY"
|
||||
|
||||
def get_desc():
|
||||
return "Basic audio algo interface single pipe to provess data"
|
||||
|
||||
def get_licence():
|
||||
return "APACHE-2"
|
||||
|
||||
def create(target):
|
||||
my_module = module.Module(__file__, 'audio-drain', 'LIBRARY')
|
||||
def get_compagny_type():
|
||||
return "com"
|
||||
|
||||
def get_compagny_name():
|
||||
return "atria-soft"
|
||||
|
||||
def get_maintainer():
|
||||
return ["Mr DUPIN Edouard <yui.heero@gmail.com>"]
|
||||
|
||||
def get_version():
|
||||
return [0,0,0]
|
||||
|
||||
def create(target, module_name):
|
||||
my_module = module.Module(__file__, module_name, get_type())
|
||||
|
||||
my_module.add_src_file([
|
||||
'audio/drain/debug.cpp',
|
||||
@ -53,8 +71,6 @@ def create(target):
|
||||
my_module.compile_flags('c++', "-DHAVE_SPEEX_DSP_RESAMPLE")
|
||||
my_module.add_module_depend(['etk', 'audio', 'ejson', 'speex-dsp', 'audio-algo-drain'])
|
||||
my_module.add_path(tools.get_current_path(__file__))
|
||||
|
||||
# add the currrent module at the
|
||||
return my_module
|
||||
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
* @license APACHE v2.0 (see license file)
|
||||
*/
|
||||
|
||||
#include <test/debug.h>
|
||||
#include <test-debug/debug.h>
|
||||
#include <gtest/gtest.h>
|
||||
#include <audio/drain/Process.h>
|
||||
|
||||
|
@ -1,15 +0,0 @@
|
||||
/**
|
||||
* @author Edouard DUPIN
|
||||
*
|
||||
* @copyright 2010, Edouard DUPIN, all right reserved
|
||||
*
|
||||
* @license GPL v3 (see license file)
|
||||
*/
|
||||
|
||||
#include "debug.h"
|
||||
|
||||
int32_t appl::getLogId() {
|
||||
static int32_t g_val = etk::log::registerInstance("test");
|
||||
return g_val;
|
||||
}
|
||||
|
43
test/debug.h
43
test/debug.h
@ -1,43 +0,0 @@
|
||||
/**
|
||||
* @author Edouard DUPIN
|
||||
*
|
||||
* @copyright 2010, Edouard DUPIN, all right reserved
|
||||
*
|
||||
* @license GPL v3 (see license file)
|
||||
*/
|
||||
|
||||
#ifndef __APPL_DEBUG_H__
|
||||
#define __APPL_DEBUG_H__
|
||||
|
||||
#include <etk/log.h>
|
||||
|
||||
namespace appl {
|
||||
int32_t getLogId();
|
||||
};
|
||||
|
||||
#define APPL_BASE(info,data) TK_LOG_BASE(appl::getLogId(),info,data)
|
||||
|
||||
#define APPL_CRITICAL(data) APPL_BASE(1, data)
|
||||
#define APPL_ERROR(data) APPL_BASE(2, data)
|
||||
#define APPL_WARNING(data) APPL_BASE(3, data)
|
||||
#ifdef DEBUG
|
||||
#define APPL_INFO(data) APPL_BASE(4, data)
|
||||
#define APPL_DEBUG(data) APPL_BASE(5, data)
|
||||
#define APPL_VERBOSE(data) APPL_BASE(6, data)
|
||||
#define APPL_TODO(data) APPL_BASE(4, "TODO : " << data)
|
||||
#else
|
||||
#define APPL_INFO(data) do { } while(false)
|
||||
#define APPL_DEBUG(data) do { } while(false)
|
||||
#define APPL_VERBOSE(data) do { } while(false)
|
||||
#define APPL_TODO(data) do { } while(false)
|
||||
#endif
|
||||
|
||||
#define APPL_ASSERT(cond,data) \
|
||||
do { \
|
||||
if (!(cond)) { \
|
||||
APPL_CRITICAL(data); \
|
||||
assert(!#cond); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#endif
|
@ -4,7 +4,7 @@
|
||||
* @license APACHE v2.0 (see license file)
|
||||
*/
|
||||
|
||||
#include <test/debug.h>
|
||||
#include <test-debug/debug.h>
|
||||
#include <gtest/gtest.h>
|
||||
#include <audio/drain/Process.h>
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
* @license APACHE v2.0 (see license file)
|
||||
*/
|
||||
|
||||
#include <test/debug.h>
|
||||
#include <test-debug/debug.h>
|
||||
#include <gtest/gtest.h>
|
||||
#include <audio/drain/Process.h>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
#include <etk/etk.h>
|
||||
#include <test/debug.h>
|
||||
#include <test-debug/debug.h>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
|
||||
@ -21,8 +21,8 @@ int main(int _argc, const char** _argv) {
|
||||
std::string data = _argv[iii];
|
||||
if ( data == "-h"
|
||||
|| data == "--help") {
|
||||
APPL_INFO("Help : ");
|
||||
APPL_INFO(" ./xxx ---");
|
||||
TEST_INFO("Help : ");
|
||||
TEST_INFO(" ./xxx ---");
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
* @license APACHE v2.0 (see license file)
|
||||
*/
|
||||
|
||||
#include <test/debug.h>
|
||||
#include <test-debug/debug.h>
|
||||
#include <gtest/gtest.h>
|
||||
#include <audio/drain/Process.h>
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
* @license APACHE v2.0 (see license file)
|
||||
*/
|
||||
|
||||
#include <test/debug.h>
|
||||
#include <test-debug/debug.h>
|
||||
#include <gtest/gtest.h>
|
||||
#include <audio/drain/Process.h>
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
* @license APACHE-2 (see license file)
|
||||
*/
|
||||
|
||||
#include <etk/types.h>
|
||||
#include <ewol/ewol.h>
|
||||
#include <appl/debug.h>
|
||||
#include <appl/Windows.h>
|
||||
@ -18,6 +19,25 @@
|
||||
#undef __class__
|
||||
#define __class__ "Windows"
|
||||
|
||||
#define APPL_SAVE_FILE_MACRO(type,fileName,dataPointer,nbElement) \
|
||||
do { \
|
||||
static FILE *pointerOnFile = nullptr; \
|
||||
static bool errorOpen = false; \
|
||||
if (pointerOnFile == nullptr) { \
|
||||
APPL_WARNING("open file '" << fileName << "' type=" << #type); \
|
||||
pointerOnFile = fopen(fileName,"w"); \
|
||||
if ( errorOpen == false \
|
||||
&& pointerOnFile == nullptr) { \
|
||||
APPL_ERROR("ERROR OPEN file ... '" << fileName << "' type=" << #type); \
|
||||
errorOpen=true; \
|
||||
} \
|
||||
} \
|
||||
if (pointerOnFile != nullptr) { \
|
||||
fwrite((dataPointer), sizeof(type), (nbElement), pointerOnFile); \
|
||||
/* fflush(pointerOnFile);*/ \
|
||||
} \
|
||||
}while(0)
|
||||
|
||||
appl::Windows::Windows() :
|
||||
m_sampleRate(48000),
|
||||
m_type(audio::algo::drain::biQuadType_lowPass),
|
||||
@ -202,7 +222,7 @@ void appl::Windows::onCallbackFrequencySlider(const float& _value) {
|
||||
onCallbackStart();
|
||||
}
|
||||
|
||||
#include <audio/river/debug.h>
|
||||
#include <appl/debug.h>
|
||||
#include <audio/algo/drain/BiQuad.h>
|
||||
#include <audio/float_t.h>
|
||||
#include <audio/int16_16_t.h>
|
||||
@ -253,9 +273,9 @@ void appl::Windows::onCallbackStart16() {
|
||||
int16_t* output = nullptr;
|
||||
void* outputVoid = nullptr;
|
||||
size_t outputNbChunk = 0;
|
||||
RIVER_SAVE_FILE_MACRO(int16_t,"aaa_test_INPUT_16.raw",&data[0],data.size());
|
||||
APPL_SAVE_FILE_MACRO(int16_t,"aaa_test_INPUT_16.raw",&data[0],data.size());
|
||||
bq.process(&data[0], &data[0], data.size(), 1, 1);
|
||||
RIVER_SAVE_FILE_MACRO(int16_t,"aaa_test_OUTPUT_16.raw",&data[0],data.size());
|
||||
APPL_SAVE_FILE_MACRO(int16_t,"aaa_test_OUTPUT_16.raw",&data[0],data.size());
|
||||
audio::int16_16_t value = 0;
|
||||
for (size_t iii=800; iii<data.size()-200; ++iii) {
|
||||
value = std::max(value, data[iii]);
|
||||
@ -292,9 +312,9 @@ void appl::Windows::onCallbackStartFloat() {
|
||||
m_phase -= 2*M_PI;
|
||||
}
|
||||
}
|
||||
RIVER_SAVE_FILE_MACRO(float,"aaa_test_INPUT_F.raw",&data[0],data.size());
|
||||
APPL_SAVE_FILE_MACRO(float,"aaa_test_INPUT_F.raw",&data[0],data.size());
|
||||
bq.process(&data[0], &data[0], data.size(), 1, 1);
|
||||
RIVER_SAVE_FILE_MACRO(float,"aaa_test_OUTPUT_F.raw",&data[0],data.size());
|
||||
APPL_SAVE_FILE_MACRO(float,"aaa_test_OUTPUT_F.raw",&data[0],data.size());
|
||||
audio::float_t value = 0.0f;
|
||||
for (size_t iii=800; iii<data.size()-200; ++iii) {
|
||||
value = std::max(value, data[iii]);
|
||||
|
@ -3,30 +3,41 @@ import lutin.module as module
|
||||
import lutin.tools as tools
|
||||
|
||||
|
||||
# optionnal : Describe in the "lutin.py --help"
|
||||
def get_desc():
|
||||
return "drain_biquad_profiling : basic test and profiling of equalizer work or not"
|
||||
def get_type():
|
||||
return "BINARY"
|
||||
|
||||
def create(target):
|
||||
my_module = module.Module(__file__, 'drain_biquad_profiling', 'BINARY')
|
||||
# add the file to compile:
|
||||
def get_sub_type():
|
||||
return "TOOLS"
|
||||
|
||||
def get_desc():
|
||||
return "basic test and profiling of equalizer work or not"
|
||||
|
||||
def get_licence():
|
||||
return "APACHE-2"
|
||||
|
||||
def get_compagny_type():
|
||||
return "com"
|
||||
|
||||
def get_compagny_name():
|
||||
return "atria-soft"
|
||||
|
||||
def get_maintainer():
|
||||
return ["Mr DUPIN Edouard <yui.heero@gmail.com>"]
|
||||
|
||||
def create(target, module_name):
|
||||
my_module = module.Module(__file__, module_name, get_type())
|
||||
my_module.add_src_file([
|
||||
'appl/main.cpp',
|
||||
'appl/debug.cpp',
|
||||
'appl/Windows.cpp',
|
||||
'appl/widget/DisplayFrequency.cpp',
|
||||
])
|
||||
# add Library dependency name
|
||||
my_module.add_module_depend(['ewol', 'audio-drain', 'audio-river'])
|
||||
# add application C flags
|
||||
my_module.compile_flags('c++', [
|
||||
"-DPROJECT_NAME=\"\\\""+my_module.name+"\\\"\""])
|
||||
# Add current include Path
|
||||
"-DPROJECT_NAME=\"\\\""+my_module.name+"\\\"\""
|
||||
])
|
||||
my_module.add_path(tools.get_current_path(__file__))
|
||||
# copy internal datas
|
||||
my_module.copy_folder("data/*")
|
||||
|
||||
# return the created module
|
||||
my_module.copy_path("data/*")
|
||||
return my_module
|
||||
|
||||
|
||||
|
@ -17,6 +17,25 @@
|
||||
#undef __class__
|
||||
#define __class__ "Windows"
|
||||
|
||||
#define APPL_SAVE_FILE_MACRO(type,fileName,dataPointer,nbElement) \
|
||||
do { \
|
||||
static FILE *pointerOnFile = nullptr; \
|
||||
static bool errorOpen = false; \
|
||||
if (pointerOnFile == nullptr) { \
|
||||
APPL_WARNING("open file '" << fileName << "' type=" << #type); \
|
||||
pointerOnFile = fopen(fileName,"w"); \
|
||||
if ( errorOpen == false \
|
||||
&& pointerOnFile == nullptr) { \
|
||||
APPL_ERROR("ERROR OPEN file ... '" << fileName << "' type=" << #type); \
|
||||
errorOpen=true; \
|
||||
} \
|
||||
} \
|
||||
if (pointerOnFile != nullptr) { \
|
||||
fwrite((dataPointer), sizeof(type), (nbElement), pointerOnFile); \
|
||||
/* fflush(pointerOnFile);*/ \
|
||||
} \
|
||||
}while(0)
|
||||
|
||||
appl::Windows::Windows() :
|
||||
m_sampleRate(48000) {
|
||||
addObjectType("appl::Windows");
|
||||
@ -107,9 +126,6 @@ void appl::Windows::onCallbackGain(const float& _value, int32_t _id) {
|
||||
onCallbackStart();
|
||||
}
|
||||
|
||||
|
||||
#include <audio/river/debug.h>
|
||||
|
||||
std11::shared_ptr<audio::drain::Equalizer> appl::Windows::createEqualizer(enum audio::format _format) {
|
||||
std::vector<audio::channel> map;
|
||||
map.push_back(audio::channel_frontCenter);
|
||||
@ -193,10 +209,10 @@ void appl::Windows::onCallbackStart16() {
|
||||
void* outputVoid = nullptr;
|
||||
size_t outputNbChunk = 0;
|
||||
audio::Time time;
|
||||
RIVER_SAVE_FILE_MACRO(int16_t, "aaa_test_INPUT.raw", &data[0], data.size());
|
||||
APPL_SAVE_FILE_MACRO(int16_t, "aaa_test_INPUT.raw", &data[0], data.size());
|
||||
eq->process(time, &data[0], data.size(), outputVoid, outputNbChunk);
|
||||
output = static_cast<int16_t*>(outputVoid);
|
||||
RIVER_SAVE_FILE_MACRO(int16_t, "aaa_test_OUTPUT.raw", output, outputNbChunk);
|
||||
APPL_SAVE_FILE_MACRO(int16_t, "aaa_test_OUTPUT.raw", output, outputNbChunk);
|
||||
int16_t value = 0;
|
||||
for (size_t iii=800; iii<outputNbChunk-200; ++iii) {
|
||||
value = std::max(value, output[iii]);
|
||||
@ -234,10 +250,10 @@ void appl::Windows::onCallbackStartFloat() {
|
||||
void* outputVoid = nullptr;
|
||||
size_t outputNbChunk = 0;
|
||||
audio::Time time;
|
||||
RIVER_SAVE_FILE_MACRO(int16_t,"aaa_test_INPUT_F.raw",&data[0],data.size());
|
||||
APPL_SAVE_FILE_MACRO(int16_t,"aaa_test_INPUT_F.raw",&data[0],data.size());
|
||||
eq->process(time, &data[0], data.size(), outputVoid, outputNbChunk);
|
||||
output = static_cast<float*>(outputVoid);
|
||||
RIVER_SAVE_FILE_MACRO(int16_t,"aaa_test_OUTPUT_F.raw",output, outputNbChunk);
|
||||
APPL_SAVE_FILE_MACRO(int16_t,"aaa_test_OUTPUT_F.raw",output, outputNbChunk);
|
||||
float value = 0;
|
||||
for (size_t iii=800; iii<outputNbChunk-200; ++iii) {
|
||||
value = std::max(value, output[iii]);
|
||||
|
@ -3,30 +3,41 @@ import lutin.module as module
|
||||
import lutin.tools as tools
|
||||
|
||||
|
||||
# optionnal : Describe in the "lutin.py --help"
|
||||
def get_desc():
|
||||
return "drain_equalizer_profiling : basic test and profiling of equalizer work or not"
|
||||
def get_type():
|
||||
return "BINARY"
|
||||
|
||||
def create(target):
|
||||
my_module = module.Module(__file__, 'drain_equalizer_profiling', 'BINARY')
|
||||
# add the file to compile:
|
||||
def get_sub_type():
|
||||
return "TOOLS"
|
||||
|
||||
def get_desc():
|
||||
return "basic test and profiling of equalizer work or not"
|
||||
|
||||
def get_licence():
|
||||
return "APACHE-2"
|
||||
|
||||
def get_compagny_type():
|
||||
return "com"
|
||||
|
||||
def get_compagny_name():
|
||||
return "atria-soft"
|
||||
|
||||
def get_maintainer():
|
||||
return ["Mr DUPIN Edouard <yui.heero@gmail.com>"]
|
||||
|
||||
def create(target, module_name):
|
||||
my_module = module.Module(__file__, module_name, get_type())
|
||||
my_module.add_src_file([
|
||||
'appl/main.cpp',
|
||||
'appl/debug.cpp',
|
||||
'appl/Windows.cpp',
|
||||
'appl/widget/DisplayFrequency.cpp',
|
||||
])
|
||||
# add Library dependency name
|
||||
my_module.add_module_depend(['ewol', 'audio-drain', 'audio-river'])
|
||||
# add application C flags
|
||||
my_module.compile_flags('c++', [
|
||||
"-DPROJECT_NAME=\"\\\""+my_module.name+"\\\"\""])
|
||||
# Add current include Path
|
||||
"-DPROJECT_NAME=\"\\\""+my_module.name+"\\\"\""
|
||||
])
|
||||
my_module.add_path(tools.get_current_path(__file__))
|
||||
# copy internal datas
|
||||
my_module.copy_folder("data/*")
|
||||
|
||||
# return the created module
|
||||
my_module.copy_path("data/*")
|
||||
return my_module
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user