[DEV] set compilation back ...

- update ejson
- update ememory
- umdate lutin
- umdate ewol
- update gale
This commit is contained in:
Edouard DUPIN 2016-10-04 21:20:40 +02:00
parent 2f3a2c5976
commit c01b518f05
49 changed files with 604 additions and 760 deletions

1
authors.txt Normal file
View File

@ -0,0 +1 @@
MR Edouard DUPIN <yui.heero@gmail.com>

View File

@ -1,17 +1,12 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
*
* @license BSD v3 (see license file)
* @license APACHE v2.0 (see license file)
*/
#include <eaudiofx/debug.h>
#include <eaudiofx/Thread.h>
#include <eaudiofx/debug.hpp>
#include <eaudiofx/Thread.hpp>
#include <unistd.h>
#undef __class__
#define __class__ "Thread"
static const char* threadGetCharState(enum eaudiofx::status state) {
const char* ret = (const char*)"";

View File

@ -1,19 +1,14 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
*
* @license BSD v3 (see license file)
* @license APACHE v2.0 (see license file)
*/
#ifndef __EAUDIO_FX_THREAD_H__
#define __EAUDIO_FX_THREAD_H__
#pragma once
#include <thread>
#include <mutex>
#include <etk/os/Fifo.h>
#include <eaudiofx/core/audio.h>
#include <etk/os/Fifo.hpp>
#include <eaudiofx/core/audio.hpp>
/**
* @brief Tanho thread system (parent class)
@ -73,4 +68,3 @@ namespace eaudiofx {
};
};
#endif

View File

@ -1,20 +1,18 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
*
* @license BSD v3 (see license file)
* @license APACHE v2.0 (see license file)
*/
#include <eaudiofx/debug.h>
#include <eaudiofx/base/GeneratorSignal.h>
#include <eaudiofx/core/BufferStream.h>
#include <eaudiofx/base/GeneratorFile.h>
#include <eaudiofx/debug.hpp>
#include <eaudiofx/base/GeneratorSignal.hpp>
#include <eaudiofx/core/BufferStream.hpp>
#include <eaudiofx/base/GeneratorFile.hpp>
eaudiofx::GeneratorFile::GeneratorFile() :
m_file(NULL) {
m_file(nullptr) {
// set output :
m_io.insert(
std::pair<std::string, eaudiofx::Block::IOProperty>(
@ -35,7 +33,7 @@ int32_t eaudiofx::GeneratorFile::pull(double _currentTime, int32_t _request, flo
}
eaudiofx::BufferStream* buffer = dynamic_cast<eaudiofx::BufferStream*>(it->second.m_buffer);
//EAUDIOFX_ERROR("Generate data, request : " << _request << " at time : " << _currentTime);
if (buffer == NULL) {
if (buffer == nullptr) {
// !! impossible case => a buffer can not be removed ...
EAUDIOFX_ERROR("Buffer has been removed... OR change type ...");
return eaudiofx::ERR_FAIL;
@ -43,7 +41,7 @@ int32_t eaudiofx::GeneratorFile::pull(double _currentTime, int32_t _request, flo
//request outpuffer needed size :
buffer->setProperty(_request);
uint8_t* data = buffer->getData();
if (m_file == NULL) {
if (m_file == nullptr) {
EAUDIOFX_ERROR("Buffer output error ==> !!ERROR!!");
return eaudiofx::ERR_FAIL;
}
@ -55,7 +53,7 @@ int32_t eaudiofx::GeneratorFile::pull(double _currentTime, int32_t _request, flo
int32_t eaudiofx::GeneratorFile::init() {
m_file = new etk::FSNode("DATA:menu.wav");
if (m_file == NULL) {
if (m_file == nullptr) {
EAUDIOFX_ERROR("Can not allocate the input file ...");
return eaudiofx::ERR_FAIL;
}
@ -68,17 +66,17 @@ int32_t eaudiofx::GeneratorFile::init() {
int32_t eaudiofx::GeneratorFile::unInit() {
if (m_file == NULL) {
if (m_file == nullptr) {
return eaudiofx::ERR_NONE;
}
if (m_file->fileClose() == false) {
EAUDIOFX_ERROR("Can not close the input file ...");
delete(m_file);
m_file = NULL;
m_file = nullptr;
return eaudiofx::ERR_FAIL;
}
delete(m_file);
m_file = NULL;
m_file = nullptr;
return eaudiofx::ERR_NONE;
}

View File

@ -1,16 +1,12 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
*
* @license BSD v3 (see license file)
* @license APACHE v2.0 (see license file)
*/
#pragma once
#ifndef __EAUDIOFX_GENERATOR_FILE_H__
#define __EAUDIOFX_GENERATOR_FILE_H__
#include <eaudiofx/core/BlockGenerator.h>
#include <etk/os/FSNode.h>
#include <eaudiofx/core/BlockGenerator.hpp>
#include <etk/os/FSNode.hpp>
namespace eaudiofx {
class GeneratorFile : public eaudiofx::BlockGenerator {
@ -26,6 +22,5 @@ namespace eaudiofx {
};
};
#endif

View File

@ -1,14 +1,12 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
*
* @license BSD v3 (see license file)
* @license APACHE v2.0 (see license file)
*/
#include <eaudiofx/base/GeneratorRtAudio.h>
#include <eaudiofx/core/BufferAudioRaw.h>
#include <airtaudio/Interface.h>
#include <eaudiofx/base/GeneratorRtAudio.hpp>
#include <eaudiofx/core/BufferAudioRaw.hpp>
#include <airtaudio/Interface.hpp>
eaudiofx::GeneratorRiver::GeneratorRiver() {
setLive(true);

View File

@ -1,15 +1,11 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
*
* @license BSD v3 (see license file)
* @license APACHE v2.0 (see license file)
*/
#pragma once
#ifndef __EAUDIOFX_GENERATOR_RIVER_H__
#define __EAUDIOFX_GENERATOR_RIVER_H__
#include <eaudiofx/core/BlockGenerator.h>
#include <eaudiofx/core/BlockGenerator.hpp>
namespace eaudiofx {
class GeneratorRiver : public eaudiofx::BlockGenerator {
@ -21,6 +17,5 @@ namespace eaudiofx {
};
};
#endif

View File

@ -1,19 +1,13 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
*
* @license BSD v3 (see license file)
* @license APACHE v2.0 (see license file)
*/
#include <eaudiofx/debug.h>
#include <eaudiofx/base/GeneratorSignal.h>
#include <eaudiofx/core/BufferAudio.h>
#include <math.h>
#undef __class__
#define __class__ "GeneratorSignal"
#include <eaudiofx/debug.hpp>
#include <eaudiofx/base/GeneratorSignal.hpp>
#include <eaudiofx/core/BufferAudio.hpp>
#include <cmath>
void eaudiofx::GeneratorSignal::init() {
eaudiofx::Block::init();
@ -39,7 +33,7 @@ int32_t eaudiofx::GeneratorSignal::pull(double _currentTime, int32_t _request, f
}
eaudiofx::BufferAudioRaw* buffer = dynamic_cast<eaudiofx::BufferAudioRaw*>(it->second.m_buffer);
//EAUDIOFX_ERROR("Generate data, request : " << _request << " at time : " << _currentTime);
if (buffer == NULL) {
if (buffer == nullptr) {
// !! impossible case => a buffer can not be removed ...
EAUDIOFX_ERROR("Buffer has been removed... OR change type ...");
return eaudiofx::ERR_FAIL;

View File

@ -1,16 +1,12 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
*
* @license BSD v3 (see license file)
* @license APACHE v2.0 (see license file)
*/
#pragma once
#ifndef __EAUDIOFX_GENERATOR_SIGNAL_H__
#define __EAUDIOFX_GENERATOR_SIGNAL_H__
#include <eaudiofx/core/Block.h>
#include <eaudiofx/core/BufferAudio.h>
#include <eaudiofx/core/Block.hpp>
#include <eaudiofx/core/BufferAudio.hpp>
namespace eaudiofx {
class GeneratorSignal : public eaudiofx::Block {
@ -29,6 +25,4 @@ namespace eaudiofx {
};
};
#endif

View File

@ -1,13 +1,10 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
*
* @license BSD v3 (see license file)
* @license APACHE v2.0 (see license file)
*/
#include <eaudiofx/debug.h>
#include <eaudiofx/base/ReceiverFile.h>
#include <eaudiofx/debug.hpp>
#include <eaudiofx/base/ReceiverFile.hpp>
eaudiofx::ReceiverFile::ReceiverFile() :
@ -23,14 +20,14 @@ eaudiofx::ReceiverFile::ReceiverFile() :
eaudiofx::Block::IOProperty(
eaudiofx::Block::ioInput,
"{ type:'audio', compression:'raw', frequency:16000, channel:4, format:'int16_t' }",
NULL
nullptr
) ) );
}
int32_t eaudiofx::ReceiverFile::init() {
m_file = new etk::FSNode("ouput.raw");
if (m_file == NULL) {
if (m_file == nullptr) {
EAUDIOFX_ERROR("Can not allocate the output file ...");
return eaudiofx::ERR_FAIL;
}
@ -43,17 +40,17 @@ int32_t eaudiofx::ReceiverFile::init() {
int32_t eaudiofx::ReceiverFile::unInit() {
EAUDIOFX_DEBUG("un-init Stream ...");
if (m_file == NULL) {
if (m_file == nullptr) {
return eaudiofx::ERR_NONE;
}
if (m_file->fileClose() == false) {
EAUDIOFX_ERROR("Can not close the input file ...");
delete(m_file);
m_file = NULL;
m_file = nullptr;
return eaudiofx::ERR_FAIL;
}
delete(m_file);
m_file = NULL;
m_file = nullptr;
return eaudiofx::ERR_NONE;
};
@ -78,7 +75,7 @@ int32_t eaudiofx::ReceiverFile::pull(double _currentTime, int32_t _request, floa
}
eaudiofx::BufferStream* buffer = dynamic_cast<eaudiofx::BufferStream*>(it->second.m_buffer);
//EAUDIOFX_ERROR("Generate data, request : " << _request << " at time : " << _currentTime);
if (buffer == NULL) {
if (buffer == nullptr) {
// !! impossible case => a buffer can not be removed ...
EAUDIOFX_ERROR("Buffer has been removed... OR change type ...");
return eaudiofx::ERR_FAIL;
@ -86,7 +83,7 @@ int32_t eaudiofx::ReceiverFile::pull(double _currentTime, int32_t _request, floa
//request outpuffer needed size :
buffer->setProperty(_request);
uint8_t* data = buffer->getData();
if (m_file == NULL) {
if (m_file == nullptr) {
EAUDIOFX_ERROR("Buffer output error ==> !!ERROR!!");
return eaudiofx::ERR_FAIL;
}

View File

@ -1,16 +1,12 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
*
* @license BSD v3 (see license file)
* @license APACHE v2.0 (see license file)
*/
#pragma once
#ifndef __EAUDIOFX_RECEIVER_FILE_H__
#define __EAUDIOFX_RECEIVER_FILE_H__
#include <eaudiofx/core/BlockReceiver.h>
#include <etk/os/FSNode.h>
#include <eaudiofx/core/BlockReceiver.hpp>
#include <etk/os/FSNode.hpp>
namespace eaudiofx {
class ReceiverFile : public eaudiofx::BlockReceiver {
@ -32,6 +28,4 @@ namespace eaudiofx {
};
};
#endif

View File

@ -1,18 +1,12 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
*
* @license BSD v3 (see license file)
* @license APACHE v2.0 (see license file)
*/
#include <eaudiofx/debug.h>
#include <eaudiofx/base/ReceiverRiver.h>
#include <eaudiofx/core/BufferAudio.h>
#undef __class__
#define __class__ "ReceiverRiver"
#include <eaudiofx/debug.hpp>
#include <eaudiofx/base/ReceiverRiver.hpp>
#include <eaudiofx/core/BufferAudio.hpp>
int32_t eaudiofx::ReceiverRiver::algoProcess(int64_t _currentTime, int64_t _processTimeSlot) {
@ -34,7 +28,7 @@ eaudiofx::ReceiverRiver::ReceiverRiver() :
void eaudiofx::ReceiverRiver::onDataNeeded(void* _data,
const std11::chrono::system_clock::time_point& _time,
const audio::Time& _time,
size_t _nbChunk,
enum audio::format _format,
uint32_t _frequency,
@ -71,14 +65,14 @@ int32_t eaudiofx::ReceiverRiver::algoInit() {
return eaudiofx::ERR_FAIL;
}
// set callback mode ...
m_interface->setOutputCallback(std11::bind(&ReceiverRiver::onDataNeeded,
m_interface->setOutputCallback(std::bind(&ReceiverRiver::onDataNeeded,
this,
std11::placeholders::_1,
std11::placeholders::_2,
std11::placeholders::_3,
std11::placeholders::_4,
std11::placeholders::_5,
std11::placeholders::_6));
std::placeholders::_1,
std::placeholders::_2,
std::placeholders::_3,
std::placeholders::_4,
std::placeholders::_5,
std::placeholders::_6));
m_interface->start();
return eaudiofx::ERR_NONE;
};

View File

@ -1,24 +1,20 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
*
* @license BSD v3 (see license file)
* @license APACHE v2.0 (see license file)
*/
#pragma once
#ifndef __EAUDIOFX_RECEIVER_RIVER_H__
#define __EAUDIOFX_RECEIVER_RIVER_H__
#include <eaudiofx/core/Block.h>
#include <audio/river/Interface.h>
#include <audio/river/Manager.h>
#include <eaudiofx/core/BufferAudio.h>
#include <eaudiofx/core/Block.hpp>
#include <audio/river/Interface.hpp>
#include <audio/river/Manager.hpp>
#include <eaudiofx/core/BufferAudio.hpp>
namespace eaudiofx {
class ReceiverRiver : public eaudiofx::Block {
private:
void onDataNeeded(void* _data,
const std11::chrono::system_clock::time_point& _time,
const audio::Time& _time,
size_t _nbChunk,
enum audio::format _format,
uint32_t _frequency,
@ -38,8 +34,8 @@ namespace eaudiofx {
virtual int32_t algoStart();
virtual int32_t algoStop();
protected:
std11::shared_ptr<audio::river::Manager> m_manager;
std11::shared_ptr<audio::river::Interface> m_interface;
ememory::SharedPtr<audio::river::Manager> m_manager;
ememory::SharedPtr<audio::river::Interface> m_interface;
std::vector<int8_t> m_buffer;
public:
int32_t algoProcess(int64_t _currentTime, int64_t _processTimeSlot);
@ -48,6 +44,5 @@ namespace eaudiofx {
};
};
#endif

View File

@ -1,19 +1,13 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
*
* @license BSD v3 (see license file)
* @license APACHE v2.0 (see license file)
*/
#include <eaudiofx/debug.h>
#include <eaudiofx/core/Block.h>
#include <eaudiofx/core/Buffer.h>
#include <eaudiofx/core/BlockMeta.h>
#undef __class__
#define __class__ "Block"
#include <eaudiofx/debug.hpp>
#include <eaudiofx/core/Block.hpp>
#include <eaudiofx/core/Buffer.hpp>
#include <eaudiofx/core/BlockMeta.hpp>
eaudiofx::Block::Block() {
addObjectType("eaudiofx::Block");
@ -25,12 +19,12 @@ eaudiofx::Block::~Block() {
std::shared_ptr<eaudiofx::Block> eaudiofx::Block::getBlockNamed(const std::string& _name) {
std::shared_ptr<eaudiofx::Block> out;
ememory::SharedPtr<eaudiofx::Block> eaudiofx::Block::getBlockNamed(const std::string& _name) {
ememory::SharedPtr<eaudiofx::Block> out;
EAUDIOFX_INFO(" get block : " << _name);
std::shared_ptr<ewol::Object> parrent = m_parent.lock();
ewol::ObjectShared parrent = m_parent.lock();
if (parrent != nullptr) {
std::shared_ptr<eaudiofx::Block> parrentBlock = std::dynamic_pointer_cast<eaudiofx::Block>(parrent);
ememory::SharedPtr<eaudiofx::Block> parrentBlock = ememory::dynamicPointerCast<eaudiofx::Block>(parrent);
if (parrentBlock != nullptr) {
return parrentBlock->getBlockNamed(_name);
} else {

View File

@ -1,21 +1,17 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
*
* @license BSD v3 (see license file)
* @license APACHE v2.0 (see license file)
*/
#ifndef __EAUDIOFX_BLOCK_H__
#define __EAUDIOFX_BLOCK_H__
#pragma once
#include <string>
#include <mutex>
#include <map>
#include <ewol/object/Object.h>
#include <eaudiofx/core/audio.h>
#include <eaudiofx/flow/Interface.h>
#include <eaudiofx/flow/Flow.h>
#include <ewol/object/Object.hpp>
#include <eaudiofx/core/audio.hpp>
#include <eaudiofx/flow/Interface.hpp>
#include <eaudiofx/flow/Flow.hpp>
namespace eaudiofx {
@ -90,10 +86,9 @@ namespace eaudiofx {
int32_t algoProcess(int64_t _currentTime, int64_t _processTimeSlot) {
return eaudiofx::ERR_NONE;
}
virtual std::shared_ptr<eaudiofx::Block> getBlockNamed(const std::string& _name);
virtual ememory::SharedPtr<eaudiofx::Block> getBlockNamed(const std::string& _name);
};
};
#endif

View File

@ -1,16 +1,11 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
*
* @license BSD v3 (see license file)
* @license APACHE v2.0 (see license file)
*/
#include <eaudiofx/debug.h>
#include <eaudiofx/core/BlockMeta.h>
#undef __class__
#define __class__ "BlockMeta"
#include <eaudiofx/debug.hpp>
#include <eaudiofx/core/BlockMeta.hpp>
eaudiofx::BlockMeta::BlockMeta() {
@ -23,13 +18,13 @@ eaudiofx::BlockMeta::~BlockMeta() {
if (it == nullptr) {
continue;
}
std::shared_ptr<eaudiofx::Block> tmp = it;
ememory::SharedPtr<eaudiofx::Block> tmp = it;
it.reset();
}
m_list.clear();
}
std::shared_ptr<eaudiofx::Block> eaudiofx::BlockMeta::getBlock(const std::string& _name) {
ememory::SharedPtr<eaudiofx::Block> eaudiofx::BlockMeta::getBlock(const std::string& _name) {
if (_name.size() == 0) {
return nullptr;
}
@ -37,32 +32,32 @@ std::shared_ptr<eaudiofx::Block> eaudiofx::BlockMeta::getBlock(const std::string
if (it == nullptr) {
continue;
}
if (it->getName() == _name) {
if (it->propertyName.get() == _name) {
return it;
}
}
return nullptr;
}
int32_t eaudiofx::BlockMeta::addBlock(const std::shared_ptr<eaudiofx::Block>& _block) {
int32_t eaudiofx::BlockMeta::addBlock(ememory::SharedPtr<eaudiofx::Block> _block) {
if (_block == nullptr) {
EAUDIOFX_ERROR("[" << getId() << "] Add nullptr block");
return eaudiofx::ERR_INPUT_NULL;
}
if (_block->getName().size() > 0 ) {
if (_block->propertyName.get().size() > 0 ) {
// Check if name exist :
for (auto &it : m_list) {
if (it == nullptr) {
continue;
}
if (it->getName() == _block->getName()) {
EAUDIOFX_ERROR("[" << getId() << "] Add block name '" << _block->getName() << "' already exist");
if (it->propertyName.get() == _block->propertyName.get()) {
EAUDIOFX_ERROR("[" << getId() << "] Add block name '" << _block->propertyName.get() << "' already exist");
return eaudiofx::ERR_ALREADY_EXIST;
}
}
}
m_list.push_back(_block);
_block->setParent(shared_from_this());
_block->setParent(sharedFromThis());
return eaudiofx::ERR_NONE;
}
@ -82,7 +77,7 @@ int32_t eaudiofx::BlockMeta::linkBlock(const std::string& _generatorBlockName,
const std::string& _receiverBlockName,
const std::string& _receiverIoName) {
// TODO : proxy IOs
std::shared_ptr<eaudiofx::Block> receive = getBlock(_receiverBlockName);
ememory::SharedPtr<eaudiofx::Block> receive = getBlock(_receiverBlockName);
if (receive == nullptr) {
EAUDIOFX_ERROR("Can not find destination block : '" << _receiverBlockName << "'");
return eaudiofx::ERR_FAIL;
@ -103,7 +98,7 @@ int32_t eaudiofx::BlockMeta::openStream(const std::string& _stream) {
int32_t eaudiofx::BlockMeta::algoInit() {
EAUDIOFX_INFO("[" << getId() << "]Init Meta block : '" << getName() << "'");
EAUDIOFX_INFO("[" << getId() << "]Init Meta block : '" << propertyName << "'");
int32_t ret = eaudiofx::ERR_NONE;
for (auto &it : m_list) {
if (it == nullptr) {
@ -114,7 +109,7 @@ int32_t eaudiofx::BlockMeta::algoInit() {
}
}
if (ret != eaudiofx::ERR_NONE) {
EAUDIOFX_WARNING("Pb when init the Meta-block '" << getName() << "' ");
EAUDIOFX_WARNING("Pb when init the Meta-block '" << propertyName << "' ");
}
return ret;
};
@ -130,14 +125,14 @@ int32_t eaudiofx::BlockMeta::algoUnInit() {
}
}
if (ret != eaudiofx::ERR_NONE) {
EAUDIOFX_WARNING("Pb when un-init the Meta-block '" << getName() << "' ");
EAUDIOFX_WARNING("Pb when un-init the Meta-block '" << propertyName << "' ");
}
return ret;
};
int32_t eaudiofx::BlockMeta::algoStart() {
EAUDIOFX_INFO("[" << getId() << "] Start Meta block : '" << getName() << "'");
EAUDIOFX_INFO("[" << getId() << "] Start Meta block : '" << propertyName << "'");
int32_t ret = eaudiofx::ERR_NONE;
for (auto &it : m_list) {
if (it == nullptr) {
@ -148,13 +143,13 @@ int32_t eaudiofx::BlockMeta::algoStart() {
}
}
if (ret != eaudiofx::ERR_NONE) {
EAUDIOFX_WARNING("Pb when start the Meta-block '" << getName() << "' ");
EAUDIOFX_WARNING("Pb when start the Meta-block '" << propertyName << "' ");
}
return ret;
};
int32_t eaudiofx::BlockMeta::algoStop() {
EAUDIOFX_INFO("[" << getId() << "] Stop Meta block : '" << getName() << "'");
EAUDIOFX_INFO("[" << getId() << "] Stop Meta block : '" << propertyName << "'");
int32_t ret = eaudiofx::ERR_NONE;
for (auto &it : m_list) {
if (it == nullptr) {
@ -165,28 +160,28 @@ int32_t eaudiofx::BlockMeta::algoStop() {
}
}
if (ret != eaudiofx::ERR_NONE) {
EAUDIOFX_WARNING("Pb when stop the Meta-block '" << getName() << "' ");
EAUDIOFX_WARNING("Pb when stop the Meta-block '" << propertyName << "' ");
}
return ret;
};
std::shared_ptr<eaudiofx::Block> eaudiofx::BlockMeta::getBlockNamed(const std::string& _name) {
std::shared_ptr<eaudiofx::Block> out;
EAUDIOFX_DEBUG("[" << m_name << "] try get Block : " << _name);
ememory::SharedPtr<eaudiofx::Block> eaudiofx::BlockMeta::getBlockNamed(const std::string& _name) {
ememory::SharedPtr<eaudiofx::Block> out;
EAUDIOFX_DEBUG("[" << propertyName << "] try get Block : " << _name);
// Special case for proxy flow ...
if ( _name == ""
|| _name == m_name.get()) {
|| _name == propertyName.get()) {
EAUDIOFX_DEBUG(" ==> find Him");
return std::static_pointer_cast<eaudiofx::Block>(shared_from_this());
return ememory::staticPointerCast<eaudiofx::Block>(sharedFromThis());
}
// find in sub elements.
for (auto &it : m_list) {
if (it == nullptr) {
continue;
}
EAUDIOFX_DEBUG(" check : " << it->getName());
if (it->getName() == _name) {
EAUDIOFX_DEBUG(" check : " << it->propertyName.get());
if (it->propertyName.get() == _name) {
out = it;
EAUDIOFX_DEBUG(" ==> find this one");
break;
@ -196,7 +191,7 @@ std::shared_ptr<eaudiofx::Block> eaudiofx::BlockMeta::getBlockNamed(const std::s
}
void eaudiofx::BlockMeta::flowLinkInput() {
EAUDIOFX_INFO("[" << getId() << "] Meta block Link: '" << getName() << "'");
EAUDIOFX_INFO("[" << getId() << "] Meta block Link: '" << propertyName << "'");
// find in sub elements.
for (auto &it : m_list) {
if (it == nullptr) {
@ -210,7 +205,7 @@ void eaudiofx::BlockMeta::flowLinkInput() {
void eaudiofx::BlockMeta::flowCheckAllCompatibility() {
EAUDIOFX_INFO("[" << getId() << "] Meta block check compatibilities: '" << getName() << "'");
EAUDIOFX_INFO("[" << getId() << "] Meta block check compatibilities: '" << propertyName << "'");
// find in sub elements.
for (auto &it : m_list) {
if (it == nullptr) {
@ -223,7 +218,7 @@ void eaudiofx::BlockMeta::flowCheckAllCompatibility() {
}
void eaudiofx::BlockMeta::flowAllocateOutput() {
EAUDIOFX_INFO("[" << getId() << "] Meta block allocate output: '" << getName() << "'");
EAUDIOFX_INFO("[" << getId() << "] Meta block allocate output: '" << propertyName << "'");
// find in sub elements.
for (auto &it : m_list) {
if (it == nullptr) {
@ -236,7 +231,7 @@ void eaudiofx::BlockMeta::flowAllocateOutput() {
}
void eaudiofx::BlockMeta::flowGetInput() {
EAUDIOFX_INFO("[" << getId() << "] Meta block get input ... : '" << getName() << "'");
EAUDIOFX_INFO("[" << getId() << "] Meta block get input ... : '" << propertyName << "'");
// find in sub elements.
for (auto &it : m_list) {
if (it == nullptr) {

View File

@ -1,15 +1,11 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
*
* @license BSD v3 (see license file)
* @license APACHE v2.0 (see license file)
*/
#pragma once
#ifndef __EAUDIOFX_BLOCK_META_H__
#define __EAUDIOFX_BLOCK_META_H__
#include <eaudiofx/core/Block.h>
#include <eaudiofx/core/Block.hpp>
#include <vector>
namespace eaudiofx {
@ -23,21 +19,21 @@ namespace eaudiofx {
DECLARE_FACTORY(BlockMeta);
virtual ~BlockMeta();
private:
std::vector<std::shared_ptr<eaudiofx::Block>> m_list; //!< list of all block to process.
std::vector<ememory::SharedPtr<eaudiofx::Block>> m_list; //!< list of all block to process.
protected:
/**
* @brief Get a pointer on a specific block.
* @param[in] _name Name of the block.
* @return generic error
*/
std::shared_ptr<eaudiofx::Block> getBlock(const std::string& _name);
ememory::SharedPtr<eaudiofx::Block> getBlock(const std::string& _name);
public:
/**
* @brief Add a block in the Meta-block
* @param[in] _block Pointer on the block (do not free yourself)
* @return generic error
*/
int32_t addBlock(const std::shared_ptr<eaudiofx::Block>& _block);
int32_t addBlock(ememory::SharedPtr<eaudiofx::Block> _block);
/**
* @brief Add a block in the Meta-block.
* @param[in] _blockType Name of the type of block to add.
@ -82,7 +78,7 @@ namespace eaudiofx {
virtual int32_t algoStart();
virtual int32_t algoStop();
virtual std::shared_ptr<eaudiofx::Block> getBlockNamed(const std::string& _name);
virtual ememory::SharedPtr<eaudiofx::Block> getBlockNamed(const std::string& _name);
virtual void flowLinkInput();
virtual void flowCheckAllCompatibility();
virtual void flowAllocateOutput();
@ -90,6 +86,5 @@ namespace eaudiofx {
};
};
#endif

View File

@ -1,16 +1,10 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
*
* @license BSD v3 (see license file)
* @license APACHE v2.0 (see license file)
*/
#include <eaudiofx/core/Buffer.h>
#undef __class__
#define __class__ "Buffer"
#include <eaudiofx/core/Buffer.hpp>
eaudiofx::Buffer::Buffer(eaudiofx::Block& _parent) :
m_parent(_parent),

View File

@ -1,20 +1,16 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
*
* @license BSD v3 (see license file)
* @license APACHE v2.0 (see license file)
*/
#pragma once
#ifndef __EAUDIOFX_BUFFER_H__
#define __EAUDIOFX_BUFFER_H__
#include <eaudiofx/core/audio.h>
#include <eaudiofx/core/Block.h>
#include <eaudiofx/core/audio.hpp>
#include <eaudiofx/core/Block.hpp>
namespace eaudiofx {
class Block;
class Buffer : public std::enable_shared_from_this<Buffer> {
class Buffer : public ememory::EnableSharedFromThis<Buffer> {
public:
Buffer(eaudiofx::Block& _parent);
virtual ~Buffer() {};
@ -26,6 +22,5 @@ namespace eaudiofx {
};
};
#endif

View File

@ -1,16 +1,11 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
*
* @license BSD v3 (see license file)
* @license APACHE v2.0 (see license file)
*/
#include <eaudiofx/core/BufferAudio.h>
#include <eaudiofx/debug.h>
#undef __class__
#define __class__ "BufferAudio"
#include <eaudiofx/core/BufferAudio.hpp>
#include <eaudiofx/debug.hpp>
eaudiofx::BufferAudio::BufferAudio(eaudiofx::Block& _parent, const std::string& _description) :

View File

@ -1,15 +1,11 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
*
* @license BSD v3 (see license file)
* @license APACHE v2.0 (see license file)
*/
#pragma once
#ifndef __EAUDIOFX_BUFFER_AUDIO_H__
#define __EAUDIOFX_BUFFER_AUDIO_H__
#include <eaudiofx/core/Buffer.h>
#include <eaudiofx/core/Buffer.hpp>
namespace eaudiofx {
enum audioFormat {
@ -75,6 +71,4 @@ namespace eaudiofx {
};
};
#endif

View File

@ -1,16 +1,9 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
*
* @license BSD v3 (see license file)
* @license APACHE v2.0 (see license file)
*/
#include <eaudiofx/core/BufferAudioFreq.h>
#undef __class__
#define __class__ "BufferAudioFreq"
#include <eaudiofx/core/BufferAudioFreq.hpp>
eaudiofx::BufferAudioFreq::BufferAudioFreq(eaudiofx::Block& _parent) :
eaudiofx::BufferAudio(_parent) {

View File

@ -1,15 +1,11 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
*
* @license BSD v3 (see license file)
* @license APACHE v2.0 (see license file)
*/
#pragma once
#ifndef __EAUDIOFX_BUFFER_AUDIO_FREQ_H__
#define __EAUDIOFX_BUFFER_AUDIO_FREQ_H__
#include <eaudiofx/core/BufferAudio.h>
#include <eaudiofx/core/BufferAudio.hpp>
namespace eaudiofx {
class BufferAudioFreq : public eaudiofx::BufferAudio {
@ -19,6 +15,4 @@ namespace eaudiofx {
};
};
#endif

View File

@ -1,24 +1,18 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
*
* @license BSD v3 (see license file)
* @license APACHE v2.0 (see license file)
*/
#include <eaudiofx/debug.h>
#include <eaudiofx/core/Processing.h>
#include <eaudiofx/debug.hpp>
#include <eaudiofx/core/Processing.hpp>
#include <unistd.h>
#undef __class__
#define __class__ "Processing"
eaudiofx::Processing::Processing() {
addObjectType("eaudiofx::Processing");
};
int32_t eaudiofx::Processing::process() {
EAUDIOFX_INFO("Start process : '" << getName() << "'");
EAUDIOFX_INFO("Start process : '" << propertyName << "'");
return eaudiofx::ERR_NONE;
}
@ -33,13 +27,13 @@ int32_t eaudiofx::Processing::stop() {
}
int32_t eaudiofx::Processing::waitEndOfProcess() {
EAUDIOFX_INFO("wait end of Processing : '" << getName() << "'");
EAUDIOFX_INFO("wait end of Processing : '" << propertyName << "'");
return eaudiofx::ERR_NONE;
}
bool eaudiofx::Processing::stateStart() {
EAUDIOFX_INFO("Start Processing : '" << getName() << "'");
EAUDIOFX_INFO("Start Processing : '" << propertyName << "'");
// TODO : Add return code ... and test all of theses events ...
EAUDIOFX_ERROR("======================================");
// Init request flow update:
@ -64,13 +58,13 @@ bool eaudiofx::Processing::stateStart() {
}
bool eaudiofx::Processing::stateRun() {
EAUDIOFX_INFO("Process : '" << getName() << "'");
EAUDIOFX_INFO("Process : '" << propertyName << "'");
usleep(10000);
return false;
}
bool eaudiofx::Processing::stateStop() {
EAUDIOFX_INFO("Stop Processing : '" << getName() << "'");
EAUDIOFX_INFO("Stop Processing : '" << propertyName << "'");
int32_t ret = eaudiofx::BlockMeta::algoStop();
if (ret != eaudiofx::ERR_NONE) {
return ret;

View File

@ -1,19 +1,14 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
*
* @license BSD v3 (see license file)
* @license APACHE v2.0 (see license file)
*/
#ifndef __EAUDIOFX_PROCESSING_H__
#define __EAUDIOFX_PROCESSING_H__
#include <eaudiofx/core/audio.h>
#include <eaudiofx/core/Buffer.h>
#include <eaudiofx/core/Block.h>
#include <eaudiofx/core/BlockMeta.h>
#include <eaudiofx/Thread.h>
#pragma once
#include <eaudiofx/core/audio.hpp>
#include <eaudiofx/core/Buffer.hpp>
#include <eaudiofx/core/Block.hpp>
#include <eaudiofx/core/BlockMeta.hpp>
#include <eaudiofx/Thread.hpp>
#include <vector>
namespace eaudiofx {
@ -39,6 +34,5 @@ namespace eaudiofx {
};
};
#endif

View File

@ -1,11 +1,9 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
*
* @license BSD v3 (see license file)
* @license APACHE v2.0 (see license file)
*/
#include <eaudiofx/core/audio.h>
#include <eaudiofx/core/audio.hpp>

View File

@ -1,16 +1,12 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
*
* @license BSD v3 (see license file)
* @license APACHE v2.0 (see license file)
*/
#ifndef __EAUDIOFX_AUDIO_H__
#define __EAUDIOFX_AUDIO_H__
#pragma once
#include <etk/types.h>
#include <etk/types.hpp>
namespace eaudiofx {
enum {
@ -24,4 +20,4 @@ namespace eaudiofx {
};
};
#endif

View File

@ -1,15 +1,13 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
*
* @license BSD v3 (see license file)
* @copyright 2014, Edouard DUPIN, all right reserved
* @license APACHE v2.0 (see license file)
*/
#include <eaudiofx/debug.h>
#include <eaudiofx/debug.hpp>
int32_t eaudiofx::getLogId() {
static int32_t g_val = etk::log::registerInstance("eaudiofx");
static int32_t g_val = elog::registerInstance("eaudiofx");
return g_val;
}

View File

@ -1,21 +1,18 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
*
* @license BSD v3 (see license file)
* @copyright 2014, Edouard DUPIN, all right reserved
* @license APACHE v2.0 (see license file)
*/
#pragma once
#ifndef __EAUDIOFX_DEBUG_H__
#define __EAUDIOFX_DEBUG_H__
#include <etk/log.h>
#include <elog/log.hpp>
namespace eaudiofx {
int32_t getLogId();
};
#define EAUDIOFX_BASE(info,data) TK_LOG_BASE(eaudiofx::getLogId(),info,data)
#define EAUDIOFX_BASE(info,data) ELOG_BASE(eaudiofx::getLogId(),info,data)
#define EAUDIOFX_PRINT(data) EAUDIOFX_BASE(1, data)
#define EAUDIOFX_CRITICAL(data) EAUDIOFX_BASE(1, data)
#define EAUDIOFX_ERROR(data) EAUDIOFX_BASE(2, data)
#define EAUDIOFX_WARNING(data) EAUDIOFX_BASE(3, data)
@ -39,5 +36,4 @@ namespace eaudiofx {
} \
} while (0)
#endif

View File

@ -1,19 +0,0 @@
/**
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
*
* @license BSD v3 (see license file)
*/
#ifndef __EAUDIOFX_H__
#define __EAUDIOFX_H__
#include <eaudiofx/core/audio.h>
#include <eaudiofx/core/Block.h>
#include <eaudiofx/core/Buffer.h>
#include <eaudiofx/core/Processing.h>
#endif

14
eaudiofx/eaudiofx.hpp Normal file
View File

@ -0,0 +1,14 @@
/** @file
* @author Edouard DUPIN
* @copyright 2014, Edouard DUPIN, all right reserved
* @license APACHE v2.0 (see license file)
*/
#pragma once
#include <eaudiofx/core/audio.hpp>
#include <eaudiofx/core/Block.hpp>
#include <eaudiofx/core/Buffer.hpp>
#include <eaudiofx/core/Processing.hpp>

View File

@ -1,19 +1,13 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
*
* @license APACHE v2.0 (see license file)
* @copyright 2014, Edouard DUPIN, all right reserved
* @license APACHE v2.0 (see license file)
*/
#include <memory>
#include <eaudiofx/debug.h>
#include <eaudiofx/flow/Interface.h>
#include <eaudiofx/flow/Base.h>
#include <eaudiofx/core/Block.h>
#undef __class__
#define __class__ "flow::Base"
#include <eaudiofx/debug.hpp>
#include <eaudiofx/flow/Interface.hpp>
#include <eaudiofx/flow/Base.hpp>
#include <eaudiofx/core/Block.hpp>
eaudiofx::flow::Base::Base(eaudiofx::flow::Interface& _flowInterfaceLink,
bool _input,
@ -24,13 +18,12 @@ eaudiofx::flow::Base::Base(eaudiofx::flow::Interface& _flowInterfaceLink,
m_name(_name),
m_description(_description),
m_input(_input) {
m_ref = std::make_shared<BaseReference>(this);
m_ref = ememory::makeShared<BaseReference>(this);
// add a reference on the current signal ...
m_flowInterfaceLink.flowAdd(this);
m_formatAvaillable = std::make_shared<ejson::Document>();
m_formatAvaillable->parse(_formatAvaillable);
m_formatAvaillable.parse(_formatAvaillable);
EAUDIOFX_INFO("Create flow : '" << m_name << "' mode:'" << (m_input==true?"input":"output") << "' prop:");
m_formatAvaillable->display();
m_formatAvaillable.display();
}
eaudiofx::flow::Base::~Base() {
@ -57,13 +50,13 @@ void eaudiofx::flow::Base::getInputBuffer() {
}
// due to the fact it acces at the block interface, we need to write it here ...
std::shared_ptr<eaudiofx::flow::BaseReference> eaudiofx::flow::Base::getFlowReference(const std::string& _blockName,
const std::string& _flowLinkName) {
std::shared_ptr<eaudiofx::flow::BaseReference> out;
ememory::SharedPtr<eaudiofx::flow::BaseReference> eaudiofx::flow::Base::getFlowReference(const std::string& _blockName,
const std::string& _flowLinkName) {
ememory::SharedPtr<eaudiofx::flow::BaseReference> out;
if (_flowLinkName == "") {
EAUDIOFX_INFO(" Get flow : " << _blockName << ":" << _flowLinkName << " nothing to do ==> no connection ...");
}
std::shared_ptr<eaudiofx::Block> blockRemote = m_flowInterfaceLink.getBlockNamed(_blockName);
ememory::SharedPtr<eaudiofx::Block> blockRemote = m_flowInterfaceLink.getBlockNamed(_blockName);
if (blockRemote == nullptr) {
EAUDIOFX_ERROR(" Get flow : '" << m_name << "' mode:'input' to " << _blockName << ":" << _flowLinkName << " Error no remote block");
} else {
@ -78,7 +71,7 @@ std::shared_ptr<eaudiofx::flow::BaseReference> eaudiofx::flow::Base::getFlowRefe
}
/*
std::shared_ptr<eaudiofx::Block> eaudiofx::flow::Base::getBlockNamed(const std::string& _name) {
ememory::SharedPtr<eaudiofx::Block> eaudiofx::flow::Base::getBlockNamed(const std::string& _name) {
EAUDIOFX_ERROR("NEED to call Parrent ...");
return nullptr;
}

View File

@ -1,17 +1,14 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
*
* @license APACHE v2.0 (see license file)
* @copyright 2014, Edouard DUPIN, all right reserved
* @license APACHE v2.0 (see license file)
*/
#pragma once
#ifndef __EAUDIOFX_FLOW_BASE_H__
#define __EAUDIOFX_FLOW_BASE_H__
#include <ejson/ejson.h>
#include <eaudiofx/flow/Interface.h>
#include <eaudiofx/debug.h>
#include <ejson/ejson.hpp>
#include <eaudiofx/flow/Interface.hpp>
#include <eaudiofx/debug.hpp>
#include <ememory/memory.hpp>
@ -24,7 +21,7 @@ namespace eaudiofx {
std::string m_name;
std::string m_description;
bool m_input;
std::shared_ptr<ejson::Document> m_formatAvaillable;
ejson::Document m_formatAvaillable;
public:
/**
* @brief Create a parameter with a specific type.
@ -56,7 +53,7 @@ namespace eaudiofx {
bool isOutput() {
return !m_input;
}
std::shared_ptr<const ejson::Object> getCapabilities() {
const ejson::Object getCapabilities() {
return m_formatAvaillable;
}
/**
@ -69,27 +66,27 @@ namespace eaudiofx {
EAUDIOFX_ERROR("[" << m_name << "] Can not create a link on an Output (only manage with input ...)");
}
protected:
std::shared_ptr<BaseReference> m_ref; //!< To simplify implementation code we use a temporary variable to shared the current reference...
ememory::SharedPtr<BaseReference> m_ref; //!< To simplify implementation code we use a temporary variable to shared the current reference...
public:
std::shared_ptr<BaseReference> getReference() {
ememory::SharedPtr<BaseReference> getReference() {
return m_ref;
}
virtual void addReference(const std::shared_ptr<BaseReference>& _reference) {
virtual void addReference(const ememory::SharedPtr<BaseReference>& _reference) {
EAUDIOFX_ERROR("[" << m_name << "] Can not add reference ...");
}
protected:
std::shared_ptr<BaseReference> getFlowReference(const std::string& _blockName,
const std::string& _flowLinkName);
ememory::SharedPtr<BaseReference> getFlowReference(const std::string& _blockName,
const std::string& _flowLinkName);
public:
virtual void link();
virtual int32_t checkCompatibility();
virtual void getInputBuffer();
//virtual std::shared_ptr<eaudiofx::Block> getBlockNamed(const std::string& _name);
//virtual ememory::SharedPtr<eaudiofx::Block> getBlockNamed(const std::string& _name);
};
std::ostream& operator <<(std::ostream& _os, const eaudiofx::flow::Base& _obj);
// we use a reference to simplify code of every blocks...
//! @not-in-doc
class BaseReference : public std::enable_shared_from_this<BaseReference> {
class BaseReference : public ememory::EnableSharedFromThis<BaseReference> {
protected:
Base* m_basePointer;
public:
@ -107,4 +104,4 @@ namespace eaudiofx {
};
};
};
#endif

View File

@ -1,26 +1,20 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
*
* @license APACHE v2.0 (see license file)
* @copyright 2014, Edouard DUPIN, all right reserved
* @license APACHE v2.0 (see license file)
*/
#ifndef __EAUDIOFX_FLOW_H__
#define __EAUDIOFX_FLOW_H__
#pragma once
#include <functional>
#include <eaudiofx/flow/Base.h>
#include <eaudiofx/core/Buffer.h>
#include <eaudiofx/debug.h>
#include <eaudiofx/flow/Base.hpp>
#include <eaudiofx/core/Buffer.hpp>
#include <eaudiofx/debug.hpp>
namespace eaudiofx {
class Buffer;
#undef __class__
#define __class__ "Flow<T>"
template<typename T = eaudiofx::Buffer> class Flow : public flow::Base {
protected:
std::shared_ptr<eaudiofx::Buffer> m_data;
ememory::SharedPtr<eaudiofx::Buffer> m_data;
public:
/**
* @brief Create a parameter with a specific type.
@ -42,9 +36,9 @@ namespace eaudiofx {
* @brief Destructor.
*/
virtual ~Flow() { };
void set(const std::shared_ptr<eaudiofx::Buffer>& _data){
void set(const ememory::SharedPtr<eaudiofx::Buffer>& _data){
m_data.reset();
std::shared_ptr<T> check = std::dynamic_pointer_cast<T>(_data);
ememory::SharedPtr<T> check = ememory::dynamicPointerCast<T>(_data);
if (check == nullptr) {
EAUDIOFX_ERROR("can not set buffer as flow (type uncompatible)");
return;
@ -56,13 +50,11 @@ namespace eaudiofx {
}
};
namespace flow {
#undef __class__
#define __class__ "flow::Input"
template<typename T> class Input : public Flow<T> {
private:
std::string m_blockName; //!< Temporary value of flow link (when not linked & distant block can be created after) : Block name
std::string m_flowName; //!< Temporary value of flow link (when not linked & distant block can be created after) : Flow name
std::weak_ptr<BaseReference> m_remoteFlow; //!< reference on the remote flow.
ememory::WeakPtr<BaseReference> m_remoteFlow; //!< reference on the remote flow.
public:
/**
* @brief Create a parameter with a specific type.
@ -90,7 +82,7 @@ namespace eaudiofx {
}
virtual void link() {
EAUDIOFX_INFO(" link flow : '" << Base::m_name << "' mode:'input' to " << m_blockName << ":" << m_flowName);
std::shared_ptr<BaseReference> remoteFlow = Base::getFlowReference(m_blockName, m_flowName);
ememory::SharedPtr<BaseReference> remoteFlow = Base::getFlowReference(m_blockName, m_flowName);
m_remoteFlow = remoteFlow;
if (remoteFlow == nullptr) {
EAUDIOFX_ERROR(" link flow : '" << Base::m_name << "' mode:'input' to " << m_blockName << ":" << m_flowName << " Error no Flow found");
@ -100,12 +92,10 @@ namespace eaudiofx {
remoteFlow->getBase()->addReference(Base::getReference());
}
};
#undef __class__
#define __class__ "flow::Output"
template<typename T> class Output : public Flow<T> {
protected:
std::vector<std::weak_ptr<BaseReference>> m_remoteFlow; //!< List of reference on the remote flow (multiple childs).
std::shared_ptr<ejson::Document> m_formatMix; //!< current format that is now availlable on the flow (can be on error) represent the intersection of all flow connected
std::vector<ememory::WeakPtr<BaseReference>> m_remoteFlow; //!< List of reference on the remote flow (multiple childs).
ejson::Object m_formatMix; //!< current format that is now availlable on the flow (can be on error) represent the intersection of all flow connected
public:
/**
* @brief Create a parameter with a specific type.
@ -117,7 +107,7 @@ namespace eaudiofx {
Output(eaudiofx::flow::Interface& _flowInterfaceLink,
const std::string& _name,
const std::string& _description = "",
const std::string& _formatAvaillable="{}") :
const std::string& _formatAvaillable="{}") :
Flow<T>(_flowInterfaceLink, false, _name, _description, _formatAvaillable) {
};
@ -125,15 +115,15 @@ namespace eaudiofx {
* @brief Destructor.
*/
virtual ~Output() { };
virtual void addReference(const std::shared_ptr<BaseReference>& _reference) {
virtual void addReference(const ememory::SharedPtr<BaseReference>& _reference) {
m_remoteFlow.push_back(_reference);
}
virtual int32_t checkCompatibility() {
EAUDIOFX_INFO(" check for : '" << Base::m_name << "' to " << m_remoteFlow.size() << " links");
std::vector<std::shared_ptr<const ejson::Object>> list;
std::vector<ejson::Object> list;
list.push_back(Base::getCapabilities());
for (auto &it : m_remoteFlow) {
std::shared_ptr<BaseReference> tmp = it.lock();
ememory::SharedPtr<BaseReference> tmp = it.lock();
if (tmp != nullptr) {
if (tmp->getBase() != nullptr) {
list.push_back(tmp->getBase()->getCapabilities());
@ -144,13 +134,11 @@ namespace eaudiofx {
// TODO : Check input property
EAUDIOFX_INFO("[" << Base::m_name << "] mix signal : ");
m_formatMix->display();
m_formatMix.display();
return 0;
}
};
};
#undef __class__
#define __class__ nullptr
};
#endif

View File

@ -1,15 +1,12 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
*
* @license APACHE v2.0 (see license file)
* @copyright 2014, Edouard DUPIN, all right reserved
* @license APACHE v2.0 (see license file)
*/
#include <memory>
#include <eaudiofx/debug.h>
#include <eaudiofx/flow/Interface.h>
#include <eaudiofx/flow/Base.h>
#include <eaudiofx/debug.hpp>
#include <eaudiofx/flow/Interface.hpp>
#include <eaudiofx/flow/Base.hpp>
eaudiofx::flow::Interface::Interface() {
@ -105,8 +102,8 @@ void eaudiofx::flow::Interface::flowGetInput() {
}
std::shared_ptr<eaudiofx::flow::BaseReference> eaudiofx::flow::Interface::getFlowReference(const std::string& _flowName) {
std::shared_ptr<eaudiofx::flow::BaseReference> out;
ememory::SharedPtr<eaudiofx::flow::BaseReference> eaudiofx::flow::Interface::getFlowReference(const std::string& _flowName) {
ememory::SharedPtr<eaudiofx::flow::BaseReference> out;
for (auto &it : m_list) {
if( it != nullptr
&& it->getName() == _flowName) {
@ -117,126 +114,125 @@ std::shared_ptr<eaudiofx::flow::BaseReference> eaudiofx::flow::Interface::getFlo
return out;
}
static std::shared_ptr<ejson::Value> intersect(const std::shared_ptr<const ejson::Value>& _obj1, const std::shared_ptr<const ejson::Value>& _obj2) {
std::shared_ptr<ejson::Value> out = ejson::Object::create();
if (_obj1 == nullptr) {
if (_obj2 == nullptr) {
static ejson::Value intersect(const ejson::Value& _obj1, const ejson::Value& _obj2) {
ejson::Value out;
if (_obj1.exist() == false) {
if (_obj2.exist() == false) {
EAUDIOFX_ERROR("intersect 2 null ptr ...");
return ejson::Null::create();
return ejson::Null();
} else {
return _obj2->clone();
return _obj2.clone();
}
}
if (_obj2 == nullptr) {
return _obj1->clone();
if (_obj2.exist() == false) {
return _obj1.clone();
}
if (_obj1->isNull() == true) {
return _obj2->clone();
if (_obj1.isNull() == true) {
return _obj2.clone();
}
if (_obj1->isNumber() == true) {
if (_obj1.isNumber() == true) {
// just a single output value ... just check if it is the same value
double value = _obj1->toNumber()->get();
if (_obj2->isNumber() == true) {
if (value == _obj2->toNumber()->get()) {
return ejson::Number::create(value);
double value = _obj1.toNumber().get();
if (_obj2.isNumber() == true) {
if (value == _obj2.toNumber().get()) {
return ejson::Number(value);
}
EAUDIOFX_ERROR("Not the same number value");
}
if (_obj2->isArray() == true) {
std::shared_ptr<const ejson::Array> obj = _obj2->toArray();
for (int32_t iii=0; iii<obj->size(); ++iii) {
if ((*obj)[iii]->isNumber() == true) {
if (value == (*obj)[iii]->toNumber()->get()) {
return ejson::Number::create(value);
if (_obj2.isArray() == true) {
const ejson::Array obj = _obj2.toArray();
for (auto it : obj) {
if (it.isNumber() == true) {
if (value == it.toNumber().get()) {
return ejson::Number(value);
}
}
}
EAUDIOFX_ERROR("Not the same values ...");
}
}
if (_obj1->isString() == true) {
if (_obj1.isString() == true) {
// just a single output value ... just check if it is the same value
std::string value = _obj1->toString()->get();
if (_obj2->isString() == true) {
if (value == _obj2->toString()->get()) {
return ejson::String::create(value);
std::string value = _obj1.toString().get();
if (_obj2.isString() == true) {
if (value == _obj2.toString().get()) {
return ejson::String(value);
}
EAUDIOFX_ERROR("Not the same string value");
}
if (_obj2->isArray() == true) {
std::shared_ptr<const ejson::Array> obj = _obj2->toArray();
for (int32_t iii=0; iii<obj->size(); ++iii) {
if ((*obj)[iii]->isString() == true) {
if (value == (*obj)[iii]->toString()->get()) {
return ejson::String::create(value);
if (_obj2.isArray() == true) {
const ejson::Array obj = _obj2.toArray();
for (auto it : obj) {
if (it.isString() == true) {
if (value == it.toString().get()) {
return ejson::String(value);
}
}
}
EAUDIOFX_ERROR("Not the same values ...");
}
}
if (_obj1->isArray() == true) {
if (_obj1.isArray() == true) {
EAUDIOFX_TODO(" manage array");
}
EAUDIOFX_ERROR("Can not intersect elements : (obj1)");
_obj1->display();
_obj1.display();
EAUDIOFX_ERROR(" (obj2)");
_obj2->display();
_obj2.display();
// remove sublist if it is reduce to 1
return ejson::Null::create();
return ejson::Null();
}
std::shared_ptr<ejson::Document> eaudiofx::flow::Interface::getFlowIntersection(const std::vector<std::shared_ptr<const ejson::Object>>& _list) {
ejson::Object eaudiofx::flow::Interface::getFlowIntersection(const std::vector<ejson::Object>& _list) {
EAUDIOFX_ERROR("-------------- start intersection --------------");
std::shared_ptr<ejson::Document> out = std::make_shared<ejson::Document>();
ejson::Object out;
if (_list.size() == 0) {
return out;
}
if (_list.size() == 1) {
_list[0]->cloneIn(out);
out = _list[0].clone().toObject();
EAUDIOFX_INFO("List clone : ");
out->display();
out.display();
EAUDIOFX_ERROR("-------------- stop intersection (no link ...) --------------");
return out;
}
// check all same type :
for (int32_t iii=1; iii<_list.size(); ++iii) {
if (_list[iii]->getStringValue("type") != _list[0]->getStringValue("type")) {
if (_list[iii].toString().get("type") != _list[0].toString().get("type")) {
EAUDIOFX_ERROR("All stream have not the same Type ...");
return out;
}
}
out->add("type", ejson::String::create(_list[0]->getStringValue("type")));
if (out->getStringValue("type") == "audio") {
out.add("type", ejson::String(_list[0].toString().get("type")));
if (out["type"].toString().get() == "audio") {
// check frequency:
std::shared_ptr<ejson::Value> tmp = ejson::Null::create();
ejson::Value tmp = ejson::Null();
for (int32_t iii=0; iii<_list.size(); ++iii) {
tmp = intersect(tmp, _list[iii]->get("freq"));
tmp = intersect(tmp, _list[iii]["freq"]);
}
out->add("freq", tmp);
out.add("freq", tmp);
// check format:
tmp = ejson::Null::create();
tmp = ejson::Null();
for (int32_t iii=0; iii<_list.size(); ++iii) {
tmp = intersect(tmp, _list[iii]->get("format"));
tmp = intersect(tmp, _list[iii]["format"]);
}
out->add("format", tmp);
out.add("format", tmp);
// check channels:
tmp = ejson::Null::create();
tmp = ejson::Null();
for (int32_t iii=0; iii<_list.size(); ++iii) {
tmp = intersect(tmp, _list[iii]->get("channels"));
tmp = intersect(tmp, _list[iii]["channels"]);
}
out->add("channels", tmp);
out.add("channels", tmp);
} else if (out->getStringValue("type") == "video") {
} else if (out["type"].toString().get() == "video") {
for (int32_t iii=1; iii<_list.size(); ++iii) {
}
} else {
EAUDIOFX_ERROR("not manage interface for mix ... '" << out->getStringValue("type") << "'");
EAUDIOFX_ERROR("not manage interface for mix ... '" << out["type"].toString().get() << "'");
}
out->display();
out.display();
EAUDIOFX_ERROR("-------------- stop intersection --------------");
return out;
}

View File

@ -1,18 +1,13 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
*
* @license APACHE v2.0 (see license file)
* @copyright 2014, Edouard DUPIN, all right reserved
* @license APACHE v2.0 (see license file)
*/
#ifndef __EAUDIOFX_FLOW_INTERFACE_H__
#define __EAUDIOFX_FLOW_INTERFACE_H__
#pragma once
#include <vector>
#include <map>
#include <ejson/ejson.h>
#include <ejson/ejson.hpp>
namespace eaudiofx {
class Block;
@ -78,14 +73,13 @@ namespace eaudiofx {
* @param[in] _name Name of the block requested
* @return The block requested if it exist.
*/
virtual std::shared_ptr<eaudiofx::Block> getBlockNamed(const std::string& _name) {
virtual ememory::SharedPtr<eaudiofx::Block> getBlockNamed(const std::string& _name) {
return nullptr;
}
std::shared_ptr<eaudiofx::flow::BaseReference> getFlowReference(const std::string& _name);
ememory::SharedPtr<eaudiofx::flow::BaseReference> getFlowReference(const std::string& _name);
public:
std::shared_ptr<ejson::Document> getFlowIntersection(const std::vector<std::shared_ptr<const ejson::Object>>& _list);
ejson::Object getFlowIntersection(const std::vector<ejson::Object>& _list);
};
};
};
#endif

View File

@ -0,0 +1,58 @@
#!/usr/bin/python
import lutin.module as module
import lutin.tools as tools
import lutin.debug as debug
import os
def get_type():
return "BINARY"
def get_name():
return "audio FX test"
def get_desc():
return "audio_block_engine_test : Audio interface FX system test example system"
def get_licence():
return "APACHE-2"
def get_compagny_type():
return "com"
def get_compagny_name():
return "atria-soft"
def get_maintainer():
return "authors.txt"
def get_version():
return "version.txt"
def create(target, module_name):
my_module = module.Module(__file__, module_name, get_type())
# basic GUI :
my_module.add_src_file([
'test/debug.cpp',
'test/Main.cpp',
'test/Windows.cpp',
])
# name of the dependency
my_module.add_depend(['ewol', 'audio-block-engine'])
my_module.add_path(tools.get_current_path(__file__))
my_module.copy_path("data/Font/Free*.ttf","fonts/")
my_module.copy_path("data/menu*","")
#if target.name=="MacOs":
# my_module.set_pkg("ICON", tools.get_current_path(__file__) + "/../data/icon.icns")
#else:
# my_module.set_pkg("ICON", tools.get_current_path(__file__) + "/../data/icon.png")
my_module.set_pkg("SECTION", ["Test"])
my_module.set_pkg("PRIORITY", "optional")
return my_module

View File

@ -0,0 +1,74 @@
#!/usr/bin/python
import lutin.module as module
import lutin.tools as tools
import lutin.debug as debug
import os
def get_type():
return "LIBRARY"
def get_name():
return "audio FX"
def get_desc():
return "audio_block_engine : Audio interface FX system"
def get_licence():
return "APACHE-2"
def get_compagny_type():
return "com"
def get_compagny_name():
return "atria-soft"
def get_maintainer():
return "authors.txt"
def get_version():
return "version.txt"
def create(target, module_name):
my_module = module.Module(__file__, module_name, get_type())
# System core
my_module.add_src_file([
'eaudiofx/debug.cpp',
'eaudiofx/Thread.cpp',
'eaudiofx/flow/Base.cpp',
'eaudiofx/flow/Interface.cpp',
'eaudiofx/core/audio.cpp',
'eaudiofx/core/Processing.cpp',
'eaudiofx/core/Block.cpp',
'eaudiofx/core/BlockMeta.cpp',
'eaudiofx/core/Buffer.cpp',
'eaudiofx/core/BufferAudio.cpp',
'eaudiofx/core/BufferAudioFreq.cpp'
])
# basic nodes:
my_module.add_src_file([
#'eaudiofx/base/GeneratorFile.cpp',
#'eaudiofx/base/ReceiverFile.cpp',
#'eaudiofx/base/GeneratorRiver.cpp',
'eaudiofx/base/ReceiverRiver.cpp',
'eaudiofx/base/GeneratorSignal.cpp'
])
# name of the dependency
my_module.add_depend([
'audio-river',
'ewol',
'ejson'
])
my_module.add_path(tools.get_current_path(__file__), export=True)
return my_module

View File

@ -1,50 +0,0 @@
#!/usr/bin/python
import lutinModule as module
import lutinTools as tools
import lutinDebug as debug
def get_desc():
return "audio_block_engine : Audio interface FX system"
def create(target):
myModule = module.Module(__file__, 'audio_block_engine', 'LIBRARY')
# System core
myModule.add_src_file([
'eaudiofx/debug.cpp',
'eaudiofx/Thread.cpp',
'eaudiofx/flow/Base.cpp',
'eaudiofx/flow/Interface.cpp',
'eaudiofx/core/audio.cpp',
'eaudiofx/core/Processing.cpp',
'eaudiofx/core/Block.cpp',
'eaudiofx/core/BlockMeta.cpp',
'eaudiofx/core/Buffer.cpp',
'eaudiofx/core/BufferAudio.cpp',
'eaudiofx/core/BufferAudioFreq.cpp'
])
# basic nodes:
myModule.add_src_file([
#'eaudiofx/base/GeneratorFile.cpp',
#'eaudiofx/base/ReceiverFile.cpp',
#'eaudiofx/base/GeneratorRiver.cpp',
'eaudiofx/base/ReceiverRiver.cpp',
'eaudiofx/base/GeneratorSignal.cpp'
])
# name of the dependency
myModule.add_module_depend(['audio_river', 'ewol', 'ejson'])
myModule.add_export_path(tools.get_current_path(__file__))
# add the currrent module at the
return myModule

View File

@ -1,45 +0,0 @@
#!/usr/bin/python
import lutinModule as module
import lutinTools as tools
import lutinDebug as debug
def get_desc():
return "audio_block_engine_test : Audio interface FX system test example system"
def create(target):
myModule = module.Module(__file__, 'audio_block_engine_test', 'PACKAGE')
# basic GUI :
myModule.add_src_file([
'test/debug.cpp',
'test/Main.cpp',
'test/Windows.cpp',
])
# name of the dependency
myModule.add_module_depend(['ewol', 'audio_block_engine'])
myModule.add_export_path(tools.get_current_path(__file__))
myModule.copy_folder("data/Font/Free*.ttf","fonts/")
myModule.copy_folder("data/menu*","")
# set the package properties :
myModule.pkg_set("VERSION", "0.0.0")
myModule.pkg_set("COMPAGNY_TYPE", "org")
myModule.pkg_set("COMPAGNY_NAME", "Edouard DUPIN")
myModule.pkg_set("MAINTAINER", ["Mr DUPIN Edouard <yui.heero@gmail.com>"])
#if target.name=="MacOs":
# myModule.pkg_set("ICON", tools.get_current_path(__file__) + "/../data/icon.icns")
#else:
# myModule.pkg_set("ICON", tools.get_current_path(__file__) + "/../data/icon.png")
myModule.pkg_set("SECTION", ["Test"])
myModule.pkg_set("PRIORITY", "optional")
myModule.pkg_set("DESCRIPTION", "Test tool of e-audio-FX")
myModule.pkg_set("NAME", "e-audio-FX test")
# add the currrent module at the
return myModule

View File

@ -1,45 +1,46 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2010, Edouard DUPIN, all right reserved
*
* @license BSD 3 clauses (see license file)
* @copyright 2014, Edouard DUPIN, all right reserved
* @license APACHE v2.0 (see license file)
*/
#include <etk/types.hpp>
#include <ewol/ewol.hpp>
#include <gale/context/commandLine.hpp>
#include <etk/types.h>
#include <ewol/ewol.h>
#include <ewol/context/commandLine.h>
#include <test/debug.h>
#include <test/Windows.h>
#include <ewol/object/Object.h>
#include <ewol/widget/Manager.h>
#include <ewol/context/Context.h>
#include <test/debug.hpp>
#include <test/Windows.hpp>
#include <ewol/object/Object.hpp>
#include <ewol/widget/Manager.hpp>
#include <ewol/context/Context.hpp>
class MainApplication : public ewol::context::Application {
public:
bool init(ewol::Context& _context, size_t _initId) {
APPL_INFO("==> Init APPL (START) [" << ewol::getBoardType() << "] (" << ewol::getCompilationMode() << ")");
// TODO : Remove this : Move if in the windows properties
virtual void onCreate(ewol::Context& _context) override {
APPL_INFO("==> OnCreate APPL (START) [" << ewol::getBoardType() << "] (" << ewol::getCompilationMode() << ")");
for( int32_t iii=0 ; iii<_context.getCmd().size(); iii++) {
std::string tmpppp = _context.getCmd().get(iii);
if ( tmpppp == "-h"
|| tmpppp == "--help") {
APPL_INFO(" -t c-flags-file-name" );
APPL_INFO(" -h/--help display this help" );
exit(0);
}
}
_context.setTitle("test 'block-engine'");
_context.setSize(vec2(800, 600));
// select internal data for font ...
_context.getFontDefault().setUseExternal(false);
_context.getFontDefault().set("FreeSerif", 30);
std::shared_ptr<ewol::widget::Windows> basicWindows = appl::Windows::create();
// create the specific windows
_context.setWindows(basicWindows);
APPL_INFO("==> Init APPL (END)");
return true;
}
void unInit(ewol::Context& _context) {
APPL_INFO("==> Un-Init APPL (START)");
// nothing to do ...
APPL_INFO("==> Un-Init APPL (END)");
void onStart(ewol::Context& _context) override {
APPL_INFO("==> On start APPL (END)");
ewol::widget::WindowsShared basicWindows = appl::Windows::create();
// create the specific windows
_context.setWindows(basicWindows);
APPL_INFO("==> On start APPL (END)");
}
};

View File

@ -1,14 +0,0 @@
/**
* @author Edouard DUPIN
*
* @copyright 2010, Edouard DUPIN, all right reserved
*
* @license BSD 3 clauses (see license file)
*/
#ifndef __APPL_MAIN_H__
#define __APPL_MAIN_H__
#endif

7
test/Main.hpp Normal file
View File

@ -0,0 +1,7 @@
/** @file
* @author Edouard DUPIN
* @copyright 2014, Edouard DUPIN, all right reserved
* @license APACHE v2.0 (see license file)
*/
#pragma once

View File

@ -1,25 +1,21 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2010, Edouard DUPIN, all right reserved
*
* @license BSD 3 clauses (see license file)
* @copyright 2014, Edouard DUPIN, all right reserved
* @license APACHE v2.0 (see license file)
*/
#include <ewol/ewol.h>
#include <test/debug.h>
#include <test/Windows.h>
#include <ewol/widget/Label.h>
#include <etk/tool.h>
#include <eaudiofx/eaudiofx.h>
#include <ewol/widget/Button.h>
#include <ewol/ewol.hpp>
#include <test/debug.hpp>
#include <test/Windows.hpp>
#include <ewol/widget/Label.hpp>
#include <etk/tool.hpp>
#include <eaudiofx/eaudiofx.hpp>
#include <ewol/widget/Button.hpp>
#include <unistd.h>
#include <eaudiofx/base/GeneratorSignal.h>
#include <eaudiofx/base/ReceiverRiver.h>
#include <eaudiofx/base/GeneratorSignal.hpp>
#include <eaudiofx/base/ReceiverRiver.hpp>
#undef __class__
#define __class__ "Windows"
static const char* const g_eventPlay1 = "appl-play-1";
static const char* const g_eventPlay2 = "appl-play-2";
@ -30,7 +26,6 @@ appl::Windows::Windows() {
void appl::Windows::init() {
ewol::widget::Windows::init();
setTitle("example 001_HelloWord");
std::string composition = std::string("");
composition += "<sizer mode='vert'>\n";
composition += " <sizer mode='hori'>\n";
@ -53,18 +48,18 @@ void appl::Windows::init() {
composition += " <spacer expand='true' fill='true'/>\n";
composition += "</sizer>\n";
m_composer = ewol::widget::Composer::create(ewol::widget::Composer::String, composition);
if (m_composer == NULL) {
m_composer = ewol::widget::Composer::create();
if (m_composer == nullptr) {
APPL_CRITICAL(" An error occured ... in the windows creatrion ...");
return;
}
m_composer->loadFromString(composition);
setSubWidget(m_composer);
subBind(ewol::widget::Button, "bt-play1", signalPressed, shared_from_this(), &appl::Windows::onCallbackPlay);
subBind(ewol::widget::Button, "bt-stop1", signalPressed, shared_from_this(), &appl::Windows::onCallbackStop);
subBind(ewol::widget::Button, "bt-play-stop", signalPressed, shared_from_this(), &appl::Windows::onCallbackPlayStop);
subBind(ewol::widget::Button, "bt-play1", signalPressed, sharedFromThis(), &appl::Windows::onCallbackPlay);
subBind(ewol::widget::Button, "bt-stop1", signalPressed, sharedFromThis(), &appl::Windows::onCallbackStop);
subBind(ewol::widget::Button, "bt-play-stop", signalPressed, sharedFromThis(), &appl::Windows::onCallbackPlayStop);
}
std::shared_ptr<eaudiofx::Processing> process = NULL;
void appl::Windows::onCallbackPlayStop() {
onCallbackPlay();
usleep(500000);
@ -73,79 +68,79 @@ void appl::Windows::onCallbackPlayStop() {
void appl::Windows::onCallbackPlay() {
#if 0
APPL_INFO("Play Requested ...");
process = eaudiofx::Processing::create();
if (process == NULL) {
m_process = eaudiofx::Processing::create();
if (m_process == nullptr) {
APPL_ERROR("can not create processing ...");
return;
}
APPL_INFO("Create Generator ...");
std::shared_ptr<eaudiofx::GeneratorFile> generator = eaudiofx::GeneratorFile::create();
if (generator == NULL) {
ememory::SharedPtr<eaudiofx::GeneratorFile> generator = eaudiofx::GeneratorFile::create();
if (generator == nullptr) {
APPL_ERROR("can not create Generator ...");
return;
}
generator->setName("myGenerator");
process->addBlock(generator);
generator->propertyName.set("myGenerator");
m_process->addBlock(generator);
APPL_INFO("Create DECODER ...");
std::shared_ptr<eaudiofx::BlockDecoder> decoder = eaudiofx::BlockDecoder::create();
if (decoder == NULL) {
ememory::SharedPtr<eaudiofx::BlockDecoder> decoder = eaudiofx::BlockDecoder::create();
if (decoder == nullptr) {
APPL_ERROR("can not create Generator ...");
return;
}
decoder->setName("myDecoder");
process->addBlock(decoder);
decoder->propertyName.set("myDecoder");
m_process->addBlock(decoder);
APPL_INFO("Create Receiver ...");
std::shared_ptr<eaudiofx::ReceiverRtAudio> receiver = eaudiofx::ReceiverRtAudio::create();
if (receiver == NULL) {
ememory::SharedPtr<eaudiofx::ReceiverRtAudio> receiver = eaudiofx::ReceiverRtAudio::create();
if (receiver == nullptr) {
APPL_ERROR("can not create Receiver ...");
return;
}
receiver->setName("myReceiver");
process->addBlock(receiver);
receiver->propertyName.set("myReceiver");
m_process->addBlock(receiver);
process->linkBlock("myGenerator", "out","myDecoder", "in");
process->linkBlock("myDecoder", "out","myReceiver", "in");
m_process->linkBlock("myGenerator", "out","myDecoder", "in");
m_process->linkBlock("myDecoder", "out","myReceiver", "in");
process->start();
m_process->start();
return;
#else
APPL_INFO("Play Requested ...");
process = eaudiofx::Processing::create();
if (process == NULL) {
m_process = eaudiofx::Processing::create();
if (m_process == nullptr) {
APPL_ERROR("can not create processing ...");
return;
}
process->setName("main Process");
m_process->propertyName.set("main Process");
APPL_INFO("Create Generator Sinus");
std::shared_ptr<eaudiofx::GeneratorSignal> generator = eaudiofx::GeneratorSignal::create();
if (generator == NULL) {
ememory::SharedPtr<eaudiofx::GeneratorSignal> generator = eaudiofx::GeneratorSignal::create();
if (generator == nullptr) {
APPL_ERROR("can not create Generator ...");
return;
}
generator->setName("myGenerator");
process->addBlock(generator);
generator->propertyName.set("myGenerator");
m_process->addBlock(generator);
APPL_INFO("Create Receiver ...");
std::shared_ptr<eaudiofx::ReceiverRiver> receiver = eaudiofx::ReceiverRiver::create();
if (receiver == NULL) {
ememory::SharedPtr<eaudiofx::ReceiverRiver> receiver = eaudiofx::ReceiverRiver::create();
if (receiver == nullptr) {
APPL_ERROR("can not create Receiver ...");
return;
}
receiver->setName("myReceiver");
process->addBlock(receiver);
receiver->propertyName.set("myReceiver");
m_process->addBlock(receiver);
process->linkBlock("myGenerator", "out","myReceiver", "in");
m_process->linkBlock("myGenerator", "out","myReceiver", "in");
process->start();
m_process->start();
return;
#endif
}
void appl::Windows::onCallbackStop() {
if (process != NULL) {
process->stop();
if (m_process != nullptr) {
m_process->stop();
}
}

View File

@ -1,33 +0,0 @@
/**
* @author Edouard DUPIN
*
* @copyright 2010, Edouard DUPIN, all right reserved
*
* @license BSD 3 clauses (see license file)
*/
#ifndef __APPL_WINDOWS_H__
#define __APPL_WINDOWS_H__
#include <ewol/widget/Windows.h>
#include <ewol/widget/Composer.h>
namespace appl {
class Windows : public ewol::widget::Windows {
private:
std::shared_ptr<ewol::widget::Composer> m_composer;
protected:
Windows();
void init();
public:
DECLARE_FACTORY(Windows);
public: // callback functions
void onCallbackPlay();
void onCallbackStop();
void onCallbackPlayStop();
};
};
#endif

29
test/Windows.hpp Normal file
View File

@ -0,0 +1,29 @@
/** @file
* @author Edouard DUPIN
* @copyright 2014, Edouard DUPIN, all right reserved
* @license APACHE v2.0 (see license file)
*/
#pragma once
#include <ewol/widget/Windows.hpp>
#include <ewol/widget/Composer.hpp>
#include <eaudiofx/core/Processing.hpp>
namespace appl {
class Windows : public ewol::widget::Windows {
private:
ewol::widget::ComposerShared m_composer;
protected:
Windows();
void init();
public:
DECLARE_FACTORY(Windows);
public: // callback functions
void onCallbackPlay();
void onCallbackStop();
void onCallbackPlayStop();
ememory::SharedPtr<eaudiofx::Processing> m_process;
};
}

View File

@ -1,15 +1,13 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2010, Edouard DUPIN, all right reserved
*
* @license BSD 3 clauses (see license file)
* @copyright 2014, Edouard DUPIN, all right reserved
* @license APACHE v2.0 (see license file)
*/
#include <test/debug.h>
#include <test/debug.hpp>
int32_t appl::getLogId() {
static int32_t g_val = etk::log::registerInstance("ea-fx TT");
static int32_t g_val = elog::registerInstance("ea-fx TT");
return g_val;
}

View File

@ -1,21 +1,18 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2010, Edouard DUPIN, all right reserved
*
* @license BSD 3 clauses (see license file)
* @copyright 2014, Edouard DUPIN, all right reserved
* @license APACHE v2.0 (see license file)
*/
#pragma once
#ifndef __APPL_DEBUG_H__
#define __APPL_DEBUG_H__
#include <etk/log.h>
#include <elog/log.hpp>
namespace appl {
int32_t getLogId();
};
#define APPL_BASE(info,data) TK_LOG_BASE(appl::getLogId(),info,data)
#define APPL_BASE(info,data) ELOG_BASE(appl::getLogId(),info,data)
#define APPL_PRINT(data) APPL_BASE(-1, 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)
@ -39,5 +36,4 @@ namespace appl {
} \
} while (0)
#endif

1
version.txt Normal file
View File

@ -0,0 +1 @@
0.1-dev