[DEV] update the input output work

This commit is contained in:
Edouard DUPIN 2015-04-11 17:43:09 +02:00
parent 8daa32a2f7
commit 620fb8e54f
3 changed files with 23 additions and 18 deletions

View File

@ -27,7 +27,7 @@ void audio::river::io::Group::createFrom(const ejson::Document& _obj, const std:
RIVER_INFO("Add element in Group[" << _name << "]: " << _obj.getKey(iii));
// get type : io
std::string ioType = tmpObject->getStringValue("io", "error");
#ifdef __AIRTAUDIO_INFERFACE__
#ifdef AUDIO_RIVER_BUILD_ORCHESTRA
if ( ioType == "input"
|| ioType == "output") {
std11::shared_ptr<audio::river::io::Node> tmp = audio::river::io::NodeOrchestra::create(_obj.getKey(iii), tmpObject);
@ -35,7 +35,7 @@ void audio::river::io::Group::createFrom(const ejson::Document& _obj, const std:
m_list.push_back(tmp);
}
#endif
#ifdef __PORTAUDIO_INFERFACE__
#ifdef AUDIO_RIVER_BUILD_PORTAUDIO
if ( ioType == "PAinput"
|| ioType == "PAoutput") {
std11::shared_ptr<audio::river::io::Node> tmp = audio::river::io::NodePortAudio::create(_obj.getKey(iii), tmpObject);
@ -48,7 +48,7 @@ void audio::river::io::Group::createFrom(const ejson::Document& _obj, const std:
// Link all the IO together : (not needed if one device ...
// Note : The interlink work only for alsa (NOW) and with AirTAudio...
if(m_list.size() > 1) {
#ifdef __AIRTAUDIO_INFERFACE__
#ifdef AUDIO_RIVER_BUILD_ORCHESTRA
std11::shared_ptr<audio::river::io::NodeOrchestra> linkRef = std11::dynamic_pointer_cast<audio::river::io::NodeOrchestra>(m_list[0]);
for (size_t iii=1; iii<m_list.size(); ++iii) {
if (m_list[iii] != nullptr) {

View File

@ -20,7 +20,7 @@
#undef __class__
#define __class__ "io::Manager"
#ifdef __PORTAUDIO_INFERFACE__
#ifdef AUDIO_RIVER_BUILD_PORTAUDIO
#include <portaudio.h>
#endif
@ -58,7 +58,7 @@ static std::string basicAutoConfig =
audio::river::io::Manager::Manager() {
#ifdef __PORTAUDIO_INFERFACE__
#ifdef AUDIO_RIVER_BUILD_PORTAUDIO
PaError err = Pa_Initialize();
if(err != paNoError) {
RIVER_WARNING("Can not initialize portaudio : " << Pa_GetErrorText(err));
@ -87,7 +87,7 @@ void audio::river::io::Manager::unInit() {
}
audio::river::io::Manager::~Manager() {
#ifdef __PORTAUDIO_INFERFACE__
#ifdef AUDIO_RIVER_BUILD_PORTAUDIO
PaError err = Pa_Terminate();
if(err != paNoError) {
RIVER_WARNING("Can not initialize portaudio : " << Pa_GetErrorText(err));
@ -200,7 +200,7 @@ std11::shared_ptr<audio::river::io::Node> audio::river::io::Manager::getNode(con
}
}
}
RIVER_WARNING("Create a new one : " << _name);
RIVER_WARNING("Try create a new one : " << _name);
// check if the node can be open :
const std11::shared_ptr<const ejson::Object> tmpObject = m_config.getObject(_name);
if (tmpObject != nullptr) {
@ -224,22 +224,27 @@ std11::shared_ptr<audio::river::io::Node> audio::river::io::Manager::getNode(con
RIVER_WARNING("Group is only availlable for Hardware interface ... '" << _name << "'");
}
// TODO : Create a standalone group for every single element ==> simplify understanding ... but not for virtual interface ...
#ifdef __AIRTAUDIO_INFERFACE__
if ( ioType == "input"
|| ioType == "output") {
std11::shared_ptr<audio::river::io::Node> tmp = audio::river::io::NodeOrchestra::create(_name, tmpObject);
m_list.push_back(tmp);
return tmp;
#ifdef AUDIO_RIVER_BUILD_ORCHESTRA
std11::shared_ptr<audio::river::io::Node> tmp = audio::river::io::NodeOrchestra::create(_name, tmpObject);
m_list.push_back(tmp);
return tmp;
#else
RIVER_WARNING("not present interface");
#endif
}
#endif
#ifdef __PORTAUDIO_INFERFACE__
if ( ioType == "PAinput"
|| ioType == "PAoutput") {
std11::shared_ptr<audio::river::io::Node> tmp = audio::river::io::NodePortAudio::create(_name, tmpObject);
m_list.push_back(tmp);
return tmp;
#ifdef AUDIO_RIVER_BUILD_PORTAUDIO
std11::shared_ptr<audio::river::io::Node> tmp = audio::river::io::NodePortAudio::create(_name, tmpObject);
m_list.push_back(tmp);
return tmp;
#else
RIVER_WARNING("not present interface");
#endif
}
#endif
if (ioType == "aec") {
std11::shared_ptr<audio::river::io::Node> tmp = audio::river::io::NodeAEC::create(_name, tmpObject);
m_list.push_back(tmp);

View File

@ -15,7 +15,7 @@ namespace audio {
* @brief Initialize the River Library
* @param[in] _filename Name of the configuration file (if "" ==> default config file)
*/
void init(const std::string& _filename);
void init(const std::string& _filename = "");
/**
* @brief Initialize the River Library with a json data string
* @param[in] _config json sting data