[DEV] update etk null

This commit is contained in:
Edouard DUPIN 2018-06-19 22:31:29 +02:00
parent 859417e4fe
commit 8a16ccf72a
12 changed files with 74 additions and 74 deletions

View File

@ -12,7 +12,7 @@
audio::blockEngine::GeneratorFile::GeneratorFile() : audio::blockEngine::GeneratorFile::GeneratorFile() :
m_file(nullptr) { m_file(null) {
// set output : // set output :
m_io.insert( m_io.insert(
etk::Pair<etk::String, audio::blockEngine::Block::IOProperty>( etk::Pair<etk::String, audio::blockEngine::Block::IOProperty>(
@ -33,7 +33,7 @@ int32_t audio::blockEngine::GeneratorFile::pull(double _currentTime, int32_t _re
} }
audio::blockEngine::BufferStream* buffer = dynamic_cast<audio::blockEngine::BufferStream*>(it->second.m_buffer); audio::blockEngine::BufferStream* buffer = dynamic_cast<audio::blockEngine::BufferStream*>(it->second.m_buffer);
//ABE_ERROR("Generate data, request : " << _request << " at time : " << _currentTime); //ABE_ERROR("Generate data, request : " << _request << " at time : " << _currentTime);
if (buffer == nullptr) { if (buffer == null) {
// !! impossible case => a buffer can not be removed ... // !! impossible case => a buffer can not be removed ...
ABE_ERROR("Buffer has been removed... OR change type ..."); ABE_ERROR("Buffer has been removed... OR change type ...");
return audio::blockEngine::ERR_FAIL; return audio::blockEngine::ERR_FAIL;
@ -41,7 +41,7 @@ int32_t audio::blockEngine::GeneratorFile::pull(double _currentTime, int32_t _re
//request outpuffer needed size : //request outpuffer needed size :
buffer->setProperty(_request); buffer->setProperty(_request);
uint8_t* data = buffer->getData(); uint8_t* data = buffer->getData();
if (m_file == nullptr) { if (m_file == null) {
ABE_ERROR("Buffer output error ==> !!ERROR!!"); ABE_ERROR("Buffer output error ==> !!ERROR!!");
return audio::blockEngine::ERR_FAIL; return audio::blockEngine::ERR_FAIL;
} }
@ -53,7 +53,7 @@ int32_t audio::blockEngine::GeneratorFile::pull(double _currentTime, int32_t _re
int32_t audio::blockEngine::GeneratorFile::init() { int32_t audio::blockEngine::GeneratorFile::init() {
m_file = new etk::FSNode("DATA:menu.wav"); m_file = new etk::FSNode("DATA:menu.wav");
if (m_file == nullptr) { if (m_file == null) {
ABE_ERROR("Can not allocate the input file ..."); ABE_ERROR("Can not allocate the input file ...");
return audio::blockEngine::ERR_FAIL; return audio::blockEngine::ERR_FAIL;
} }
@ -66,17 +66,17 @@ int32_t audio::blockEngine::GeneratorFile::init() {
int32_t audio::blockEngine::GeneratorFile::unInit() { int32_t audio::blockEngine::GeneratorFile::unInit() {
if (m_file == nullptr) { if (m_file == null) {
return audio::blockEngine::ERR_NONE; return audio::blockEngine::ERR_NONE;
} }
if (m_file->fileClose() == false) { if (m_file->fileClose() == false) {
ABE_ERROR("Can not close the input file ..."); ABE_ERROR("Can not close the input file ...");
delete(m_file); delete(m_file);
m_file = nullptr; m_file = null;
return audio::blockEngine::ERR_FAIL; return audio::blockEngine::ERR_FAIL;
} }
delete(m_file); delete(m_file);
m_file = nullptr; m_file = null;
return audio::blockEngine::ERR_NONE; return audio::blockEngine::ERR_NONE;
} }

View File

@ -33,7 +33,7 @@ int32_t audio::blockEngine::GeneratorSignal::pull(double _currentTime, int32_t _
} }
audio::blockEngine::BufferAudioRaw* buffer = dynamic_cast<audio::blockEngine::BufferAudioRaw*>(it->second.m_buffer); audio::blockEngine::BufferAudioRaw* buffer = dynamic_cast<audio::blockEngine::BufferAudioRaw*>(it->second.m_buffer);
//ABE_ERROR("Generate data, request : " << _request << " at time : " << _currentTime); //ABE_ERROR("Generate data, request : " << _request << " at time : " << _currentTime);
if (buffer == nullptr) { if (buffer == null) {
// !! impossible case => a buffer can not be removed ... // !! impossible case => a buffer can not be removed ...
ABE_ERROR("Buffer has been removed... OR change type ..."); ABE_ERROR("Buffer has been removed... OR change type ...");
return audio::blockEngine::ERR_FAIL; return audio::blockEngine::ERR_FAIL;

View File

@ -8,7 +8,7 @@
audio::blockEngine::ReceiverFile::ReceiverFile() : audio::blockEngine::ReceiverFile::ReceiverFile() :
m_file(nullptr), m_file(null),
m_channels(4), m_channels(4),
m_frequency(16000), m_frequency(16000),
m_requestSize(256), m_requestSize(256),
@ -20,14 +20,14 @@ audio::blockEngine::ReceiverFile::ReceiverFile() :
audio::blockEngine::Block::IOProperty( audio::blockEngine::Block::IOProperty(
audio::blockEngine::Block::ioInput, audio::blockEngine::Block::ioInput,
"{ type:'audio', compression:'raw', frequency:16000, channel:4, format:'int16_t' }", "{ type:'audio', compression:'raw', frequency:16000, channel:4, format:'int16_t' }",
nullptr null
) ) ); ) ) );
} }
int32_t audio::blockEngine::ReceiverFile::init() { int32_t audio::blockEngine::ReceiverFile::init() {
m_file = new etk::FSNode("ouput.raw"); m_file = new etk::FSNode("ouput.raw");
if (m_file == nullptr) { if (m_file == null) {
ABE_ERROR("Can not allocate the output file ..."); ABE_ERROR("Can not allocate the output file ...");
return audio::blockEngine::ERR_FAIL; return audio::blockEngine::ERR_FAIL;
} }
@ -40,17 +40,17 @@ int32_t audio::blockEngine::ReceiverFile::init() {
int32_t audio::blockEngine::ReceiverFile::unInit() { int32_t audio::blockEngine::ReceiverFile::unInit() {
ABE_DEBUG("un-init Stream ..."); ABE_DEBUG("un-init Stream ...");
if (m_file == nullptr) { if (m_file == null) {
return audio::blockEngine::ERR_NONE; return audio::blockEngine::ERR_NONE;
} }
if (m_file->fileClose() == false) { if (m_file->fileClose() == false) {
ABE_ERROR("Can not close the input file ..."); ABE_ERROR("Can not close the input file ...");
delete(m_file); delete(m_file);
m_file = nullptr; m_file = null;
return audio::blockEngine::ERR_FAIL; return audio::blockEngine::ERR_FAIL;
} }
delete(m_file); delete(m_file);
m_file = nullptr; m_file = null;
return audio::blockEngine::ERR_NONE; return audio::blockEngine::ERR_NONE;
}; };
@ -75,7 +75,7 @@ int32_t audio::blockEngine::ReceiverFile::pull(double _currentTime, int32_t _req
} }
audio::blockEngine::BufferStream* buffer = dynamic_cast<audio::blockEngine::BufferStream*>(it->second.m_buffer); audio::blockEngine::BufferStream* buffer = dynamic_cast<audio::blockEngine::BufferStream*>(it->second.m_buffer);
//ABE_ERROR("Generate data, request : " << _request << " at time : " << _currentTime); //ABE_ERROR("Generate data, request : " << _request << " at time : " << _currentTime);
if (buffer == nullptr) { if (buffer == null) {
// !! impossible case => a buffer can not be removed ... // !! impossible case => a buffer can not be removed ...
ABE_ERROR("Buffer has been removed... OR change type ..."); ABE_ERROR("Buffer has been removed... OR change type ...");
return audio::blockEngine::ERR_FAIL; return audio::blockEngine::ERR_FAIL;
@ -83,7 +83,7 @@ int32_t audio::blockEngine::ReceiverFile::pull(double _currentTime, int32_t _req
//request outpuffer needed size : //request outpuffer needed size :
buffer->setProperty(_request); buffer->setProperty(_request);
uint8_t* data = buffer->getData(); uint8_t* data = buffer->getData();
if (m_file == nullptr) { if (m_file == null) {
ABE_ERROR("Buffer output error ==> !!ERROR!!"); ABE_ERROR("Buffer output error ==> !!ERROR!!");
return audio::blockEngine::ERR_FAIL; return audio::blockEngine::ERR_FAIL;
} }

View File

@ -48,7 +48,7 @@ void audio::blockEngine::ReceiverRiver::onDataNeeded(void* _data,
int32_t audio::blockEngine::ReceiverRiver::algoInit() { int32_t audio::blockEngine::ReceiverRiver::algoInit() {
ABE_DEBUG("Intanciate audio::river Manager ..."); ABE_DEBUG("Intanciate audio::river Manager ...");
m_manager = audio::river::Manager::create("eaudio-fx-output"); m_manager = audio::river::Manager::create("eaudio-fx-output");
if (m_manager == nullptr) { if (m_manager == null) {
ABE_ERROR("Can not intanciate RIVER interface"); ABE_ERROR("Can not intanciate RIVER interface");
return audio::blockEngine::ERR_FAIL; return audio::blockEngine::ERR_FAIL;
} }
@ -60,8 +60,8 @@ int32_t audio::blockEngine::ReceiverRiver::algoInit() {
channelMap, channelMap,
audio::format_int16, audio::format_int16,
"speaker"); "speaker");
if(m_interface == nullptr) { if(m_interface == null) {
ABE_ERROR("nullptr interface"); ABE_ERROR("null interface");
return audio::blockEngine::ERR_FAIL; return audio::blockEngine::ERR_FAIL;
} }
// set callback mode ... // set callback mode ...
@ -79,8 +79,8 @@ int32_t audio::blockEngine::ReceiverRiver::algoInit() {
int32_t audio::blockEngine::ReceiverRiver::algoUnInit() { int32_t audio::blockEngine::ReceiverRiver::algoUnInit() {
ABE_DEBUG("un-init Stream ..."); ABE_DEBUG("un-init Stream ...");
if(m_interface == nullptr) { if(m_interface == null) {
ABE_ERROR("nullptr interface"); ABE_ERROR("null interface");
return audio::blockEngine::ERR_FAIL; return audio::blockEngine::ERR_FAIL;
} }
m_interface.reset(); m_interface.reset();
@ -90,8 +90,8 @@ int32_t audio::blockEngine::ReceiverRiver::algoUnInit() {
int32_t audio::blockEngine::ReceiverRiver::algoStart() { int32_t audio::blockEngine::ReceiverRiver::algoStart() {
ABE_DEBUG("Start stream ..."); ABE_DEBUG("Start stream ...");
if(m_interface == nullptr) { if(m_interface == null) {
ABE_ERROR("nullptr interface"); ABE_ERROR("null interface");
return audio::blockEngine::ERR_FAIL; return audio::blockEngine::ERR_FAIL;
} }
m_interface->start(); m_interface->start();
@ -100,8 +100,8 @@ int32_t audio::blockEngine::ReceiverRiver::algoStart() {
int32_t audio::blockEngine::ReceiverRiver::algoStop() { int32_t audio::blockEngine::ReceiverRiver::algoStop() {
ABE_DEBUG("Stop Stream ..."); ABE_DEBUG("Stop Stream ...");
if(m_interface == nullptr) { if(m_interface == null) {
ABE_ERROR("nullptr interface"); ABE_ERROR("null interface");
return audio::blockEngine::ERR_FAIL; return audio::blockEngine::ERR_FAIL;
} }
m_interface->stop(); m_interface->stop();

View File

@ -23,9 +23,9 @@ ememory::SharedPtr<audio::blockEngine::Block> audio::blockEngine::Block::getBloc
ememory::SharedPtr<audio::blockEngine::Block> out; ememory::SharedPtr<audio::blockEngine::Block> out;
ABE_INFO(" get block : " << _name); ABE_INFO(" get block : " << _name);
ewol::ObjectShared parrent = m_parent.lock(); ewol::ObjectShared parrent = m_parent.lock();
if (parrent != nullptr) { if (parrent != null) {
ememory::SharedPtr<audio::blockEngine::Block> parrentBlock = ememory::dynamicPointerCast<audio::blockEngine::Block>(parrent); ememory::SharedPtr<audio::blockEngine::Block> parrentBlock = ememory::dynamicPointerCast<audio::blockEngine::Block>(parrent);
if (parrentBlock != nullptr) { if (parrentBlock != null) {
return parrentBlock->getBlockNamed(_name); return parrentBlock->getBlockNamed(_name);
} else { } else {
ABE_INFO(" Parent is not a Block ..."); ABE_INFO(" Parent is not a Block ...");

View File

@ -15,7 +15,7 @@ audio::blockEngine::BlockMeta::BlockMeta() {
audio::blockEngine::BlockMeta::~BlockMeta() { audio::blockEngine::BlockMeta::~BlockMeta() {
// TODO : Unlink all ... // TODO : Unlink all ...
for (auto &it : m_list) { for (auto &it : m_list) {
if (it == nullptr) { if (it == null) {
continue; continue;
} }
ememory::SharedPtr<audio::blockEngine::Block> tmp = it; ememory::SharedPtr<audio::blockEngine::Block> tmp = it;
@ -26,28 +26,28 @@ audio::blockEngine::BlockMeta::~BlockMeta() {
ememory::SharedPtr<audio::blockEngine::Block> audio::blockEngine::BlockMeta::getBlock(const etk::String& _name) { ememory::SharedPtr<audio::blockEngine::Block> audio::blockEngine::BlockMeta::getBlock(const etk::String& _name) {
if (_name.size() == 0) { if (_name.size() == 0) {
return nullptr; return null;
} }
for (auto &it : m_list) { for (auto &it : m_list) {
if (it == nullptr) { if (it == null) {
continue; continue;
} }
if (it->propertyName.get() == _name) { if (it->propertyName.get() == _name) {
return it; return it;
} }
} }
return nullptr; return null;
} }
int32_t audio::blockEngine::BlockMeta::addBlock(ememory::SharedPtr<audio::blockEngine::Block> _block) { int32_t audio::blockEngine::BlockMeta::addBlock(ememory::SharedPtr<audio::blockEngine::Block> _block) {
if (_block == nullptr) { if (_block == null) {
ABE_ERROR("[" << getId() << "] Add nullptr block"); ABE_ERROR("[" << getId() << "] Add null block");
return audio::blockEngine::ERR_INPUT_NULL; return audio::blockEngine::ERR_INPUT_NULL;
} }
if (_block->propertyName.get().size() > 0 ) { if (_block->propertyName.get().size() > 0 ) {
// Check if name exist : // Check if name exist :
for (auto &it : m_list) { for (auto &it : m_list) {
if (it == nullptr) { if (it == null) {
continue; continue;
} }
if (it->propertyName.get() == _block->propertyName.get()) { if (it->propertyName.get() == _block->propertyName.get()) {
@ -78,7 +78,7 @@ int32_t audio::blockEngine::BlockMeta::linkBlock(const etk::String& _generatorBl
const etk::String& _receiverIoName) { const etk::String& _receiverIoName) {
// TODO : proxy IOs // TODO : proxy IOs
ememory::SharedPtr<audio::blockEngine::Block> receive = getBlock(_receiverBlockName); ememory::SharedPtr<audio::blockEngine::Block> receive = getBlock(_receiverBlockName);
if (receive == nullptr) { if (receive == null) {
ABE_ERROR("Can not find destination block : '" << _receiverBlockName << "'"); ABE_ERROR("Can not find destination block : '" << _receiverBlockName << "'");
return audio::blockEngine::ERR_FAIL; return audio::blockEngine::ERR_FAIL;
} }
@ -101,7 +101,7 @@ int32_t audio::blockEngine::BlockMeta::algoInit() {
ABE_INFO("[" << getId() << "]Init Meta block : '" << propertyName << "'"); ABE_INFO("[" << getId() << "]Init Meta block : '" << propertyName << "'");
int32_t ret = audio::blockEngine::ERR_NONE; int32_t ret = audio::blockEngine::ERR_NONE;
for (auto &it : m_list) { for (auto &it : m_list) {
if (it == nullptr) { if (it == null) {
continue; continue;
} }
if (it->algoInit() != audio::blockEngine::ERR_NONE) { if (it->algoInit() != audio::blockEngine::ERR_NONE) {
@ -117,7 +117,7 @@ int32_t audio::blockEngine::BlockMeta::algoInit() {
int32_t audio::blockEngine::BlockMeta::algoUnInit() { int32_t audio::blockEngine::BlockMeta::algoUnInit() {
int32_t ret = audio::blockEngine::ERR_NONE; int32_t ret = audio::blockEngine::ERR_NONE;
for (auto &it : m_list) { for (auto &it : m_list) {
if (it == nullptr) { if (it == null) {
continue; continue;
} }
if (it->algoUnInit() != audio::blockEngine::ERR_NONE) { if (it->algoUnInit() != audio::blockEngine::ERR_NONE) {
@ -135,7 +135,7 @@ int32_t audio::blockEngine::BlockMeta::algoStart() {
ABE_INFO("[" << getId() << "] Start Meta block : '" << propertyName << "'"); ABE_INFO("[" << getId() << "] Start Meta block : '" << propertyName << "'");
int32_t ret = audio::blockEngine::ERR_NONE; int32_t ret = audio::blockEngine::ERR_NONE;
for (auto &it : m_list) { for (auto &it : m_list) {
if (it == nullptr) { if (it == null) {
continue; continue;
} }
if (it->algoStart() != audio::blockEngine::ERR_NONE) { if (it->algoStart() != audio::blockEngine::ERR_NONE) {
@ -152,7 +152,7 @@ int32_t audio::blockEngine::BlockMeta::algoStop() {
ABE_INFO("[" << getId() << "] Stop Meta block : '" << propertyName << "'"); ABE_INFO("[" << getId() << "] Stop Meta block : '" << propertyName << "'");
int32_t ret = audio::blockEngine::ERR_NONE; int32_t ret = audio::blockEngine::ERR_NONE;
for (auto &it : m_list) { for (auto &it : m_list) {
if (it == nullptr) { if (it == null) {
continue; continue;
} }
if (it->algoStop() != audio::blockEngine::ERR_NONE) { if (it->algoStop() != audio::blockEngine::ERR_NONE) {
@ -177,7 +177,7 @@ ememory::SharedPtr<audio::blockEngine::Block> audio::blockEngine::BlockMeta::get
} }
// find in sub elements. // find in sub elements.
for (auto &it : m_list) { for (auto &it : m_list) {
if (it == nullptr) { if (it == null) {
continue; continue;
} }
ABE_DEBUG(" check : " << it->propertyName.get()); ABE_DEBUG(" check : " << it->propertyName.get());
@ -194,7 +194,7 @@ void audio::blockEngine::BlockMeta::flowLinkInput() {
ABE_INFO("[" << getId() << "] Meta block Link: '" << propertyName << "'"); ABE_INFO("[" << getId() << "] Meta block Link: '" << propertyName << "'");
// find in sub elements. // find in sub elements.
for (auto &it : m_list) { for (auto &it : m_list) {
if (it == nullptr) { if (it == null) {
continue; continue;
} }
it->flowLinkInput(); it->flowLinkInput();
@ -208,7 +208,7 @@ void audio::blockEngine::BlockMeta::flowCheckAllCompatibility() {
ABE_INFO("[" << getId() << "] Meta block check compatibilities: '" << propertyName << "'"); ABE_INFO("[" << getId() << "] Meta block check compatibilities: '" << propertyName << "'");
// find in sub elements. // find in sub elements.
for (auto &it : m_list) { for (auto &it : m_list) {
if (it == nullptr) { if (it == null) {
continue; continue;
} }
it->flowCheckAllCompatibility(); it->flowCheckAllCompatibility();
@ -221,7 +221,7 @@ void audio::blockEngine::BlockMeta::flowAllocateOutput() {
ABE_INFO("[" << getId() << "] Meta block allocate output: '" << propertyName << "'"); ABE_INFO("[" << getId() << "] Meta block allocate output: '" << propertyName << "'");
// find in sub elements. // find in sub elements.
for (auto &it : m_list) { for (auto &it : m_list) {
if (it == nullptr) { if (it == null) {
continue; continue;
} }
it->flowAllocateOutput(); it->flowAllocateOutput();
@ -234,7 +234,7 @@ void audio::blockEngine::BlockMeta::flowGetInput() {
ABE_INFO("[" << getId() << "] Meta block get input ... : '" << propertyName << "'"); ABE_INFO("[" << getId() << "] Meta block get input ... : '" << propertyName << "'");
// find in sub elements. // find in sub elements.
for (auto &it : m_list) { for (auto &it : m_list) {
if (it == nullptr) { if (it == null) {
continue; continue;
} }
it->flowGetInput(); it->flowGetInput();

View File

@ -57,11 +57,11 @@ ememory::SharedPtr<audio::blockEngine::flow::BaseReference> audio::blockEngine::
ABE_INFO(" Get flow : " << _blockName << ":" << _flowLinkName << " nothing to do ==> no connection ..."); ABE_INFO(" Get flow : " << _blockName << ":" << _flowLinkName << " nothing to do ==> no connection ...");
} }
ememory::SharedPtr<audio::blockEngine::Block> blockRemote = m_flowInterfaceLink.getBlockNamed(_blockName); ememory::SharedPtr<audio::blockEngine::Block> blockRemote = m_flowInterfaceLink.getBlockNamed(_blockName);
if (blockRemote == nullptr) { if (blockRemote == null) {
ABE_ERROR(" Get flow : '" << m_name << "' mode:'input' to " << _blockName << ":" << _flowLinkName << " Error no remote block"); ABE_ERROR(" Get flow : '" << m_name << "' mode:'input' to " << _blockName << ":" << _flowLinkName << " Error no remote block");
} else { } else {
out = blockRemote->getFlowReference(_flowLinkName); out = blockRemote->getFlowReference(_flowLinkName);
if (out == nullptr) { if (out == null) {
ABE_ERROR(" Get flow : '" << m_name << "' mode:'input' to " << _blockName << ":" << _flowLinkName << " Error no Flow found"); ABE_ERROR(" Get flow : '" << m_name << "' mode:'input' to " << _blockName << ":" << _flowLinkName << " Error no Flow found");
} else { } else {
ABE_INFO(" Get flow : " << _blockName << ":" << _flowLinkName); ABE_INFO(" Get flow : " << _blockName << ":" << _flowLinkName);
@ -73,6 +73,6 @@ ememory::SharedPtr<audio::blockEngine::flow::BaseReference> audio::blockEngine::
/* /*
ememory::SharedPtr<audio::blockEngine::Block> audio::blockEngine::flow::Base::getBlockNamed(const etk::String& _name) { ememory::SharedPtr<audio::blockEngine::Block> audio::blockEngine::flow::Base::getBlockNamed(const etk::String& _name) {
ABE_ERROR("NEED to call Parrent ..."); ABE_ERROR("NEED to call Parrent ...");
return nullptr; return null;
} }
*/ */

View File

@ -90,13 +90,13 @@ namespace audio {
protected: protected:
Base* m_basePointer; Base* m_basePointer;
public: public:
BaseReference(Base* _base = nullptr) : BaseReference(Base* _base = null) :
m_basePointer(_base) { m_basePointer(_base) {
// nothing to do ... // nothing to do ...
} }
~BaseReference() {} ~BaseReference() {}
void removeBase() { void removeBase() {
m_basePointer = nullptr; m_basePointer = null;
} }
inline Base* getBase() const { inline Base* getBase() const {
return m_basePointer; return m_basePointer;

View File

@ -40,7 +40,7 @@ namespace audio {
void set(const ememory::SharedPtr<audio::blockEngine::Buffer>& _data){ void set(const ememory::SharedPtr<audio::blockEngine::Buffer>& _data){
m_data.reset(); m_data.reset();
ememory::SharedPtr<T> check = ememory::dynamicPointerCast<T>(_data); ememory::SharedPtr<T> check = ememory::dynamicPointerCast<T>(_data);
if (check == nullptr) { if (check == null) {
ABE_ERROR("can not set buffer as flow (type uncompatible)"); ABE_ERROR("can not set buffer as flow (type uncompatible)");
return; return;
} }
@ -85,7 +85,7 @@ namespace audio {
ABE_INFO(" link flow : '" << Base::m_name << "' mode:'input' to " << m_blockName << ":" << m_flowName); ABE_INFO(" link flow : '" << Base::m_name << "' mode:'input' to " << m_blockName << ":" << m_flowName);
ememory::SharedPtr<BaseReference> remoteFlow = Base::getFlowReference(m_blockName, m_flowName); ememory::SharedPtr<BaseReference> remoteFlow = Base::getFlowReference(m_blockName, m_flowName);
m_remoteFlow = remoteFlow; m_remoteFlow = remoteFlow;
if (remoteFlow == nullptr) { if (remoteFlow == null) {
ABE_ERROR(" link flow : '" << Base::m_name << "' mode:'input' to " << m_blockName << ":" << m_flowName << " Error no Flow found"); ABE_ERROR(" link flow : '" << Base::m_name << "' mode:'input' to " << m_blockName << ":" << m_flowName << " Error no Flow found");
return; return;
} }
@ -125,8 +125,8 @@ namespace audio {
list.pushBack(Base::getCapabilities()); list.pushBack(Base::getCapabilities());
for (auto &it : m_remoteFlow) { for (auto &it : m_remoteFlow) {
ememory::SharedPtr<BaseReference> tmp = it.lock(); ememory::SharedPtr<BaseReference> tmp = it.lock();
if (tmp != nullptr) { if (tmp != null) {
if (tmp->getBase() != nullptr) { if (tmp->getBase() != null) {
list.pushBack(tmp->getBase()->getCapabilities()); list.pushBack(tmp->getBase()->getCapabilities());
} }
} }

View File

@ -18,20 +18,20 @@ audio::blockEngine::flow::Interface::~Interface() {
// note this pointer is not allocated and not free at the end of the class // note this pointer is not allocated and not free at the end of the class
void audio::blockEngine::flow::Interface::flowAdd(audio::blockEngine::flow::Base* _pointerOnFlow) { void audio::blockEngine::flow::Interface::flowAdd(audio::blockEngine::flow::Base* _pointerOnFlow) {
if (_pointerOnFlow == nullptr) { if (_pointerOnFlow == null) {
ABE_ERROR("Try to link a nullptr flow"); ABE_ERROR("Try to link a null flow");
return; return;
} }
m_list.pushBack(_pointerOnFlow); m_list.pushBack(_pointerOnFlow);
} }
void audio::blockEngine::flow::Interface::flowRemove(audio::blockEngine::flow::Base* _pointerOnFlow) { void audio::blockEngine::flow::Interface::flowRemove(audio::blockEngine::flow::Base* _pointerOnFlow) {
if (_pointerOnFlow == nullptr) { if (_pointerOnFlow == null) {
ABE_ERROR("Try to unlink a nullptr flow"); ABE_ERROR("Try to unlink a null flow");
return; return;
} }
for (auto it(m_list.begin()); it != m_list.end(); ++it) { for (auto it(m_list.begin()); it != m_list.end(); ++it) {
if (*it == nullptr) { if (*it == null) {
continue; continue;
} }
if (*it == _pointerOnFlow) { if (*it == _pointerOnFlow) {
@ -45,7 +45,7 @@ void audio::blockEngine::flow::Interface::flowRemove(audio::blockEngine::flow::B
etk::Vector<etk::String> audio::blockEngine::flow::Interface::flowGetAll() const { etk::Vector<etk::String> audio::blockEngine::flow::Interface::flowGetAll() const {
etk::Vector<etk::String> out; etk::Vector<etk::String> out;
for (auto &it : m_list) { for (auto &it : m_list) {
if(it != nullptr) { if(it != null) {
out.pushBack(it->getName()); out.pushBack(it->getName());
} }
} }
@ -61,7 +61,7 @@ void audio::blockEngine::flow::Interface::flowSetLinkWith(const etk::String& _fl
const etk::String& _blockName, const etk::String& _blockName,
const etk::String& _flowLinkName) { const etk::String& _flowLinkName) {
for (auto &it : m_list) { for (auto &it : m_list) {
if( it != nullptr if( it != null
&& it->getName() == _flowName) { && it->getName() == _flowName) {
it->setLink(_blockName, _flowLinkName); it->setLink(_blockName, _flowLinkName);
return; return;
@ -73,7 +73,7 @@ void audio::blockEngine::flow::Interface::flowSetLinkWith(const etk::String& _fl
void audio::blockEngine::flow::Interface::flowLinkInput() { void audio::blockEngine::flow::Interface::flowLinkInput() {
ABE_INFO(" Block update the flows links (" << m_list.size() << " flows)"); ABE_INFO(" Block update the flows links (" << m_list.size() << " flows)");
for (auto &it : m_list) { for (auto &it : m_list) {
if(it != nullptr) { if(it != null) {
it->link(); it->link();
} }
} }
@ -82,7 +82,7 @@ void audio::blockEngine::flow::Interface::flowLinkInput() {
void audio::blockEngine::flow::Interface::flowCheckAllCompatibility() { void audio::blockEngine::flow::Interface::flowCheckAllCompatibility() {
ABE_INFO(" Block Check the flows Capabilities (" << m_list.size() << " flows)"); ABE_INFO(" Block Check the flows Capabilities (" << m_list.size() << " flows)");
for (auto &it : m_list) { for (auto &it : m_list) {
if(it != nullptr) { if(it != null) {
it->checkCompatibility(); it->checkCompatibility();
} }
} }
@ -95,7 +95,7 @@ void audio::blockEngine::flow::Interface::flowAllocateOutput() {
void audio::blockEngine::flow::Interface::flowGetInput() { void audio::blockEngine::flow::Interface::flowGetInput() {
ABE_WARNING(" Block Get input data pointers"); ABE_WARNING(" Block Get input data pointers");
for (auto &it : m_list) { for (auto &it : m_list) {
if(it != nullptr) { if(it != null) {
it->getInputBuffer(); it->getInputBuffer();
} }
} }
@ -105,7 +105,7 @@ void audio::blockEngine::flow::Interface::flowGetInput() {
ememory::SharedPtr<audio::blockEngine::flow::BaseReference> audio::blockEngine::flow::Interface::getFlowReference(const etk::String& _flowName) { ememory::SharedPtr<audio::blockEngine::flow::BaseReference> audio::blockEngine::flow::Interface::getFlowReference(const etk::String& _flowName) {
ememory::SharedPtr<audio::blockEngine::flow::BaseReference> out; ememory::SharedPtr<audio::blockEngine::flow::BaseReference> out;
for (auto &it : m_list) { for (auto &it : m_list) {
if( it != nullptr if( it != null
&& it->getName() == _flowName) { && it->getName() == _flowName) {
out = it->getReference(); out = it->getReference();
break; break;

View File

@ -75,7 +75,7 @@ namespace audio {
* @return The block requested if it exist. * @return The block requested if it exist.
*/ */
virtual ememory::SharedPtr<audio::blockEngine::Block> getBlockNamed(const etk::String& _name) { virtual ememory::SharedPtr<audio::blockEngine::Block> getBlockNamed(const etk::String& _name) {
return nullptr; return null;
} }
ememory::SharedPtr<audio::blockEngine::flow::BaseReference> getFlowReference(const etk::String& _name); ememory::SharedPtr<audio::blockEngine::flow::BaseReference> getFlowReference(const etk::String& _name);
public: public:

View File

@ -49,7 +49,7 @@ void appl::Windows::init() {
composition += "</sizer>\n"; composition += "</sizer>\n";
m_composer = ewol::widget::Composer::create(); m_composer = ewol::widget::Composer::create();
if (m_composer == nullptr) { if (m_composer == null) {
APPL_CRITICAL(" An error occured ... in the windows creatrion ..."); APPL_CRITICAL(" An error occured ... in the windows creatrion ...");
return; return;
} }
@ -69,13 +69,13 @@ void appl::Windows::onCallbackPlay() {
#if 0 #if 0
APPL_INFO("Play Requested ..."); APPL_INFO("Play Requested ...");
m_process = audio::blockEngine::Processing::create(); m_process = audio::blockEngine::Processing::create();
if (m_process == nullptr) { if (m_process == null) {
APPL_ERROR("can not create processing ..."); APPL_ERROR("can not create processing ...");
return; return;
} }
APPL_INFO("Create Generator ..."); APPL_INFO("Create Generator ...");
ememory::SharedPtr<audio::blockEngine::GeneratorFile> generator = audio::blockEngine::GeneratorFile::create(); ememory::SharedPtr<audio::blockEngine::GeneratorFile> generator = audio::blockEngine::GeneratorFile::create();
if (generator == nullptr) { if (generator == null) {
APPL_ERROR("can not create Generator ..."); APPL_ERROR("can not create Generator ...");
return; return;
} }
@ -84,7 +84,7 @@ void appl::Windows::onCallbackPlay() {
APPL_INFO("Create DECODER ..."); APPL_INFO("Create DECODER ...");
ememory::SharedPtr<audio::blockEngine::BlockDecoder> decoder = audio::blockEngine::BlockDecoder::create(); ememory::SharedPtr<audio::blockEngine::BlockDecoder> decoder = audio::blockEngine::BlockDecoder::create();
if (decoder == nullptr) { if (decoder == null) {
APPL_ERROR("can not create Generator ..."); APPL_ERROR("can not create Generator ...");
return; return;
} }
@ -93,7 +93,7 @@ void appl::Windows::onCallbackPlay() {
APPL_INFO("Create Receiver ..."); APPL_INFO("Create Receiver ...");
ememory::SharedPtr<audio::blockEngine::ReceiverRtAudio> receiver = audio::blockEngine::ReceiverRtAudio::create(); ememory::SharedPtr<audio::blockEngine::ReceiverRtAudio> receiver = audio::blockEngine::ReceiverRtAudio::create();
if (receiver == nullptr) { if (receiver == null) {
APPL_ERROR("can not create Receiver ..."); APPL_ERROR("can not create Receiver ...");
return; return;
} }
@ -108,14 +108,14 @@ void appl::Windows::onCallbackPlay() {
#else #else
APPL_INFO("Play Requested ..."); APPL_INFO("Play Requested ...");
m_process = audio::blockEngine::Processing::create(); m_process = audio::blockEngine::Processing::create();
if (m_process == nullptr) { if (m_process == null) {
APPL_ERROR("can not create processing ..."); APPL_ERROR("can not create processing ...");
return; return;
} }
m_process->propertyName.set("main Process"); m_process->propertyName.set("main Process");
APPL_INFO("Create Generator Sinus"); APPL_INFO("Create Generator Sinus");
ememory::SharedPtr<audio::blockEngine::GeneratorSignal> generator = audio::blockEngine::GeneratorSignal::create(); ememory::SharedPtr<audio::blockEngine::GeneratorSignal> generator = audio::blockEngine::GeneratorSignal::create();
if (generator == nullptr) { if (generator == null) {
APPL_ERROR("can not create Generator ..."); APPL_ERROR("can not create Generator ...");
return; return;
} }
@ -124,7 +124,7 @@ void appl::Windows::onCallbackPlay() {
APPL_INFO("Create Receiver ..."); APPL_INFO("Create Receiver ...");
ememory::SharedPtr<audio::blockEngine::ReceiverRiver> receiver = audio::blockEngine::ReceiverRiver::create(); ememory::SharedPtr<audio::blockEngine::ReceiverRiver> receiver = audio::blockEngine::ReceiverRiver::create();
if (receiver == nullptr) { if (receiver == null) {
APPL_ERROR("can not create Receiver ..."); APPL_ERROR("can not create Receiver ...");
return; return;
} }
@ -139,7 +139,7 @@ void appl::Windows::onCallbackPlay() {
} }
void appl::Windows::onCallbackStop() { void appl::Windows::onCallbackStop() {
if (m_process != nullptr) { if (m_process != null) {
m_process->stop(); m_process->stop();
} }
} }