[DEV] update gitignore & chaneg log base

This commit is contained in:
Edouard DUPIN 2015-02-05 21:33:12 +01:00
parent e7a23e6b8d
commit 44f52e7fe1
9 changed files with 114 additions and 114 deletions

View File

@ -47,10 +47,10 @@ bool river::Interface::init(const std::string& _name,
algo->setInputFormat(m_node->getInterfaceFormat()); algo->setInputFormat(m_node->getInterfaceFormat());
algo->setName("volume"); algo->setName("volume");
m_process->pushBack(algo); m_process->pushBack(algo);
AIRTIO_INFO("add basic volume stage (1)"); RIVER_INFO("add basic volume stage (1)");
std::shared_ptr<drain::VolumeElement> tmpVolume = m_node->getVolume(); std::shared_ptr<drain::VolumeElement> tmpVolume = m_node->getVolume();
if (tmpVolume != nullptr) { if (tmpVolume != nullptr) {
AIRTIO_INFO(" add volume for node"); RIVER_INFO(" add volume for node");
algo->addVolumeStage(tmpVolume); algo->addVolumeStage(tmpVolume);
} }
} else { } else {
@ -59,10 +59,10 @@ bool river::Interface::init(const std::string& _name,
algo->setOutputFormat(m_node->getInterfaceFormat()); algo->setOutputFormat(m_node->getInterfaceFormat());
algo->setName("volume"); algo->setName("volume");
m_process->pushBack(algo); m_process->pushBack(algo);
AIRTIO_INFO("add basic volume stage (2)"); RIVER_INFO("add basic volume stage (2)");
std::shared_ptr<drain::VolumeElement> tmpVolume = m_node->getVolume(); std::shared_ptr<drain::VolumeElement> tmpVolume = m_node->getVolume();
if (tmpVolume != nullptr) { if (tmpVolume != nullptr) {
AIRTIO_INFO(" add volume for node"); RIVER_INFO(" add volume for node");
algo->addVolumeStage(tmpVolume); algo->addVolumeStage(tmpVolume);
} }
} }
@ -94,7 +94,7 @@ void river::Interface::setReadwrite() {
std::unique_lock<std::recursive_mutex> lock(m_mutex); std::unique_lock<std::recursive_mutex> lock(m_mutex);
m_process->removeAlgoDynamic(); m_process->removeAlgoDynamic();
if (m_process->hasType<drain::EndPoint>() ) { if (m_process->hasType<drain::EndPoint>() ) {
AIRTIO_ERROR("Endpoint is already present ==> can not change"); RIVER_ERROR("Endpoint is already present ==> can not change");
return; return;
} }
if (m_node->isInput() == true) { if (m_node->isInput() == true) {
@ -117,7 +117,7 @@ void river::Interface::setOutputCallback(size_t _chunkSize, drain::needDataFunct
m_process->removeAlgoDynamic(); m_process->removeAlgoDynamic();
m_process->removeIfFirst<drain::EndPoint>(); m_process->removeIfFirst<drain::EndPoint>();
std::shared_ptr<drain::Algo> algo = drain::EndPointCallback::create(_function); std::shared_ptr<drain::Algo> algo = drain::EndPointCallback::create(_function);
AIRTIO_INFO("set property: " << m_map << " " << m_format << " " << m_freq); RIVER_INFO("set property: " << m_map << " " << m_format << " " << m_freq);
algo->setInputFormat(drain::IOFormatInterface(m_map, m_format, m_freq)); algo->setInputFormat(drain::IOFormatInterface(m_map, m_format, m_freq));
//algo->setOutputFormat(drain::IOFormatInterface(m_map, m_format, m_freq)); //algo->setOutputFormat(drain::IOFormatInterface(m_map, m_format, m_freq));
m_process->pushFront(algo); m_process->pushFront(algo);
@ -145,65 +145,65 @@ void river::Interface::setWriteCallback(drain::needDataFunctionWrite _function)
void river::Interface::start(const std::chrono::system_clock::time_point& _time) { void river::Interface::start(const std::chrono::system_clock::time_point& _time) {
std::unique_lock<std::recursive_mutex> lock(m_mutex); std::unique_lock<std::recursive_mutex> lock(m_mutex);
AIRTIO_DEBUG("start [BEGIN]"); RIVER_DEBUG("start [BEGIN]");
m_process->updateInterAlgo(); m_process->updateInterAlgo();
m_node->interfaceAdd(shared_from_this()); m_node->interfaceAdd(shared_from_this());
AIRTIO_DEBUG("start [ END ]"); RIVER_DEBUG("start [ END ]");
} }
void river::Interface::stop(bool _fast, bool _abort) { void river::Interface::stop(bool _fast, bool _abort) {
std::unique_lock<std::recursive_mutex> lock(m_mutex); std::unique_lock<std::recursive_mutex> lock(m_mutex);
AIRTIO_DEBUG("stop [BEGIN]"); RIVER_DEBUG("stop [BEGIN]");
m_node->interfaceRemove(shared_from_this()); m_node->interfaceRemove(shared_from_this());
AIRTIO_DEBUG("stop [ END]"); RIVER_DEBUG("stop [ END]");
} }
void river::Interface::abort() { void river::Interface::abort() {
std::unique_lock<std::recursive_mutex> lock(m_mutex); std::unique_lock<std::recursive_mutex> lock(m_mutex);
AIRTIO_DEBUG("abort [BEGIN]"); RIVER_DEBUG("abort [BEGIN]");
// TODO :... // TODO :...
AIRTIO_DEBUG("abort [ END ]"); RIVER_DEBUG("abort [ END ]");
} }
bool river::Interface::setParameter(const std::string& _filter, const std::string& _parameter, const std::string& _value) { bool river::Interface::setParameter(const std::string& _filter, const std::string& _parameter, const std::string& _value) {
AIRTIO_DEBUG("setParameter [BEGIN] : '" << _filter << "':'" << _parameter << "':'" << _value << "'"); RIVER_DEBUG("setParameter [BEGIN] : '" << _filter << "':'" << _parameter << "':'" << _value << "'");
bool out = false; bool out = false;
if ( _filter == "volume" if ( _filter == "volume"
&& _parameter != "FLOW") { && _parameter != "FLOW") {
AIRTIO_ERROR("Interface is not allowed to modify '" << _parameter << "' Volume just allowed to modify 'FLOW' volume"); RIVER_ERROR("Interface is not allowed to modify '" << _parameter << "' Volume just allowed to modify 'FLOW' volume");
return false; return false;
} }
std::shared_ptr<drain::Algo> algo = m_process->get<drain::Algo>(_filter); std::shared_ptr<drain::Algo> algo = m_process->get<drain::Algo>(_filter);
if (algo == nullptr) { if (algo == nullptr) {
AIRTIO_ERROR("setParameter(" << _filter << ") ==> no filter named like this ..."); RIVER_ERROR("setParameter(" << _filter << ") ==> no filter named like this ...");
return false; return false;
} }
out = algo->setParameter(_parameter, _value); out = algo->setParameter(_parameter, _value);
AIRTIO_DEBUG("setParameter [ END ] : '" << out << "'"); RIVER_DEBUG("setParameter [ END ] : '" << out << "'");
return out; return out;
} }
std::string river::Interface::getParameter(const std::string& _filter, const std::string& _parameter) const { std::string river::Interface::getParameter(const std::string& _filter, const std::string& _parameter) const {
AIRTIO_DEBUG("getParameter [BEGIN] : '" << _filter << "':'" << _parameter << "'"); RIVER_DEBUG("getParameter [BEGIN] : '" << _filter << "':'" << _parameter << "'");
std::string out; std::string out;
std::shared_ptr<drain::Algo> algo = m_process->get<drain::Algo>(_filter); std::shared_ptr<drain::Algo> algo = m_process->get<drain::Algo>(_filter);
if (algo == nullptr) { if (algo == nullptr) {
AIRTIO_ERROR("setParameter(" << _filter << ") ==> no filter named like this ..."); RIVER_ERROR("setParameter(" << _filter << ") ==> no filter named like this ...");
return "[ERROR]"; return "[ERROR]";
} }
out = algo->getParameter(_parameter); out = algo->getParameter(_parameter);
AIRTIO_DEBUG("getParameter [ END ] : '" << out << "'"); RIVER_DEBUG("getParameter [ END ] : '" << out << "'");
return out; return out;
} }
std::string river::Interface::getParameterProperty(const std::string& _filter, const std::string& _parameter) const { std::string river::Interface::getParameterProperty(const std::string& _filter, const std::string& _parameter) const {
AIRTIO_DEBUG("getParameterProperty [BEGIN] : '" << _filter << "':'" << _parameter << "'"); RIVER_DEBUG("getParameterProperty [BEGIN] : '" << _filter << "':'" << _parameter << "'");
std::string out; std::string out;
std::shared_ptr<drain::Algo> algo = m_process->get<drain::Algo>(_filter); std::shared_ptr<drain::Algo> algo = m_process->get<drain::Algo>(_filter);
if (algo == nullptr) { if (algo == nullptr) {
AIRTIO_ERROR("setParameter(" << _filter << ") ==> no filter named like this ..."); RIVER_ERROR("setParameter(" << _filter << ") ==> no filter named like this ...");
return "[ERROR]"; return "[ERROR]";
} }
out = algo->getParameterProperty(_parameter); out = algo->getParameterProperty(_parameter);
AIRTIO_DEBUG("getParameterProperty [ END ] : '" << out << "'"); RIVER_DEBUG("getParameterProperty [ END ] : '" << out << "'");
return out; return out;
} }
@ -285,10 +285,10 @@ std::chrono::system_clock::time_point river::Interface::getCurrentTime() const {
void river::Interface::addVolumeGroup(const std::string& _name) { void river::Interface::addVolumeGroup(const std::string& _name) {
std::unique_lock<std::recursive_mutex> lock(m_mutex); std::unique_lock<std::recursive_mutex> lock(m_mutex);
AIRTIO_DEBUG("addVolumeGroup(" << _name << ")"); RIVER_DEBUG("addVolumeGroup(" << _name << ")");
std::shared_ptr<drain::Volume> algo = m_process->get<drain::Volume>("volume"); std::shared_ptr<drain::Volume> algo = m_process->get<drain::Volume>("volume");
if (algo == nullptr) { if (algo == nullptr) {
AIRTIO_ERROR("addVolumeGroup(" << _name << ") ==> no volume stage ... can not add it ..."); RIVER_ERROR("addVolumeGroup(" << _name << ") ==> no volume stage ... can not add it ...");
return; return;
} }
if (_name == "FLOW") { if (_name == "FLOW") {

View File

@ -4,8 +4,8 @@
* @license APACHE v2.0 (see license file) * @license APACHE v2.0 (see license file)
*/ */
#ifndef __AIRTIO_INTERFACE_H__ #ifndef __RIVER_INTERFACE_H__
#define __AIRTIO_INTERFACE_H__ #define __RIVER_INTERFACE_H__
#include <string> #include <string>
#include <vector> #include <vector>

View File

@ -4,8 +4,8 @@
* @license APACHE v2.0 (see license file) * @license APACHE v2.0 (see license file)
*/ */
#ifndef __AIRTIO_MANAGER_H__ #ifndef __RIVER_MANAGER_H__
#define __AIRTIO_MANAGER_H__ #define __RIVER_MANAGER_H__
#include <string> #include <string>
#include <stdint.h> #include <stdint.h>

View File

@ -5,8 +5,8 @@
*/ */
#ifndef __AIRTIO_DEBUG_H__ #ifndef __RIVER_DEBUG_H__
#define __AIRTIO_DEBUG_H__ #define __RIVER_DEBUG_H__
#include <etk/log.h> #include <etk/log.h>
@ -14,7 +14,7 @@ namespace river {
int32_t getLogId(); int32_t getLogId();
}; };
// TODO : Review this problem of multiple intanciation of "std::stringbuf sb" // TODO : Review this problem of multiple intanciation of "std::stringbuf sb"
#define AIRTIO_BASE(info,data) \ #define RIVER_BASE(info,data) \
do { \ do { \
if (info <= etk::log::getLevel(river::getLogId())) { \ if (info <= etk::log::getLevel(river::getLogId())) { \
std::stringbuf sb; \ std::stringbuf sb; \
@ -24,25 +24,25 @@ namespace river {
} \ } \
} while(0) } while(0)
#define AIRTIO_CRITICAL(data) AIRTIO_BASE(1, data) #define RIVER_CRITICAL(data) RIVER_BASE(1, data)
#define AIRTIO_ERROR(data) AIRTIO_BASE(2, data) #define RIVER_ERROR(data) RIVER_BASE(2, data)
#define AIRTIO_WARNING(data) AIRTIO_BASE(3, data) #define RIVER_WARNING(data) RIVER_BASE(3, data)
#ifdef DEBUG #ifdef DEBUG
#define AIRTIO_INFO(data) AIRTIO_BASE(4, data) #define RIVER_INFO(data) RIVER_BASE(4, data)
#define AIRTIO_DEBUG(data) AIRTIO_BASE(5, data) #define RIVER_DEBUG(data) RIVER_BASE(5, data)
#define AIRTIO_VERBOSE(data) AIRTIO_BASE(6, data) #define RIVER_VERBOSE(data) RIVER_BASE(6, data)
#define AIRTIO_TODO(data) AIRTIO_BASE(4, "TODO : " << data) #define RIVER_TODO(data) RIVER_BASE(4, "TODO : " << data)
#else #else
#define AIRTIO_INFO(data) do { } while(false) #define RIVER_INFO(data) do { } while(false)
#define AIRTIO_DEBUG(data) do { } while(false) #define RIVER_DEBUG(data) do { } while(false)
#define AIRTIO_VERBOSE(data) do { } while(false) #define RIVER_VERBOSE(data) do { } while(false)
#define AIRTIO_TODO(data) do { } while(false) #define RIVER_TODO(data) do { } while(false)
#endif #endif
#define AIRTIO_ASSERT(cond,data) \ #define RIVER_ASSERT(cond,data) \
do { \ do { \
if (!(cond)) { \ if (!(cond)) { \
AIRTIO_CRITICAL(data); \ RIVER_CRITICAL(data); \
assert(!#cond); \ assert(!#cond); \
} \ } \
} while (0) } while (0)

View File

@ -4,17 +4,17 @@
* @license APACHE v2.0 (see license file) * @license APACHE v2.0 (see license file)
*/ */
#ifdef __AIRTIO_DEBUG_H__ #ifdef __RIVER_DEBUG_H__
#undef __AIRTIO_DEBUG_H__ #undef __RIVER_DEBUG_H__
#undef AIRTIO_BASE #undef RIVER_BASE
#undef AIRTIO_CRITICAL #undef RIVER_CRITICAL
#undef AIRTIO_ERROR #undef RIVER_ERROR
#undef AIRTIO_WARNING #undef RIVER_WARNING
#undef AIRTIO_INFO #undef RIVER_INFO
#undef AIRTIO_DEBUG #undef RIVER_DEBUG
#undef AIRTIO_VERBOSE #undef RIVER_VERBOSE
#undef AIRTIO_TODO #undef RIVER_TODO
#undef AIRTIO_ASSERT #undef RIVER_ASSERT
#endif #endif

View File

@ -14,7 +14,7 @@
river::io::Manager::Manager() { river::io::Manager::Manager() {
if (m_config.load("DATA:hardware.json") == false) { if (m_config.load("DATA:hardware.json") == false) {
AIRTIO_ERROR("you must set a basic configuration file for harware configuration: DATA:hardware.json"); RIVER_ERROR("you must set a basic configuration file for harware configuration: DATA:hardware.json");
} }
}; };
@ -39,13 +39,13 @@ std::shared_ptr<river::io::Node> river::io::Manager::getNode(const std::string&
m_list.push_back(tmp); m_list.push_back(tmp);
return tmp; return tmp;
} }
AIRTIO_ERROR("Can not create the interface : '" << _name << "' the node is not DEFINED in the configuration file availlable : " << m_config.getKeys()); RIVER_ERROR("Can not create the interface : '" << _name << "' the node is not DEFINED in the configuration file availlable : " << m_config.getKeys());
return nullptr; return nullptr;
} }
std::shared_ptr<drain::VolumeElement> river::io::Manager::getVolumeGroup(const std::string& _name) { std::shared_ptr<drain::VolumeElement> river::io::Manager::getVolumeGroup(const std::string& _name) {
if (_name == "") { if (_name == "") {
AIRTIO_ERROR("Try to create an audio group with no name ..."); RIVER_ERROR("Try to create an audio group with no name ...");
return nullptr; return nullptr;
} }
for (auto &it : m_volumeGroup) { for (auto &it : m_volumeGroup) {
@ -56,7 +56,7 @@ std::shared_ptr<drain::VolumeElement> river::io::Manager::getVolumeGroup(const s
return it; return it;
} }
} }
AIRTIO_DEBUG("Add a new volume group : '" << _name << "'"); RIVER_DEBUG("Add a new volume group : '" << _name << "'");
std::shared_ptr<drain::VolumeElement> tmpVolume = std::make_shared<drain::VolumeElement>(_name); std::shared_ptr<drain::VolumeElement> tmpVolume = std::make_shared<drain::VolumeElement>(_name);
m_volumeGroup.push_back(tmpVolume); m_volumeGroup.push_back(tmpVolume);
return tmpVolume; return tmpVolume;
@ -65,12 +65,12 @@ std::shared_ptr<drain::VolumeElement> river::io::Manager::getVolumeGroup(const s
bool river::io::Manager::setVolume(const std::string& _volumeName, float _valuedB) { bool river::io::Manager::setVolume(const std::string& _volumeName, float _valuedB) {
std::shared_ptr<drain::VolumeElement> volume = getVolumeGroup(_volumeName); std::shared_ptr<drain::VolumeElement> volume = getVolumeGroup(_volumeName);
if (volume == nullptr) { if (volume == nullptr) {
AIRTIO_ERROR("Can not set volume ... : '" << _volumeName << "'"); RIVER_ERROR("Can not set volume ... : '" << _volumeName << "'");
return false; return false;
} }
if ( _valuedB < -300 if ( _valuedB < -300
|| _valuedB > 300) { || _valuedB > 300) {
AIRTIO_ERROR("Can not set volume ... : '" << _volumeName << "' out of range : [-300..300]"); RIVER_ERROR("Can not set volume ... : '" << _volumeName << "' out of range : [-300..300]");
return false; return false;
} }
volume->setVolume(_valuedB); volume->setVolume(_valuedB);
@ -86,7 +86,7 @@ bool river::io::Manager::setVolume(const std::string& _volumeName, float _valued
float river::io::Manager::getVolume(const std::string& _volumeName) { float river::io::Manager::getVolume(const std::string& _volumeName) {
std::shared_ptr<drain::VolumeElement> volume = getVolumeGroup(_volumeName); std::shared_ptr<drain::VolumeElement> volume = getVolumeGroup(_volumeName);
if (volume == nullptr) { if (volume == nullptr) {
AIRTIO_ERROR("Can not get volume ... : '" << _volumeName << "'"); RIVER_ERROR("Can not get volume ... : '" << _volumeName << "'");
return 0.0f; return 0.0f;
} }
return volume->getVolume(); return volume->getVolume();

View File

@ -4,8 +4,8 @@
* @license APACHE v2.0 (see license file) * @license APACHE v2.0 (see license file)
*/ */
#ifndef __AIRTIO_IO_MANAGER_H__ #ifndef __RIVER_IO_MANAGER_H__
#define __AIRTIO_IO_MANAGER_H__ #define __RIVER_IO_MANAGER_H__
#include <string> #include <string>
#include <vector> #include <vector>

View File

@ -34,7 +34,7 @@ int32_t river::io::Node::rtAudioCallback(void* _outputBuffer,
std::chrono::system_clock::time_point ttime = std::chrono::system_clock::time_point();//std::chrono::system_clock::now(); std::chrono::system_clock::time_point ttime = std::chrono::system_clock::time_point();//std::chrono::system_clock::now();
if (_outputBuffer != nullptr) { if (_outputBuffer != nullptr) {
AIRTIO_VERBOSE("data Output"); RIVER_VERBOSE("data Output");
std::vector<int32_t> output; std::vector<int32_t> output;
output.resize(_nBufferFrames*m_interfaceFormat.getMap().size(), 0); output.resize(_nBufferFrames*m_interfaceFormat.getMap().size(), 0);
const int32_t* outputTmp = nullptr; const int32_t* outputTmp = nullptr;
@ -44,7 +44,7 @@ int32_t river::io::Node::rtAudioCallback(void* _outputBuffer,
if (it != nullptr) { if (it != nullptr) {
// clear datas ... // clear datas ...
memset(&outputTmp2[0], 0, sizeof(int32_t)*m_interfaceFormat.getMap().size()*_nBufferFrames); memset(&outputTmp2[0], 0, sizeof(int32_t)*m_interfaceFormat.getMap().size()*_nBufferFrames);
AIRTIO_VERBOSE(" IO : " /* << std::distance(m_list.begin(), it)*/ << "/" << m_list.size() << " name="<< it->getName()); RIVER_VERBOSE(" IO : " /* << std::distance(m_list.begin(), it)*/ << "/" << m_list.size() << " name="<< it->getName());
it->systemNeedOutputData(ttime, &outputTmp2[0], _nBufferFrames, sizeof(int32_t)*m_interfaceFormat.getMap().size()); it->systemNeedOutputData(ttime, &outputTmp2[0], _nBufferFrames, sizeof(int32_t)*m_interfaceFormat.getMap().size());
outputTmp = reinterpret_cast<const int32_t*>(&outputTmp2[0]); outputTmp = reinterpret_cast<const int32_t*>(&outputTmp2[0]);
//it->systemNeedOutputData(ttime, _outputBuffer, _nBufferFrames, sizeof(int16_t)*m_map.size()); //it->systemNeedOutputData(ttime, _outputBuffer, _nBufferFrames, sizeof(int16_t)*m_map.size());
@ -61,11 +61,11 @@ int32_t river::io::Node::rtAudioCallback(void* _outputBuffer,
} }
} }
if (_inputBuffer != nullptr) { if (_inputBuffer != nullptr) {
AIRTIO_INFO("data Input"); RIVER_INFO("data Input");
int16_t* inputBuffer = static_cast<int16_t *>(_inputBuffer); int16_t* inputBuffer = static_cast<int16_t *>(_inputBuffer);
for (size_t iii=0; iii< m_list.size(); ++iii) { for (size_t iii=0; iii< m_list.size(); ++iii) {
if (m_list[iii] != nullptr) { if (m_list[iii] != nullptr) {
AIRTIO_INFO(" IO : " << iii+1 << "/" << m_list.size() << " name="<< m_list[iii]->getName()); RIVER_INFO(" IO : " << iii+1 << "/" << m_list.size() << " name="<< m_list[iii]->getName());
m_list[iii]->systemNewInputData(ttime, inputBuffer, _nBufferFrames); m_list[iii]->systemNewInputData(ttime, inputBuffer, _nBufferFrames);
} }
} }
@ -82,9 +82,9 @@ river::io::Node::Node(const std::string& _name, const std::shared_ptr<const ejso
m_config(_config), m_config(_config),
m_name(_name), m_name(_name),
m_isInput(false) { m_isInput(false) {
AIRTIO_INFO("-----------------------------------------------------------------"); RIVER_INFO("-----------------------------------------------------------------");
AIRTIO_INFO("-- CREATE NODE --"); RIVER_INFO("-- CREATE NODE --");
AIRTIO_INFO("-----------------------------------------------------------------"); RIVER_INFO("-----------------------------------------------------------------");
/** /**
io:"input", # input or output io:"input", # input or output
map-on:{ # select hardware interface and name map-on:{ # select hardware interface and name
@ -104,7 +104,7 @@ river::io::Node::Node(const std::string& _name, const std::shared_ptr<const ejso
std::string streamName = "default"; std::string streamName = "default";
const std::shared_ptr<const ejson::Object> tmpObject = m_config->getObject("map-on"); const std::shared_ptr<const ejson::Object> tmpObject = m_config->getObject("map-on");
if (tmpObject == nullptr) { if (tmpObject == nullptr) {
AIRTIO_WARNING("missing node : 'map-on' ==> auto map : 'alsa:default'"); RIVER_WARNING("missing node : 'map-on' ==> auto map : 'alsa:default'");
} else { } else {
std::string value = tmpObject->getStringValue("interface", "default"); std::string value = tmpObject->getStringValue("interface", "default");
if (value == "alsa") { if (value == "alsa") {
@ -136,7 +136,7 @@ river::io::Node::Node(const std::string& _name, const std::shared_ptr<const ejso
} else if (value == "user-4") { } else if (value == "user-4") {
typeInterface = airtaudio::api::USER_INTERFACE_4; typeInterface = airtaudio::api::USER_INTERFACE_4;
} else { } else {
AIRTIO_WARNING("Unknow interface : '" << value << "'"); RIVER_WARNING("Unknow interface : '" << value << "'");
} }
streamName = tmpObject->getStringValue("name", "default"); streamName = tmpObject->getStringValue("name", "default");
} }
@ -145,7 +145,7 @@ river::io::Node::Node(const std::string& _name, const std::shared_ptr<const ejso
int32_t nbChunk = m_config->getNumberValue("nb-chunk", 1024); int32_t nbChunk = m_config->getNumberValue("nb-chunk", 1024);
std::string volumeName = m_config->getStringValue("volume-name", ""); std::string volumeName = m_config->getStringValue("volume-name", "");
if (volumeName != "") { if (volumeName != "") {
AIRTIO_INFO("add node volume stage : '" << volumeName << "'"); RIVER_INFO("add node volume stage : '" << volumeName << "'");
// use global manager for volume ... // use global manager for volume ...
m_volume = river::io::Manager::getInstance()->getVolumeGroup(volumeName); m_volume = river::io::Manager::getInstance()->getVolumeGroup(volumeName);
} }
@ -154,7 +154,7 @@ river::io::Node::Node(const std::string& _name, const std::shared_ptr<const ejso
if (type == "int16") { if (type == "int16") {
formatType = audio::format_int16; formatType = audio::format_int16;
} else { } else {
AIRTIO_WARNING("not managed type : '" << type << "'"); RIVER_WARNING("not managed type : '" << type << "'");
} }
// TODO : MAP ... // TODO : MAP ...
@ -181,19 +181,19 @@ river::io::Node::Node(const std::string& _name, const std::shared_ptr<const ejso
} }
// search device ID : // search device ID :
AIRTIO_INFO("Open :"); RIVER_INFO("Open :");
AIRTIO_INFO(" m_streamName=" << streamName); RIVER_INFO(" m_streamName=" << streamName);
AIRTIO_INFO(" m_freq=" << m_hardwareFormat.getFrequency()); RIVER_INFO(" m_freq=" << m_hardwareFormat.getFrequency());
AIRTIO_INFO(" m_map=" << m_hardwareFormat.getMap()); RIVER_INFO(" m_map=" << m_hardwareFormat.getMap());
AIRTIO_INFO(" m_format=" << m_hardwareFormat.getFormat()); RIVER_INFO(" m_format=" << m_hardwareFormat.getFormat());
AIRTIO_INFO(" m_isInput=" << m_isInput); RIVER_INFO(" m_isInput=" << m_isInput);
int32_t deviceId = 0; int32_t deviceId = 0;
AIRTIO_INFO("Device list:"); RIVER_INFO("Device list:");
for (int32_t iii=0; iii<m_adac.getDeviceCount(); ++iii) { for (int32_t iii=0; iii<m_adac.getDeviceCount(); ++iii) {
m_info = m_adac.getDeviceInfo(iii); m_info = m_adac.getDeviceInfo(iii);
AIRTIO_INFO(" " << iii << " name :" << m_info.name); RIVER_INFO(" " << iii << " name :" << m_info.name);
if (m_info.name == streamName) { if (m_info.name == streamName) {
AIRTIO_INFO(" Select ..."); RIVER_INFO(" Select ...");
deviceId = iii; deviceId = iii;
} }
} }
@ -201,41 +201,41 @@ river::io::Node::Node(const std::string& _name, const std::shared_ptr<const ejso
m_info = m_adac.getDeviceInfo(deviceId); m_info = m_adac.getDeviceInfo(deviceId);
// display property : // display property :
{ {
AIRTIO_INFO("Device " << deviceId << " property :"); RIVER_INFO("Device " << deviceId << " property :");
AIRTIO_INFO(" probe=" << m_info.probed); RIVER_INFO(" probe=" << m_info.probed);
AIRTIO_INFO(" name=" << m_info.name); RIVER_INFO(" name=" << m_info.name);
AIRTIO_INFO(" outputChannels=" << m_info.outputChannels); RIVER_INFO(" outputChannels=" << m_info.outputChannels);
AIRTIO_INFO(" inputChannels=" << m_info.inputChannels); RIVER_INFO(" inputChannels=" << m_info.inputChannels);
AIRTIO_INFO(" duplexChannels=" << m_info.duplexChannels); RIVER_INFO(" duplexChannels=" << m_info.duplexChannels);
AIRTIO_INFO(" isDefaultOutput=" << m_info.isDefaultOutput); RIVER_INFO(" isDefaultOutput=" << m_info.isDefaultOutput);
AIRTIO_INFO(" isDefaultInput=" << m_info.isDefaultInput); RIVER_INFO(" isDefaultInput=" << m_info.isDefaultInput);
//std::string rrate; //std::string rrate;
std::stringstream rrate; std::stringstream rrate;
for (int32_t jjj=0; jjj<m_info.sampleRates.size(); ++jjj) { for (int32_t jjj=0; jjj<m_info.sampleRates.size(); ++jjj) {
rrate << m_info.sampleRates[jjj] << ";"; rrate << m_info.sampleRates[jjj] << ";";
} }
AIRTIO_INFO(" rates=" << rrate.str()); RIVER_INFO(" rates=" << rrate.str());
switch(m_info.nativeFormats) { switch(m_info.nativeFormats) {
case airtaudio::SINT8: case airtaudio::SINT8:
AIRTIO_INFO(" native Format: 8-bit signed integer"); RIVER_INFO(" native Format: 8-bit signed integer");
break; break;
case airtaudio::SINT16: case airtaudio::SINT16:
AIRTIO_INFO(" native Format: 16-bit signed integer"); RIVER_INFO(" native Format: 16-bit signed integer");
break; break;
case airtaudio::SINT24: case airtaudio::SINT24:
AIRTIO_INFO(" native Format: 24-bit signed integer"); RIVER_INFO(" native Format: 24-bit signed integer");
break; break;
case airtaudio::SINT32: case airtaudio::SINT32:
AIRTIO_INFO(" native Format: 32-bit signed integer"); RIVER_INFO(" native Format: 32-bit signed integer");
break; break;
case airtaudio::FLOAT32: case airtaudio::FLOAT32:
AIRTIO_INFO(" native Format: Normalized between plus/minus 1.0"); RIVER_INFO(" native Format: Normalized between plus/minus 1.0");
break; break;
case airtaudio::FLOAT64: case airtaudio::FLOAT64:
AIRTIO_INFO(" native Format: Normalized between plus/minus 1.0"); RIVER_INFO(" native Format: Normalized between plus/minus 1.0");
break; break;
default: default:
AIRTIO_INFO(" native Format: Unknow"); RIVER_INFO(" native Format: Unknow");
break; break;
} }
} }
@ -252,7 +252,7 @@ river::io::Node::Node(const std::string& _name, const std::shared_ptr<const ejso
} }
m_rtaudioFrameSize = nbChunk; m_rtaudioFrameSize = nbChunk;
AIRTIO_INFO("Open output stream nbChannels=" << params.nChannels); RIVER_INFO("Open output stream nbChannels=" << params.nChannels);
enum airtaudio::errorType err = airtaudio::errorNone; enum airtaudio::errorType err = airtaudio::errorNone;
if (m_isInput == true) { if (m_isInput == true) {
err = m_adac.openStream(nullptr, &params, err = m_adac.openStream(nullptr, &params,
@ -278,16 +278,16 @@ river::io::Node::Node(const std::string& _name, const std::shared_ptr<const ejso
); );
} }
if (err != airtaudio::errorNone) { if (err != airtaudio::errorNone) {
AIRTIO_ERROR("Create stream : '" << m_name << "' mode=" << (m_isInput?"input":"output") << " can not create stream " << err); RIVER_ERROR("Create stream : '" << m_name << "' mode=" << (m_isInput?"input":"output") << " can not create stream " << err);
} }
} }
river::io::Node::~Node() { river::io::Node::~Node() {
std::unique_lock<std::mutex> lock(m_mutex); std::unique_lock<std::mutex> lock(m_mutex);
AIRTIO_INFO("-----------------------------------------------------------------"); RIVER_INFO("-----------------------------------------------------------------");
AIRTIO_INFO("-- DESTROY NODE --"); RIVER_INFO("-- DESTROY NODE --");
AIRTIO_INFO("-----------------------------------------------------------------"); RIVER_INFO("-----------------------------------------------------------------");
AIRTIO_INFO("close input stream"); RIVER_INFO("close input stream");
if (m_adac.isStreamOpen() ) { if (m_adac.isStreamOpen() ) {
m_adac.closeStream(); m_adac.closeStream();
} }
@ -295,19 +295,19 @@ river::io::Node::~Node() {
void river::io::Node::start() { void river::io::Node::start() {
std::unique_lock<std::mutex> lock(m_mutex); std::unique_lock<std::mutex> lock(m_mutex);
AIRTIO_INFO("Start stream : '" << m_name << "' mode=" << (m_isInput?"input":"output") ); RIVER_INFO("Start stream : '" << m_name << "' mode=" << (m_isInput?"input":"output") );
enum airtaudio::errorType err = m_adac.startStream(); enum airtaudio::errorType err = m_adac.startStream();
if (err != airtaudio::errorNone) { if (err != airtaudio::errorNone) {
AIRTIO_ERROR("Start stream : '" << m_name << "' mode=" << (m_isInput?"input":"output") << " can not start stream ... " << err); RIVER_ERROR("Start stream : '" << m_name << "' mode=" << (m_isInput?"input":"output") << " can not start stream ... " << err);
} }
} }
void river::io::Node::stop() { void river::io::Node::stop() {
std::unique_lock<std::mutex> lock(m_mutex); std::unique_lock<std::mutex> lock(m_mutex);
AIRTIO_INFO("Stop stream : '" << m_name << "' mode=" << (m_isInput?"input":"output") ); RIVER_INFO("Stop stream : '" << m_name << "' mode=" << (m_isInput?"input":"output") );
enum airtaudio::errorType err = m_adac.stopStream(); enum airtaudio::errorType err = m_adac.stopStream();
if (err != airtaudio::errorNone) { if (err != airtaudio::errorNone) {
AIRTIO_ERROR("Stop stream : '" << m_name << "' mode=" << (m_isInput?"input":"output") << " can not stop stream ... " << err); RIVER_ERROR("Stop stream : '" << m_name << "' mode=" << (m_isInput?"input":"output") << " can not stop stream ... " << err);
} }
} }
@ -330,7 +330,7 @@ void river::io::Node::interfaceAdd(const std::shared_ptr<river::Interface>& _int
return; return;
} }
} }
AIRTIO_INFO("ADD interface for stream : '" << m_name << "' mode=" << (m_isInput?"input":"output") ); RIVER_INFO("ADD interface for stream : '" << m_name << "' mode=" << (m_isInput?"input":"output") );
m_list.push_back(_interface); m_list.push_back(_interface);
} }
if (m_list.size() == 1) { if (m_list.size() == 1) {
@ -344,7 +344,7 @@ void river::io::Node::interfaceRemove(const std::shared_ptr<river::Interface>& _
for (size_t iii=0; iii< m_list.size(); ++iii) { for (size_t iii=0; iii< m_list.size(); ++iii) {
if (_interface == m_list[iii]) { if (_interface == m_list[iii]) {
m_list.erase(m_list.begin()+iii); m_list.erase(m_list.begin()+iii);
AIRTIO_INFO("RM interface for stream : '" << m_name << "' mode=" << (m_isInput?"input":"output") ); RIVER_INFO("RM interface for stream : '" << m_name << "' mode=" << (m_isInput?"input":"output") );
break; break;
} }
} }

View File

@ -4,8 +4,8 @@
* @license APACHE v2.0 (see license file) * @license APACHE v2.0 (see license file)
*/ */
#ifndef __AIRTIO_IO_NODE_H__ #ifndef __RIVER_IO_NODE_H__
#define __AIRTIO_IO_NODE_H__ #define __RIVER_IO_NODE_H__
#include <string> #include <string>
#include <vector> #include <vector>