From 50dcfaff8262b0edf4742d7a998c7ae0a4d7bf6d Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Sun, 14 Jun 2015 18:33:24 +0200 Subject: [PATCH] [DEV] update new orchestra modification --- audio/river/io/Group.cpp | 2 +- audio/river/io/NodeOrchestra.cpp | 18 +++++++----------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/audio/river/io/Group.cpp b/audio/river/io/Group.cpp index 0c1b127..e3b2e12 100644 --- a/audio/river/io/Group.cpp +++ b/audio/river/io/Group.cpp @@ -53,7 +53,7 @@ void audio::river::io::Group::createFrom(const ejson::Document& _obj, const std: for (size_t iii=1; iii link = std11::dynamic_pointer_cast(m_list[iii]); - linkRef->m_adac.isMasterOf(link->m_adac); + linkRef->m_interface.isMasterOf(link->m_interface); } } #endif diff --git a/audio/river/io/NodeOrchestra.cpp b/audio/river/io/NodeOrchestra.cpp index 9535239..25f4028 100644 --- a/audio/river/io/NodeOrchestra.cpp +++ b/audio/river/io/NodeOrchestra.cpp @@ -52,14 +52,16 @@ audio::river::io::NodeOrchestra::NodeOrchestra(const std::string& _name, const s }, nb-chunk:1024 # number of chunk to open device (create the latency anf the frequency to call user) */ - enum audio::orchestra::type typeInterface = audio::orchestra::type_undefined; + std::string typeInterface = audio::orchestra::type_undefined; std::string streamName = "default"; const std11::shared_ptr tmpObject = m_config->getObject("map-on"); if (tmpObject == nullptr) { RIVER_WARNING("missing node : 'map-on' ==> auto map : 'auto:default'"); } else { - std::string value = tmpObject->getStringValue("interface", "default"); - typeInterface = audio::orchestra::getTypeFromString(value); + typeInterface = tmpObject->getStringValue("interface", audio::orchestra::type_undefined); + if (typeInterface == "auto") { + typeInterface = audio::orchestra::type_undefined; + } streamName = tmpObject->getStringValue("name", "default"); } int32_t nbChunk = m_config->getNumberValue("nb-chunk", 1024); @@ -183,14 +185,8 @@ audio::river::io::NodeOrchestra::NodeOrchestra(const std::string& _name, const s params.deviceId = deviceId; params.deviceName = streamName; params.nChannels = hardwareFormat.getMap().size(); - if (m_isInput == true) { - if (m_info.inputChannels < params.nChannels) { - RIVER_CRITICAL("Can not open hardware device with more channel (" << params.nChannels << ") that is autorized by hardware (" << m_info.inputChannels << ")."); - } - } else { - if (m_info.outputChannels < params.nChannels) { - RIVER_CRITICAL("Can not open hardware device with more channel (" << params.nChannels << ") that is autorized by hardware (" << m_info.inputChannels << ")."); - } + if (m_info.channels.size() < params.nChannels) { + RIVER_CRITICAL("Can not open hardware device with more channel (" << params.nChannels << ") that is autorized by hardware (" << m_info.channels.size() << ")."); } audio::orchestra::StreamOptions option; etk::from_string(option.mode, tmpObject->getStringValue("timestamp-mode", "soft"));