diff --git a/audio/river/Interface.cpp b/audio/river/Interface.cpp index 8e25c70..d84cd0f 100644 --- a/audio/river/Interface.cpp +++ b/audio/river/Interface.cpp @@ -33,7 +33,7 @@ bool audio::river::Interface::init(float _freq, m_node = _node; m_config = _config; m_mode = audio::river::modeInterface_unknow; - std::string type = m_config.getStringValue("io", "error"); + std::string type = m_config["io"].toString().get("error"); static int32_t uid=0; m_name = _node->getName() + "__" + (_node->isInput()==true?"input":"output") + "__" + type + "__" + etk::to_string(uid++); if (type == "output") { diff --git a/audio/river/Manager.cpp b/audio/river/Manager.cpp index 4ce15ad..0dad101 100644 --- a/audio/river/Manager.cpp +++ b/audio/river/Manager.cpp @@ -141,10 +141,10 @@ bool audio::river::Manager::getMute(const std::string& _volumeName) const { } std::shared_ptr audio::river::Manager::createOutput(float _freq, - const std::vector& _map, - audio::format _format, - const std::string& _streamName, - const std::string& _options) { + const std::vector& _map, + audio::format _format, + const std::string& _streamName, + const std::string& _options) { // get global hardware interface: std::shared_ptr manager = audio::river::io::Manager::getInstance(); if (manager == nullptr) { @@ -164,7 +164,7 @@ std::shared_ptr audio::river::Manager::createOutput(flo // create user iterface: std::shared_ptr interface; ejson::Object tmpOption = ejson::Object(_options); - tmpOption.addString("io", "output"); + tmpOption.add("io", ejson::String("output")); interface = audio::river::Interface::create(_freq, _map, _format, node, tmpOption); // store it in a list (needed to apply some parameters). m_listOpenInterface.push_back(interface); @@ -195,7 +195,7 @@ std::shared_ptr audio::river::Manager::createInput(floa // create user iterface: std::shared_ptr interface; ejson::Object tmpOption = ejson::Object(_options); - tmpOption.addString("io", "input"); + tmpOption.add("io", ejson::String("input")); interface = audio::river::Interface::create(_freq, _map, _format, node, tmpOption); // store it in a list (needed to apply some parameters). m_listOpenInterface.push_back(interface); @@ -227,7 +227,7 @@ std::shared_ptr audio::river::Manager::createFeedback(f // create user iterface: std::shared_ptr interface; ejson::Object tmpOption = ejson::Object(_options); - tmpOption.addString("io", "feedback"); + tmpOption.add("io", ejson::String("feedback")); interface = audio::river::Interface::create(_freq, _map, _format, node, tmpOption); // store it in a list (needed to apply some parameters). m_listOpenInterface.push_back(interface); diff --git a/audio/river/io/Group.cpp b/audio/river/io/Group.cpp index b49c5e7..55d73ea 100644 --- a/audio/river/io/Group.cpp +++ b/audio/river/io/Group.cpp @@ -22,11 +22,11 @@ void audio::river::io::Group::createFrom(const ejson::Document& _obj, const std: if (tmpObject.exist() == false) { continue; } - std::string groupName = tmpObject.getStringValue("group", ""); + std::string groupName = tmpObject["group"].toString().get(); if (groupName == _name) { RIVER_INFO("Add element in Group[" << _name << "]: " << _obj.getKey(iii)); // get type : io - std::string ioType = tmpObject.getStringValue("io", "error"); + std::string ioType = tmpObject["io"].toString().get("error"); #ifdef AUDIO_RIVER_BUILD_ORCHESTRA if ( ioType == "input" || ioType == "output") { diff --git a/audio/river/io/Manager.cpp b/audio/river/io/Manager.cpp index fb03640..e9ea697 100644 --- a/audio/river/io/Manager.cpp +++ b/audio/river/io/Manager.cpp @@ -111,7 +111,7 @@ std::vector audio::river::io::Manager::getListStreamInput() { for (auto &it : keys) { const ejson::Object tmppp = m_config[it].toObject(); if (tmppp.exist() == true) { - std::string type = tmppp.getStringValue("io", "error"); + std::string type = tmppp["io"].toString().get("error"); if ( type == "input" || type == "PAinput") { output.push_back(it); @@ -128,7 +128,7 @@ std::vector audio::river::io::Manager::getListStreamOutput() { for (auto &it : keys) { const ejson::Object tmppp = m_config[it].toObject(); if (tmppp.exist() == true) { - std::string type = tmppp.getStringValue("io", "error"); + std::string type = tmppp["io"].toString().get("error"); if ( type == "output" || type == "PAoutput") { output.push_back(it); @@ -145,7 +145,7 @@ std::vector audio::river::io::Manager::getListStreamVirtual() { for (auto &it : keys) { const ejson::Object tmppp = m_config[it].toObject(); if (tmppp.exist() == true) { - std::string type = tmppp.getStringValue("io", "error"); + std::string type = tmppp["io"].toString().get("error"); if ( type != "input" && type != "PAinput" && type != "output" @@ -165,7 +165,7 @@ std::vector audio::river::io::Manager::getListStream() { for (auto &it : keys) { const ejson::Object tmppp = m_config[it].toObject(); if (tmppp.exist() == true) { - std::string type = tmppp.getStringValue("io", "error"); + std::string type = tmppp["io"].toString().get("error"); if (type != "error") { output.push_back(it); } @@ -205,9 +205,9 @@ std::shared_ptr audio::river::io::Manager::getNode(const const ejson::Object tmpObject = m_config[_name].toObject(); if (tmpObject.exist() == true) { //Check if it is in a group: - std::string groupName = tmpObject.getStringValue("group", ""); + std::string groupName = tmpObject["group"].toString().get(); // get type : io - std::string ioType = tmpObject.getStringValue("io", "error"); + std::string ioType = tmpObject["io"].toString().get("error"); if ( groupName != "" && ( ioType == "input" || ioType == "output" diff --git a/audio/river/io/Node.cpp b/audio/river/io/Node.cpp index 6b98c6c..ec18863 100644 --- a/audio/river/io/Node.cpp +++ b/audio/river/io/Node.cpp @@ -34,7 +34,7 @@ audio::river::io::Node::Node(const std::string& _name, const ejson::Object& _con # muxer/demuxer format type (int8-on-int16, int16-on-int32, int24-on-int32, int32-on-int64, float) mux-demux-type:"int16_on_int32", */ - std::string interfaceType = m_config.getStringValue("io"); + std::string interfaceType = m_config["io"].toString().get(); RIVER_INFO("interfaceType=" << interfaceType); if ( interfaceType == "input" || interfaceType == "PAinput" @@ -45,12 +45,12 @@ audio::river::io::Node::Node(const std::string& _name, const ejson::Object& _con m_isInput = false; } - int32_t frequency = m_config.getNumberValue("frequency", 1); + int32_t frequency = m_config["frequency"].toNumber().get(1); // Get audio format type: - std::string type = m_config.getStringValue("type", "int16"); + std::string type = m_config["type"].toString().get("int16"); enum audio::format formatType = audio::getFormatFromString(type); // Get volume stage : - std::string volumeName = m_config.getStringValue("volume-name", ""); + std::string volumeName = m_config["volume-name"].toString().get(); if (volumeName != "") { RIVER_INFO("add node volume stage : '" << volumeName << "'"); // use global manager for volume ... @@ -75,9 +75,9 @@ audio::river::io::Node::Node(const std::string& _name, const ejson::Object& _con std::string muxerDemuxerConfig; if (m_isInput == true) { - muxerDemuxerConfig = m_config.getStringValue("mux-demux-type", "int16"); + muxerDemuxerConfig = m_config["mux-demux-type"].toString().get("int16"); } else { - muxerDemuxerConfig = m_config.getStringValue("mux-demux-type", "int16-on-int32"); + muxerDemuxerConfig = m_config["mux-demux-type"].toString().get("int16-on-int32"); } enum audio::format muxerFormatType = audio::getFormatFromString(muxerDemuxerConfig); if (m_isInput == true) { diff --git a/audio/river/io/NodeAEC.cpp b/audio/river/io/NodeAEC.cpp index eb8f17e..f5c8d8e 100644 --- a/audio/river/io/NodeAEC.cpp +++ b/audio/river/io/NodeAEC.cpp @@ -28,11 +28,11 @@ std::shared_ptr audio::river::io::NodeAEC::createInput( RIVER_ERROR("can not open a non existance virtual interface: '" << _objectName << "' not present in : " << m_config.getKeys()); return std::shared_ptr(); } - std::string streamName = tmppp.getStringValue("map-on", "error"); + std::string streamName = tmppp["map-on"].toString().get("error"); - m_nbChunk = m_config.getNumberValue("nb-chunk", 1024); + m_nbChunk = m_config["nb-chunk"].toNumber().get(1024); // check if it is an Output: - std::string type = tmppp.getStringValue("io", "error"); + std::string type = tmppp["io"].toString().get("error"); if ( type != "input" && type != "feedback") { RIVER_ERROR("can not open in output a virtual interface: '" << streamName << "' configured has : " << type); diff --git a/audio/river/io/NodeMuxer.cpp b/audio/river/io/NodeMuxer.cpp index 7612c08..08d10cd 100644 --- a/audio/river/io/NodeMuxer.cpp +++ b/audio/river/io/NodeMuxer.cpp @@ -28,11 +28,11 @@ std::shared_ptr audio::river::io::NodeMuxer::createInpu RIVER_ERROR("can not open a non existance virtual interface: '" << _objectName << "' not present in : " << m_config.getKeys()); return std::shared_ptr(); } - std::string streamName = tmppp.getStringValue("map-on", "error"); + std::string streamName = tmppp["map-on"].toString().get("error"); // check if it is an Output: - std::string type = tmppp.getStringValue("io", "error"); + std::string type = tmppp["io"].toString().get("error"); if ( type != "input" && type != "feedback") { RIVER_ERROR("can not open in output a virtual interface: '" << streamName << "' configured has : " << type); diff --git a/audio/river/io/NodeOrchestra.cpp b/audio/river/io/NodeOrchestra.cpp index 469ead2..43547e2 100644 --- a/audio/river/io/NodeOrchestra.cpp +++ b/audio/river/io/NodeOrchestra.cpp @@ -58,19 +58,19 @@ audio::river::io::NodeOrchestra::NodeOrchestra(const std::string& _name, const e if (tmpObject.exist() == false) { RIVER_WARNING("missing node : 'map-on' ==> auto map : 'auto:default'"); } else { - typeInterface = tmpObject.getStringValue("interface", audio::orchestra::type_undefined); + typeInterface = tmpObject["interface"].toString().get(audio::orchestra::type_undefined); if (typeInterface == "auto") { typeInterface = audio::orchestra::type_undefined; } - streamName = tmpObject.getStringValue("name", "default"); + streamName = tmpObject["name"].toString().get("default"); } - int32_t nbChunk = m_config.getNumberValue("nb-chunk", 1024); + int32_t nbChunk = m_config["nb-chunk"].toNumber().get(1024); // intanciate specific API ... m_interface.instanciate(typeInterface); m_interface.setName(_name); // TODO : Check return ... - std::string type = m_config.getStringValue("type", "int16"); + std::string type = m_config["type"].toString().get("int16"); if (streamName == "") { streamName = "default"; } @@ -189,7 +189,7 @@ audio::river::io::NodeOrchestra::NodeOrchestra(const std::string& _name, const e 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")); + etk::from_string(option.mode, tmpObject["timestamp-mode"].toString().get("soft")); RIVER_DEBUG("interfaceFormat=" << interfaceFormat); RIVER_DEBUG("hardwareFormat=" << hardwareFormat);